7#include "core/fpdfapi/page/cpdf_docpagedata.h"
16#include "build/build_config.h"
17#include "constants/font_encodings.h"
18#include "core/fpdfapi/font/cpdf_fontglobals.h"
19#include "core/fpdfapi/font/cpdf_type1font.h"
20#include "core/fpdfapi/page/cpdf_form.h"
21#include "core/fpdfapi/page/cpdf_iccprofile.h"
22#include "core/fpdfapi/page/cpdf_image.h"
23#include "core/fpdfapi/page/cpdf_pattern.h"
24#include "core/fpdfapi/page/cpdf_shadingpattern.h"
25#include "core/fpdfapi/page/cpdf_tilingpattern.h"
26#include "core/fpdfapi/parser/cpdf_array.h"
27#include "core/fpdfapi/parser/cpdf_dictionary.h"
28#include "core/fpdfapi/parser/cpdf_name.h"
29#include "core/fpdfapi/parser/cpdf_number.h"
30#include "core/fpdfapi/parser/cpdf_reference.h"
31#include "core/fpdfapi/parser/cpdf_stream.h"
32#include "core/fpdfapi/parser/cpdf_stream_acc.h"
33#include "core/fpdfapi/parser/cpdf_string.h"
34#include "core/fxcodec/icc/icc_transform.h"
35#include "core/fxcrt/check.h"
36#include "core/fxcrt/containers/contains.h"
37#include "core/fxcrt/fixed_size_data_vector.h"
38#include "core/fxcrt/fx_codepage.h"
39#include "core/fxcrt/fx_memory.h"
40#include "core/fxcrt/fx_safe_types.h"
41#include "core/fxcrt/scoped_set_insertion.h"
42#include "core/fxcrt/span.h"
43#include "core/fxge/cfx_font.h"
44#include "core/fxge/cfx_fontmapper.h"
45#include "core/fxge/cfx_substfont.h"
46#include "core/fxge/cfx_unicodeencoding.h"
47#include "core/fxge/fx_font.h"
51void InsertWidthArrayImpl(std::vector<
int> widths,
CPDF_Array* pWidthArray) {
53 for (i = 1; i < widths.size(); i++) {
54 if (widths[i] != widths[0])
57 if (i == widths.size()) {
58 int first = pWidthArray->GetIntegerAt(pWidthArray->size() - 1);
59 pWidthArray->AppendNew<CPDF_Number>(first +
60 static_cast<
int>(widths.size()) - 1);
61 pWidthArray->AppendNew<CPDF_Number>(widths[0]);
64 auto pWidthArray1 = pWidthArray->AppendNew<
CPDF_Array>();
66 pWidthArray1->AppendNew<CPDF_Number>(w);
70void InsertWidthArray(HDC hDC,
int start,
int end, CPDF_Array* pWidthArray) {
71 std::vector<
int> widths(end - start + 1);
72 GetCharWidth(hDC, start, end, widths.data());
73 InsertWidthArrayImpl(std::move(widths), pWidthArray);
76ByteString GetPSNameFromTT(HDC hDC) {
78 DWORD size = ::GetFontData(hDC,
'eman', 0,
nullptr, 0);
79 if (size != GDI_ERROR) {
80 auto buffer = FixedSizeDataVector<BYTE>::Uninit(size);
81 ::GetFontData(hDC,
'eman', 0, buffer.span().data(), buffer.size());
82 result = GetNameFromTT(buffer, 6);
88void InsertWidthArray1(
CFX_Font* pFont,
93 std::vector<
int> widths(end - start + 1);
94 for (size_t i = 0; i < widths.size(); ++i) {
98 InsertWidthArrayImpl(
std::move(widths), pWidthArray);
101int CalculateFlags(
bool bold,
131 basefont
+= ",BoldItalic";
135 basefont
+= ",Italic";
136 pBaseDict->SetNewFor<CPDF_Name>(
"Subtype",
"TrueType");
137 pBaseDict->SetNewFor<CPDF_Name>(
"BaseFont", basefont);
138 pBaseDict->SetNewFor<CPDF_Number>(
"FirstChar", 32);
139 pBaseDict->SetNewFor<CPDF_Number>(
"LastChar", 255);
140 pBaseDict->SetFor(
"Widths", pWidths);
152 pFontDesc->SetNewFor<CPDF_Name>(
"Type",
"FontDescriptor");
153 pFontDesc->SetNewFor<CPDF_Name>(
"FontName", basefont);
154 pFontDesc->SetNewFor<CPDF_Number>(
"Flags", flags);
155 pFontDesc->SetFor(
"FontBBox", bbox);
156 pFontDesc->SetNewFor<CPDF_Number>(
"ItalicAngle", italicangle);
157 pFontDesc->SetNewFor<CPDF_Number>(
"Ascent", ascend);
158 pFontDesc->SetNewFor<CPDF_Number>(
"Descent", descend);
159 pFontDesc->SetNewFor<CPDF_Number>(
"StemV", stemV);
173 for (
auto& it : m_ImageMap) {
174 it.second->WillBeDestroyed();
176 for (
auto& it : m_FontMap) {
177 it.second->WillBeDestroyed();
181CPDF_DocPageData::HashIccProfileKey::HashIccProfileKey(
182 DataVector<uint8_t> digest,
184 : digest(std::move(digest)), components(components) {}
186CPDF_DocPageData::HashIccProfileKey::HashIccProfileKey(
187 const HashIccProfileKey& that) =
default;
189CPDF_DocPageData::HashIccProfileKey::~HashIccProfileKey() =
default;
191bool CPDF_DocPageData::HashIccProfileKey::operator<(
192 const HashIccProfileKey& other)
const {
193 if (components == other.components) {
194 return digest < other.digest;
196 return components < other.components;
208 auto it = m_FontMap.find(pFontDict);
209 if (it != m_FontMap.end() && it->second)
210 return pdfium::WrapRetain(it->second.Get());
213 CPDF_Font::Create(GetDocument(), pFontDict,
this);
217 m_FontMap[std::move(pFontDict)].Reset(pFont.Get());
224 if (fontName.IsEmpty())
227 for (
auto& it : m_FontMap) {
228 CPDF_Font* pFont = it.second.Get();
231 if (pFont->GetBaseFontName() != fontName)
233 if (pFont->IsEmbedded())
235 if (!pFont->IsType1Font())
237 if (pFont->GetFontDict()->KeyExist(
"Widths"))
240 CPDF_Type1Font* pT1Font = pFont->AsType1Font();
241 if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding))
244 return pdfium::WrapRetain(pFont);
248 pDict->SetNewFor<CPDF_Name>(
"Type",
"Font");
249 pDict->SetNewFor<CPDF_Name>(
"Subtype",
"Type1");
250 pDict->SetNewFor<CPDF_Name>(
"BaseFont", fontName);
252 pDict->SetFor(
"Encoding",
253 pEncoding->Realize(
GetDocument()->GetByteStringPool()));
261 m_FontMap[std::move(pDict)].Reset(pFont.Get());
268 std::set<
const CPDF_Object*> visited;
269 return GetColorSpaceGuarded(pCSObj, pResources, &visited);
275 std::set<
const CPDF_Object*>* pVisited) {
276 std::set<
const CPDF_Object*> visitedLocal;
277 return GetColorSpaceInternal(pCSObj, pResources, pVisited, &visitedLocal);
283 std::set<
const CPDF_Object*>* pVisited,
284 std::set<
const CPDF_Object*>* pVisitedInternal) {
288 if (
pdfium::Contains(*pVisitedInternal, pCSObj))
296 if (!pCS && pResources) {
298 pResources->GetDictFor(
"ColorSpace");
300 return GetColorSpaceInternal(pList->GetDirectObjectFor(name).Get(),
301 nullptr, pVisited, pVisitedInternal);
304 if (!pCS || !pResources)
308 pResources->GetDictFor(
"ColorSpace");
313 switch (pCS->GetFamily()) {
315 pDefaultCS = pColorSpaces->GetDirectObjectFor(
"DefaultRGB");
318 pDefaultCS = pColorSpaces->GetDirectObjectFor(
"DefaultGray");
321 pDefaultCS = pColorSpaces->GetDirectObjectFor(
"DefaultCMYK");
329 return GetColorSpaceInternal(pDefaultCS.Get(),
nullptr, pVisited,
334 if (!pArray || pArray->IsEmpty())
337 if (pArray->size() == 1) {
338 return GetColorSpaceInternal(pArray->GetDirectObjectAt(0).Get(), pResources,
339 pVisited, pVisitedInternal);
342 auto it = m_ColorSpaceMap.find(pArray);
343 if (it != m_ColorSpaceMap.end() && it->second)
344 return pdfium::WrapRetain(it->second.Get());
347 CPDF_ColorSpace::Load(GetDocument(), pArray.Get(), pVisited);
351 m_ColorSpaceMap[std::move(pArray)].Reset(pCS.Get());
358 CHECK(pPatternObj->IsDictionary() || pPatternObj->IsStream());
360 auto it = m_PatternMap.find(pPatternObj);
361 if (it != m_PatternMap.end() && it->second)
362 return pdfium::WrapRetain(it->second.Get());
365 switch (pPatternObj->GetDict()->GetIntegerFor(
"PatternType")) {
368 pPatternObj, matrix);
371 pattern =
pdfium::MakeRetain<CPDF_ShadingPattern>(
377 m_PatternMap[pPatternObj].Reset(pattern.Get());
384 CHECK(pPatternObj->IsDictionary() || pPatternObj->IsStream());
386 auto it = m_PatternMap.find(pPatternObj);
387 if (it != m_PatternMap.end() && it->second)
388 return pdfium::WrapRetain(it->second->AsShadingPattern());
390 auto pPattern =
pdfium::MakeRetain<CPDF_ShadingPattern>(
392 m_PatternMap[pPatternObj].Reset(pPattern.Get());
398 auto it = m_ImageMap.find(dwStreamObjNum);
399 if (it != m_ImageMap.end())
403 m_ImageMap[dwStreamObjNum] = pImage;
409 auto it = m_ImageMap.find(dwStreamObjNum);
410 if (it != m_ImageMap.end() && it->second->HasOneRef())
411 m_ImageMap.erase(it);
415 RetainPtr<
const CPDF_Stream> pProfileStream) {
416 CHECK(pProfileStream);
418 auto it = m_IccProfileMap.find(pProfileStream);
419 if (it != m_IccProfileMap.end()) {
423 auto pAccessor =
pdfium::MakeRetain<CPDF_StreamAcc>(pProfileStream);
424 pAccessor->LoadAllDataFiltered();
427 const int expected_components = pProfileStream->GetDict()->GetIntegerFor(
"N");
433 const HashIccProfileKey hash_profile_key(pAccessor->ComputeDigest(),
434 expected_components);
435 auto hash_it = m_HashIccProfileMap.find(hash_profile_key);
436 if (hash_it != m_HashIccProfileMap.end()) {
437 auto it_copied_stream = m_IccProfileMap.find(hash_it->second);
438 if (it_copied_stream != m_IccProfileMap.end()) {
439 return it_copied_stream->second;
443 pdfium::MakeRetain<CPDF_IccProfile>(pAccessor, expected_components);
444 m_IccProfileMap[pProfileStream] = pProfile;
445 m_HashIccProfileMap[hash_profile_key] = std::move(pProfileStream);
450 RetainPtr<
const CPDF_Stream> pFontStream) {
452 auto it = m_FontFileMap.find(pFontStream);
453 if (it != m_FontFileMap.end())
457 int32_t len1 = pFontDict->GetIntegerFor(
"Length1");
458 int32_t len2 = pFontDict->GetIntegerFor(
"Length2");
459 int32_t len3 = pFontDict->GetIntegerFor(
"Length3");
460 uint32_t org_size = 0;
461 if (len1 >= 0 && len2 >= 0 && len3 >= 0) {
463 safe_org_size += len2;
464 safe_org_size += len3;
465 org_size = safe_org_size.ValueOrDefault(0);
468 auto pFontAcc =
pdfium::MakeRetain<CPDF_StreamAcc>(pFontStream);
469 pFontAcc->LoadAllDataFilteredWithEstimatedSize(org_size);
470 m_FontFileMap[std::move(pFontStream)] = pFontAcc;
475 RetainPtr<CPDF_StreamAcc>&& pStreamAcc) {
479 RetainPtr<
const CPDF_Stream> pFontStream = pStreamAcc->GetStream();
484 auto it = m_FontFileMap.find(pFontStream);
485 if (it != m_FontFileMap.end() && it->second->HasOneRef())
486 m_FontFileMap.erase(it);
493 return std::make_unique<CPDF_Form>(pDocument,
std::move(pPageResources),
494 std::move(pFormStream));
502 CFX_FontMapper::GetStandardFontName(&mutable_name);
503 if (!font_id.has_value())
505 return GetStandardFont(mutable_name, pEncoding);
515 basefont.Replace(
" ",
"");
517 CalculateFlags(pFont->IsBold(), pFont->IsItalic(), pFont->IsFixedWidth(),
521 pBaseDict->SetNewFor<CPDF_Name>(
"Type",
"Font");
527 for (
int charcode = 32; charcode < 128; charcode++) {
528 int glyph_index = pEncoding->GlyphFromCharCode(charcode);
529 int char_width = pFont->GetGlyphWidth(glyph_index);
530 pWidths->AppendNew<CPDF_Number>(char_width);
534 pBaseDict->SetNewFor<CPDF_Name>(
"Encoding",
536 for (
int charcode = 128; charcode <= 255; charcode++) {
537 int glyph_index = pEncoding->GlyphFromCharCode(charcode);
538 int char_width = pFont->GetGlyphWidth(glyph_index);
539 pWidths->AppendNew<CPDF_Number>(char_width);
542 size_t i = CalculateEncodingDict(charset, pBaseDict.Get());
544 pdfium::span<
const uint16_t> pUnicodes =
546 for (
int j = 0; j < 128; j++) {
547 int glyph_index = pEncoding->GlyphFromCharCode(pUnicodes[j]);
548 int char_width = pFont->GetGlyphWidth(glyph_index);
549 pWidths->AppendNew<CPDF_Number>(char_width);
553 ProcessNonbCJK(pBaseDict, pFont->IsBold(), pFont->IsItalic(), basefont,
556 pFontDict = ProcessbCJK(
557 pBaseDict, charset, basefont,
558 [&pFont, &pEncoding](
wchar_t start,
wchar_t end,
CPDF_Array* widthArr) {
559 InsertWidthArray1(pFont.get(), pEncoding.get(), start, end, widthArr);
562 int italicangle = pFont->GetSubstFontItalicAngle();
565 pBBox->AppendNew<CPDF_Number>(bbox
.left);
566 pBBox->AppendNew<CPDF_Number>(bbox
.bottom);
567 pBBox->AppendNew<CPDF_Number>(bbox
.right);
568 pBBox->AppendNew<CPDF_Number>(bbox
.top);
570 if (pFont->GetSubstFont()) {
571 nStemV = pFont->GetSubstFont()->m_Weight / 5;
573 static constexpr char kStemChars[] = {
'i',
'I',
'!',
'1'};
574 static constexpr pdfium::span<
const char> kStemSpan{kStemChars};
575 uint32_t glyph = pEncoding->GlyphFromCharCode(kStemSpan.front());
576 const auto remaining = kStemSpan.subspan<1>();
577 nStemV = pFont->GetGlyphWidth(glyph);
578 for (
auto ch : remaining) {
579 glyph = pEncoding->GlyphFromCharCode(ch);
580 int width = pFont->GetGlyphWidth(glyph);
581 if (width > 0 && width < nStemV)
586 GetDocument(), basefont, flags, italicangle, pFont->GetAscent(),
587 pFont->GetDescent(), std::move(pBBox), nStemV);
588 uint32_t new_objnum =
GetDocument()->AddIndirectObject(
std::move(pFontDesc));
589 pFontDict->SetNewFor<CPDF_Reference>(
"FontDescriptor",
GetDocument(),
591 return GetFont(pBaseDict);
595RetainPtr<CPDF_Font> CPDF_DocPageData::AddWindowsFont(LOGFONTA* pLogFont) {
596 pLogFont->lfHeight = -1000;
597 pLogFont->lfWidth = 0;
598 HGDIOBJ hFont = CreateFontIndirectA(pLogFont);
599 HDC hDC = CreateCompatibleDC(
nullptr);
600 hFont = SelectObject(hDC, hFont);
601 int tm_size = GetOutlineTextMetrics(hDC, 0,
nullptr);
603 hFont = SelectObject(hDC, hFont);
609 LPBYTE tm_buf = FX_Alloc(BYTE, tm_size);
610 OUTLINETEXTMETRIC* ptm =
reinterpret_cast<OUTLINETEXTMETRIC*>(tm_buf);
611 GetOutlineTextMetrics(hDC, tm_size, ptm);
612 int flags = CalculateFlags(
613 false, pLogFont->lfItalic != 0,
614 (pLogFont->lfPitchAndFamily & 3) == FIXED_PITCH,
615 (pLogFont->lfPitchAndFamily & 0xf8) == FF_ROMAN,
616 (pLogFont->lfPitchAndFamily & 0xf8) == FF_SCRIPT,
617 pLogFont->lfCharSet ==
static_cast<
int>(FX_Charset::kSymbol));
619 const FX_Charset eCharset = FX_GetCharsetFromInt(pLogFont->lfCharSet);
620 const bool bCJK = FX_CharSetIsCJK(eCharset);
623 basefont = GetPSNameFromTT(hDC);
625 if (basefont.IsEmpty())
626 basefont = pLogFont->lfFaceName;
628 int italicangle = ptm->otmItalicAngle / 10;
629 int ascend = ptm->otmrcFontBox.top;
630 int descend = ptm->otmrcFontBox.bottom;
631 int capheight = ptm->otmsCapEmHeight;
632 std::array<
int, 4> bbox = {{ptm->otmrcFontBox.left, ptm->otmrcFontBox.bottom,
633 ptm->otmrcFontBox.right, ptm->otmrcFontBox.top}};
635 basefont.Replace(
" ",
"");
636 auto pBaseDict = GetDocument()->NewIndirect<CPDF_Dictionary>();
637 pBaseDict->SetNewFor<CPDF_Name>(
"Type",
"Font");
638 RetainPtr<CPDF_Dictionary> pFontDict = pBaseDict;
640 if (eCharset == FX_Charset::kANSI || eCharset == FX_Charset::kDefault ||
641 eCharset == FX_Charset::kSymbol) {
642 pBaseDict->SetNewFor<CPDF_Name>(
"Encoding",
643 pdfium::font_encodings::kWinAnsiEncoding);
645 CalculateEncodingDict(eCharset, pBaseDict.Get());
647 std::array<
int, 224> char_widths;
648 GetCharWidth(hDC, 32, 255, char_widths.data());
649 auto pWidths = pdfium::MakeRetain<CPDF_Array>();
650 for (
const auto char_width : char_widths) {
651 pWidths->AppendNew<CPDF_Number>(char_width);
653 ProcessNonbCJK(pBaseDict, pLogFont->lfWeight > FW_MEDIUM,
654 pLogFont->lfItalic != 0, basefont, std::move(pWidths));
657 ProcessbCJK(pBaseDict, eCharset, basefont,
658 [&hDC](
wchar_t start,
wchar_t end, CPDF_Array* widthArr) {
659 InsertWidthArray(hDC, start, end, widthArr);
662 auto pBBox = pdfium::MakeRetain<CPDF_Array>();
663 for (
const auto bound : bbox) {
664 pBBox->AppendNew<CPDF_Number>(bound);
666 RetainPtr<CPDF_Dictionary> pFontDesc =
667 CalculateFontDesc(GetDocument(), basefont, flags, italicangle, ascend,
668 descend, std::move(pBBox), pLogFont->lfWeight / 5);
669 pFontDesc->SetNewFor<CPDF_Number>(
"CapHeight", capheight);
670 GetDocument()->AddIndirectObject(pFontDesc);
671 pFontDict->SetFor(
"FontDescriptor", pFontDesc->MakeReference(GetDocument()));
672 hFont = SelectObject(hDC, hFont);
675 return GetFont(std::move(pBaseDict));
679size_t CPDF_DocPageData::CalculateEncodingDict(
FX_Charset charset,
690 pEncodingDict->SetNewFor<CPDF_Name>(
"BaseEncoding",
693 auto pArray = pEncodingDict->SetNewFor<
CPDF_Array>(
"Differences");
694 pArray->AppendNew<CPDF_Number>(128);
697 for (
int j = 0; j < 128; j++) {
698 ByteString name = AdobeNameFromUnicode(pUnicodes[j]);
699 pArray->AppendNew<CPDF_Name>(name.IsEmpty() ?
".notdef" : name);
701 pBaseDict->SetNewFor<CPDF_Reference>(
"Encoding",
GetDocument(),
702 pEncodingDict->GetObjNum());
715 auto pWidthArray = pFontDict->SetNewFor<
CPDF_Array>(
"W");
718 cmap
= "ETenms-B5-H";
721 pWidthArray->AppendNew<CPDF_Number>(1);
722 Insert(0x20, 0x7e, pWidthArray.Get());
728 pWidthArray->AppendNew<CPDF_Number>(7716);
729 Insert(0x20, 0x20, pWidthArray.Get());
730 pWidthArray->AppendNew<CPDF_Number>(814);
731 Insert(0x21, 0x7e, pWidthArray.Get());
734 cmap
= "KSCms-UHC-H";
737 pWidthArray->AppendNew<CPDF_Number>(1);
738 Insert(0x20, 0x7e, pWidthArray.Get());
741 cmap
= "90ms-RKSJ-H";
744 pWidthArray->AppendNew<CPDF_Number>(231);
745 Insert(0x20, 0x7d, pWidthArray.Get());
746 pWidthArray->AppendNew<CPDF_Number>(326);
747 Insert(0xa0, 0xa0, pWidthArray.Get());
748 pWidthArray->AppendNew<CPDF_Number>(327);
749 Insert(0xa1, 0xdf, pWidthArray.Get());
750 pWidthArray->AppendNew<CPDF_Number>(631);
751 Insert(0x7e, 0x7e, pWidthArray.Get());
756 pBaseDict->SetNewFor<CPDF_Name>(
"Subtype",
"Type0");
757 pBaseDict->SetNewFor<CPDF_Name>(
"BaseFont", basefont);
758 pBaseDict->SetNewFor<CPDF_Name>(
"Encoding", cmap);
759 pFontDict->SetNewFor<CPDF_Name>(
"Type",
"Font");
760 pFontDict->SetNewFor<CPDF_Name>(
"Subtype",
"CIDFontType2");
761 pFontDict->SetNewFor<CPDF_Name>(
"BaseFont", basefont);
763 auto pCIDSysInfo = pFontDict->SetNewFor<
CPDF_Dictionary>(
"CIDSystemInfo");
764 pCIDSysInfo->SetNewFor<CPDF_String>(
"Registry",
"Adobe");
765 pCIDSysInfo->SetNewFor<CPDF_String>(
"Ordering", ordering);
766 pCIDSysInfo->SetNewFor<CPDF_Number>(
"Supplement", supplement);
768 auto pArray = pBaseDict->SetNewFor<
CPDF_Array>(
"DescendantFonts");
769 pArray->AppendNew<CPDF_Reference>(
GetDocument(), pFontDict->GetObjNum());
fxcrt::ByteString ByteString
int GetGlyphWidth(uint32_t glyph_index) const
virtual uint32_t GlyphFromCharCode(uint32_t charcode)
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
void MaybePurgeFontFileStreamAcc(RetainPtr< CPDF_StreamAcc > &&pStreamAcc) override
RetainPtr< CPDF_ColorSpace > GetColorSpace(const CPDF_Object *pCSObj, const CPDF_Dictionary *pResources)
void ClearStockFont() override
RetainPtr< CPDF_IccProfile > GetIccProfile(RetainPtr< const CPDF_Stream > pProfileStream)
RetainPtr< CPDF_Pattern > GetPattern(RetainPtr< CPDF_Object > pPatternObj, const CFX_Matrix &matrix)
std::unique_ptr< CPDF_Font::FormIface > CreateForm(CPDF_Document *pDocument, RetainPtr< CPDF_Dictionary > pPageResources, RetainPtr< CPDF_Stream > pFormStream) override
RetainPtr< CPDF_Font > AddFont(std::unique_ptr< CFX_Font > pFont, FX_Charset charset)
RetainPtr< CPDF_Font > GetStandardFont(const ByteString &fontName, const CPDF_FontEncoding *pEncoding)
RetainPtr< CPDF_Font > GetFont(RetainPtr< CPDF_Dictionary > pFontDict)
RetainPtr< CPDF_ShadingPattern > GetShading(RetainPtr< CPDF_Object > pPatternObj, const CFX_Matrix &matrix)
void MaybePurgeImage(uint32_t dwStreamObjNum) override
RetainPtr< CPDF_Image > GetImage(uint32_t dwStreamObjNum)
~CPDF_DocPageData() override
RetainPtr< CPDF_ColorSpace > GetColorSpaceGuarded(const CPDF_Object *pCSObj, const CPDF_Dictionary *pResources, std::set< const CPDF_Object * > *pVisited)
RetainPtr< CPDF_StreamAcc > GetFontFileStreamAcc(RetainPtr< const CPDF_Stream > pFontStream) override
static CPDF_DocPageData * FromDocument(const CPDF_Document *pDoc)
RetainPtr< CPDF_Font > AddStandardFont(const ByteString &fontName, const CPDF_FontEncoding *pEncoding)
CPDF_Document * GetDocument() const
PageDataIface * GetPageData() const
static CPDF_FontGlobals * GetInstance()
void Clear(CPDF_Document *pDoc)
virtual ByteString GetString() const
ByteString & operator+=(const char *str)
ByteString & operator=(const char *str)
ByteString(const ByteString &other)=default
const std::array< FX_CharsetUnicodes, 8 > kFX_CharsetUnicodes
bool FX_CharSetIsCJK(FX_Charset uCharset)
#define FXFONT_NONSYMBOLIC
#define FXFONT_FORCE_BOLD
#define FXFONT_FIXED_PITCH
pdfium::CheckedNumeric< uint32_t > FX_SAFE_UINT32
const char kWinAnsiEncoding[]
constexpr FX_RECT()=default