5#ifndef PDF_FONT_METRICS_OBJECT_H
6#define PDF_FONT_METRICS_OBJECT_H
12#include "PdfFontMetrics.h"
20class PODOFO_API PdfFontMetricsObject final :
public PdfFontMetricsBase
28 PdfFontMetricsObject(
const PdfDictionary& fontDict,
const PdfReference& fontRef,
const PdfDictionary* descriptorDict);
31 ~PdfFontMetricsObject();
33 static std::unique_ptr<const PdfFontMetricsObject>
Create(
const PdfObject& font);
35 bool HasUnicodeMapping()
const override;
37 bool TryGetGID(
char32_t codePoint,
unsigned& gid)
const override;
39 bool TryGetFlags(PdfFontDescriptorFlags& value)
const override;
41 bool TryGetBoundingBox(Corners& value)
const override;
43 bool TryGetItalicAngle(
double& value)
const override;
45 bool TryGetAscent(
double& value)
const override;
47 bool TryGetDescent(
double& value)
const override;
49 bool TryGetCapHeight(
double& value)
const override;
51 bool TryGetStemV(
double& value)
const override;
53 double GetDefaultWidthRaw()
const override;
55 double GetLineSpacing()
const override;
57 double GetUnderlineThickness()
const override;
59 double GetUnderlinePosition()
const override;
61 double GetStrikeThroughPosition()
const override;
63 double GetStrikeThroughThickness()
const override;
65 std::string_view GetFontName()
const override;
67 std::string_view GetFontNameRaw()
const override;
69 std::string_view GetFontFamilyName()
const override;
71 unsigned char GetSubsetPrefixLength()
const override;
73 PdfFontStretch GetFontStretch()
const override;
75 double GetLeadingRaw()
const override;
77 int GetWeightRaw()
const override;
79 double GetXHeightRaw()
const override;
81 double GetStemHRaw()
const override;
83 double GetAvgWidthRaw()
const override;
85 double GetMaxWidthRaw()
const override;
89 const PdfObject* GetFontFileObject()
const override;
91 unsigned GetFontFileLength1()
const override;
93 unsigned GetFontFileLength2()
const override;
95 unsigned GetFontFileLength3()
const override;
97 const Matrix& GetMatrix()
const override;
99 bool IsObjectLoaded()
const override;
102 void ExportType3GlyphData(PdfDictionary& fontDict, cspan<std::string_view> glyphs)
const override;
104 unsigned GetGlyphCountFontProgram()
const override;
106 std::string_view GetBaseFontName()
const override;
110 bool getIsBoldHint()
const override;
112 bool getIsItalicHint()
const override;
114 datahandle getFontFileDataHandle()
const override;
117 static std::unique_ptr<const PdfFontMetricsObject>
Create(
const PdfObject& font,
const PdfDictionary* descriptor);
119 void processFontName();
121 Corners getBBox(
const PdfObject& obj);
124 struct Type3FontData;
126 std::shared_ptr<charbuff> m_Data;
127 PdfCIDToGIDMapConstPtr m_CIDToGIDMap;
130 std::string m_FontName;
131 std::string m_FontNameRaw;
132 std::string m_FontBaseName;
133 std::string m_FontFamilyName;
134 unsigned char m_SubsetPrefixLength;
138 PdfFontStretch m_FontStretch;
141 nullable<PdfFontDescriptorFlags> m_Flags;
143 double m_ItalicAngle;
153 double m_DefaultWidth;
155 const PdfObject* m_FontFileObject;
157 Type3FontData* m_Type3FontData;
158 nullable<PdfFontFileType> m_FontFileType;
164 double m_LineSpacing;
165 double m_UnderlineThickness;
166 double m_UnderlinePosition;
167 double m_StrikeThroughThickness;
168 double m_StrikeThroughPosition;
This file should be included as the FIRST file in every header of PoDoFo lib.
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfFontFileType
Definition PdfDeclarations.h:276
@ Create
Create a new file or truncate existing one for writing/reading.
PdfFontType
Enum specifying the type of the font.
Definition PdfDeclarations.h:266