wxPdfDocument 0.9.2
|
Class representing a TrueType/OpenType font parser. More...
#include <pdffontparsertruetype.h>
Public Member Functions | |
wxPdfFontParserTrueType () | |
Default constructor. | |
virtual | ~wxPdfFontParserTrueType () |
Default destructor. | |
wxPdfFontData * | IdentifyFont (const wxString &fontFileName, int fontIndex) |
Identify font based on a font file. | |
bool | LoadFontData (wxPdfFontData *fontData) |
Load the font data. | |
int | GetCollectionFontCount (const wxString &fontFileName) |
Get the number of fonts within a font collection. | |
Protected Member Functions | |
void | ClearTableDirectory () |
Clear the table directory. | |
void | LockTable (const wxString &tableName) |
Lock font table. | |
void | ReleaseTable () |
Release font table. | |
int | CalculateChecksum (const char *b, size_t length) |
Calculate a check sum. | |
wxPdfFontData * | IdentifyFont () |
Identify a font. | |
bool | PrepareFontData (wxPdfFontData *fontData) |
Prepare the font data. | |
bool | CheckTables () |
Check whether the font contains all required tables. | |
void | CheckCff () |
Check whether the font is in compact font format (CFF) | |
void | CheckRestrictions () |
Check the font's access restrictions. | |
wxString | GetBaseFont () |
Get the base name of the font. | |
wxArrayString | GetUniqueNames (int id) |
Get a list of unique names. | |
wxArrayString | GetNames (int id, bool namesOnly=true) |
Get font names. | |
wxString | GetEnglishName (int id) |
Get the English language font name. | |
bool | ReadMaps () |
Read font maps. | |
bool | ReadGlyphWidths (int numberOfHMetrics, int unitsPerEm) |
Read the glyph widths. | |
void | ReadKerning (int unitsPerEm) |
Read kerning information. | |
bool | ReadTableDirectory () |
Read table directory. | |
wxPdfCMap * | ReadFormat0 () |
Read a Format 0 CMap. | |
wxPdfCMap * | ReadFormat4 () |
Read a Format 4 CMap. | |
wxPdfCMap * | ReadFormat6 () |
Read a Format 6 CMap. | |
wxPdfCMap * | ReadFormat12 () |
Read a Format 12 CMap. | |
int | GetGlyphWidth (unsigned int glyph) |
Get the width of a specific glyph. | |
Protected Attributes | |
size_t | m_directoryOffset |
offset of the table directory | |
wxPdfTableDirectory * | m_tableDirectory |
table directory of the font | |
bool | m_isMacCoreText |
Flag whether a Mac Core Text font is to be parsed. |
Class representing a TrueType/OpenType font parser.
wxPdfFontParserTrueType::wxPdfFontParserTrueType | ( | ) |
Default constructor.
virtual wxPdfFontParserTrueType::~wxPdfFontParserTrueType | ( | ) | [virtual] |
Default destructor.
int wxPdfFontParserTrueType::CalculateChecksum | ( | const char * | b, |
size_t | length | ||
) | [protected] |
Calculate a check sum.
void wxPdfFontParserTrueType::CheckCff | ( | ) | [protected] |
Check whether the font is in compact font format (CFF)
void wxPdfFontParserTrueType::CheckRestrictions | ( | ) | [protected] |
Check the font's access restrictions.
bool wxPdfFontParserTrueType::CheckTables | ( | ) | [protected] |
Check whether the font contains all required tables.
void wxPdfFontParserTrueType::ClearTableDirectory | ( | ) | [protected] |
Clear the table directory.
wxString wxPdfFontParserTrueType::GetBaseFont | ( | ) | [protected] |
Get the base name of the font.
Gets the Postscript font name.
int wxPdfFontParserTrueType::GetCollectionFontCount | ( | const wxString & | fontFileName | ) |
Get the number of fonts within a font collection.
fontFileName | the fully qualified name of the font collection file |
wxString wxPdfFontParserTrueType::GetEnglishName | ( | int | id | ) | [protected] |
Get the English language font name.
id | the name id to retrieve |
int wxPdfFontParserTrueType::GetGlyphWidth | ( | unsigned int | glyph | ) | [protected] |
Get the width of a specific glyph.
wxArrayString wxPdfFontParserTrueType::GetNames | ( | int | id, |
bool | namesOnly = true |
||
) | [protected] |
Get font names.
Extracts the names of the font in all the languages available. Optionally the platform, encoding and language identifiers are extracted as well. In the latter case 4 consecutive entries in the resulting string array represent a single font name.
id | the name id to retrieve |
namesOnly | flag whether to extract only names or names and identifiers |
wxArrayString wxPdfFontParserTrueType::GetUniqueNames | ( | int | id | ) | [protected] |
Get a list of unique names.
Extracts the names of the font in all the languages available.
id | the name id to retrieve |
wxPdfFontData* wxPdfFontParserTrueType::IdentifyFont | ( | ) | [protected] |
Identify a font.
wxPdfFontData* wxPdfFontParserTrueType::IdentifyFont | ( | const wxString & | fontFileName, |
int | fontIndex | ||
) |
Identify font based on a font file.
fontFileName | fully qualified name of the font file |
fontIndex | the index of the font within a font collection (if appropriate) |
bool wxPdfFontParserTrueType::LoadFontData | ( | wxPdfFontData * | fontData | ) |
Load the font data.
Before using a font it's data have be loaded into memory. This method tries to load the required font data for a previously identified font.
fontData | the font data instance to be loaded |
void wxPdfFontParserTrueType::LockTable | ( | const wxString & | tableName | ) | [protected] |
Lock font table.
bool wxPdfFontParserTrueType::PrepareFontData | ( | wxPdfFontData * | fontData | ) | [protected] |
Prepare the font data.
wxPdfCMap* wxPdfFontParserTrueType::ReadFormat0 | ( | ) | [protected] |
Read a Format 0 CMap.
wxPdfCMap* wxPdfFontParserTrueType::ReadFormat12 | ( | ) | [protected] |
Read a Format 12 CMap.
wxPdfCMap* wxPdfFontParserTrueType::ReadFormat4 | ( | ) | [protected] |
Read a Format 4 CMap.
wxPdfCMap* wxPdfFontParserTrueType::ReadFormat6 | ( | ) | [protected] |
Read a Format 6 CMap.
bool wxPdfFontParserTrueType::ReadGlyphWidths | ( | int | numberOfHMetrics, |
int | unitsPerEm | ||
) | [protected] |
Read the glyph widths.
Reads the glyphs widths. The widths are extracted from the table 'hmtx'. The glyphs are normalized to 1000 units.
numberOfHMetrics | |
unitsPerEm |
void wxPdfFontParserTrueType::ReadKerning | ( | int | unitsPerEm | ) | [protected] |
Read kerning information.
bool wxPdfFontParserTrueType::ReadMaps | ( | ) | [protected] |
Read font maps.
Reads the tables 'head', 'hhea', 'OS/2' and 'post' filling several variables.
bool wxPdfFontParserTrueType::ReadTableDirectory | ( | ) | [protected] |
Read table directory.
void wxPdfFontParserTrueType::ReleaseTable | ( | ) | [protected] |
Release font table.
size_t wxPdfFontParserTrueType::m_directoryOffset [protected] |
offset of the table directory
bool wxPdfFontParserTrueType::m_isMacCoreText [protected] |
Flag whether a Mac Core Text font is to be parsed.
wxPdfTableDirectory* wxPdfFontParserTrueType::m_tableDirectory [protected] |
table directory of the font