7 #ifndef PDF_FONT_METRICS_STANDARD14_H
8 #define PDF_FONT_METRICS_STANDARD14_H
12 #include "PdfFontMetrics.h"
13 #include <podofo/auxiliary/Rect.h>
17 struct Standard14FontData;
26 const Standard14FontData& data,
27 std::unique_ptr<std::vector<double>> parsedWidths = { });
33 static std::unique_ptr<const PdfFontMetricsStandard14>
Create(
34 PdfStandard14FontType fontType);
35 static std::unique_ptr<const PdfFontMetricsStandard14>
Create(
36 PdfStandard14FontType fontType,
const PdfObject& fontObj);
39 unsigned GetGlyphCount()
const override;
41 bool TryGetGlyphWidth(
unsigned gid,
double& width)
const override;
43 bool HasUnicodeMapping()
const override;
45 bool TryGetGID(char32_t codePoint,
unsigned& gid)
const override;
47 double GetDefaultWidthRaw()
const override;
49 double GetLineSpacing()
const override;
51 double GetUnderlineThickness()
const override;
53 double GetUnderlinePosition()
const override;
55 double GetStrikeThroughPosition()
const override;
57 double GetStrikeThroughThickness()
const override;
59 std::string_view GetFontName()
const override;
61 std::string_view GetFontFamilyName()
const override;
63 PdfFontStretch GetFontStretch()
const override;
65 int GetWeightRaw()
const override;
69 void GetBoundingBox(std::vector<double>& bbox)
const override;
71 double GetItalicAngle()
const override;
73 double GetAscent()
const override;
75 double GetDescent()
const override;
77 double GetLeadingRaw()
const override;
79 double GetCapHeight()
const override;
81 double GetXHeightRaw()
const override;
83 double GetStemV()
const override;
85 double GetStemHRaw()
const override;
87 double GetAvgWidthRaw()
const override;
89 double GetMaxWidthRaw()
const override;
93 bool IsStandard14FontMetrics(PdfStandard14FontType& std14Font)
const override;
95 unsigned GetFontFileLength1()
const override;
97 unsigned GetFontFileLength2()
const override;
99 unsigned GetFontFileLength3()
const override;
101 inline const Standard14FontData& GetRawData()
const {
return m_data; }
104 std::string_view GetBaseFontName()
const override;
106 bool getIsItalicHint()
const override;
108 bool getIsBoldHint()
const override;
110 datahandle getFontFileDataHandle()
const override;
113 static std::unique_ptr<PdfFontMetricsStandard14> create(
114 PdfStandard14FontType fontType,
const PdfObject* fontObj =
nullptr);
117 static std::shared_ptr<const PdfFontMetricsStandard14> GetInstance(PdfStandard14FontType std14Font);
120 PdfStandard14FontType m_Std14FontType;
121 const Standard14FontData& m_data;
123 std::unique_ptr<std::vector<double>> m_parsedWidths;
128 double m_LineSpacing;
129 double m_UnderlineThickness;
130 double m_UnderlinePosition;
131 double m_StrikeThroughThickness;
132 double m_StrikeThroughPosition;
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
This is the main class to handle the Standard14 metric data.
Definition: PdfFontMetricsStandard14.h:23
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
A const data provider that can hold a view to a static segments or a shared buffer.
Definition: basetypes.h:144
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16
PdfFontFileType
Definition: PdfDeclarations.h:267
@ Create
Create a new file or truncate existing one for writing/reading.
PdfFontDescriptorFlags
Enum for the font descriptor flags.
Definition: PdfDeclarations.h:223