11#include "core/fpdfapi/font/cpdf_cidfont.h"
12#include "core/fpdfapi/font/cpdf_font.h"
13#include "core/fpdfapi/page/cpdf_docpagedata.h"
14#include "core/fpdfapi/page/cpdf_textobject.h"
15#include "core/fpdfapi/page/cpdf_textstate.h"
16#include "core/fpdfapi/parser/cpdf_array.h"
17#include "core/fpdfapi/parser/cpdf_dictionary.h"
18#include "core/fpdfapi/parser/cpdf_document.h"
19#include "core/fpdfapi/parser/cpdf_name.h"
20#include "core/fpdfapi/parser/cpdf_number.h"
21#include "core/fpdfapi/parser/cpdf_reference.h"
22#include "core/fpdfapi/parser/cpdf_stream.h"
23#include "core/fpdfapi/parser/cpdf_string.h"
24#include "core/fpdfapi/render/charposlist.h"
25#include "core/fpdfapi/render/cpdf_pagerendercontext.h"
26#include "core/fpdfapi/render/cpdf_rendercontext.h"
27#include "core/fpdfapi/render/cpdf_renderstatus.h"
28#include "core/fpdfapi/render/cpdf_textrenderer.h"
29#include "core/fpdftext/cpdf_textpage.h"
30#include "core/fxcrt/fx_extension.h"
31#include "core/fxcrt/fx_string_wrappers.h"
32#include "core/fxcrt/span_util.h"
33#include "core/fxcrt/stl_util.h"
34#include "core/fxcrt/utf16.h"
35#include "core/fxge/cfx_defaultrenderdevice.h"
36#include "core/fxge/cfx_fontmgr.h"
37#include "core/fxge/dib/cfx_dibitmap.h"
38#include "core/fxge/fx_font.h"
39#include "core/fxge/text_char_pos.h"
40#include "fpdfsdk/cpdfsdk_helpers.h"
41#include "public/fpdf_edit.h"
42#include "third_party/base/check.h"
43#include "third_party/base/check_op.h"
44#include "third_party/base/containers/contains.h"
45#include "third_party/base/numerics/safe_conversions.h"
49 FPDF_TEXTRENDERMODE_UNKNOWN,
50 "TextRenderingMode::MODE_UNKNOWN value mismatch");
52 FPDF_TEXTRENDERMODE_FILL,
53 "TextRenderingMode::MODE_FILL value mismatch");
55 FPDF_TEXTRENDERMODE_STROKE,
56 "TextRenderingMode::MODE_STROKE value mismatch");
58 FPDF_TEXTRENDERMODE_FILL_STROKE,
59 "TextRenderingMode::MODE_FILL_STROKE value mismatch");
61 FPDF_TEXTRENDERMODE_INVISIBLE,
62 "TextRenderingMode::MODE_INVISIBLE value mismatch");
64 FPDF_TEXTRENDERMODE_FILL_CLIP,
65 "TextRenderingMode::MODE_FILL_CLIP value mismatch");
67 FPDF_TEXTRENDERMODE_STROKE_CLIP,
68 "TextRenderingMode::MODE_STROKE_CLIP value mismatch");
70 FPDF_TEXTRENDERMODE_FILL_STROKE_CLIP,
71 "TextRenderingMode::MODE_FILL_STROKE_CLIP value mismatch");
73 FPDF_TEXTRENDERMODE_CLIP,
74 "TextRenderingMode::MODE_CLIP value mismatch");
76 FPDF_TEXTRENDERMODE_LAST,
77 "TextRenderingMode::MODE_LAST value mismatch");
81ByteString BaseFontNameForType(
CFX_Font* pFont,
int font_type) {
91 const ByteString& font_name,
93 pdfium::span<
const uint8_t> span,
95 auto pFontDesc = pDoc->NewIndirect<CPDF_Dictionary>();
96 pFontDesc->SetNewFor<CPDF_Name>(
"Type",
"FontDescriptor");
97 pFontDesc->SetNewFor<CPDF_Name>(
"FontName", font_name);
99 if (pFont->GetFace()->IsFixedWidth()) {
102 if (font_name.Contains(
"Serif"))
104 if (pFont->GetFace()->IsItalic()) {
107 if (pFont->GetFace()->IsBold()) {
114 pFontDesc->SetNewFor<CPDF_Number>(
"Flags", flags);
119 pFontDesc->SetNewFor<CPDF_Number>(
"ItalicAngle", pFont
->IsItalic() ? -12 : 0);
121 pFontDesc->SetNewFor<CPDF_Number>(
"Ascent", pFont
->GetAscent());
122 pFontDesc->SetNewFor<CPDF_Number>(
"Descent", pFont
->GetDescent());
125 pFontDesc->SetNewFor<CPDF_Number>(
"CapHeight", pFont
->GetAscent());
126 pFontDesc->SetNewFor<CPDF_Number>(
"StemV", pFont
->IsBold() ? 120 : 70);
128 auto pStream = pDoc->NewIndirect<CPDF_Stream>();
129 pStream->SetData(span);
132 pStream->GetMutableDict()->SetNewFor<CPDF_Number>(
133 "Length1",
static_cast<
int>(span.size()));
135 ByteString fontFile = font_type ==
FPDF_FONT_TYPE1 ?
"FontFile" :
"FontFile2";
136 pFontDesc->SetNewFor<CPDF_Reference>(fontFile, pDoc, pStream->GetObjNum());
140const char ToUnicodeStart[] =
141 "/CIDInit /ProcSet findresource begin\n"
145 "<</Registry (Adobe)\n"
146 "/Ordering (Identity)\n"
149 "/CMapName /Adobe-Identity-H def\n"
151 "1 begincodespacerange\n"
153 "endcodespacerange\n";
155const char ToUnicodeEnd[] =
157 "CMapName currentdict /CMap defineresource pop\n"
161void AddCharcode(fxcrt::ostringstream* pBuffer, uint32_t number) {
162 DCHECK(number <= 0xFFFF);
166 for (size_t i = 0; i < 4; ++i)
173void AddUnicode(fxcrt::ostringstream* pBuffer, uint32_t unicode) {
180 size_t numChars = FXSYS_ToUTF16BE(unicode, ans);
181 for (size_t i = 0; i < numChars; ++i)
189 const std::multimap<uint32_t, uint32_t>& to_unicode) {
191 std::map<uint32_t, uint32_t> char_to_uni;
195 std::map<std::pair<uint32_t, uint32_t>, std::vector<uint32_t>>
201 std::map<std::pair<uint32_t, uint32_t>, uint32_t> map_range;
204 for (
auto iter = to_unicode.begin(); iter != to_unicode.end(); ++iter) {
205 uint32_t firstCharcode = iter->first;
206 uint32_t firstUnicode = iter->second;
207 if (
std::next(iter) == to_unicode.end() ||
208 firstCharcode + 1 !=
std::next(iter)->first) {
209 char_to_uni[firstCharcode] = firstUnicode;
213 uint32_t curCharcode = iter->first;
214 uint32_t curUnicode = iter->second;
215 if (curCharcode % 256 == 0) {
216 char_to_uni[firstCharcode] = firstUnicode;
217 char_to_uni[curCharcode] = curUnicode;
220 const size_t maxExtra = 255 - (curCharcode % 256);
221 auto next_it =
std::next(iter);
222 if (firstUnicode + 1 != curUnicode) {
224 std::vector<uint32_t> unicodes;
225 unicodes.push_back(firstUnicode);
226 unicodes.push_back(curUnicode);
227 for (size_t i = 0; i < maxExtra; ++i) {
228 if (next_it == to_unicode.end() || curCharcode + 1 != next_it->first)
232 unicodes.push_back(iter->second);
233 next_it =
std::next(iter);
235 DCHECK_EQ(iter->first - firstCharcode + 1, unicodes.size());
236 map_range_vector[
std::make_pair(firstCharcode, iter->first)] = unicodes;
240 for (size_t i = 0; i < maxExtra; ++i) {
241 if (next_it == to_unicode.end() || curCharcode + 1 != next_it->first ||
242 curUnicode + 1 != next_it->second) {
248 next_it =
std::next(iter);
250 map_range[
std::make_pair(firstCharcode, curCharcode)] = firstUnicode;
252 fxcrt::ostringstream buffer;
253 buffer << ToUnicodeStart;
255 buffer <<
static_cast<uint32_t>(char_to_uni.size()) <<
" beginbfchar\n";
256 for (
const auto& iter : char_to_uni) {
257 AddCharcode(&buffer, iter.first);
259 AddUnicode(&buffer, iter.second);
262 buffer <<
"endbfchar\n"
263 <<
static_cast<uint32_t>(map_range_vector.size() + map_range.size())
264 <<
" beginbfrange\n";
265 for (
const auto& iter : map_range_vector) {
266 const std::pair<uint32_t, uint32_t>& charcodeRange = iter.first;
267 AddCharcode(&buffer, charcodeRange.first);
269 AddCharcode(&buffer, charcodeRange.second);
271 const std::vector<uint32_t>& unicodes = iter.second;
272 for (size_t i = 0; i < unicodes.size(); ++i) {
273 uint32_t uni = unicodes[i];
274 AddUnicode(&buffer, uni);
275 if (i != unicodes.size() - 1)
280 for (
const auto& iter : map_range) {
281 const std::pair<uint32_t, uint32_t>& charcodeRange = iter.first;
282 AddCharcode(&buffer, charcodeRange.first);
284 AddCharcode(&buffer, charcodeRange.second);
286 AddUnicode(&buffer, iter.second);
289 buffer <<
"endbfrange\n";
290 buffer << ToUnicodeEnd;
292 auto stream = pDoc->NewIndirect<CPDF_Stream>();
293 stream->SetDataFromStringstream(&buffer);
298 std::unique_ptr<CFX_Font> pFont,
299 pdfium::span<
const uint8_t> span,
301 auto pFontDict = pDoc->NewIndirect<CPDF_Dictionary>();
302 pFontDict->SetNewFor<CPDF_Name>(
"Type",
"Font");
303 pFontDict->SetNewFor<CPDF_Name>(
305 ByteString name = BaseFontNameForType(pFont.get(), font_type);
306 pFontDict->SetNewFor<CPDF_Name>(
"BaseFont", name);
309 RetainPtr<CFX_Face> face = pFont->GetFace();
310 if (face->GetGlyphCount() <= 0) {
315 static constexpr uint32_t kMaxSimpleFontChar = 0xFF;
316 auto char_codes_and_indices =
317 face->GetCharCodesAndIndices(kMaxSimpleFontChar);
318 if (char_codes_and_indices.empty()) {
322 pFontDict->SetNewFor<CPDF_Number>(
323 "FirstChar",
static_cast<
int>(char_codes_and_indices[0].char_code));
324 auto widths_array = pDoc->NewIndirect<CPDF_Array>();
325 for (size_t i = 0; i < char_codes_and_indices.size(); ++i) {
326 widths_array->AppendNew<CPDF_Number>(
327 pFont->GetGlyphWidth(char_codes_and_indices[i].glyph_index));
328 if (i > 0 && i < char_codes_and_indices.size() - 1) {
329 for (uint32_t j = char_codes_and_indices[i - 1].char_code + 1;
330 j < char_codes_and_indices[i].char_code; ++j) {
331 widths_array->AppendNew<CPDF_Number>(0);
335 pFontDict->SetNewFor<CPDF_Number>(
336 "LastChar",
static_cast<
int>(char_codes_and_indices.back().char_code));
337 pFontDict->SetNewFor<CPDF_Reference>(
"Widths", pDoc,
338 widths_array->GetObjNum());
340 LoadFontDesc(pDoc, name, pFont.get(), span, font_type);
342 pFontDict->SetNewFor<CPDF_Reference>(
"FontDescriptor", pDoc,
343 pFontDesc->GetObjNum());
348 std::unique_ptr<CFX_Font> pFont,
349 pdfium::span<
const uint8_t> span,
351 auto pFontDict = pDoc->NewIndirect<CPDF_Dictionary>();
352 pFontDict->SetNewFor<CPDF_Name>(
"Type",
"Font");
353 pFontDict->SetNewFor<CPDF_Name>(
"Subtype",
"Type0");
355 ByteString encoding =
"Identity-H";
356 pFontDict->SetNewFor<CPDF_Name>(
"Encoding", encoding);
357 ByteString name = BaseFontNameForType(pFont.get(), font_type);
358 pFontDict->SetNewFor<CPDF_Name>(
361 auto pCIDFont = pDoc->NewIndirect<CPDF_Dictionary>();
362 pCIDFont->SetNewFor<CPDF_Name>(
"Type",
"Font");
366 pCIDFont->SetNewFor<CPDF_Name>(
"BaseFont", name);
370 auto pCIDSystemInfo = pDoc->NewIndirect<CPDF_Dictionary>();
371 pCIDSystemInfo->SetNewFor<CPDF_String>(
"Registry",
"Adobe",
false);
372 pCIDSystemInfo->SetNewFor<CPDF_String>(
"Ordering",
"Identity",
false);
373 pCIDSystemInfo->SetNewFor<CPDF_Number>(
"Supplement", 0);
374 pCIDFont->SetNewFor<CPDF_Reference>(
"CIDSystemInfo", pDoc,
375 pCIDSystemInfo->GetObjNum());
378 LoadFontDesc(pDoc, name, pFont.get(), span, font_type);
379 pCIDFont->SetNewFor<CPDF_Reference>(
"FontDescriptor", pDoc,
380 pFontDesc->GetObjNum());
383 RetainPtr<CFX_Face> face = pFont->GetFace();
384 if (face->GetGlyphCount() <= 0) {
388 auto char_codes_and_indices =
390 if (char_codes_and_indices.empty()) {
394 std::multimap<uint32_t, uint32_t> to_unicode;
395 std::map<uint32_t, uint32_t> widths;
396 for (
const auto& item : char_codes_and_indices) {
397 if (!pdfium::Contains(widths, item.glyph_index)) {
398 widths[item.glyph_index] = pFont->GetGlyphWidth(item.glyph_index);
400 to_unicode.emplace(item.glyph_index, item.char_code);
402 auto widthsArray = pDoc->NewIndirect<CPDF_Array>();
403 for (
auto it = widths.begin(); it != widths.end(); ++it) {
406 if (
std::next(it) == widths.end()) {
408 auto oneW = pdfium::MakeRetain<CPDF_Array>();
409 oneW->AppendNew<CPDF_Number>(w);
410 widthsArray->AppendNew<CPDF_Number>(ch);
411 widthsArray->Append(oneW);
415 int next_ch = it->first;
416 int next_w = it->second;
417 if (next_ch == ch + 1 && next_w == w) {
420 widthsArray->AppendNew<CPDF_Number>(ch);
423 auto next_it =
std::next(it);
424 if (next_it == widths.end() || next_it->first != it->first + 1 ||
425 next_it->second != it->second) {
431 widthsArray->AppendNew<CPDF_Number>(ch);
432 widthsArray->AppendNew<CPDF_Number>(w);
437 widthsArray->AppendNew<CPDF_Number>(ch);
438 auto curWidthArray = pdfium::MakeRetain<CPDF_Array>();
439 curWidthArray->AppendNew<CPDF_Number>(w);
440 curWidthArray->AppendNew<CPDF_Number>(next_w);
442 auto next_it =
std::next(it);
443 if (next_it == widths.end() || next_it->first != it->first + 1)
446 curWidthArray->AppendNew<CPDF_Number>(
static_cast<
int>(it->second));
448 widthsArray->Append(curWidthArray);
450 pCIDFont->SetNewFor<CPDF_Reference>(
"W", pDoc, widthsArray->GetObjNum());
454 auto pDescendant = pFontDict->SetNewFor<CPDF_Array>(
"DescendantFonts");
455 pDescendant->AppendNew<CPDF_Reference>(pDoc, pCIDFont->GetObjNum());
457 RetainPtr<CPDF_Stream> toUnicodeStream = LoadUnicode(pDoc, to_unicode);
458 pFontDict->SetNewFor<CPDF_Reference>(
"ToUnicode", pDoc,
459 toUnicodeStream->GetObjNum());
463CPDF_TextObject* CPDFTextObjectFromFPDFPageObject(FPDF_PAGEOBJECT page_object) {
468FPDF_GLYPHPATH FPDFGlyphPathFromCFXPath(
const CFX_Path* path) {
469 return reinterpret_cast<FPDF_GLYPHPATH>(path);
471const CFX_Path* CFXPathFromFPDFGlyphPath(FPDF_GLYPHPATH path) {
472 return reinterpret_cast<
const CFX_Path*>(path);
479 FPDF_BYTESTRING font,
486 CPDF_Font::GetStockFont(pDoc, ByteStringView(font));
490 auto pTextObj =
std::make_unique<CPDF_TextObject>();
491 pTextObj->mutable_text_state().SetFont(
std::move(pFont));
492 pTextObj->mutable_text_state().SetFontSize(font_size);
493 pTextObj->SetDefaultStates();
496 return FPDFPageObjectFromCPDFPageObject(pTextObj.release());
501 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text_object);
507 for (
wchar_t wc : encodedText) {
508 pTextObj->GetFont()->AppendChar(
509 &byteText, pTextObj->GetFont()->CharCodeFromUnicode(wc));
517 const uint32_t* charcodes,
519 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text_object);
523 if (!charcodes && count)
526 ByteString byte_text;
528 for (size_t i = 0; i < count; ++i) {
529 pTextObj->GetFont()->AppendChar(&byte_text, charcodes[i]);
542 if (!pDoc || !data || size == 0 ||
547 auto span = pdfium::make_span(data, size);
553 if (!pFont->LoadEmbedded(span,
false, 0))
557 return FPDFFontFromCPDFFont(
558 cid ? LoadCompositeFont(pDoc, std::move(pFont), span, font_type).Leak()
559 : LoadSimpleFont(pDoc, std::move(pFont), span, font_type).Leak());
569 return FPDFFontFromCPDFFont(
578 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text);
588 FPDF_TEXTPAGE text_page,
590 unsigned long length) {
591 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text_object);
606 FPDF_PAGEOBJECT text_object,
616 CPDF_TextObject* text = CPDFTextObjectFromFPDFPageObject(text_object);
632 auto result_bitmap = pdfium::MakeRetain<CFX_DIBitmap>();
636 auto render_context =
std::make_unique<CPDF_PageRenderContext>();
637 CPDF_PageRenderContext* render_context_ptr = render_context.get();
640 optional_page->SetRenderContext(
std::move(render_context));
642 RetainPtr<CPDF_Dictionary> page_resources =
643 optional_page ? optional_page->GetMutablePageResources() :
nullptr;
645 auto device =
std::make_unique<CFX_DefaultRenderDevice>();
646 CFX_DefaultRenderDevice* device_ptr = device.get();
647 render_context_ptr->m_pDevice =
std::move(device);
649 doc,
std::move(page_resources),
nullptr);
660 render_matrix
*= scale_matrix;
664 return FPDFBitmapFromCFXDIBitmap(result_bitmap.Leak());
681 auto pTextObj =
std::make_unique<CPDF_TextObject>();
682 pTextObj->mutable_text_state().SetFont(
684 pFont->GetMutableFontDict()
));
685 pTextObj->mutable_text_state().SetFontSize(font_size);
686 pTextObj->SetDefaultStates();
687 return FPDFPageObjectFromCPDFPageObject(pTextObj.release());
692 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text);
694 return FPDF_TEXTRENDERMODE_UNKNOWN;
700 FPDF_TEXT_RENDERMODE render_mode) {
701 if (render_mode <= FPDF_TEXTRENDERMODE_UNKNOWN ||
702 render_mode > FPDF_TEXTRENDERMODE_LAST) {
706 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text);
715 CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text);
720 return FPDFFontFromCPDFFont(pTextObj
->GetFont());
731 const unsigned long dwStringLen =
732 pdfium::base::checked_cast<
unsigned long>(name.GetLength() + 1);
733 if (buffer && length >= dwStringLen)
734 memcpy(buffer, name
.c_str(), dwStringLen);
742 size_t* out_buflen) {
744 if (!cfont || !out_buflen)
747 pdfium::span<uint8_t> data = cfont->GetFont()->GetFontSpan();
748 if (buffer && buflen >= data.size())
749 fxcrt::spancpy(pdfium::make_span(buffer, buflen), data);
750 *out_buflen = data.size();
778 if (!pFont || !angle)
789 if (!pFont || !ascent)
800 if (!pFont || !descent)
812 if (!pFont || !width)
834 if (!pdfium::base::IsValueInRangeForNumericType<
wchar_t>(glyph))
838 std::vector<TextCharPos> pos =
839 GetCharPosList(pdfium::span_from_ref(charcode),
840 pdfium::span<
const float>(), pFont, font_size);
845 if (pos[0].m_FallbackFontPosition == -1) {
857 return FPDFGlyphPathFromCFXPath(pPath);
862 auto* pPath = CFXPathFromFPDFGlyphPath(glyphpath);
866 return fxcrt::CollectionSize<
int>(pPath->GetPoints());
871 auto* pPath = CFXPathFromFPDFGlyphPath(glyphpath);
875 pdfium::span<
const CFX_Path::
Point> points = pPath->GetPoints();
876 if (!
fxcrt::IndexInBounds(points, index))
879 return FPDFPathSegmentFromFXPathPoint(&points[index]);
bool Attach(RetainPtr< CFX_DIBitmap > pBitmap)
CFX_FloatRect(const FX_RECT &rect)
FX_RECT GetOuterRect() const
const CFX_Path * LoadGlyphPath(uint32_t glyph_index, int dest_width) const
ByteString GetPsName() const
ByteString GetBaseFontName() const
static const char kUntitledFontName[]
ByteString GetFamilyName() const
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
CFX_Matrix & operator*=(const CFX_Matrix &other)
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
uint16_t CIDFromCharCode(uint32_t charcode) const
int16_t GetVertWidth(uint16_t cid) const
bool IsVertWriting() const override
RetainPtr< CPDF_Font > GetFont(RetainPtr< CPDF_Dictionary > pFontDict)
static CPDF_DocPageData * FromDocument(const CPDF_Document *pDoc)
int GetItalicAngle() const
virtual int GetCharWidthF(uint32_t charcode)=0
int GetTypeDescent() const
virtual CPDF_CIDFont * AsCIDFont()
virtual uint32_t CharCodeFromUnicode(wchar_t Unicode) const
static RetainPtr< CPDF_Font > GetStockFont(CPDF_Document *pDoc, ByteStringView fontname)
int GetFontWeight() const
int GetTypeAscent() const
CFX_Font * GetFontFallback(int position)
const CFX_FloatRect & GetRect() const
virtual CPDF_TextObject * AsText()
RenderContextClearer(CPDF_Page *pPage)
CPDF_Document * GetDocument() const override
void SetDeviceMatrix(const CFX_Matrix &matrix)
void RenderSingleObject(CPDF_PageObject *pObj, const CFX_Matrix &mtObj2Device)
void Initialize(const CPDF_RenderStatus *pParentStatus, const CPDF_GraphicStates *pInitialStates)
RetainPtr< CPDF_Font > GetFont() const
void SetText(const ByteString &str)
void SetTextRenderMode(TextRenderingMode mode)
float GetFontSize() const
TextRenderingMode GetTextRenderMode() const
WideString GetTextByObject(const CPDF_TextObject *pTextObj) const
const char * c_str() const
WideString WideStringFromFPDFWideString(FPDF_WIDESTRING wide_string)
unsigned long Utf16EncodeMaybeCopyAndReturnLength(const WideString &text, void *buffer, unsigned long buflen)
CPDF_TextPage * CPDFTextPageFromFPDFTextPage(FPDF_TEXTPAGE page)
CPDF_Font * CPDFFontFromFPDFFont(FPDF_FONT font)
CPDF_Page * CPDFPageFromFPDFPage(FPDF_PAGE page)
CPDF_Document * CPDFDocumentFromFPDFDocument(FPDF_DOCUMENT doc)
CPDF_PageObject * CPDFPageObjectFromFPDFPageObject(FPDF_PAGEOBJECT page_object)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object, FPDF_TEXTPAGE text_page, FPDF_WCHAR *buffer, unsigned long length)
FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFFont_GetFontName(FPDF_FONT font, char *buffer, unsigned long length)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetGlyphWidth(FPDF_FONT font, uint32_t glyph, float font_size, float *width)
FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetWeight(FPDF_FONT font)
FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetIsEmbedded(FPDF_FONT font)
#define FPDF_FONT_TRUETYPE
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetDescent(FPDF_FONT font, float font_size, float *descent)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFTextObj_SetTextRenderMode(FPDF_PAGEOBJECT text, FPDF_TEXT_RENDERMODE render_mode)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadFont(FPDF_DOCUMENT document, const uint8_t *data, uint32_t size, int font_type, FPDF_BOOL cid)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetItalicAngle(FPDF_FONT font, int *angle)
FPDF_EXPORT int FPDF_CALLCONV FPDFFont_GetFlags(FPDF_FONT font)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, FPDF_BYTESTRING font, float font_size)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadStandardFont(FPDF_DOCUMENT document, FPDF_BYTESTRING font)
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document, FPDF_FONT font, float font_size)
FPDF_EXPORT FPDF_TEXT_RENDERMODE FPDF_CALLCONV FPDFTextObj_GetTextRenderMode(FPDF_PAGEOBJECT text)
FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFTextObj_GetFont(FPDF_PAGEOBJECT text)
FPDF_EXPORT FPDF_GLYPHPATH FPDF_CALLCONV FPDFFont_GetGlyphPath(FPDF_FONT font, uint32_t glyph, float font_size)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_SetText(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text)
FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close(FPDF_FONT font)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFTextObj_GetFontSize(FPDF_PAGEOBJECT text, float *size)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetAscent(FPDF_FONT font, float font_size, float *ascent)
FPDF_EXPORT FPDF_PATHSEGMENT FPDF_CALLCONV FPDFGlyphPath_GetGlyphPathSegment(FPDF_GLYPHPATH glyphpath, int index)
FPDF_EXPORT FPDF_BITMAP FPDF_CALLCONV FPDFTextObj_GetRenderedBitmap(FPDF_DOCUMENT document, FPDF_PAGE page, FPDF_PAGEOBJECT text_object, float scale)
FPDF_EXPORT int FPDF_CALLCONV FPDFGlyphPath_CountGlyphSegments(FPDF_GLYPHPATH glyphpath)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFFont_GetFontData(FPDF_FONT font, uint8_t *buffer, size_t buflen, size_t *out_buflen)
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_SetCharcodes(FPDF_PAGEOBJECT text_object, const uint32_t *charcodes, size_t count)
void FXSYS_IntToFourHexChars(uint16_t n, char *buf)
#define FXFONT_NONSYMBOLIC
#define FXFONT_FORCE_BOLD
#define FXFONT_FIXED_PITCH
ByteString operator+(const ByteString &str1, const ByteString &str2)
ByteString operator+(const ByteString &str1, const char *str2)
constexpr char32_t kMaximumSupplementaryCodePoint
constexpr bool IsHighSurrogate(char32_t code_point)
constexpr bool IsLowSurrogate(char32_t code_point)
constexpr FX_RECT()=default