PoDoFo::PdfFontCache Class Reference

#include <PdfFontCache.h>

List of all members.

Public Member Functions

 PdfFontCache (PdfVecObjects *pParent)
 ~PdfFontCache ()
void EmptyCache ()
PdfFontGetFont (PdfObject *pObject)
PdfFontGetFont (const char *pszFontName, bool bBold, bool bItalic, bool bEmbedd, const PdfEncoding *const =PdfEncodingFactory::GlobalPdfDocEncodingInstance(), const char *pszFileName=NULL)
PdfFontGetFont (FT_Face face, bool bEmbedd, const PdfEncoding *const =PdfEncodingFactory::GlobalPdfDocEncodingInstance())
PdfFontGetFontSubset (const char *pszFontName, bool bBold, bool bItalic, const PdfEncoding *const =PdfEncodingFactory::GlobalPdfDocEncodingInstance(), const char *pszFileName=NULL)
FT_Library GetFontLibrary () const


Detailed Description

This class assists PdfDocument with caching font information.

Additional to font caching, this class is also responsible for font matching.

PdfFont is an actual font that can be used in a PDF file (i.e. it does also font embedding) and PdfFontMetrics provides only metrics informations.

This class is an internal class of PoDoFo and should not be used in user applications

See also:
PdfDocument


Constructor & Destructor Documentation

PoDoFo::PdfFontCache::PdfFontCache ( PdfVecObjects pParent  ) 

Create an empty font cache

Parameters:
pParent a PdfVecObjects which is required to create new font objects

PoDoFo::PdfFontCache::~PdfFontCache (  ) 

Destroy and empty the font cache


Member Function Documentation

void PoDoFo::PdfFontCache::EmptyCache (  ) 

Empty the internal font cache. This should be done when ever a new document is created or openened.

PdfFont * PoDoFo::PdfFontCache::GetFont ( FT_Face  face,
bool  bEmbedd,
const PdfEncoding const = PdfEncodingFactory::GlobalPdfDocEncodingInstance() 
)

Get a font from the cache. If the font does not yet exist, add it to the cache.

Parameters:
face a valid freetype font face (will be free'd by PoDoFo)
bEmbedd if true a font for embedding into PDF will be created
pEncoding the encoding of the font. The font will not take ownership of this object.
Returns:
a PdfFont object or NULL if the font could not be created or found.

PdfFont * PoDoFo::PdfFontCache::GetFont ( const char *  pszFontName,
bool  bBold,
bool  bItalic,
bool  bEmbedd,
const PdfEncoding const = PdfEncodingFactory::GlobalPdfDocEncodingInstance(),
const char *  pszFileName = NULL 
)

Get a font from the cache. If the font does not yet exist, add it to the cache.

Parameters:
pszFontName a valid fontname
bBold if true search for a bold font
bItalic if true search for an italic font
bEmbedd if true a font for embedding into PDF will be created
pEncoding the encoding of the font. The font will not take ownership of this object.
optional,: pszFileName path to a valid font file
Returns:
a PdfFont object or NULL if the font could not be created or found.

PdfFont * PoDoFo::PdfFontCache::GetFont ( PdfObject pObject  ) 

Get a font from the cache. If the font does not yet exist, add it to the cache. This font is created from an existing object.

Parameters:
pObject a PdfObject that is a font
Returns:
a PdfFont object or NULL if the font could not be created or found.

FT_Library PoDoFo::PdfFontCache::GetFontLibrary (  )  const [inline]

Returns the font library from font cache

Returns:
the internal handle to the freetype library

PdfFont * PoDoFo::PdfFontCache::GetFontSubset ( const char *  pszFontName,
bool  bBold,
bool  bItalic,
const PdfEncoding const = PdfEncodingFactory::GlobalPdfDocEncodingInstance(),
const char *  pszFileName = NULL 
)

Get a fontsubset from the cache. If the font does not yet exist, add it to the cache.

Parameters:
pszFontName a valid fontname
bBold if true search for a bold font
bItalic if true search for an italic font
pEncoding the encoding of the font. All characters of the encoding will be included in this subset. The font will not take ownership of this object.
optional,: pszFileName path to a valid font file
Returns:
a PdfFont object or NULL if the font could not be created or found.


Generated on Sat May 2 02:59:41 2009 for PoDoFo by  doxygen 1.4.7