wxPdfDocument 1.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
wxPdfFontData Class Reference

Base class for all fonts. (For internal use only) More...

#include <pdffontdata.h>

Inheritance diagram for wxPdfFontData:
wxPdfFontDataCore wxPdfFontDataOpenTypeUnicode wxPdfFontDataTrueType wxPdfFontDataTrueTypeUnicode wxPdfFontDataType0 wxPdfFontDataType1

Public Member Functions

 wxPdfFontData ()
 Default constructor.
 
virtual ~wxPdfFontData ()
 Default destructor.
 
bool IsInitialized () const
 Check initialization state.
 
void SetInitialized (bool initialized)
 Set initialization state.
 
void SetType (const wxString &type)
 Set font type.
 
wxString GetType () const
 Get font type.
 
void SetFamily (const wxString &name)
 Set font family name.
 
wxString GetFamily () const
 Get font family name.
 
void SetAlias (const wxString &alias)
 Set font family alias.
 
wxString GetAlias () const
 Get font family alias.
 
void SetName (const wxString &name)
 Set font name.
 
wxString GetName () const
 Get font name.
 
void SetFullNames (const wxArrayString &fullNames)
 Set list of full font names.
 
wxArrayString GetFullNames () const
 Get list of full font names.
 
void SetStyle (int style)
 Set font style.
 
void SetStyle (const wxString &style)
 Set font style.
 
void SetStyleFromName ()
 Set font style based on font name.
 
int GetStyle () const
 Get font style.
 
bool EmbedRequired ()
 Set embed support flag.
 
bool EmbedSupported () const
 Check whether the font embedding is required.
 
bool SubsetSupported () const
 Check whether the font subsetting is supported.
 
void SetEmbedSupported (bool embedSupported)
 Set embed support flag.
 
void SetSubsetSupported (bool subsetSupported)
 Set subset support flag.
 
void SetFontFileName (const wxString &fontFileName)
 Set fully qualified font file name.
 
wxString GetFontFileName () const
 Get fully qualified font file name.
 
void SetFontIndex (int fontIndex)
 Set font index in case the font is member of a font collection.
 
int GetFontIndex () const
 Get font index.
 
bool HasCff () const
 Check whether the font is in compact font format.
 
size_t GetCffOffset () const
 Get the offset of the CFF section within the font file.
 
size_t GetCffLength () const
 Get the length of the CFF section.
 
void SetUnderlinePosition (int up)
 Set underline position.
 
int GetUnderlinePosition () const
 Get underline position.
 
void SetUnderlineThickness (int ut)
 Set underline thickness.
 
int GetUnderlineThickness () const
 Get underline thickness.
 
int GetBBoxTopPosition () const
 Get bounding box top position.
 
void SetEncoding (const wxString &encoding)
 Set encoding.
 
wxString GetEncoding () const
 Get encoding.
 
const wxPdfEncodingGetBaseEncoding () const
 Get encoding.
 
bool HasDiffs () const
 Check whether the font has differences to WinAnsi encoding.
 
void SetDiffs (const wxString &diffs)
 Set encoding differences.
 
wxString GetDiffs () const
 Get encoding differences.
 
void SetFilePath (const wxString &path)
 Set path of font files.
 
wxString GetFilePath () const
 Get path of font files.
 
bool HasFile () const
 Check whether the font has an associated font file.
 
void SetFontFile (const wxString &file)
 Set the name of the font file created by MakeFont.
 
wxString GetFontFile () const
 Get the name of the associated font file.
 
void SetCtgFile (const wxString &ctg)
 Set the name of the character to glyph mapping file created by MakeFont.
 
wxString GetCtgFile () const
 Get the name of the character to glyph mapping file created by MakeFont.
 
void SetSize1 (size_t size1)
 Get font file size 1.
 
size_t GetSize1 () const
 Get font file size 1.
 
bool HasSize2 () const
 Check whether the file has a size 2.
 
void SetSize2 (size_t size2)
 Set font file size 2.
 
size_t GetSize2 () const
 Get font file size 2 (Type 1 only)
 
void SetCMap (const wxString &cmap)
 Set font CMap.
 
wxString GetCMap () const
 Get the font's CMap (Type 0 only)
 
void SetOrdering (const wxString &ordering)
 Set font ordering.
 
wxString GetOrdering () const
 Get font ordering.
 
void SetSupplement (const wxString &supplement)
 Set font supplement.
 
wxString GetSupplement () const
 Get font supplement (Type 0 only)
 
void SetGlyphWidthMap (wxPdfGlyphWidthMap *cw)
 Set glyph width map.
 
const wxPdfGlyphWidthMap * GetGlyphWidthMap () const
 Get glyph width map.
 
void SetChar2GlyphMap (wxPdfChar2GlyphMap *gn)
 Set character to glyph number map.
 
const wxPdfChar2GlyphMap * GetChar2GlyphMap () const
 Get character to glyph number map.
 
void SetKernPairMap (wxPdfKernPairMap *kp)
 Set kerning pair map.
 
const wxPdfKernPairMap * GetKernPairMap () const
 Get kerning pair map.
 
int GetKerningWidth (const wxString &s) const
 Get width of string taking kerning into account.
 
wxArrayInt GetKerningWidthArray (const wxString &s) const
 Get kerning width array.
 
void SetSubset (bool subset)
 Set subset flag if font subsetting is supported.
 
virtual bool Initialize ()
 Initialize font data.
 
virtual bool HasVoltData () const
 Check whether VOLT data are available.
 
virtual wxString ApplyVoltData (const wxString &s) const
 Applay VOLT data.
 
virtual double GetStringWidth (const wxString &s, const wxPdfEncoding *encoding=NULL, bool withKerning=false, double charSpacing=0) const
 Get the width of a string.
 
virtual bool CanShow (const wxString &s, const wxPdfEncoding *encoding=NULL) const
 Check whether the font can show all characters of a given string.
 
virtual wxString ConvertToValid (const wxString &s, wxUniChar replace=wxS('?')) const
 Force string to valid string in respect of the current font encoding.
 
virtual wxString ConvertCID2GID (const wxString &s, const wxPdfEncoding *encoding=NULL, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL) const
 Convert character codes to glyph numbers.
 
virtual wxString ConvertGlyph (wxUint32 glyph, const wxPdfEncoding *encoding=NULL, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL) const
 Convert glyph number to string.
 
virtual wxString GetWidthsAsString (bool subset=false, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL) const
 Get the character width array as string.
 
virtual bool GetGlyphNames (wxArrayString &glyphNames) const
 Get list of glyph names supported by this font.
 
virtual size_t WriteFontData (wxOutputStream *fontData, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL)
 Write font data.
 
virtual size_t WriteUnicodeMap (wxOutputStream *mapData, const wxPdfEncoding *encoding=NULL, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL)
 Write character/glyph to unicode mapping.
 
virtual size_t WriteCIDToGIDMap (wxOutputStream *mapData, const wxPdfEncoding *encoding=NULL, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL)
 Write CID to GID mapping.
 
virtual size_t WriteCIDSet (wxOutputStream *setData, const wxPdfEncoding *encoding=NULL, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL)
 Write CID set.
 
void SetDescription (const wxPdfFontDescription &desc)
 Set the font description.
 
virtual const wxPdfFontDescriptionGetDescription () const
 Get the font description.
 
virtual bool LoadFontMetrics (wxXmlNode *root)
 Load the font metrics XML file.
 
virtual wxMBConv * GetEncodingConv () const
 Get the associated encoding converter.
 
virtual void CreateDefaultEncodingConv ()
 Create the associated default encoding converter.
 
virtual void SetGlyphWidths (const wxPdfArrayUint16 &glyphWidths)
 Set the glyph widths.
 
bool GetFontDescription (const wxXmlNode *node, wxPdfFontDescription &fontDescription)
 Get the font description from XML.
 

Static Public Member Functions

static wxMBConv * GetWinEncodingConv ()
 Get the default WinAnsi encoding converter.
 
static wxString GetNodeContent (const wxXmlNode *node)
 Get the content of an XML node.
 

Protected Member Functions

const wxPdfChar2GlyphMap * FindEncodingMap (const wxPdfEncoding *encoding) const
 Find the encoding map to be used for character to glyph conversion.
 

Static Protected Member Functions

static int FindStyleFromName (const wxString &name)
 Determine font style from font name.
 
static int CompareGlyphListEntries (wxPdfGlyphListEntry *item1, wxPdfGlyphListEntry *item2)
 Compare glyph list entries.
 
static void WriteStreamBuffer (wxOutputStream &stream, const char *buffer)
 Write a buffer to a stream.
 
static void WriteToUnicode (wxPdfGlyphList &glyphs, wxMemoryOutputStream &toUnicode, bool simple=false)
 Write a mapping from glyphs to unicode to a stream.
 

Protected Attributes

wxString m_type
 Font type.
 
wxString m_family
 Font family.
 
wxString m_alias
 Font family alias.
 
wxString m_name
 Font name.
 
wxArrayString m_fullNames
 List of full font names.
 
int m_style
 Font style flags.
 
bool m_initialized
 Flag whether the font has been initialized.
 
bool m_embedRequired
 Flag whether embedding of the font is allowed and supported.
 
bool m_embedSupported
 Flag whether embedding of the font is allowed and supported.
 
bool m_subsetSupported
 Flag whether subsetting of the font is allowed and supported.
 
wxString m_fontFileName
 Qualified name of the font file.
 
int m_fontIndex
 Index of the font in case of a font collection.
 
wxFont m_font
 Associated wxFont object (currently used by wxMSW only)
 
wxPdfGlyphWidthMap * m_cw
 Mapping of character ids to character widths.
 
wxPdfChar2GlyphMap * m_gn
 Mapping of character ids to glyph numbers.
 
wxPdfKernPairMap * m_kp
 Kerning pair map.
 
wxPdfFontDescription m_desc
 Font description.
 
wxString m_enc
 Encoding.
 
wxString m_diffs
 Encoding differences.
 
wxString m_path
 Path of font files.
 
wxString m_file
 Filename of font program.
 
wxString m_ctg
 Filename of char to glyph mapping.
 
size_t m_size1
 TrueType file size or Type1 file size 1.
 
size_t m_size2
 Type1 file size 2.
 
bool m_cff
 Flag whether the font has a CFF table.
 
size_t m_cffOffset
 Offset of the CFF table of a TrueType/OpenType font.
 
size_t m_cffLength
 Lenght of the CFF table of a TrueType/OpenType font.
 
wxString m_cmap
 CMap of a CID font.
 
wxString m_ordering
 Ordering of a CID font.
 
wxString m_supplement
 Supplement of a CID font.
 
wxPdfEncodingm_encoding
 Encoding.
 
wxPdfEncodingCheckerm_encodingChecker
 Encoding checker.
 

Static Protected Attributes

static wxMBConv * ms_winEncoding
 WinAnsi converter.
 

Friends

class WXDLLIMPEXP_FWD_PDFDOC wxPdfFont
 
class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontExtended
 
class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontListEntry
 
class wxPdfFontManagerBase
 

Detailed Description

Base class for all fonts. (For internal use only)

Constructor & Destructor Documentation

◆ wxPdfFontData()

wxPdfFontData::wxPdfFontData ( )

Default constructor.

◆ ~wxPdfFontData()

virtual wxPdfFontData::~wxPdfFontData ( )
virtual

Default destructor.

Member Function Documentation

◆ ApplyVoltData()

virtual wxString wxPdfFontData::ApplyVoltData ( const wxString & s) const
inlinevirtual

Applay VOLT data.

Parameters
stext string for which VOLT data should be applied
Returns
text string modified according to the VOLT data

Reimplemented in wxPdfFontDataTrueTypeUnicode.

◆ CanShow()

virtual bool wxPdfFontData::CanShow ( const wxString & s,
const wxPdfEncoding * encoding = NULL ) const
virtual

Check whether the font can show all characters of a given string.

Parameters
sthe string to be checked
encodingthe character to glyph mapping
Returns
TRUE if the font can show all characters of the string, FALSE otherwise

Reimplemented in wxPdfFontDataCore, wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

◆ CompareGlyphListEntries()

static int wxPdfFontData::CompareGlyphListEntries ( wxPdfGlyphListEntry * item1,
wxPdfGlyphListEntry * item2 )
staticprotected

Compare glyph list entries.

◆ ConvertCID2GID()

virtual wxString wxPdfFontData::ConvertCID2GID ( const wxString & s,
const wxPdfEncoding * encoding = NULL,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL ) const
virtual

Convert character codes to glyph numbers.

Parameters
sthe string to be converted
encodingthe character to glyph mapping
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the converted string

Reimplemented in wxPdfFontDataType1, wxPdfFontDataCore, wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, and wxPdfFontDataType0.

◆ ConvertGlyph()

virtual wxString wxPdfFontData::ConvertGlyph ( wxUint32 glyph,
const wxPdfEncoding * encoding = NULL,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL ) const
virtual

Convert glyph number to string.

Parameters
glyphthe glyph to be converted
encodingthe character to glyph mapping
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the converted string

Reimplemented in wxPdfFontDataOpenTypeUnicode, and wxPdfFontDataTrueTypeUnicode.

◆ ConvertToValid()

virtual wxString wxPdfFontData::ConvertToValid ( const wxString & s,
wxUniChar replace = wxS('?') ) const
virtual

Force string to valid string in respect of the current font encoding.

The given string is converted in such a way that it contains only characters available in the current font encoding

Parameters
sthe string to be converted
replacethe character used to replace invalid characters
Returns
converted string

◆ CreateDefaultEncodingConv()

virtual void wxPdfFontData::CreateDefaultEncodingConv ( )
virtual

Create the associated default encoding converter.

Reimplemented in wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

◆ EmbedRequired()

bool wxPdfFontData::EmbedRequired ( )
inline

Set embed support flag.

Returns
TRUE if embedding of this font is required, FALSE otherwise

◆ EmbedSupported()

bool wxPdfFontData::EmbedSupported ( ) const
inline

Check whether the font embedding is required.

Returns
TRUE if embedding of this font is supported/allowed, FALSE otherwise

◆ FindEncodingMap()

const wxPdfChar2GlyphMap * wxPdfFontData::FindEncodingMap ( const wxPdfEncoding * encoding) const
protected

Find the encoding map to be used for character to glyph conversion.

◆ FindStyleFromName()

static int wxPdfFontData::FindStyleFromName ( const wxString & name)
staticprotected

Determine font style from font name.

◆ GetAlias()

wxString wxPdfFontData::GetAlias ( ) const

Get font family alias.

Returns
the alias of the font family name or an empty string

◆ GetBaseEncoding()

const wxPdfEncoding * wxPdfFontData::GetBaseEncoding ( ) const

Get encoding.

Returns
the name of the font encoding

◆ GetBBoxTopPosition()

int wxPdfFontData::GetBBoxTopPosition ( ) const

Get bounding box top position.

Returns
the top position from the bounding box

◆ GetCffLength()

size_t wxPdfFontData::GetCffLength ( ) const
inline

Get the length of the CFF section.

Returns
the length of the CFF section

◆ GetCffOffset()

size_t wxPdfFontData::GetCffOffset ( ) const
inline

Get the offset of the CFF section within the font file.

Returns
the offset of the CFF section

◆ GetChar2GlyphMap()

const wxPdfChar2GlyphMap * wxPdfFontData::GetChar2GlyphMap ( ) const

Get character to glyph number map.

Returns
the character to glyph number map

◆ GetCMap()

wxString wxPdfFontData::GetCMap ( ) const

Get the font's CMap (Type 0 only)

return the font's CMap descriptor

◆ GetCtgFile()

wxString wxPdfFontData::GetCtgFile ( ) const

Get the name of the character to glyph mapping file created by MakeFont.

Returns
the name of the character to glyph mapping file created by the MakeFont utility

◆ GetDescription()

virtual const wxPdfFontDescription & wxPdfFontData::GetDescription ( ) const
virtual

Get the font description.

Returns
the font description

◆ GetDiffs()

wxString wxPdfFontData::GetDiffs ( ) const

Get encoding differences.

Returns
the string describing the differences to the WinAnsi encoding

◆ GetEncoding()

wxString wxPdfFontData::GetEncoding ( ) const

Get encoding.

Returns
the name of the font encoding

◆ GetEncodingConv()

virtual wxMBConv * wxPdfFontData::GetEncodingConv ( ) const
virtual

Get the associated encoding converter.

Returns
the encoding converter associated with this font

Reimplemented in wxPdfFontDataCore, wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

◆ GetFamily()

wxString wxPdfFontData::GetFamily ( ) const

Get font family name.

Returns
the name of the font family

◆ GetFilePath()

wxString wxPdfFontData::GetFilePath ( ) const

Get path of font files.

Returns
the path where the font file is located

◆ GetFontDescription()

bool wxPdfFontData::GetFontDescription ( const wxXmlNode * node,
wxPdfFontDescription & fontDescription )

Get the font description from XML.

Parameters
noderoot node of the XML font description
[out]fontDescriptionthe resulting font description
Returns
TRUE if the font description could be processed successfully, FALSE otherwise

◆ GetFontFile()

wxString wxPdfFontData::GetFontFile ( ) const

Get the name of the associated font file.

Returns
the name of the font file created by the MakeFont utility

◆ GetFontFileName()

wxString wxPdfFontData::GetFontFileName ( ) const
inline

Get fully qualified font file name.

Returns
the fully qualified name of the font file

◆ GetFontIndex()

int wxPdfFontData::GetFontIndex ( ) const
inline

Get font index.

Returns
the index of the font within a font collection

◆ GetFullNames()

wxArrayString wxPdfFontData::GetFullNames ( ) const

Get list of full font names.

Returns
a list of full names of the font

◆ GetGlyphNames()

virtual bool wxPdfFontData::GetGlyphNames ( wxArrayString & glyphNames) const
virtual

Get list of glyph names supported by this font.

Parameters
[out]glyphNamesa list of glyph names
Returns
TRUE if the list of glyph names is available, FALSE otherwise

Reimplemented in wxPdfFontDataType1.

◆ GetGlyphWidthMap()

const wxPdfGlyphWidthMap * wxPdfFontData::GetGlyphWidthMap ( ) const

Get glyph width map.

Returns
the glyph width map

◆ GetKerningWidth()

int wxPdfFontData::GetKerningWidth ( const wxString & s) const

Get width of string taking kerning into account.

Parameters
sthe string which's width is to be calculated
Returns
the width of the string with kerning taken into account

◆ GetKerningWidthArray()

wxArrayInt wxPdfFontData::GetKerningWidthArray ( const wxString & s) const

Get kerning width array.

Parameters
sthe string for which kerning information should be provided
Returns
an array with indices and kerning width of the found kerning pairs. The array consists of information pairs: the first item (even indices) represents the index of the first character of a kerning pair within the string and the second item (odd indices) represents the kerning value.

◆ GetKernPairMap()

const wxPdfKernPairMap * wxPdfFontData::GetKernPairMap ( ) const

Get kerning pair map.

Returns
the kerning pair map

◆ GetName()

wxString wxPdfFontData::GetName ( ) const

Get font name.

Returns
the full name of the font, usually the PostScript name

◆ GetNodeContent()

static wxString wxPdfFontData::GetNodeContent ( const wxXmlNode * node)
static

Get the content of an XML node.

Parameters
nodethe XML node containing content
Returns
the content of the XML node

◆ GetOrdering()

wxString wxPdfFontData::GetOrdering ( ) const

Get font ordering.

Returns
the font's ordering descriptor

◆ GetSize1()

size_t wxPdfFontData::GetSize1 ( ) const

Get font file size 1.

Returns
the size of the font file

◆ GetSize2()

size_t wxPdfFontData::GetSize2 ( ) const

Get font file size 2 (Type 1 only)

Returns
the second size of the font file

◆ GetStringWidth()

virtual double wxPdfFontData::GetStringWidth ( const wxString & s,
const wxPdfEncoding * encoding = NULL,
bool withKerning = false,
double charSpacing = 0 ) const
virtual

Get the width of a string.

Parameters
sthe string for which the width should be calculated
encodingthe character to glyph mapping
withKerningflag indicating whether kerning should be taken into account
charSpacingextra amount of spacing between characters (optional)
Returns
the width of the string

Reimplemented in wxPdfFontDataCore, wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

◆ GetStyle()

int wxPdfFontData::GetStyle ( ) const

Get font style.

Returns
the font style
See also
SetStyle()

◆ GetSupplement()

wxString wxPdfFontData::GetSupplement ( ) const

Get font supplement (Type 0 only)

Returns
the font's supplement descriptor
Note
For Type0 fonts only

◆ GetType()

wxString wxPdfFontData::GetType ( ) const

Get font type.

Returns
type of the font
See also
SetType()

◆ GetUnderlinePosition()

int wxPdfFontData::GetUnderlinePosition ( ) const

Get underline position.

Returns
the position of the underline decoration

◆ GetUnderlineThickness()

int wxPdfFontData::GetUnderlineThickness ( ) const

Get underline thickness.

Returns
the thickness of the underline decoration

◆ GetWidthsAsString()

virtual wxString wxPdfFontData::GetWidthsAsString ( bool subset = false,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL ) const
virtual

Get the character width array as string.

Parameters
subsetflag whether subsetting is enabled
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the string representation of the character widths

Reimplemented in wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, wxPdfFontDataCore, wxPdfFontDataTrueType, and wxPdfFontDataType1.

◆ GetWinEncodingConv()

static wxMBConv * wxPdfFontData::GetWinEncodingConv ( )
static

Get the default WinAnsi encoding converter.

Returns
the default WinAnsi converter

◆ HasCff()

bool wxPdfFontData::HasCff ( ) const
inline

Check whether the font is in compact font format.

Returns
TRUE if the font is in CFF format, FALSE otherwise

◆ HasDiffs()

bool wxPdfFontData::HasDiffs ( ) const

Check whether the font has differences to WinAnsi encoding.

Returns
TRUE if the font has differences to the WinAnsi encoding, FALSE otherwise

◆ HasFile()

bool wxPdfFontData::HasFile ( ) const

Check whether the font has an associated font file.

Returns
TRUE if the font has an associated font file, FALSE otherwise

◆ HasSize2()

bool wxPdfFontData::HasSize2 ( ) const

Check whether the file has a size 2.

Returns
TRUE if the font has a second size associated, FALSE otherwise
Note
Usually only Type1 fonts have a second size entry.

◆ HasVoltData()

virtual bool wxPdfFontData::HasVoltData ( ) const
inlinevirtual

Check whether VOLT data are available.

Returns
TRUE if the font data contain VOLT data, FALSE otherwise

Reimplemented in wxPdfFontDataTrueTypeUnicode.

◆ Initialize()

virtual bool wxPdfFontData::Initialize ( )
virtual

Initialize font data.

Returns
TRUE if the font data has been initialized successfully, FALSE otherwise

Reimplemented in wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueTypeUnicode, and wxPdfFontDataType1.

◆ IsInitialized()

bool wxPdfFontData::IsInitialized ( ) const
inline

Check initialization state.

Returns
TRUE if the font data are initialized, FALSE otherwise

◆ LoadFontMetrics()

virtual bool wxPdfFontData::LoadFontMetrics ( wxXmlNode * root)
virtual

Load the font metrics XML file.

Parameters
rootthe root node of the XML font metric file
Returns
TRUE if the metric file could be processed successfully, FALSE otherwise

Reimplemented in wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

◆ SetAlias()

void wxPdfFontData::SetAlias ( const wxString & alias)

Set font family alias.

Parameters
aliasthe alias name of the font family

◆ SetChar2GlyphMap()

void wxPdfFontData::SetChar2GlyphMap ( wxPdfChar2GlyphMap * gn)

Set character to glyph number map.

Parameters
gnthe character to glyph number map

◆ SetCMap()

void wxPdfFontData::SetCMap ( const wxString & cmap)

Set font CMap.

Parameters
cmapthe CMap descriptor
Note
For Type0 fonts only

◆ SetCtgFile()

void wxPdfFontData::SetCtgFile ( const wxString & ctg)

Set the name of the character to glyph mapping file created by MakeFont.

Parameters
ctgthe name of the character to glyph mapping file created by the MakeFont utility

◆ SetDescription()

void wxPdfFontData::SetDescription ( const wxPdfFontDescription & desc)

Set the font description.

Parameters
descthe font description

◆ SetDiffs()

void wxPdfFontData::SetDiffs ( const wxString & diffs)

Set encoding differences.

Parameters
diffsthe string describing the differences to the WinAnsi encoding

◆ SetEmbedSupported()

void wxPdfFontData::SetEmbedSupported ( bool embedSupported)
inline

Set embed support flag.

Parameters
embedSupportedflag whether the font supports embedding

◆ SetEncoding()

void wxPdfFontData::SetEncoding ( const wxString & encoding)

Set encoding.

Parameters
encodingthe name of the font encoding

◆ SetFamily()

void wxPdfFontData::SetFamily ( const wxString & name)

Set font family name.

Parameters
namethe name of the font family

◆ SetFilePath()

void wxPdfFontData::SetFilePath ( const wxString & path)

Set path of font files.

Parameters
paththe path where the font file is located

◆ SetFontFile()

void wxPdfFontData::SetFontFile ( const wxString & file)

Set the name of the font file created by MakeFont.

Parameters
filethe name of the font file created by the MakeFont utility

◆ SetFontFileName()

void wxPdfFontData::SetFontFileName ( const wxString & fontFileName)
inline

Set fully qualified font file name.

Parameters
fontFileNamethe fully qualified name of the font file

◆ SetFontIndex()

void wxPdfFontData::SetFontIndex ( int fontIndex)
inline

Set font index in case the font is member of a font collection.

Parameters
fontIndexthe index of the font if it is a member of a font collection

◆ SetFullNames()

void wxPdfFontData::SetFullNames ( const wxArrayString & fullNames)

Set list of full font names.

Parameters
fullNamesa list of full font names

◆ SetGlyphWidthMap()

void wxPdfFontData::SetGlyphWidthMap ( wxPdfGlyphWidthMap * cw)

Set glyph width map.

Parameters
cwthe glyph width map

◆ SetGlyphWidths()

virtual void wxPdfFontData::SetGlyphWidths ( const wxPdfArrayUint16 & glyphWidths)
virtual

Set the glyph widths.

Parameters
glyphWidthsarray with glyph widths

Reimplemented in wxPdfFontDataOpenTypeUnicode, and wxPdfFontDataTrueTypeUnicode.

◆ SetInitialized()

void wxPdfFontData::SetInitialized ( bool initialized)

Set initialization state.

Parameters
initializedstate of initialization to set

◆ SetKernPairMap()

void wxPdfFontData::SetKernPairMap ( wxPdfKernPairMap * kp)

Set kerning pair map.

Parameters
kpthe kerning pair map

◆ SetName()

void wxPdfFontData::SetName ( const wxString & name)

Set font name.

Parameters
namethe full name of the font, usually the PostScript name

◆ SetOrdering()

void wxPdfFontData::SetOrdering ( const wxString & ordering)

Set font ordering.

Parameters
orderingthe font's ordering descriptor

◆ SetSize1()

void wxPdfFontData::SetSize1 ( size_t size1)

Get font file size 1.

Parameters
size1the size of the font file
Note
For Type1 fonts this represents the size of the ASCII section.

◆ SetSize2()

void wxPdfFontData::SetSize2 ( size_t size2)

Set font file size 2.

Parameters
size2the second size of the font file
Note
For Type1 fonts this represents the size of the BINARY section.

◆ SetStyle() [1/2]

void wxPdfFontData::SetStyle ( const wxString & style)

Set font style.

Parameters
stylethe style of the font. If the style string
  • contains "bold" or "black" the style is set to bold
  • contains "italic" or "oblique" the style is set to italic
  • equals "b" the style is set to bold
  • equals "i" the style is set to italic
  • equals "bi" or "ib" īthe style is set to bolditalic

◆ SetStyle() [2/2]

void wxPdfFontData::SetStyle ( int style)

Set font style.

Parameters
stylethe style of the font. Vaild values are
  • wxPDF_FONTSTYLE_REGULAR
  • wxPDF_FONTSTYLE_BOLD
  • wxPDF_FONTSTYLE_ITALIC
  • wxPDF_FONTSTYLE_BOLDITALIC

◆ SetStyleFromName()

void wxPdfFontData::SetStyleFromName ( )

Set font style based on font name.

The font's full name is searched for substrings "regular", "bold", "black", "italic" and "oblique". Depending on the findings the style is set.

◆ SetSubset()

void wxPdfFontData::SetSubset ( bool subset)

Set subset flag if font subsetting is supported.

Parameters
subsetflag whether subsetting should be used

◆ SetSubsetSupported()

void wxPdfFontData::SetSubsetSupported ( bool subsetSupported)
inline

Set subset support flag.

Parameters
subsetSupportedflag whether the font supports subsetting

◆ SetSupplement()

void wxPdfFontData::SetSupplement ( const wxString & supplement)

Set font supplement.

Parameters
supplementthe font's supplement descriptor
Note
For Type0 fonts only

◆ SetType()

void wxPdfFontData::SetType ( const wxString & type)

Set font type.

Parameters
typetype of the font
Note
Valid types are
  • core - Adobe Standard font (i.e. Courier, Helvetica, ...)
  • OpenTypeUnicode - TrueType/OpenType font using the compact font format (CFF)
  • TrueType - TrueType/OpenType font using the TrueType font format and standard encoding
  • TrueTypeUnicode - TrueType/OpenType font using the TrueType font format and Unicode encoding
  • Type0 - Type0 font, usually a CJK font
  • Type1 - PostScript font

◆ SetUnderlinePosition()

void wxPdfFontData::SetUnderlinePosition ( int up)

Set underline position.

Parameters
upthe position of the underline decoration

◆ SetUnderlineThickness()

void wxPdfFontData::SetUnderlineThickness ( int ut)

Set underline thickness.

Parameters
utthe thickness of the underline decoration

◆ SubsetSupported()

bool wxPdfFontData::SubsetSupported ( ) const
inline

Check whether the font subsetting is supported.

Returns
TRUE if subsetting of this font is supported/allowed, FALSE otherwise

◆ WriteCIDSet()

virtual size_t wxPdfFontData::WriteCIDSet ( wxOutputStream * setData,
const wxPdfEncoding * encoding = NULL,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL )
virtual

Write CID set.

Parameters
setDatathe output stream
encodingthe character to glyph mapping
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the size of the written data

Reimplemented in wxPdfFontDataOpenTypeUnicode, and wxPdfFontDataTrueTypeUnicode.

◆ WriteCIDToGIDMap()

virtual size_t wxPdfFontData::WriteCIDToGIDMap ( wxOutputStream * mapData,
const wxPdfEncoding * encoding = NULL,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL )
virtual

Write CID to GID mapping.

Parameters
mapDatathe output stream
encodingthe character to glyph mapping
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the size of the written data

Reimplemented in wxPdfFontDataTrueTypeUnicode.

◆ WriteFontData()

virtual size_t wxPdfFontData::WriteFontData ( wxOutputStream * fontData,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL )
virtual

Write font data.

Parameters
fontDatathe output stream
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the size of the written font data

Reimplemented in wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, and wxPdfFontDataType1.

◆ WriteStreamBuffer()

static void wxPdfFontData::WriteStreamBuffer ( wxOutputStream & stream,
const char * buffer )
staticprotected

Write a buffer to a stream.

◆ WriteToUnicode()

static void wxPdfFontData::WriteToUnicode ( wxPdfGlyphList & glyphs,
wxMemoryOutputStream & toUnicode,
bool simple = false )
staticprotected

Write a mapping from glyphs to unicode to a stream.

◆ WriteUnicodeMap()

virtual size_t wxPdfFontData::WriteUnicodeMap ( wxOutputStream * mapData,
const wxPdfEncoding * encoding = NULL,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL )
virtual

Write character/glyph to unicode mapping.

Parameters
mapDatathe output stream
encodingthe character to glyph mapping
usedGlyphsthe list of used glyphs
subsetGlyphsthe mapping of glyphs to subset glyphs
Returns
the size of the written data

Reimplemented in wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueTypeUnicode, and wxPdfFontDataType1.

Friends And Related Symbol Documentation

◆ wxPdfFont

friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFont
friend

◆ wxPdfFontExtended

◆ wxPdfFontListEntry

friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontListEntry
friend

◆ wxPdfFontManagerBase

friend class wxPdfFontManagerBase
friend

Member Data Documentation

◆ m_alias

wxString wxPdfFontData::m_alias
protected

Font family alias.

◆ m_cff

bool wxPdfFontData::m_cff
protected

Flag whether the font has a CFF table.

◆ m_cffLength

size_t wxPdfFontData::m_cffLength
protected

Lenght of the CFF table of a TrueType/OpenType font.

◆ m_cffOffset

size_t wxPdfFontData::m_cffOffset
protected

Offset of the CFF table of a TrueType/OpenType font.

◆ m_cmap

wxString wxPdfFontData::m_cmap
protected

CMap of a CID font.

◆ m_ctg

wxString wxPdfFontData::m_ctg
protected

Filename of char to glyph mapping.

◆ m_cw

wxPdfGlyphWidthMap* wxPdfFontData::m_cw
protected

Mapping of character ids to character widths.

◆ m_desc

wxPdfFontDescription wxPdfFontData::m_desc
protected

Font description.

◆ m_diffs

wxString wxPdfFontData::m_diffs
protected

Encoding differences.

◆ m_embedRequired

bool wxPdfFontData::m_embedRequired
protected

Flag whether embedding of the font is allowed and supported.

◆ m_embedSupported

bool wxPdfFontData::m_embedSupported
protected

Flag whether embedding of the font is allowed and supported.

◆ m_enc

wxString wxPdfFontData::m_enc
protected

Encoding.

◆ m_encoding

wxPdfEncoding* wxPdfFontData::m_encoding
protected

Encoding.

◆ m_encodingChecker

wxPdfEncodingChecker* wxPdfFontData::m_encodingChecker
protected

Encoding checker.

◆ m_family

wxString wxPdfFontData::m_family
protected

Font family.

◆ m_file

wxString wxPdfFontData::m_file
protected

Filename of font program.

◆ m_font

wxFont wxPdfFontData::m_font
protected

Associated wxFont object (currently used by wxMSW only)

◆ m_fontFileName

wxString wxPdfFontData::m_fontFileName
protected

Qualified name of the font file.

◆ m_fontIndex

int wxPdfFontData::m_fontIndex
protected

Index of the font in case of a font collection.

◆ m_fullNames

wxArrayString wxPdfFontData::m_fullNames
protected

List of full font names.

◆ m_gn

wxPdfChar2GlyphMap* wxPdfFontData::m_gn
protected

Mapping of character ids to glyph numbers.

◆ m_initialized

bool wxPdfFontData::m_initialized
protected

Flag whether the font has been initialized.

◆ m_kp

wxPdfKernPairMap* wxPdfFontData::m_kp
protected

Kerning pair map.

◆ m_name

wxString wxPdfFontData::m_name
protected

Font name.

◆ m_ordering

wxString wxPdfFontData::m_ordering
protected

Ordering of a CID font.

◆ m_path

wxString wxPdfFontData::m_path
protected

Path of font files.

◆ m_size1

size_t wxPdfFontData::m_size1
protected

TrueType file size or Type1 file size 1.

◆ m_size2

size_t wxPdfFontData::m_size2
protected

Type1 file size 2.

◆ m_style

int wxPdfFontData::m_style
protected

Font style flags.

◆ m_subsetSupported

bool wxPdfFontData::m_subsetSupported
protected

Flag whether subsetting of the font is allowed and supported.

◆ m_supplement

wxString wxPdfFontData::m_supplement
protected

Supplement of a CID font.

◆ m_type

wxString wxPdfFontData::m_type
protected

Font type.

◆ ms_winEncoding

wxMBConv* wxPdfFontData::ms_winEncoding
staticprotected

WinAnsi converter.


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