PoDoFo  0.9.4
Static Public Member Functions | List of all members
PoDoFo::PdfFontFactory Class Reference

#include <PdfFontFactory.h>

Static Public Member Functions

static PdfFontCreateFontObject (PdfFontMetrics *pMetrics, int nFlags, const PdfEncoding *pEncoding, PdfVecObjects *pParent)
static PdfFontCreateFont (FT_Library *pLibrary, PdfObject *pObject)
static PdfFontCreateBase14Font (const char *pszFontName, EPdfFontFlags eFlags, const PdfEncoding *const pEncoding, PdfVecObjects *pParent)
static EPdfFontType GetFontType (const char *pszFilename)

Detailed Description

This is a factory class which knows which implementation of PdfFont is required for a certain font type with certain features (like encoding).

Member Function Documentation

PdfFont * PoDoFo::PdfFontFactory::CreateBase14Font ( const char *  pszFontName,
EPdfFontFlags  eFlags,
const PdfEncoding *const  pEncoding,
PdfVecObjects pParent 

Creates a new base-14 font object (of class PdfFontType1Base14) if the font name (has to include variant) is one of the base 14 fonts. The font name is to be given as specified (with an ASCII hyphen).

pszFontNameASCII C string (zero-terminated) of the font name
eFlagsone flag for font variant (Bold, Italic or BoldItalic)
pEncodingan encoding compatible with the font
pParenta vector of PDF objects to be the font object's owner
PdfFont * PoDoFo::PdfFontFactory::CreateFont ( FT_Library *  pLibrary,
PdfObject pObject 

Create a new PdfFont from an existing font in a PDF file.

pLibraryhandle to the FreeType library, so that a PdfFontMetrics can be constructed for this font
pObjecta PDF font object
PdfFont * PoDoFo::PdfFontFactory::CreateFontObject ( PdfFontMetrics pMetrics,
int  nFlags,
const PdfEncoding pEncoding,
PdfVecObjects pParent 

Create a new PdfFont object.

pMetricspointer to a font metrics object. The font in the PDF file will match this fontmetrics object. The metrics object is deleted along with the created font. In case of an error, it is deleted here.
nFlagsfont flags or'ed together, specifying the font style and if it should be embedded
pEncodingthe encoding of this font.
pParentthe parent of the created font.
a new PdfFont object or NULL
EPdfFontType PoDoFo::PdfFontFactory::GetFontType ( const char *  pszFilename)

Try to guess the fonttype from a the filename of a font file.

pszFilenamefilename of a fontfile
the font type