PoDoFo  1.0.0-dev
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
PoDoFo::PdfFontMetricsStandard14 Class Referencefinal

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

#include <PdfFontMetricsStandard14.h>

Inherits PoDoFo::PdfFontMetricsBase.

Public Member Functions

unsigned GetGlyphCount () const override
 
bool TryGetGlyphWidth (unsigned gid, double &width) const override
 
bool HasUnicodeMapping () const override
 Determines if the metrics has a valid Unicode code point to gid map.
 
bool TryGetGID (char32_t codePoint, unsigned &gid) const override
 Try to retrieve the mapped gid from Unicode code point. More...
 
double GetDefaultWidthRaw () const override
 
double GetLineSpacing () const override
 Retrieve the line spacing for this font. More...
 
double GetUnderlineThickness () const override
 Get the width of the underline for the current font size in PDF units. More...
 
double GetUnderlinePosition () const override
 Return the position of the underline for the current font size in PDF units. More...
 
double GetStrikeThroughPosition () const override
 Return the position of the strikethrough for the current font size in PDF units. More...
 
double GetStrikeThroughThickness () const override
 Get the width of the strikethrough for the current font size in PDF units. More...
 
std::string_view GetFontName () const override
 Get the actual /FontName, eg. More...
 
std::string_view GetFontFamilyName () const override
 Get the actual /FontFamily, eg. More...
 
PdfFontStretch GetFontStretch () const override
 
int GetWeightRaw () const override
 
PdfFontDescriptorFlags GetFlags () const override
 
void GetBoundingBox (std::vector< double > &bbox) const override
 Create the bounding box vector in PDF units. More...
 
double GetItalicAngle () const override
 Get the italic angle of this font. More...
 
double GetAscent () const override
 Get the ascent of this font in PDF units for the current font size. More...
 
double GetDescent () const override
 Get the descent of this font in PDF units for the current font size. More...
 
double GetLeadingRaw () const override
 
double GetCapHeight () const override
 The vertical coordinate of the top of flat capital letters, measured from the baseline.
 
double GetXHeightRaw () const override
 
double GetStemV () const override
 The thickness, measured horizontally, of the dominant vertical stems of glyphs in the font.
 
double GetStemHRaw () const override
 
double GetAvgWidthRaw () const override
 
double GetMaxWidthRaw () const override
 
PdfFontFileType GetFontFileType () const override
 
bool IsStandard14FontMetrics (PdfStandard14FontType &std14Font) const override
 
unsigned GetFontFileLength1 () const override
 Get /Length1 value for the font file, if available.
 
unsigned GetFontFileLength2 () const override
 Get /Length2 value for the font file, if available.
 
unsigned GetFontFileLength3 () const override
 Get /Length3 value for the font file, if available.
 
const Standard14FontData & GetRawData () const
 

Static Public Member Functions

static std::unique_ptr< const PdfFontMetricsStandard14Create (PdfStandard14FontType fontType)
 Create a Standard14 font metrics. More...
 
static std::unique_ptr< const PdfFontMetricsStandard14Create (PdfStandard14FontType fontType, const PdfObject &fontObj)
 
static std::shared_ptr< const PdfFontMetricsStandard14GetInstance (PdfStandard14FontType std14Font)
 

Protected Member Functions

std::string_view GetBaseFontName () const override
 Get a semantical base name for the font that can be used to compose the final name, eg. More...
 
bool getIsItalicHint () const override
 
bool getIsBoldHint () const override
 
datahandle getFontFileDataHandle () const override
 

Detailed Description

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

Member Function Documentation

◆ Create()

unique_ptr< const PdfFontMetricsStandard14 > PdfFontMetricsStandard14::Create ( PdfStandard14FontType  fontType)
static

Create a Standard14 font metrics.

Parameters
fontObjoptionally try to read a /Widths entry from the supplied

◆ 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 PoDoFo::PdfFontMetrics.

◆ GetBaseFontName()

string_view PdfFontMetricsStandard14::GetBaseFontName ( ) const
overrideprotectedvirtual

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

from "AAAAAA+Arial,Bold" to "Arial"

Remarks
It doesn't correspond to /BaseFont name entry in the font

Implements PoDoFo::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 PoDoFo::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 PoDoFo::PdfFontMetrics.

◆ GetFontFamilyName()

string_view PdfFontMetricsStandard14::GetFontFamilyName ( ) const
overridevirtual

Get the actual /FontFamily, eg.

"Times", if available

Implements PoDoFo::PdfFontMetrics.

◆ GetFontName()

string_view PdfFontMetricsStandard14::GetFontName ( ) const
overridevirtual

Get the actual /FontName, eg.

"AAAAAA+Arial,Bold", if available

By default returns empty string

Returns
the postscript name of the font or empty string if no postscript name is available.

Implements PoDoFo::PdfFontMetrics.

◆ GetItalicAngle()

double PdfFontMetricsStandard14::GetItalicAngle ( ) const
overridevirtual

Get the italic angle of this font.

Used to build the font dictionary

Returns
the italic angle of this font.

Implements PoDoFo::PdfFontMetrics.

◆ GetLineSpacing()

double PdfFontMetricsStandard14::GetLineSpacing ( ) const
overridevirtual

Retrieve the line spacing for this font.

Returns
the linespacing in PDF units

Implements PoDoFo::PdfFontMetrics.

◆ GetStrikeThroughPosition()

double PdfFontMetricsStandard14::GetStrikeThroughPosition ( ) const
overridevirtual

Return the position of the strikethrough for the current font size in PDF units.

Returns
the strikethrough position in PDF units

Implements PoDoFo::PdfFontMetrics.

◆ GetStrikeThroughThickness()

double PdfFontMetricsStandard14::GetStrikeThroughThickness ( ) const
overridevirtual

Get the width of the strikethrough for the current font size in PDF units.

Returns
the thickness of the strikethrough in PDF units

Implements PoDoFo::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 PoDoFo::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 PoDoFo::PdfFontMetrics.

◆ TryGetGID()

bool PdfFontMetricsStandard14::TryGetGID ( char32_t  codePoint,
unsigned &  gid 
) const
overridevirtual

Try to retrieve the mapped gid from Unicode code point.

Remarks
don't use this method directly unless you know what you're doing: use PdfFont::TryGetGID instead

Implements PoDoFo::PdfFontMetrics.


The documentation for this class was generated from the following files: