#include <PdfFontCache.h>
Public Member Functions | |
PdfFontCache (PdfVecObjects *pParent) | |
~PdfFontCache () | |
void | EmptyCache () |
PdfFont * | GetFont (PdfObject *pObject) |
PdfFont * | GetFont (const char *pszFontName, bool bBold, bool bItalic, bool bEmbedd, const PdfEncoding *const =PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), const char *pszFileName=NULL) |
PdfFont * | GetFont (FT_Face face, bool bEmbedd, const PdfEncoding *const =PdfEncodingFactory::GlobalWinAnsiEncodingInstance()) |
PdfFont * | GetDuplicateFontType1 (PdfFont *pFont, const char *pszSuffix) |
PdfFont * | GetFontSubset (const char *pszFontName, bool bBold, bool bItalic, const PdfEncoding *const =PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), const char *pszFileName=NULL) |
FT_Library | GetFontLibrary () const |
Static Public Member Functions | |
static std::string | GetFontConfigFontPath (FcConfig *pConfig, const char *pszFontName, bool bBold, bool bItalic) |
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
PoDoFo::PdfFontCache::PdfFontCache | ( | PdfVecObjects * | pParent | ) |
Create an empty font cache
pParent | a PdfVecObjects which is required to create new font objects |
PoDoFo::PdfFontCache::~PdfFontCache | ( | ) |
Destroy and empty the font cache
void PoDoFo::PdfFontCache::EmptyCache | ( | ) |
Empty the internal font cache. This should be done when ever a new document is created or openened.
Get a font with specific id from the cache. If the font does not yet exist, copy from existing type1-font and set id.
pFont | an existing font | |
pszSuffix | Suffix to add to font-id |
PdfFont * PoDoFo::PdfFontCache::GetFont | ( | FT_Face | face, | |
bool | bEmbedd, | |||
const PdfEncoding * const | pEncoding = PdfEncodingFactory::GlobalWinAnsiEncodingInstance() | |||
) |
Get a font from the cache. If the font does not yet exist, add it to the cache.
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. |
PdfFont * PoDoFo::PdfFontCache::GetFont | ( | const char * | pszFontName, | |
bool | bBold, | |||
bool | bItalic, | |||
bool | bEmbedd, | |||
const PdfEncoding * const | pEncoding = PdfEncodingFactory::GlobalWinAnsiEncodingInstance() , |
|||
const char * | pszFileName = NULL | |||
) |
Get a font from the cache. If the font does not yet exist, add it to the cache.
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 |
std::string PoDoFo::PdfFontCache::GetFontConfigFontPath | ( | FcConfig * | pConfig, | |
const char * | pszFontName, | |||
bool | bBold, | |||
bool | bItalic | |||
) | [static] |
Get the path of a font file on a Unix system using fontconfig
This method is only available if PoDoFo was compiled with fontconfig support.
pConfig | a handle to an initialized fontconfig library | |
pszFontName | name of the requested font | |
bBold | if true find a bold font | |
bItalic | if true find an italic font |
FT_Library PoDoFo::PdfFontCache::GetFontLibrary | ( | ) | const [inline] |
Returns the font library from font cache
PdfFont * PoDoFo::PdfFontCache::GetFontSubset | ( | const char * | pszFontName, | |
bool | bBold, | |||
bool | bItalic, | |||
const PdfEncoding * const | pEncoding = PdfEncodingFactory::GlobalWinAnsiEncodingInstance() , |
|||
const char * | pszFileName = NULL | |||
) |
Get a fontsubset from the cache. If the font does not yet exist, add it to the cache.
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 |