7#include "core/fpdfdoc/cpvt_fontmap.h"
11#include "core/fpdfapi/font/cpdf_font.h"
12#include "core/fpdfapi/parser/cpdf_dictionary.h"
13#include "core/fpdfapi/parser/cpdf_document.h"
14#include "core/fpdfapi/parser/cpdf_reference.h"
15#include "core/fpdfapi/parser/fpdf_parser_utility.h"
16#include "core/fpdfdoc/cpdf_interactiveform.h"
17#include "core/fxcrt/fx_codepage.h"
18#include "third_party/base/check.h"
19#include "third_party/base/notreached.h"
24 const ByteString& sDefFontAlias)
32void CPVT_FontMap::SetupAnnotSysPDFFont() {
33 if (!m_pDocument || !m_pResDict)
37 CPDF_InteractiveForm::AddNativeInteractiveFormFont(m_pDocument,
42 RetainPtr<CPDF_Dictionary> pFontList = m_pResDict->GetMutableDictFor(
"Font");
43 if (ValidateFontResourceDict(pFontList.Get()) &&
44 !pFontList->KeyExist(m_sSysFontAlias)) {
45 pFontList->SetNewFor<CPDF_Reference>(m_sSysFontAlias, m_pDocument,
46 pPDFFont->GetFontDictObjNum());
48 m_pSysFont = std::move(pPDFFont);
57 SetupAnnotSysPDFFont();
67 return m_sDefFontAlias;
70 SetupAnnotSysPDFFont();
71 return m_sSysFontAlias;
80 NOTREACHED_NORETURN();
84 NOTREACHED_NORETURN();
89 NOTREACHED_NORETURN();
ByteString GetPDFFontAlias(int32_t nFontIndex) override
RetainPtr< CPDF_Font > GetPDFFont(int32_t nFontIndex) override
int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override
CPVT_FontMap(CPDF_Document *pDoc, RetainPtr< CPDF_Dictionary > pResDict, RetainPtr< CPDF_Font > pDefFont, const ByteString &sDefFontAlias)
int32_t GetWordFontIndex(uint16_t word, FX_Charset charset, int32_t nFontIndex) override
FX_Charset CharSetFromUnicode(uint16_t word, FX_Charset nOldCharset) override