wxPdfDocument  0.9.6
Public Member Functions | List of all members
wxPdfFontDataCore Class Reference

Class representing the Adobe core fonts. (For internal use only) More...

#include <pdffontdatacore.h>

Inheritance diagram for wxPdfFontDataCore:
wxPdfFontData

Public Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from wxPdfFontData
static wxMBConv * GetWinEncodingConv ()
 Get the default WinAnsi encoding converter. More...
 
static wxString GetNodeContent (const wxXmlNode *node)
 Get the content of an XML node. More...
 
- Protected Member Functions inherited from wxPdfFontData
const wxPdfChar2GlyphMap * FindEncodingMap (const wxPdfEncoding *encoding) const
 Find the encoding map to be used for character to glyph conversion. More...
 
- Static Protected Member Functions inherited from wxPdfFontData
static int FindStyleFromName (const wxString &name)
 Determine font style from font name. More...
 
static int CompareGlyphListEntries (wxPdfGlyphListEntry *item1, wxPdfGlyphListEntry *item2)
 Compare glyph list entries. More...
 
static void WriteStreamBuffer (wxOutputStream &stream, const char *buffer)
 Write a buffer to a stream. More...
 
static void WriteToUnicode (wxPdfGlyphList &glyphs, wxMemoryOutputStream &toUnicode, bool simple=false)
 Write a mapping from glyphs to unicode to a stream. More...
 
- Protected Attributes inherited from wxPdfFontData
wxString m_type
 Font type. More...
 
wxString m_family
 Font family. More...
 
wxString m_alias
 Font family alias. More...
 
wxString m_name
 Font name. More...
 
wxArrayString m_fullNames
 List of full font names. More...
 
int m_style
 Font style flags. More...
 
bool m_initialized
 Flag whether the font has been initialized. More...
 
bool m_embedRequired
 Flag whether embedding of the font is allowed and supported. More...
 
bool m_embedSupported
 Flag whether embedding of the font is allowed and supported. More...
 
bool m_subsetSupported
 Flag whether subsetting of the font is allowed and supported. More...
 
wxString m_fontFileName
 Qualified name of the font file. More...
 
int m_fontIndex
 Index of the font in case of a font collection. More...
 
wxFont m_font
 Associated wxFont object (currently used by wxMSW only) More...
 
wxPdfGlyphWidthMap * m_cw
 Mapping of character ids to character widths. More...
 
wxPdfChar2GlyphMap * m_gn
 Mapping of character ids to glyph numbers. More...
 
wxPdfKernPairMap * m_kp
 Kerning pair map. More...
 
wxPdfFontDescription m_desc
 Font description. More...
 
wxString m_enc
 Encoding. More...
 
wxString m_diffs
 Encoding differences. More...
 
wxString m_path
 Path of font files. More...
 
wxString m_file
 Filename of font program. More...
 
wxString m_ctg
 Filename of char to glyph mapping. More...
 
size_t m_size1
 TrueType file size or Type1 file size 1. More...
 
size_t m_size2
 Type1 file size 2. More...
 
bool m_cff
 Flag whether the font has a CFF table. More...
 
size_t m_cffOffset
 Offset of the CFF table of a TrueType/OpenType font. More...
 
size_t m_cffLength
 Lenght of the CFF table of a TrueType/OpenType font. More...
 
wxString m_cmap
 CMap of a CID font. More...
 
wxString m_ordering
 Ordering of a CID font. More...
 
wxString m_supplement
 Supplement of a CID font. More...
 
wxPdfEncodingm_encoding
 Encoding. More...
 
wxPdfEncodingCheckerm_encodingChecker
 Encoding checker. More...
 
- Static Protected Attributes inherited from wxPdfFontData
static wxMBConv * ms_winEncoding
 WinAnsi converter. More...
 

Detailed Description

Class representing the Adobe core fonts. (For internal use only)

Constructor & Destructor Documentation

◆ wxPdfFontDataCore() [1/2]

wxPdfFontDataCore::wxPdfFontDataCore ( )

Default constructor.

◆ wxPdfFontDataCore() [2/2]

wxPdfFontDataCore::wxPdfFontDataCore ( const wxString &  family,
const wxString &  name,
const wxString &  alias,
short *  cwArray,
const wxPdfKernPairDesc kpArray,
const wxPdfFontDescription desc 
)

Constructor.

Parameters
familythe family name of the font
namethe font name
aliasthe alias name of the font or an empty string
cwArrayan array with the character widths
kpArrayan array with kerning pairs
desca font description

◆ ~wxPdfFontDataCore()

virtual wxPdfFontDataCore::~wxPdfFontDataCore ( )
virtual

Default destructor.

Member Function Documentation

◆ CanShow()

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

Check whether the font oan 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 from wxPdfFontData.

◆ ConvertCID2GID()

virtual wxString wxPdfFontDataCore::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 from wxPdfFontData.

◆ GetEncodingConv()

virtual wxMBConv* wxPdfFontDataCore::GetEncodingConv ( ) const
virtual

Get the associated encoding converter.

Returns
the encoding converter associated with this font

Reimplemented from wxPdfFontData.

◆ GetStringWidth()

virtual double wxPdfFontDataCore::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 from wxPdfFontData.

◆ GetWidthsAsString()

virtual wxString wxPdfFontDataCore::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 from wxPdfFontData.


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