pdfmm 0.9.20
Public Member Functions | List of all members
mm::PdfFontMetricsStandard14 Class Referencefinal

#include <PdfFontMetricsStandard14.h>

Inheritance diagram for mm::PdfFontMetricsStandard14:
mm::PdfFontMetrics

Public Member Functions

void GetBoundingBox (std::vector< double > &bbox) const override
 
double GetLineSpacing () const override
 
double GetUnderlineThickness () const override
 
double GetUnderlinePosition () const override
 
double GetStrikeOutPosition () const override
 
double GetStrikeOutThickness () const override
 
double GetAscent () const override
 
double GetDescent () const override
 
std::string GetBaseFontName () const override
 
unsigned GetWeight () const override
 
double GetCapHeight () const override
 
double GetXHeight () const override
 
double GetStemV () const override
 
double GetItalicAngle () const override
 
bool IsSymbol () const override
 
std::string_view GetFontData () const override
 
bool IsBold () const override
 
bool IsItalic () const override
 
bool FontNameHasBoldItalicInfo () const override
 
- Public Member Functions inherited from mm::PdfFontMetrics
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 PdfObjectGetFontDataObject () 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
 

Additional Inherited Members

- Static Public Member Functions inherited from mm::PdfFontMetrics
static PdfFontMetricsType GetFontMetricsTypeFromFilename (const std::string_view &filename)
 
- Protected Member Functions inherited from mm::PdfFontMetrics
void SetType (PdfFontMetricsType eFontType)
 

Detailed Description

This is the main class to handle the Standard14 metric data.

Member Function Documentation

◆ FontNameHasBoldItalicInfo()

bool PdfFontMetricsStandard14::FontNameHasBoldItalicInfo ( ) const
overridevirtual

State whether font name reports if the font is bold or italic, such has in "Helvetica-Bold"

Reimplemented from mm::PdfFontMetrics.

◆ GetAscent()

double PdfFontMetricsStandard14::GetAscent ( ) const
overridevirtual

Get the ascent of this font in PDF units for the current font size.

Returns
the ascender for this font
See also
GetAscent

Implements mm::PdfFontMetrics.

◆ GetBaseFontName()

string PdfFontMetricsStandard14::GetBaseFontName ( ) const
overridevirtual

Get a base name for the font that can be used to compose the final name, eg. "Arial"

Return empty string by default

Reimplemented from mm::PdfFontMetrics.

◆ GetBoundingBox()

void PdfFontMetricsStandard14::GetBoundingBox ( std::vector< double > &  bbox) const
overridevirtual

Create the bounding box vector in PDF units

Parameters
bboxwrite the bounding box to this vector

Implements mm::PdfFontMetrics.

◆ GetCapHeight()

double PdfFontMetricsStandard14::GetCapHeight ( ) const
overridevirtual

The vertical coordinate of the top of flat capital letters, measured from the baseline

Implements mm::PdfFontMetrics.

◆ GetDescent()

double PdfFontMetricsStandard14::GetDescent ( ) const
overridevirtual

Get the descent of this font in PDF units for the current font size. This value is usually negative!

Returns
the descender for this font
See also
GetDescent

Implements mm::PdfFontMetrics.

◆ GetFontData()

string_view PdfFontMetricsStandard14::GetFontData ( ) const
overridevirtual

Get the actual font data for a file loaded font, if available

For font data coming from the /FontFile keys, use GetFontDataObject()

Returns
a binary buffer of data containing the font data

Reimplemented from mm::PdfFontMetrics.

◆ GetItalicAngle()

double PdfFontMetricsStandard14::GetItalicAngle ( ) const
overridevirtual

Get the italic angle of this font. Used to build the font dictionay

Returns
the italic angle of this font.

Implements mm::PdfFontMetrics.

◆ GetLineSpacing()

double PdfFontMetricsStandard14::GetLineSpacing ( ) const
overridevirtual

Retrieve the line spacing for this font

Returns
the linespacing in PDF units

Implements mm::PdfFontMetrics.

◆ GetStemV()

double PdfFontMetricsStandard14::GetStemV ( ) const
overridevirtual

The thickness, measured horizontally, of the dominant vertical stems of glyphs in the font

Implements mm::PdfFontMetrics.

◆ GetStrikeOutPosition()

double PdfFontMetricsStandard14::GetStrikeOutPosition ( ) const
overridevirtual

Return the position of the strikeout for the current font size in PDF units

Returns
the underline position in PDF units

Implements mm::PdfFontMetrics.

◆ GetStrikeOutThickness()

double PdfFontMetricsStandard14::GetStrikeOutThickness ( ) const
overridevirtual

Get the width of the strikeout for the current font size in PDF units

Returns
the thickness of the strikeout in PDF units

Implements mm::PdfFontMetrics.

◆ GetUnderlinePosition()

double PdfFontMetricsStandard14::GetUnderlinePosition ( ) const
overridevirtual

Return the position of the underline for the current font size in PDF units

Returns
the underline position in PDF units

Implements mm::PdfFontMetrics.

◆ GetUnderlineThickness()

double PdfFontMetricsStandard14::GetUnderlineThickness ( ) const
overridevirtual

Get the width of the underline for the current font size in PDF units

Returns
the thickness of the underline in PDF units

Implements mm::PdfFontMetrics.

◆ GetWeight()

unsigned PdfFontMetricsStandard14::GetWeight ( ) const
overridevirtual

Get the weight of this font. Used to build the font dictionay

Returns
the weight of this font (500 is normal).

Implements mm::PdfFontMetrics.

◆ GetXHeight()

double PdfFontMetricsStandard14::GetXHeight ( ) const
overridevirtual

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

Implements mm::PdfFontMetrics.

◆ IsBold()

bool PdfFontMetricsStandard14::IsBold ( ) const
overridevirtual

Get whether the font style is bold

Implements mm::PdfFontMetrics.

◆ IsItalic()

bool PdfFontMetricsStandard14::IsItalic ( ) const
overridevirtual

Get whether the font style is italic

Implements mm::PdfFontMetrics.

◆ IsSymbol()

bool PdfFontMetricsStandard14::IsSymbol ( ) const
overridevirtual

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.

Returns
true if this is a symbol font

Implements mm::PdfFontMetrics.