pdfmm 0.9.20
Protected Member Functions | List of all members
mm::PdfFontSimple Class Referenceabstract

#include <PdfFontSimple.h>

Inheritance diagram for mm::PdfFontSimple:
mm::PdfFont mm::PdfFontTrueType mm::PdfFontType1 mm::PdfFontType3

Protected Member Functions

 PdfFontSimple (PdfDocument &doc, const PdfFontMetricsConstPtr &metrics, const PdfEncoding &encoding)
 
virtual void embedFontFile (PdfObject &descriptor)=0
 
- 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
 
- 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)
 

Detailed Description

This is a common base class for simple, non CID-keyed fonts like Type1, TrueType and Type3

Constructor & Destructor Documentation

◆ PdfFontSimple()

PdfFontSimple::PdfFontSimple ( PdfDocument doc,
const PdfFontMetricsConstPtr metrics,
const PdfEncoding encoding 
)
protected

Create a new PdfFont object which will introduce itself automatically to every page object it is used on.

Parameters
docparent of the font object
metricspointer to a font metrics object. The font in the PDF file will match this fontmetrics object. The metrics object is deleted along with the font.
encodingthe encoding of this font. The font will take ownership of this object depending on pEncoding->IsAutoDelete()

Member Function Documentation

◆ embedFontFile()

virtual void mm::PdfFontSimple::embedFontFile ( PdfObject descriptor)
protectedpure virtual

Embed the font file directly into the PDF file.

Parameters
pDescriptorfont descriptor object

Implemented in mm::PdfFontTrueType, mm::PdfFontType1, and mm::PdfFontType3.