wxPdfFontManager Class Reference

Class representing the font manager. More...

#include <pdffontmanager.h>

List of all members.

Public Member Functions

void AddSearchPath (const wxString &path)
 Add a path entry to the font search path list.
void AddSearchPath (const wxArrayString &pathArray)
 Add a list of path entries to the font search path list.
bool SetDefaultEmbed (bool embed)
 Set the default embedding mode.
bool GetDefaultEmbed ()
 Get the default embedding mode.
bool SetDefaultSubset (bool subset)
 Set the default subsetting mode.
bool GetDefaultSubset ()
 Get the default subsetting mode.
wxPdfFont RegisterFont (const wxString &fontFileName, const wxString &aliasName=wxEmptyString, int fontIndex=0)
 Register a font.
wxPdfFont RegisterFont (const wxFont &font, const wxString &aliasName=wxEmptyString)
 Register a font basedon a wxFont object.
int RegisterFontCollection (const wxString &fontCollectionFileName)
 Register a font collection.
bool RegisterFontCJK (const wxString &family)
 Register a CJK font family.
int RegisterSystemFonts ()
 Register the fonts known to the operating system.
int RegisterFontDirectory (const wxString &directory, bool recursive=false)
 Register all fonts located in a directory.
wxPdfFont GetFont (const wxString &fontName, int fontStyle=wxPDF_FONTSTYLE_REGULAR) const
 Get a font by name and style.
wxPdfFont GetFont (const wxString &fontName, const wxString &fontStyle) const
 Get a font by name and style.
wxPdfFont GetFont (size_t fontIndex) const
 Get a font by index.
size_t GetFontCount () const
 Get the number of registered fonts.
bool InitializeFontData (const wxPdfFont &font)
 Initialize the font data of a font.

Static Public Member Functions

static wxPdfFontManagerGetFontManager ()
 Get the font manager.

Friends

class wxPdfDocumentModule

Detailed Description

Class representing the font manager.


Member Function Documentation

void wxPdfFontManager::AddSearchPath ( const wxArrayString &  pathArray  ) 

Add a list of path entries to the font search path list.

Parameters:
pathArray a list of path entries to add to the search list
void wxPdfFontManager::AddSearchPath ( const wxString &  path  ) 

Add a path entry to the font search path list.

Parameters:
path path to add to the search list
bool wxPdfFontManager::GetDefaultEmbed (  ) 

Get the default embedding mode.

Returns:
the current state of the default embedding mode
bool wxPdfFontManager::GetDefaultSubset (  ) 

Get the default subsetting mode.

Returns:
the state of the default subsetting mode
wxPdfFont wxPdfFontManager::GetFont ( size_t  fontIndex  )  const

Get a font by index.

Parameters:
fontIndex the index of the requested font in the list of registered fonts
Returns:
the requested font
Note:
If the index is out of range an invalid font object is returned. It's the user's responsibility to check the font object before further using it.
wxPdfFont wxPdfFontManager::GetFont ( const wxString &  fontName,
const wxString &  fontStyle 
) const

Get a font by name and style.

Based on the given name and style the list of registered fonts is searched for a matching font. The name is checked whether it represents a font family. If the name is not a family name then the name is checked whether it represents an alias for a font family. If the name is not an alias either the name is checked whether it is a full font name.

Parameters:
fontName the name of the requested font
fontStyle the style of the requested font (string representation)
Returns:
the requested font
Note:
If no appropriate font is registered an invalid font object is returned. It's the user's responsibility to check the font object before further using it.
wxPdfFont wxPdfFontManager::GetFont ( const wxString &  fontName,
int  fontStyle = wxPDF_FONTSTYLE_REGULAR 
) const

Get a font by name and style.

Based on the given name and style the list of registered fonts is searched for a matching font. The name is checked whether it represents a font family. If the name is not a family name then the name is checked whether it represents an alias for a font family. If the name is not an alias either the name is checked whether it is a full font name.

Parameters:
fontName the name of the requested font
fontStyle the style of the requested font
Returns:
the requested font
Note:
If no appropriate font is registered an invalid font object is returned. It's the user's responsibility to check the font object before further using it.
size_t wxPdfFontManager::GetFontCount (  )  const

Get the number of registered fonts.

Returns:
the number of registered fonts
static wxPdfFontManager* wxPdfFontManager::GetFontManager (  )  [static]

Get the font manager.

Returns:
a reference to the font manager
bool wxPdfFontManager::InitializeFontData ( const wxPdfFont font  ) 

Initialize the font data of a font.

On registering a font the associated font data are not completely loaded into memory to save time and memory resources, but as soon as the font is actually used it must be fully initialized. Usually this method is called automatically.

Parameters:
font the font to be initialized
Returns:
TRUE if the font could be initialized successfully, FALSE otherwise
wxPdfFont wxPdfFontManager::RegisterFont ( const wxFont &  font,
const wxString &  aliasName = wxEmptyString 
)

Register a font basedon a wxFont object.

Register a font based on a wxFont object for later use in creating a PDF document.

Parameters:
font the wxFont object to be registered
aliasName an alias name for the font family (default: no alias)
Returns:
the registered font
wxPdfFont wxPdfFontManager::RegisterFont ( const wxString &  fontFileName,
const wxString &  aliasName = wxEmptyString,
int  fontIndex = 0 
)

Register a font.

Register a font for later use in creating a PDF document.

Parameters:
fontFileName the name of the font file (if the name is not fully qualified, it will be searched in font search path)
aliasName an alias name for the font family (default: no alias)
fontIndex the index of the font in a font collection (default: 0)
Returns:
the registered font
bool wxPdfFontManager::RegisterFontCJK ( const wxString &  family  ) 

Register a CJK font family.

Register all fonts from a font collection for later use in creating a PDF document. The following CJK font families are currently known to wxPdfDocument:

  • GB, GB-HW - Simplified Chinese (Adobe-Font STSongStd-Light-Acro)
  • BIG5, BIG5-HW - Traditional Chinese (Adobe-Font MSungStd-Light-Acro)
  • SJIS - Japanese (Adobe-Font KozMinPro-Regular-Acro)
  • UHC, UHC-HW - Korean (Adobe-Font HYSMyeongJoStd-Medium-Acro)
  • GOTHIC, PGOTHIC, UIGOTHIC - Japanese (Microsoft-Font MS-Gothic/MS-PGothic/MS-UIGothic)
  • MINCHO, PMINCHO - Japanese (Microsoft-Font MS-Mincho/MS-PMincho)
Parameters:
family the name of the CJK font family
Returns:
TRUE if the CJK family could be registered successfully, FALSE otherwise
int wxPdfFontManager::RegisterFontCollection ( const wxString &  fontCollectionFileName  ) 

Register a font collection.

Register all fonts from a font collection for later use in creating a PDF document.

Parameters:
fontCollectionFileName the name of the font collection file (if the name is not fully qualified, it will be searched in font search path)
Returns:
the number of registered fonts
int wxPdfFontManager::RegisterFontDirectory ( const wxString &  directory,
bool  recursive = false 
)

Register all fonts located in a directory.

Parameters:
directory the directory path to be searched for font files
recursive flag whether the search should include subdirectories or not (Default: false)
Returns:
the number of registered fonts
int wxPdfFontManager::RegisterSystemFonts (  ) 

Register the fonts known to the operating system.

bool wxPdfFontManager::SetDefaultEmbed ( bool  embed  ) 

Set the default embedding mode.

Usually it is recommended to enable embedding, since this guarantees that no font substitution takes place on a target system not providing a required font.

The default embedding mode is enabled by default, but the embedding mode can be set for each font individually.

Note:
For most fonts the embedding mode is predefined. For example the Adobe Standard fonts and the Adobe CJK fonts are never embedded independently of the setting of the default embedding mode, and TrueType/OpenType Unicode fonts need to be always embedded.
Parameters:
embed flag whether to enable or disable embedding
Returns:
the state of the default embedding mode prior to this call
bool wxPdfFontManager::SetDefaultSubset ( bool  subset  ) 

Set the default subsetting mode.

Usually it is recommended to enable subsetting, since embedding only a font subset reduces the size of the resulting PDF file significantly.

The default subsetting mode is enabled by default, but the subsetting mode can be set for each font individually.

Parameters:
subset flag whether to enable or disable font subsetting
Returns:
the state of the default subsetting mode prior to this call

Friends And Related Function Documentation

friend class wxPdfDocumentModule [friend]

The documentation for this class was generated from the following file:

Generated on Mon Oct 12 22:02:42 2009 for wxPdfDocument by  doxygen 1.6.1