|
pdfmm 0.9.20
|
#include <PdfFontMetrics.h>
Public Member Functions | |
| double | GetGlyphWidth (unsigned gid) const |
| virtual void | SubstituteGIDs (std::vector< unsigned > &gids, std::vector< unsigned char > &backwardMap) const |
| unsigned | GetGID (char32_t codePoint) const |
| virtual void | GetBoundingBox (std::vector< double > &bbox) const =0 |
| virtual double | GetLineSpacing () const =0 |
| virtual double | GetUnderlineThickness () const =0 |
| virtual double | GetUnderlinePosition () const =0 |
| virtual double | GetStrikeOutPosition () const =0 |
| virtual double | GetStrikeOutThickness () const =0 |
| virtual double | GetAscent () const =0 |
| virtual double | GetDescent () const =0 |
| virtual std::string_view | GetFontData () const |
| virtual const PdfObject * | GetFontDataObject () const |
| std::string | GetFontNameSafe (bool baseFirst=false) const |
| virtual std::string | GetBaseFontName () const |
| virtual std::string | GetFontName () const |
| virtual unsigned | GetWeight () const =0 |
| virtual double | GetCapHeight () const =0 |
| virtual double | GetXHeight () const =0 |
| virtual double | GetStemV () const =0 |
| virtual double | GetItalicAngle () const =0 |
| virtual bool | IsBold () const =0 |
| virtual bool | IsItalic () const =0 |
| virtual bool | FontNameHasBoldItalicInfo () const |
| PdfFontMetricsType | GetType () const |
| virtual bool | IsSymbol () const =0 |
Static Public Member Functions | |
| static PdfFontMetricsType | GetFontMetricsTypeFromFilename (const std::string_view &filename) |
Protected Member Functions | |
| void | SetType (PdfFontMetricsType eFontType) |
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 |
State whether font name reports if the font is bold or italic, such has in "Helvetica-Bold"
Reimplemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get the ascent of this font in PDF units for the current font size.
Implemented in mm::PdfFontMetricsStandard14.
|
virtual |
Get a base name for the font that can be used to compose the final name, eg. "Arial"
Return empty string by default
Reimplemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Create the bounding box vector in PDF units
| bbox | write the bounding box to this vector |
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
The vertical coordinate of the top of flat capital letters, measured from the baseline
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get the descent of this font in PDF units for the current font size. This value is usually negative!
Implemented in mm::PdfFontMetricsStandard14.
|
virtual |
Get the actual font data for a file loaded font, if available
For font data coming from the /FontFile keys, use GetFontDataObject()
Reimplemented in mm::PdfFontMetricsStandard14.
|
virtual |
Get the actual font data object from a /FontFile like key, if available
For font data coming from a file loaded font, see GetFontData()
|
static |
Try to detect the internal fonttype from the file extension of a fontfile.
| filename | must be the filename of a font file |
|
virtual |
Get the actual /FontName, eg. "AAAAAA+Arial,Bold", if available
By default return empty string
| string PdfFontMetrics::GetFontNameSafe | ( | bool | baseFirst = false | ) | const |
Get a string with either the actual /FontName or a base font name inferred from a font file
| unsigned PdfFontMetrics::GetGID | ( | char32_t | codePoint | ) | const |
Get the GID by the codePoint
| codePoint | unicode codepoint |
| 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 mm::PdfFontMetricsStandard14.
|
pure virtual |
Retrieve the line spacing for this font
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
The thickness, measured horizontally, of the dominant vertical stems of glyphs in the font
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Return the position of the strikeout for the current font size in PDF units
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get the width of the strikeout for the current font size in PDF units
Implemented in mm::PdfFontMetricsStandard14.
|
inline |
|
pure virtual |
Return the position of the underline for the current font size in PDF units
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get the width of the underline for the current font size in PDF units
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get the weight of this font. Used to build the font dictionay
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
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
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get whether the font style is bold
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Get whether the font style is italic
Implemented in mm::PdfFontMetricsStandard14.
|
pure virtual |
Symbol fonts do need special treatment in a few cases. Use this method to check if the current font is a symbol font. Symbold fonts are detected by checking if they use FT_ENCODING_MS_SYMBOL as internal encoding.
Implemented in mm::PdfFontMetricsStandard14.
|
inlineprotected |
Set the fonttype.
| eFontType | fonttype |
|
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 } |