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

Class representing a font providing a basic interface. More...

#include <pdffont.h>

Public Member Functions

 wxPdfFont ()
 Default constructor.
 
virtual ~wxPdfFont ()
 Default destructor.
 
 wxPdfFont (const wxPdfFont &font)
 Copy constructor.
 
wxPdfFontoperator= (const wxPdfFont &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.
 
wxString GetEncoding () const
 Get encoding.
 
virtual double GetStringWidth (const wxString &s) const
 Get the width of a string.
 
bool EmbedRequired () const
 Check whether the font embedding is required.
 
bool EmbedSupported () const
 Check whether the font embedding is supported.
 
bool SubsetSupported () const
 Check whether the font subsetting is supported.
 
const wxPdfFontDescription GetDescription () const
 Get the font description.
 
void SetEmbed (bool embed)
 Set embed flag.
 
bool GetEmbed () const
 Get embed flag.
 
void SetSubset (bool subset)
 Set subset flag.
 
bool GetSubset () const
 Get subset flag.
 
bool SetEncoding (const wxString &encodingName)
 Set encoding.
 
bool GetEncoding (wxPdfEncoding &encoding)
 Get encoding.
 
bool CanShow (const wxString &s)
 Check whether the font oan show all characters of a given string.
 
bool GetSupportedUnicodeCharacters (wxPdfArrayUint32 &unicodeCharacters) const
 Get list of supported unicode characters.
 
wxString ConvertToValid (const wxString &s, wxUniChar replace=wxS('?')) const
 Force string to valid string in respect of the current font encoding.
 
bool GetGlyphNames (wxArrayString &glyphNames) const
 Get list of supported glyph names.
 

Friends

class wxPdfFontExtended
 
class wxPdfFontManagerBase
 

Detailed Description

Class representing a font providing a basic interface.

Constructor & Destructor Documentation

◆ wxPdfFont() [1/2]

wxPdfFont::wxPdfFont ( )

Default constructor.

◆ ~wxPdfFont()

virtual wxPdfFont::~wxPdfFont ( )
virtual

Default destructor.

◆ wxPdfFont() [2/2]

wxPdfFont::wxPdfFont ( const wxPdfFont & font)

Copy constructor.

Member Function Documentation

◆ CanShow()

bool wxPdfFont::CanShow ( const wxString & s)

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

◆ ConvertToValid()

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

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

◆ EmbedRequired()

bool wxPdfFont::EmbedRequired ( ) const

Check whether the font embedding is required.

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

◆ EmbedSupported()

bool wxPdfFont::EmbedSupported ( ) const

Check whether the font embedding is supported.

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

◆ GetDescription()

const wxPdfFontDescription wxPdfFont::GetDescription ( ) const

Get the font description.

Returns
the font description

◆ GetEmbed()

bool wxPdfFont::GetEmbed ( ) const
inline

Get embed flag.

Returns
TRUE if the font will be embedded, FALSE otherwise
See also
EmbedRequired(), EmbedSupported()

◆ GetEncoding() [1/2]

wxString wxPdfFont::GetEncoding ( ) const

Get encoding.

Returns
the name of the font encoding

◆ GetEncoding() [2/2]

bool wxPdfFont::GetEncoding ( wxPdfEncoding & encoding)

Get encoding.

For Type1 and non-Unicode TrueType fonts it is possible to overwrite the default encoding of the font. It's the user's responsibility to ensure the font supports all characters assigned by the encoding.

Parameters
[out]encodingthe encoding used with this font
Returns
TRUE if an encoding is associated with the font, FALSE otherwise

◆ GetFamily()

wxString wxPdfFont::GetFamily ( ) const

Get font family.

Returns
the font family

◆ GetGlyphNames()

bool wxPdfFont::GetGlyphNames ( wxArrayString & glyphNames) const

Get list of supported glyph names.

For dynamically loaded Type1 fonts the list of supported glyph names is provided. For all other font types this information is not available.

Returns
TRUE if the list of glyph names is available, otherwise FALSE

◆ GetName()

wxString wxPdfFont::GetName ( ) const

Get font name.

Returns
the font name

◆ GetStringWidth()

virtual double wxPdfFont::GetStringWidth ( const wxString & s) const
virtual

Get the width of a string.

Parameters
sstring which's width is to be returned
Returns
the width of the string

◆ GetStyle()

int wxPdfFont::GetStyle ( ) const

Get font style.

Returns
the font style

◆ GetSubset()

bool wxPdfFont::GetSubset ( ) const
inline

Get subset flag.

Returns
TRUE if the font will be subsetted, FALSE otherwise
See also
SubsetSupported()

◆ GetSupportedUnicodeCharacters()

bool wxPdfFont::GetSupportedUnicodeCharacters ( wxPdfArrayUint32 & unicodeCharacters) const

Get list of supported unicode characters.

Parameters
unicodeCharacterslist of supported unicode characters on return
Returns
TRUE if the list could be determined, FALSE otherwise
Note
Any previous content of the Unicode character list will be deleted

◆ GetType()

wxString wxPdfFont::GetType ( ) const

Get font type.

Returns
the font type

◆ IsValid()

bool wxPdfFont::IsValid ( ) const

Check whether font is valid.

Returns
TRUE if the font is valid, FALSE otherwise

◆ operator=()

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

Assignment.

◆ SetEmbed()

void wxPdfFont::SetEmbed ( bool embed)

Set embed flag.

Enables or disables embedding for the font. Embedding can be enabled if and only if the font allows embedding. Embedding can be disabled if and only if the font does not requires embedding.

Parameters
embedIndicates whether to embed or not embed the font
See also
EmbedRequired(), EmbedSupported()

◆ SetEncoding()

bool wxPdfFont::SetEncoding ( const wxString & encodingName)

Set encoding.

For Type1 and non-Unicode TrueType fonts it is possible to overwrite the default encoding of the font. It's the user's responsibility to ensure the font supports all characters assigned by the encoding.

Parameters
encodingNamethe name of the encoding to use with this font
Returns
TRUE if the encoding could be assigned, FALSE otherwise
Note
The encoding has to be registered to the font manager in advance

◆ SetSubset()

void wxPdfFont::SetSubset ( bool subset)

Set subset flag.

Enables or disables subsetting for the font. Subsetting can be enabled if and only if the font allows subsetting.

Parameters
subsetindicates whether to subset or not subset the font
See also
SubsetSupported()

◆ SubsetSupported()

bool wxPdfFont::SubsetSupported ( ) const

Check whether the font subsetting is supported.

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

Friends And Related Symbol Documentation

◆ wxPdfFontExtended

friend class wxPdfFontExtended
friend

◆ wxPdfFontManagerBase

friend class wxPdfFontManagerBase
friend

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