PoDoFo 0.9.20
|
#include <PdfFontMetrics.h>
Inherited by PoDoFo::PdfFontMetricsBase, and PoDoFo::PdfFontMetricsFreetype.
Public Member Functions | |
double | GetGlyphWidth (unsigned gid) const |
virtual void | SubstituteGIDs (std::vector< unsigned > &gids, std::vector< unsigned char > &backwardMap) const |
virtual bool | HasUnicodeMapping () const =0 |
virtual bool | TryGetGID (char32_t codePoint, unsigned &gid) const =0 |
virtual double | GetLineSpacing () const =0 |
virtual double | GetUnderlineThickness () const =0 |
virtual double | GetUnderlinePosition () const =0 |
virtual double | GetStrikeThroughPosition () const =0 |
virtual double | GetStrikeThroughThickness () const =0 |
bufferview | GetOrLoadFontFileData () const |
bool | TryGetOrLoadFace (FT_Face &face) const |
virtual const PdfObject * | GetFontFileObject () const |
virtual unsigned | GetFontFileLength1 () const =0 |
virtual unsigned | GetFontFileLength2 () const =0 |
virtual unsigned | GetFontFileLength3 () const =0 |
std::string_view | GetFontNameSafe (bool familyFirst=false) const |
std::string_view | GetBaseFontNameSafe () const |
virtual std::string_view | GetBaseFontName () const =0 |
virtual std::string_view | GetFontName () const =0 |
virtual std::string_view | GetFontNameRaw () const |
virtual std::string_view | GetFontFamilyName () const =0 |
unsigned | GetWeight () const |
virtual void | GetBoundingBox (std::vector< double > &bbox) const =0 |
virtual double | GetItalicAngle () const =0 |
virtual double | GetAscent () const =0 |
virtual double | GetDescent () const =0 |
virtual double | GetCapHeight () const =0 |
double | GetXHeight () const |
virtual double | GetStemV () const =0 |
double | GetStemH () const |
double | GetAvgWidth () const |
double | GetMaxWidth () const |
double | GetDefaultWidth () const |
PdfFontStyle | GetStyle () const |
virtual const Matrix2D & | GetMatrix () const |
bool | IsType1Kind () const |
bool | IsTrueTypeKind () const |
bool | IsPdfSymbolic () const |
bool | IsPdfNonSymbolic () const |
virtual std::unique_ptr< PdfCMapEncoding > | CreateToUnicodeMap (const PdfEncodingLimits &limitHints) const |
bool | TryGetImplicitEncoding (PdfEncodingMapConstPtr &encoding) const |
This abstract class provides access to font metrics information.
The class doesn't know anything about CIDs (Character IDs), it just index glyphs, or GIDs where the terminology applies
|
virtual |
Create a best effort /ToUnicode map based on the character unicode maps of the font
Thi is implemented just for PdfFontMetricsFreetype This map may be unreliable because of ligatures, other kind of character subsitutions, or glyphs mapping to multiple unicode codepoints.
|
pure virtual |
Get the ascent of this font in PDF units for the current font size.
Implemented in PoDoFo::PdfFontMetricsStandard14.
double PdfFontMetrics::GetAvgWidth | ( | ) | const |
/AvgWidth (optional, default 0)
|
pure virtual |
Get a semantical base name for the font that can be used to compose the final name, eg. from "AAAAAA+Arial,Bold" to "Arial"
Implemented in PoDoFo::PdfFontMetricsStandard14.
string_view PdfFontMetrics::GetBaseFontNameSafe | ( | ) | const |
Get a semantical base name for the font that can be used to compose the final name, eg. from "AAAAAA+Arial,Bold" to "Arial"
The string is constructed either from the actual /BaseFont, /FontName or /FontFamily name, depending on exsistences of such entries
|
pure virtual |
Create the bounding box vector in PDF units
bbox | write the bounding box to this vector |
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
The vertical coordinate of the top of flat capital letters, measured from the baseline
Implemented in PoDoFo::PdfFontMetricsStandard14.
double PdfFontMetrics::GetDefaultWidth | ( | ) | const |
/MissingWidth or /DW in CID fonts (optional default 1000 in CID fonts, 0 otherwise)
|
pure virtual |
Get the descent of this font in PDF units for the current font size. This value is usually negative!
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Get the actual /FontFamily, eg. "Times", if available
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Get /Length1 value for the font file, if available
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Get /Length2 value for the font file, if available
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Get /Length3 value for the font file, if available
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
virtual |
Get the actual font file object from a /FontFile like key, if available
For font data coming from a file imported font, see GetFontFileData()
|
pure virtual |
Get the actual /FontName, eg. "AAAAAA+Arial,Bold", if available
By default returns empty string
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
virtual |
Get the actual /FontName, eg. "AAAAAA+Arial,Bold", if available By default returns GetFontName()
string_view PdfFontMetrics::GetFontNameSafe | ( | bool | familyFirst = false | ) | const |
Get a string with either the actual /BaseFont, /FontName or /FontFamily name, depending on exsistences of such entries
double PdfFontMetrics::GetGlyphWidth | ( | unsigned | gid | ) | const |
Get the width of a single glyph id
gid | id of the glyph |
|
pure virtual |
Get the italic angle of this font. Used to build the font dictionay
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Retrieve the line spacing for this font
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
virtual |
Returns the matrix mapping glyph space to text space
double PdfFontMetrics::GetMaxWidth | ( | ) | const |
/MaxWidth (optional, default 0)
bufferview PdfFontMetrics::GetOrLoadFontFileData | ( | ) | const |
Get an actual font data view
The data shall be resident. For font coming from the /FontFile keys, GetFontFileObject() may also be available.
double PdfFontMetrics::GetStemH | ( | ) | const |
The thickness, measured vertically, of the dominant horizontal stems of glyphs in the font (optional, default 0)
|
pure virtual |
The thickness, measured horizontally, of the dominant vertical stems of glyphs in the font
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Return the position of the strikethrough for the current font size in PDF units
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Get the width of the strikethrough for the current font size in PDF units
Implemented in PoDoFo::PdfFontMetricsStandard14.
PdfFontStyle PdfFontMetrics::GetStyle | ( | ) | const |
Get whether the font style is bold.
This is a logical value that can be inferred from several characteristics
|
pure virtual |
Return the position of the underline for the current font size in PDF units
Implemented in PoDoFo::PdfFontMetricsStandard14.
|
pure virtual |
Get the width of the underline for the current font size in PDF units
Implemented in PoDoFo::PdfFontMetricsStandard14.
unsigned PdfFontMetrics::GetWeight | ( | ) | const |
Get the weight of this font.
double PdfFontMetrics::GetXHeight | ( | ) | const |
The font’s x height: the vertical coordinate of the top of flat nonascending lowercase letters (like the letter x), measured from the baseline, in fonts that have Latin characters (optional, default 0)
|
pure virtual |
Determines if the metrics has a valid Unicode code point to gid map
Implemented in PoDoFo::PdfFontMetricsStandard14.
bool PdfFontMetrics::IsPdfNonSymbolic | ( | ) | const |
Determine if the font is symbolic according to the PDF definition
The font is symbolic if "uses the Standard Latin character set or a subset of it."
bool PdfFontMetrics::IsPdfSymbolic | ( | ) | const |
Determine if the font is non symbolic according to the PDF definition
The font is symbolic if "contains glyphs outside the Standard Latin character set"
bool PdfFontMetrics::IsTrueTypeKind | ( | ) | const |
Determine if the metrics are TrueType like font
bool PdfFontMetrics::IsType1Kind | ( | ) | const |
Determine if the metrics are for Adobe Type1 like font
|
virtual |
Some fonts provides a glyph subsitution list, eg. for ligatures. OpenType fonts for example provides GSUB "Glyph Substitution Table"
gids | gids to be substituded |
backwardMap | list of gid counts to remap back substituded gids eg. { 32, 102, 105 } gets substituted in { 32, 174 } the backward map is { 1, 2 } |
|
pure virtual |
Try to retrieve the mapped gid from Unicode code point
Implemented in PoDoFo::PdfFontMetricsStandard14.
bool PdfFontMetrics::TryGetImplicitEncoding | ( | PdfEncodingMapConstPtr & | encoding | ) | const |
Get an implicit encoding, such as the one of standard14 fonts, or the built-in encoding of a Type1 font, if available
bool PdfFontMetrics::TryGetOrLoadFace | ( | FT_Face & | face | ) | const |
Get direct access to the internal FreeType handle