pdfmm 0.9.20
Static Public Member Functions | Protected Member Functions | List of all members
mm::PdfFontStandard14 Class Referencefinal

#include <PdfFontStandard14.h>

Inheritance diagram for mm::PdfFontStandard14:
mm::PdfFont

Static Public Member Functions

static bool IsStandard14Font (const std::string_view &fontName, PdfStandard14FontType &stdFont)
 
static bool TryGetStandard14Font (const std::string_view &baseFontName, bool bold, bool italic, PdfStandard14FontType &stdFont)
 
static bool TryGetStandard14Font (const std::string_view &baseFontName, bool bold, bool italic, bool useAltNames, PdfStandard14FontType &stdFont)
 
- Static Public Member Functions inherited from mm::PdfFont
static std::unique_ptr< PdfFontCreate (PdfDocument &doc, const PdfFontMetricsConstPtr &metrics, const PdfEncoding &encoding, PdfFontInitOptions flags)
 
static std::unique_ptr< PdfFontCreateStandard14 (PdfDocument &doc, PdfStandard14FontType baseFont, const PdfEncoding &encoding, PdfFontInitOptions flags)
 
static bool TryCreateFromObject (PdfObject &obj, std::unique_ptr< PdfFont > &font)
 
static std::string ExtractBaseName (const std::string_view &fontName, bool &isBold, bool &isItalic)
 
static std::string ExtractBaseName (const std::string_view &fontName)
 

Protected Member Functions

bool TryMapCIDToGID (unsigned cid, unsigned &gid) const override
 
bool TryMapGIDToCID (unsigned gid, unsigned &cid) const override
 
void initImported () override
 
- Protected Member Functions inherited from mm::PdfFont
 PdfFont (PdfDocument &doc, const PdfFontMetricsConstPtr &metrics, const PdfEncoding &encoding)
 
virtual bool TryMapCIDToGID (unsigned cid, unsigned &gid) const
 
virtual bool TryMapGIDToCID (unsigned gid, unsigned &cid) const
 
double GetCIDWidthRaw (unsigned cid) const
 
void FillDescriptor (PdfDictionary &dict) const
 
virtual void initImported ()
 

Additional Inherited Members

- Public Member Functions inherited from mm::PdfFont
void WriteStringToStream (PdfStream &stream, const std::string_view &str) const
 
void WriteStringToStream (std::ostream &stream, const std::string_view &str) const
 
double GetStringWidth (const std::string_view &view, const PdfTextState &state) const
 
bool TryGetStringWidth (const std::string_view &view, const PdfTextState &state, double &width) const
 
double GetStringWidth (const PdfString &encodedStr, const PdfTextState &state) const
 
bool TryGetStringWidth (const PdfString &encodedStr, const PdfTextState &state, double &width) const
 
double GetCharWidth (char32_t codePoint, const PdfTextState &state, bool ignoreCharSpacing=false) const
 
double GetLineSpacing (const PdfTextState &state) const
 
double GetUnderlineThickness (const PdfTextState &state) const
 
double GetUnderlinePosition (const PdfTextState &state) const
 
double GetStrikeOutPosition (const PdfTextState &state) const
 
double GetStrikeOutThickness (const PdfTextState &state) const
 
double GetAscent (const PdfTextState &state) const
 
double GetDescent (const PdfTextState &state) const
 
bool IsLoaded () const
 
bool IsSubsettingEnabled () const
 
const std::string & GetSubsetPrefix () const
 
const PdfNameGetIdentifier () const
 
const PdfEncodingGetEncoding () const
 
const PdfFontMetricsGetMetrics () const
 
const std::string & GetName () const
 

Detailed Description

A PdfFont implementation that represents a standard 14 type1 font

Member Function Documentation

◆ initImported()

void PdfFontStandard14::initImported ( )
overrideprotectedvirtual

Inititialization tasks for imported/created from scratch fonts

Reimplemented from mm::PdfFont.

◆ IsStandard14Font()

bool PdfFontStandard14::IsStandard14Font ( const std::string_view &  fontName,
PdfStandard14FontType &  stdFont 
)
static

Determine if font name is a Standard14 font

Parameters
fontNamethe unprocessed font name

◆ TryGetStandard14Font() [1/2]

static bool mm::PdfFontStandard14::TryGetStandard14Font ( const std::string_view &  baseFontName,
bool  bold,
bool  italic,
bool  useAltNames,
PdfStandard14FontType &  stdFont 
)
static

Try get a standard14 font from a base font name, representing the family and bold/italic characteristic

Parameters
baseFontNamethe processed font name
useAltNamesuse also the alternative names (Arial, TimesNewRoman, CourierNew)

◆ TryGetStandard14Font() [2/2]

static bool mm::PdfFontStandard14::TryGetStandard14Font ( const std::string_view &  baseFontName,
bool  bold,
bool  italic,
PdfStandard14FontType &  stdFont 
)
static

Try get a standard14 font from a base font name, representing the family and bold/italic characteristic

By default use only standard names, not alternative ones (Arial, TimesNewRoman, CourierNew)

Parameters
baseFontNamethe processed font name

◆ TryMapCIDToGID()

bool PdfFontStandard14::TryMapCIDToGID ( unsigned  cid,
unsigned &  gid 
) const
overrideprotectedvirtual

Optional function to map a CID to a GID

Example for /Type2 CID fonts may have a /CIDToGIDMap For Standard14 fonts we have to convert CID to unicode then we retrieve the glyph index

Reimplemented from mm::PdfFont.

◆ TryMapGIDToCID()

bool PdfFontStandard14::TryMapGIDToCID ( unsigned  gid,
unsigned &  cid 
) const
overrideprotectedvirtual

Optional function to map a CID to a GID

Example for /Type2 CID fonts may have a /CIDToGIDMap For Standard14 fonts we have to convert CID to unicode then we retrieve the glyph index

Reimplemented from mm::PdfFont.