wxPdfDocument 0.9.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
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

List of all members.

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) 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, wxChar replace=wxT('?')) 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.
void SetDescription (const wxPdfFontDescription &desc)
 Set the font description.
virtual const
wxPdfFontDescription
GetDescription () 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 ( )

Default constructor.

virtual wxPdfFontData::~wxPdfFontData ( ) [virtual]

Default destructor.


Member Function Documentation

virtual wxString wxPdfFontData::ApplyVoltData ( const wxString &  s) const [inline, virtual]

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.

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.

static int wxPdfFontData::CompareGlyphListEntries ( wxPdfGlyphListEntry item1,
wxPdfGlyphListEntry item2 
) [static, protected]

Compare glyph list entries.

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 wxPdfFontDataCore, wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

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.

virtual wxString wxPdfFontData::ConvertToValid ( const wxString &  s,
wxChar  replace = wxT('?') 
) 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
virtual void wxPdfFontData::CreateDefaultEncodingConv ( ) [virtual]

Create the associated default encoding converter.

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

bool wxPdfFontData::EmbedRequired ( ) [inline]

Set embed support flag.

Returns:
TRUE if embedding of this font is required, FALSE otherwise
bool wxPdfFontData::EmbedSupported ( ) const [inline]

Check whether the font embedding is required.

Returns:
TRUE if embedding of this font is supported/allowed, FALSE otherwise
const wxPdfChar2GlyphMap* wxPdfFontData::FindEncodingMap ( const wxPdfEncoding encoding) const [protected]

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

static int wxPdfFontData::FindStyleFromName ( const wxString &  name) [static, protected]

Determine font style from font name.

wxString wxPdfFontData::GetAlias ( ) const

Get font family alias.

Returns:
the alias of the font family name or an empty string
const wxPdfEncoding* wxPdfFontData::GetBaseEncoding ( ) const

Get encoding.

Returns:
the name of the font encoding
int wxPdfFontData::GetBBoxTopPosition ( ) const

Get bounding box top position.

Returns:
the top position from the bounding box
size_t wxPdfFontData::GetCffLength ( ) const [inline]

Get the length of the CFF section.

Returns:
the length of the CFF section
size_t wxPdfFontData::GetCffOffset ( ) const [inline]

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

Returns:
the offset of the CFF section
const wxPdfChar2GlyphMap* wxPdfFontData::GetChar2GlyphMap ( ) const

Get character to glyph number map.

Returns:
the character to glyph number map
wxString wxPdfFontData::GetCMap ( ) const

Get the font's CMap (Type 0 only)

return the font's CMap descriptor

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
virtual const wxPdfFontDescription& wxPdfFontData::GetDescription ( ) const [virtual]

Get the font description.

Returns:
the font description
wxString wxPdfFontData::GetDiffs ( ) const

Get encoding differences.

Returns:
the string describing the differences to the WinAnsi encoding
wxString wxPdfFontData::GetEncoding ( ) const

Get encoding.

Returns:
the name of the font encoding
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.

wxString wxPdfFontData::GetFamily ( ) const

Get font family name.

Returns:
the name of the font family
wxString wxPdfFontData::GetFilePath ( ) const

Get path of font files.

Returns:
the path where the font file is located
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
wxString wxPdfFontData::GetFontFile ( ) const

Get the name of the associated font file.

Returns:
the name of the font file created by the MakeFont utility
wxString wxPdfFontData::GetFontFileName ( ) const [inline]

Get fully qualified font file name.

Returns:
the fully qualified name of the font file
int wxPdfFontData::GetFontIndex ( ) const [inline]

Get font index.

Returns:
the index of the font within a font collection
wxArrayString wxPdfFontData::GetFullNames ( ) const

Get list of full font names.

Returns:
a list of full names of the font
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.

const wxPdfGlyphWidthMap* wxPdfFontData::GetGlyphWidthMap ( ) const

Get glyph width map.

Returns:
the glyph width map
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
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.
const wxPdfKernPairMap* wxPdfFontData::GetKernPairMap ( ) const

Get kerning pair map.

Returns:
the kerning pair map
wxString wxPdfFontData::GetName ( ) const

Get font name.

Returns:
the full name of the font, usually the PostScript name
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
wxString wxPdfFontData::GetOrdering ( ) const

Get font ordering.

Returns:
the font's ordering descriptor
size_t wxPdfFontData::GetSize1 ( ) const

Get font file size 1.

Returns:
the size of the font file
size_t wxPdfFontData::GetSize2 ( ) const

Get font file size 2 (Type 1 only)

Returns:
the second size of the font file
virtual double wxPdfFontData::GetStringWidth ( const wxString &  s,
const wxPdfEncoding encoding = NULL,
bool  withKerning = false 
) 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
Returns:
the width of the string

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

int wxPdfFontData::GetStyle ( ) const

Get font style.

Returns:
the font style
See also:
SetStyle()
wxString wxPdfFontData::GetSupplement ( ) const

Get font supplement (Type 0 only)

Returns:
the font's supplement descriptor
Note:
For Type0 fonts only
wxString wxPdfFontData::GetType ( ) const

Get font type.

Returns:
type of the font
See also:
SetType()
int wxPdfFontData::GetUnderlinePosition ( ) const

Get underline position.

Returns:
the position of the underline decoration
int wxPdfFontData::GetUnderlineThickness ( ) const

Get underline thickness.

Returns:
the thickness of the underline decoration
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 wxPdfFontDataCore, wxPdfFontDataOpenTypeUnicode, wxPdfFontDataTrueType, wxPdfFontDataTrueTypeUnicode, wxPdfFontDataType0, and wxPdfFontDataType1.

static wxMBConv* wxPdfFontData::GetWinEncodingConv ( ) [static]

Get the default WinAnsi encoding converter.

Returns:
the default WinAnsi converter
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
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
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
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.
virtual bool wxPdfFontData::HasVoltData ( ) const [inline, virtual]

Check whether VOLT data are available.

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

Reimplemented in wxPdfFontDataTrueTypeUnicode.

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.

bool wxPdfFontData::IsInitialized ( ) const [inline]

Check initialization state.

Returns:
TRUE if the font data are initialized, FALSE otherwise
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.

void wxPdfFontData::SetAlias ( const wxString &  alias)

Set font family alias.

Parameters:
aliasthe alias name of the font family
void wxPdfFontData::SetChar2GlyphMap ( wxPdfChar2GlyphMap *  gn)

Set character to glyph number map.

Parameters:
gnthe character to glyph number map
void wxPdfFontData::SetCMap ( const wxString &  cmap)

Set font CMap.

Parameters:
cmapthe CMap descriptor
Note:
For Type0 fonts only
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
void wxPdfFontData::SetDescription ( const wxPdfFontDescription desc)

Set the font description.

Parameters:
descthe font description
void wxPdfFontData::SetDiffs ( const wxString &  diffs)

Set encoding differences.

Parameters:
diffsthe string describing the differences to the WinAnsi encoding
void wxPdfFontData::SetEmbedSupported ( bool  embedSupported) [inline]

Set embed support flag.

Parameters:
embedSupportedflag whether the font supports embedding
void wxPdfFontData::SetEncoding ( const wxString &  encoding)

Set encoding.

Parameters:
encodingthe name of the font encoding
void wxPdfFontData::SetFamily ( const wxString &  name)

Set font family name.

Parameters:
namethe name of the font family
void wxPdfFontData::SetFilePath ( const wxString &  path)

Set path of font files.

Parameters:
paththe path where the font file is located
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
void wxPdfFontData::SetFontFileName ( const wxString &  fontFileName) [inline]

Set fully qualified font file name.

Parameters:
fontFileNamethe fully qualified name of the font file
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
void wxPdfFontData::SetFullNames ( const wxArrayString &  fullNames)

Set list of full font names.

Parameters:
fullNamesa list of full font names
void wxPdfFontData::SetGlyphWidthMap ( wxPdfGlyphWidthMap *  cw)

Set glyph width map.

Parameters:
cwthe glyph width map
virtual void wxPdfFontData::SetGlyphWidths ( const wxPdfArrayUint16 &  glyphWidths) [virtual]

Set the glyph widths.

Parameters:
glyphWidthsarray with glyph widths

Reimplemented in wxPdfFontDataOpenTypeUnicode, and wxPdfFontDataTrueTypeUnicode.

void wxPdfFontData::SetInitialized ( bool  initialized)

Set initialization state.

Parameters:
initializedstate of initialization to set
void wxPdfFontData::SetKernPairMap ( wxPdfKernPairMap *  kp)

Set kerning pair map.

Parameters:
kpthe kerning pair map
void wxPdfFontData::SetName ( const wxString &  name)

Set font name.

Parameters:
namethe full name of the font, usually the PostScript name
void wxPdfFontData::SetOrdering ( const wxString &  ordering)

Set font ordering.

Parameters:
orderingthe font's ordering descriptor
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.
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.
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
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
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.

void wxPdfFontData::SetSubset ( bool  subset)

Set subset flag if font subsetting is supported.

Parameters:
subsetflag whether subsetting should be used
void wxPdfFontData::SetSubsetSupported ( bool  subsetSupported) [inline]

Set subset support flag.

Parameters:
subsetSupportedflag whether the font supports subsetting
void wxPdfFontData::SetSupplement ( const wxString &  supplement)

Set font supplement.

Parameters:
supplementthe font's supplement descriptor
Note:
For Type0 fonts only
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
void wxPdfFontData::SetUnderlinePosition ( int  up)

Set underline position.

Parameters:
upthe position of the underline decoration
void wxPdfFontData::SetUnderlineThickness ( int  ut)

Set underline thickness.

Parameters:
utthe thickness of the underline decoration
bool wxPdfFontData::SubsetSupported ( ) const [inline]

Check whether the font subsetting is supported.

Returns:
TRUE if subsetting of this font is supported/allowed, FALSE otherwise
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.

static void wxPdfFontData::WriteStreamBuffer ( wxOutputStream &  stream,
const char *  buffer 
) [static, protected]

Write a buffer to a stream.

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

Write a mapping from glyphs to unicode to a stream.

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 Function Documentation

friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFont [friend]
friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontExtended [friend]
friend class WXDLLIMPEXP_FWD_PDFDOC wxPdfFontListEntry [friend]
friend class wxPdfFontManagerBase [friend]

Member Data Documentation

wxString wxPdfFontData::m_alias [protected]

Font family alias.

bool wxPdfFontData::m_cff [protected]

Flag whether the font has a CFF table.

size_t wxPdfFontData::m_cffLength [protected]

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

size_t wxPdfFontData::m_cffOffset [protected]

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

wxString wxPdfFontData::m_cmap [protected]

CMap of a CID font.

wxString wxPdfFontData::m_ctg [protected]

Filename of char to glyph mapping.

wxPdfGlyphWidthMap* wxPdfFontData::m_cw [protected]

Mapping of character ids to character widths.

Font description.

wxString wxPdfFontData::m_diffs [protected]

Encoding differences.

Flag whether embedding of the font is allowed and supported.

Flag whether embedding of the font is allowed and supported.

wxString wxPdfFontData::m_enc [protected]

Encoding.

Encoding.

Encoding checker.

wxString wxPdfFontData::m_family [protected]

Font family.

wxString wxPdfFontData::m_file [protected]

Filename of font program.

wxFont wxPdfFontData::m_font [protected]

Associated wxFont object (currently used by wxMSW only)

wxString wxPdfFontData::m_fontFileName [protected]

Qualified name of the font file.

int wxPdfFontData::m_fontIndex [protected]

Index of the font in case of a font collection.

wxArrayString wxPdfFontData::m_fullNames [protected]

List of full font names.

wxPdfChar2GlyphMap* wxPdfFontData::m_gn [protected]

Mapping of character ids to glyph numbers.

bool wxPdfFontData::m_initialized [protected]

Flag whether the font has been initialized.

wxPdfKernPairMap* wxPdfFontData::m_kp [protected]

Kerning pair map.

wxString wxPdfFontData::m_name [protected]

Font name.

wxString wxPdfFontData::m_ordering [protected]

Ordering of a CID font.

wxString wxPdfFontData::m_path [protected]

Path of font files.

size_t wxPdfFontData::m_size1 [protected]

TrueType file size or Type1 file size 1.

size_t wxPdfFontData::m_size2 [protected]

Type1 file size 2.

int wxPdfFontData::m_style [protected]

Font style flags.

Flag whether subsetting of the font is allowed and supported.

wxString wxPdfFontData::m_supplement [protected]

Supplement of a CID font.

wxString wxPdfFontData::m_type [protected]

Font type.

wxMBConv* wxPdfFontData::ms_winEncoding [static, protected]

WinAnsi converter.


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