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

Class representing a font providing an extended interface. More...

#include <pdffontextended.h>

Public Member Functions

 wxPdfFontExtended ()
 Default constructor.
 
 wxPdfFontExtended (const wxPdfFont &font)
 Constructor.
 
virtual ~wxPdfFontExtended ()
 Default destructor.
 
 wxPdfFontExtended (const wxPdfFontExtended &font)
 Copy constructor.
 
wxPdfFontExtendedoperator= (const wxPdfFontExtended &font)
 Assignment.
 
bool IsValid () const
 Check whether font is valid.
 
wxString GetType () const
 Get font type.
 
wxString GetFamily () const
 Get font family.
 
wxString GetName () const
 Get font name.
 
int GetStyle () const
 Get font style.
 
bool EmbedRequested () const
 Check whether font embedding is requested for this font.
 
bool SubsetRequested () const
 Check whether font subsetting is requested for this font.
 
int GetUnderlinePosition () const
 Get underline position.
 
int GetUnderlineThickness () const
 Get underline thickness.
 
int GetBBoxTopPosition () const
 Get bounding box top position.
 
wxString GetEncoding () const
 Get encoding.
 
wxString GetBaseEncoding () const
 Get encoding.
 
bool HasDiffs () const
 Check whether the font has differences to WinAnsi encoding.
 
wxString GetDiffs () const
 Get encoding differences.
 
size_t GetSize1 () const
 Get font file size 1.
 
bool HasSize2 () const
 Check whether the file has a size 2.
 
size_t GetSize2 () const
 Get font file size 2 (Type 1 only)
 
wxString GetCMap () const
 Get the font's CMap (Type 0 only)
 
wxString GetOrdering () const
 Get font ordering.
 
wxString GetSupplement () const
 Get font supplement /Type 0 only)
 
wxString GetWidthsAsString (bool subset=false, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL) const
 Get the character width array as string.
 
double GetStringWidth (const wxString &s, bool withKerning=false, double charSpacing=0)
 Get the width of a string.
 
wxArrayInt GetKerningWidthArray (const wxString &s) const
 Get kerning width array.
 
bool CanShow (const wxString &s) const
 Check whether the font oan show all characters of a given string.
 
wxString ConvertCID2GID (const wxString &s, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL)
 Convert character codes to glyph numbers.
 
wxString ConvertGlyph (wxUint32 glyph, wxPdfSortedArrayInt *usedGlyphs=NULL, wxPdfChar2GlyphMap *subsetGlyphs=NULL)
 Convert glyph number to string.
 
bool IsEmbedded () const
 Check whether the font will be embedded.
 
bool SupportsSubset () const
 Check whether the font supports subsetting.
 
size_t WriteFontData (wxOutputStream *fontData, wxPdfSortedArrayInt *usedGlyphs, wxPdfChar2GlyphMap *subsetGlyphs)
 Write font data.
 
size_t WriteUnicodeMap (wxOutputStream *mapData, wxPdfSortedArrayInt *usedGlyphs, wxPdfChar2GlyphMap *subsetGlyphs)
 Write character/glyph to unicode mapping.
 
size_t WriteCIDToGIDMap (wxOutputStream *mapData, wxPdfSortedArrayInt *usedGlyphs, wxPdfChar2GlyphMap *subsetGlyphs)
 Write CID to GID mapping.
 
size_t WriteCIDSet (wxOutputStream *setData, wxPdfSortedArrayInt *usedGlyphs, wxPdfChar2GlyphMap *subsetGlyphs)
 Write CID set.
 
const wxPdfFontDescriptionGetDescription () const
 Get the font description.
 
wxPdfFont GetUserFont () const
 Get user font.
 
bool HasEncodingMap () const
 Check whether the font has an encoding map.
 
virtual wxMBConv * GetEncodingConv () const
 Get the associated encoding converter.
 
bool HasVoltData () const
 
wxString ApplyVoltData (const wxString &txt) const
 

Friends

class wxPdfFontManagerBase
 

Detailed Description

Class representing a font providing an extended interface.

Constructor & Destructor Documentation

◆ wxPdfFontExtended() [1/3]

wxPdfFontExtended::wxPdfFontExtended ( )

Default constructor.

◆ wxPdfFontExtended() [2/3]

wxPdfFontExtended::wxPdfFontExtended ( const wxPdfFont & font)

Constructor.

Parameters
fontthe user font

◆ ~wxPdfFontExtended()

virtual wxPdfFontExtended::~wxPdfFontExtended ( )
virtual

Default destructor.

◆ wxPdfFontExtended() [3/3]

wxPdfFontExtended::wxPdfFontExtended ( const wxPdfFontExtended & font)

Copy constructor.

Member Function Documentation

◆ ApplyVoltData()

wxString wxPdfFontExtended::ApplyVoltData ( const wxString & txt) const

◆ CanShow()

bool wxPdfFontExtended::CanShow ( const wxString & s) const

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

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

◆ ConvertCID2GID()

wxString wxPdfFontExtended::ConvertCID2GID ( const wxString & s,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL )

Convert character codes to glyph numbers.

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

◆ ConvertGlyph()

wxString wxPdfFontExtended::ConvertGlyph ( wxUint32 glyph,
wxPdfSortedArrayInt * usedGlyphs = NULL,
wxPdfChar2GlyphMap * subsetGlyphs = NULL )

Convert glyph number to string.

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

◆ EmbedRequested()

bool wxPdfFontExtended::EmbedRequested ( ) const
inline

Check whether font embedding is requested for this font.

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

◆ GetBaseEncoding()

wxString wxPdfFontExtended::GetBaseEncoding ( ) const

Get encoding.

Returns
the name of the font's base encoding

◆ GetBBoxTopPosition()

int wxPdfFontExtended::GetBBoxTopPosition ( ) const

Get bounding box top position.

Returns
the bounding box of the font in string representation

◆ GetCMap()

wxString wxPdfFontExtended::GetCMap ( ) const

Get the font's CMap (Type 0 only)

return the font's CMap descriptor

◆ GetDescription()

const wxPdfFontDescription & wxPdfFontExtended::GetDescription ( ) const

Get the font description.

◆ GetDiffs()

wxString wxPdfFontExtended::GetDiffs ( ) const

Get encoding differences.

Returns
the font encoding differences

◆ GetEncoding()

wxString wxPdfFontExtended::GetEncoding ( ) const

Get encoding.

Returns
the name of the font's encoding

◆ GetEncodingConv()

virtual wxMBConv * wxPdfFontExtended::GetEncodingConv ( ) const
virtual

Get the associated encoding converter.

Returns
the encoding converter associated with this font

◆ GetFamily()

wxString wxPdfFontExtended::GetFamily ( ) const

Get font family.

Returns
the font family

◆ GetKerningWidthArray()

wxArrayInt wxPdfFontExtended::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.

◆ GetName()

wxString wxPdfFontExtended::GetName ( ) const

Get font name.

Returns
the font name

◆ GetOrdering()

wxString wxPdfFontExtended::GetOrdering ( ) const

Get font ordering.

Returns
the font's ordering descriptor

◆ GetSize1()

size_t wxPdfFontExtended::GetSize1 ( ) const

Get font file size 1.

Returns
the size of the font file

◆ GetSize2()

size_t wxPdfFontExtended::GetSize2 ( ) const

Get font file size 2 (Type 1 only)

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

◆ GetStringWidth()

double wxPdfFontExtended::GetStringWidth ( const wxString & s,
bool withKerning = false,
double charSpacing = 0 )

Get the width of a string.

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

◆ GetStyle()

int wxPdfFontExtended::GetStyle ( ) const

Get font style.

Returns
the font style

◆ GetSupplement()

wxString wxPdfFontExtended::GetSupplement ( ) const

Get font supplement /Type 0 only)

Returns
the font's supplement descriptor

◆ GetType()

wxString wxPdfFontExtended::GetType ( ) const

Get font type.

Returns
the font type

◆ GetUnderlinePosition()

int wxPdfFontExtended::GetUnderlinePosition ( ) const

Get underline position.

Returns
the position of the underline decoration

◆ GetUnderlineThickness()

int wxPdfFontExtended::GetUnderlineThickness ( ) const

Get underline thickness.

Returns
the thickness of the underline decoration

◆ GetUserFont()

wxPdfFont wxPdfFontExtended::GetUserFont ( ) const

Get user font.

Returns
the font description

◆ GetWidthsAsString()

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

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

◆ HasDiffs()

bool wxPdfFontExtended::HasDiffs ( ) const

Check whether the font has differences to WinAnsi encoding.

Returns
TRUE if the font has encoding differences, FALSE otherwise

◆ HasEncodingMap()

bool wxPdfFontExtended::HasEncodingMap ( ) const

Check whether the font has an encoding map.

Returns
TRUE if the font has an encoding map, FALSE otherwise

◆ HasSize2()

bool wxPdfFontExtended::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()

bool wxPdfFontExtended::HasVoltData ( ) const

◆ IsEmbedded()

bool wxPdfFontExtended::IsEmbedded ( ) const

Check whether the font will be embedded.

Returns
TRUE if the font will be embedde, FALSE otherwise

◆ IsValid()

bool wxPdfFontExtended::IsValid ( ) const

Check whether font is valid.

Returns
TRUE if the font is valid, FALSE otherwise

◆ operator=()

wxPdfFontExtended & wxPdfFontExtended::operator= ( const wxPdfFontExtended & font)

Assignment.

◆ SubsetRequested()

bool wxPdfFontExtended::SubsetRequested ( ) const
inline

Check whether font subsetting is requested for this font.

Returns
TRUE if subsetting of this font is requested, FALSE otherwise

◆ SupportsSubset()

bool wxPdfFontExtended::SupportsSubset ( ) const

Check whether the font supports subsetting.

Returns
TRUE if the font supports subsetting, FALSE otherwise

◆ WriteCIDSet()

size_t wxPdfFontExtended::WriteCIDSet ( wxOutputStream * setData,
wxPdfSortedArrayInt * usedGlyphs,
wxPdfChar2GlyphMap * subsetGlyphs )

Write CID set.

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

◆ WriteCIDToGIDMap()

size_t wxPdfFontExtended::WriteCIDToGIDMap ( wxOutputStream * mapData,
wxPdfSortedArrayInt * usedGlyphs,
wxPdfChar2GlyphMap * subsetGlyphs )

Write CID to GID mapping.

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

◆ WriteFontData()

size_t wxPdfFontExtended::WriteFontData ( wxOutputStream * fontData,
wxPdfSortedArrayInt * usedGlyphs,
wxPdfChar2GlyphMap * subsetGlyphs )

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

◆ WriteUnicodeMap()

size_t wxPdfFontExtended::WriteUnicodeMap ( wxOutputStream * mapData,
wxPdfSortedArrayInt * usedGlyphs,
wxPdfChar2GlyphMap * subsetGlyphs )

Write character/glyph to unicode mapping.

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

Friends And Related Symbol Documentation

◆ wxPdfFontManagerBase

friend class wxPdfFontManagerBase
friend

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