wxPdfDocument 1.2.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
wxPdfFontManager Class Reference

Class representing the font manager. More...

#include <pdffontmanager.h>

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.
 
bool RegisterEncoding (const wxPdfEncoding &encoding)
 Register a font encoding.
 
const wxPdfEncodingGetEncoding (const wxString &encodingName)
 Get the encoding having the given name.
 

Static Public Member Functions

static wxPdfFontManagerGetFontManager ()
 Get the font manager.
 

Friends

class wxPdfDocumentModule
 

Detailed Description

Class representing the font manager.

Member Function Documentation

◆ AddSearchPath() [1/2]

void wxPdfFontManager::AddSearchPath ( const wxArrayString & pathArray)

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

Parameters
pathArraya list of path entries to add to the search list

◆ AddSearchPath() [2/2]

void wxPdfFontManager::AddSearchPath ( const wxString & path)

Add a path entry to the font search path list.

Parameters
pathpath to add to the search list

◆ GetDefaultEmbed()

bool wxPdfFontManager::GetDefaultEmbed ( )

Get the default embedding mode.

Returns
the current state of the default embedding mode

◆ GetDefaultSubset()

bool wxPdfFontManager::GetDefaultSubset ( )

Get the default subsetting mode.

Returns
the state of the default subsetting mode

◆ GetEncoding()

const wxPdfEncoding * wxPdfFontManager::GetEncoding ( const wxString & encodingName)

Get the encoding having the given name.

Parameters
encodingNamename of the encoding
Returns
the encoding

◆ GetFont() [1/3]

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
fontNamethe name of the requested font
fontStylethe 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.

◆ GetFont() [2/3]

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
fontNamethe name of the requested font
fontStylethe 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.

◆ GetFont() [3/3]

wxPdfFont wxPdfFontManager::GetFont ( size_t fontIndex) const

Get a font by index.

Parameters
fontIndexthe 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.

◆ GetFontCount()

size_t wxPdfFontManager::GetFontCount ( ) const

Get the number of registered fonts.

Returns
the number of registered fonts

◆ GetFontManager()

static wxPdfFontManager * wxPdfFontManager::GetFontManager ( )
static

Get the font manager.

Returns
a reference to the font manager

◆ InitializeFontData()

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
fontthe font to be initialized
Returns
TRUE if the font could be initialized successfully, FALSE otherwise

◆ RegisterEncoding()

bool wxPdfFontManager::RegisterEncoding ( const wxPdfEncoding & encoding)

Register a font encoding.

Parameters
encodingthe encoding to be registered
Returns
TRUE if the encoding could be registered successfully

◆ RegisterFont() [1/2]

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
fontthe wxFont object to be registered
aliasNamean alias name for the font family (default: no alias)
Returns
the registered font

◆ RegisterFont() [2/2]

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
fontFileNamethe name of the font file (if the name is not fully qualified, it will be searched in font search path)
aliasNamean alias name for the font family (default: no alias)
fontIndexthe index of the font in a font collection (default: 0)
Returns
the registered font

◆ RegisterFontCJK()

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
familythe name of the CJK font family
Returns
TRUE if the CJK family could be registered successfully, FALSE otherwise

◆ RegisterFontCollection()

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
fontCollectionFileNamethe 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

◆ RegisterFontDirectory()

int wxPdfFontManager::RegisterFontDirectory ( const wxString & directory,
bool recursive = false )

Register all fonts located in a directory.

Parameters
directorythe directory path to be searched for font files
recursiveflag whether the search should include subdirectories or not (Default: false)
Returns
the number of registered fonts

◆ RegisterSystemFonts()

int wxPdfFontManager::RegisterSystemFonts ( )

Register the fonts known to the operating system.

◆ SetDefaultEmbed()

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
embedflag whether to enable or disable embedding
Returns
the state of the default embedding mode prior to this call

◆ SetDefaultSubset()

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
subsetflag whether to enable or disable font subsetting
Returns
the state of the default subsetting mode prior to this call

Friends And Related Symbol Documentation

◆ wxPdfDocumentModule

friend class wxPdfDocumentModule
friend

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