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
30 PdfFontMetricsObject(
const PdfObject& font,
const PdfObject* descriptor);
33 static std::unique_ptr<const PdfFontMetricsObject>
Create(
const PdfObject& font,
const PdfObject* descriptor =
nullptr);
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 std::string_view GetBaseFontName()
const override;
104 bool getIsBoldHint()
const override;
106 bool getIsItalicHint()
const override;
108 datahandle getFontFileDataHandle()
const override;
110 const PdfCIDToGIDMapConstPtr& getCIDToGIDMap()
const override;
113 void processFontName();
115 Corners getBBox(
const PdfObject& obj);
117 void tryLoadBuiltinTrueTypeCIDToGIDMap();
120 std::shared_ptr<charbuff> m_Data;
121 PdfCIDToGIDMapConstPtr m_CIDToGIDMap;
124 std::string m_FontName;
125 std::string m_FontNameRaw;
126 std::string m_FontBaseName;
127 std::string m_FontFamilyName;
128 unsigned char m_SubsetPrefixLength;
132 PdfFontStretch m_FontStretch;
135 nullable<PdfFontDescriptorFlags> m_Flags;
137 double m_ItalicAngle;
147 double m_DefaultWidth;
149 const PdfObject* m_FontFileObject;
150 nullable<PdfFontFileType> m_FontFileType;
156 double m_LineSpacing;
157 double m_UnderlineThickness;
158 double m_UnderlinePosition;
159 double m_StrikeThroughThickness;
160 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.