7#ifndef PDF_FONT_METRICS_OBJECT_H
8#define PDF_FONT_METRICS_OBJECT_H
14#include "PdfFontMetrics.h"
22class PODOFO_API PdfFontMetricsObject final :
public PdfFontMetricsBase
32 PdfFontMetricsObject(
const PdfDictionary& fontDict,
const PdfReference& fontRef,
const PdfDictionary* descriptorDict);
35 ~PdfFontMetricsObject();
37 static std::unique_ptr<const PdfFontMetricsObject>
Create(
const PdfObject& font);
39 bool HasUnicodeMapping()
const override;
41 bool TryGetGID(
char32_t codePoint,
unsigned& gid)
const override;
43 bool TryGetFlags(PdfFontDescriptorFlags& value)
const override;
45 bool TryGetBoundingBox(Corners& value)
const override;
47 bool TryGetItalicAngle(
double& value)
const override;
49 bool TryGetAscent(
double& value)
const override;
51 bool TryGetDescent(
double& value)
const override;
53 bool TryGetCapHeight(
double& value)
const override;
55 bool TryGetStemV(
double& value)
const override;
57 double GetDefaultWidthRaw()
const override;
59 double GetLineSpacing()
const override;
61 double GetUnderlineThickness()
const override;
63 double GetUnderlinePosition()
const override;
65 double GetStrikeThroughPosition()
const override;
67 double GetStrikeThroughThickness()
const override;
69 std::string_view GetFontName()
const override;
71 std::string_view GetFontNameRaw()
const override;
73 std::string_view GetFontFamilyName()
const override;
75 unsigned char GetSubsetPrefixLength()
const override;
77 PdfFontStretch GetFontStretch()
const override;
79 double GetLeadingRaw()
const override;
81 int GetWeightRaw()
const override;
83 double GetXHeightRaw()
const override;
85 double GetStemHRaw()
const override;
87 double GetAvgWidthRaw()
const override;
89 double GetMaxWidthRaw()
const override;
93 const PdfObject* GetFontFileObject()
const override;
95 unsigned GetFontFileLength1()
const override;
97 unsigned GetFontFileLength2()
const override;
99 unsigned GetFontFileLength3()
const override;
101 const Matrix& GetMatrix()
const override;
103 bool IsObjectLoaded()
const override;
106 void ExportType3GlyphData(PdfDictionary& fontDict, cspan<std::string_view> glyphs)
const override;
108 unsigned GetGlyphCountFontProgram()
const override;
110 std::string_view GetBaseFontName()
const override;
114 bool getIsBoldHint()
const override;
116 bool getIsItalicHint()
const override;
118 datahandle getFontFileDataHandle()
const override;
121 static std::unique_ptr<const PdfFontMetricsObject>
Create(
const PdfObject& font,
const PdfDictionary* descriptor);
123 void processFontName();
125 Corners getBBox(
const PdfObject& obj);
128 struct Type3FontData;
130 std::shared_ptr<charbuff> m_Data;
131 PdfCIDToGIDMapConstPtr m_CIDToGIDMap;
134 std::string m_FontName;
135 std::string m_FontNameRaw;
136 std::string m_FontBaseName;
137 std::string m_FontFamilyName;
138 unsigned char m_SubsetPrefixLength;
142 PdfFontStretch m_FontStretch;
145 nullable<PdfFontDescriptorFlags> m_Flags;
147 double m_ItalicAngle;
157 double m_DefaultWidth;
159 const PdfObject* m_FontFileObject;
161 Type3FontData* m_Type3FontData;
162 nullable<PdfFontFileType> m_FontFileType;
168 double m_LineSpacing;
169 double m_UnderlineThickness;
170 double m_UnderlinePosition;
171 double m_StrikeThroughThickness;
172 double m_StrikeThroughPosition;
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfFontFileType
Definition PdfDeclarations.h:296
@ Create
Create a new file or truncate existing one for writing/reading.
PdfFontType
Enum specifying the type of the font.
Definition PdfDeclarations.h:286