62bool CPDF_Type3Font::
Load() {
63 m_pFontResources = m_pFontDict->GetMutableDictFor(
"Resources");
68 m_FontMatrix = pMatrix->GetMatrix();
69 xscale = m_FontMatrix
.a;
70 yscale = m_FontMatrix
.d;
76 pBBox->GetFloatAt(0) * xscale, pBBox->GetFloatAt(1) * yscale,
77 pBBox->GetFloatAt(2) * xscale, pBBox->GetFloatAt(3) * yscale);
82 const size_t kCharLimit = m_CharWidthL.size();
83 int StartChar = m_pFontDict->GetIntegerFor(
"FirstChar");
84 if (StartChar >= 0 &&
static_cast<size_t>(StartChar) < kCharLimit) {
86 m_pFontDict->GetArrayFor(
"Widths");
88 size_t count =
std::min(pWidthArray->size(), kCharLimit);
89 count =
std::min(count, kCharLimit - StartChar);
90 for (size_t i = 0; i < count; i++) {
91 m_CharWidthL[StartChar + i] =
92 FXSYS_roundf(CPDF_Type3Char::TextUnitToGlyphUnit(
93 pWidthArray->GetFloatAt(i) * xscale));
97 m_pCharProcs = m_pFontDict->GetMutableDictFor(
"CharProcs");
98 if (m_pFontDict->GetDirectObjectFor(
"Encoding"))
110 if (m_CharLoadingDepth >= kMaxType3FormLevel)
113 auto it = m_CacheMap.find(charcode);
114 if (it != m_CacheMap.end())
115 return it->second.get();
117 const char* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode);
125 ToStream(m_pCharProcs->GetMutableDirectObjectFor(name));
129 std::unique_ptr<CPDF_Font::FormIface> pForm = m_pFormFactory->CreateForm(
130 m_pDocument, m_pFontResources ? m_pFontResources : m_pPageResources,
140 m_CharLoadingDepth++;
141 pForm->ParseContentForType3Char(pNewChar.get());
143 it = m_CacheMap.find(charcode);
144 if (it != m_CacheMap.end())
145 return it->second.get();
147 pNewChar->Transform(pForm.get(), m_FontMatrix);
148 if (pForm->HasPageObjects())
149 pNewChar->SetForm(
std::move(pForm));
152 m_CacheMap[charcode] = std::move(pNewChar);