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

Class representing a Type1 font parser. More...

#include <pdffontparsertype1.h>

Inheritance diagram for wxPdfFontParserType1:
wxPdfFontParser

Public Member Functions

 wxPdfFontParserType1 ()
 Default constructor.
 
virtual ~wxPdfFontParserType1 ()
 Default destructor.
 
wxPdfFontDataIdentifyFont (const wxString &fontFileName, int fontIndex)
 Identify font based on a font file.
 
bool ParseFont (const wxString &fileName, wxInputStream *fontFile, wxInputStream *metricFile, bool onlyNames)
 Parse font stream.
 
bool LoadFontData (wxPdfFontData *fontData)
 Load the font data.
 
bool ReadAFM (wxInputStream &afmFile)
 Read font metrics from Adobe Font Metric file.
 
bool ReadPFM (wxInputStream &pfmFile)
 Read font metrics from Printer Font Metric file.
 
bool ReadPFX (wxInputStream *pfxFile, bool onlyNames)
 Read font data from font file.
 
- Public Member Functions inherited from wxPdfFontParser
 wxPdfFontParser ()
 Default constructor.
 
virtual ~wxPdfFontParser ()
 Default destructor.
 
void SeekI (int offset)
 Seek to offset in default input stream.
 
void SeekI (int offset, wxInputStream *stream)
 Seek to offset in specific input stream.
 
int TellI ()
 Tell current position in default input stream.
 
int TellI (wxInputStream *stream)
 Tell current position in specific input stream.
 
void SkipBytes (int count)
 Skip bytes in default input stream.
 
void SkipBytes (int count, wxInputStream *stream)
 Skip bytes in specific input stream.
 
int ReadInt ()
 Read integer from default input stream.
 
short ReadShort ()
 Read short integer from default input stream.
 
unsigned short ReadUShort ()
 Read unsigned short integer from default input stream.
 
unsigned char ReadByte ()
 Read byte from default input stream.
 
unsigned char ReadByte (wxInputStream *stream)
 Read byte from specific input stream.
 
wxString ReadString (int length)
 Read string from default input stream.
 
wxString ReadString (int length, wxInputStream *stream)
 Read string from specific input stream.
 
wxString ReadUnicodeString (int length)
 Read Unicode string from default input stream.
 
short ReadShortLE (wxInputStream *stream)
 Read short integer from specific input stream in little endian mode.
 
unsigned short ReadUShortLE (wxInputStream *stream)
 Read unsigned short integer from specific input stream in little endian mode.
 
unsigned int ReadUIntLE (wxInputStream *stream)
 Read unsigned integer from specific input stream in little endian mode.
 
wxString ReadString (wxInputStream &stream)
 Read string from specific input stream.
 

Additional Inherited Members

- Protected Attributes inherited from wxPdfFontParser
wxString m_fileName
 File name of the font file.
 
wxString m_fontName
 Name of font.
 
wxInputStream * m_inFont
 Font file input stream.
 
wxString m_style
 Font style.
 

Detailed Description

Class representing a Type1 font parser.

Constructor & Destructor Documentation

◆ wxPdfFontParserType1()

wxPdfFontParserType1::wxPdfFontParserType1 ( )

Default constructor.

◆ ~wxPdfFontParserType1()

virtual wxPdfFontParserType1::~wxPdfFontParserType1 ( )
virtual

Default destructor.

Member Function Documentation

◆ IdentifyFont()

wxPdfFontData * wxPdfFontParserType1::IdentifyFont ( const wxString & fontFileName,
int fontIndex )

Identify font based on a font file.

Parameters
fontFileNamefully qualified name of the font file
fontIndexthe index of the font within a font collection (if appropriate)
Returns
a reference to a new font data instance

◆ LoadFontData()

bool wxPdfFontParserType1::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.

Parameters
fontDatathe font data instance to be loaded
Returns
TRUE if the font data could be loaded successfully, FALSE otherwise

◆ ParseFont()

bool wxPdfFontParserType1::ParseFont ( const wxString & fileName,
wxInputStream * fontFile,
wxInputStream * metricFile,
bool onlyNames )

Parse font stream.

Parameters
fileNamethe name of the file containing the font data
fontFilethe stream containing the font data
metricFilethe stream containing the font metric data
onlyNamesflag whether only the font names should be parsed or the full font data
Returns
TRUE if the parsing was successful, FALSE otherwise

◆ ReadAFM()

bool wxPdfFontParserType1::ReadAFM ( wxInputStream & afmFile)

Read font metrics from Adobe Font Metric file.

Parameters
afmFilestream containing the font metric data
Returns
TRUE if the font metrics are valid, FALSE otherwise

◆ ReadPFM()

bool wxPdfFontParserType1::ReadPFM ( wxInputStream & pfmFile)

Read font metrics from Printer Font Metric file.

Parameters
pfmFilestream containing the font metric data
Returns
TRUE if the font metrics are valid, FALSE otherwise

◆ ReadPFX()

bool wxPdfFontParserType1::ReadPFX ( wxInputStream * pfxFile,
bool onlyNames )

Read font data from font file.

Parameters
pfxFilestream containing the font data
onlyNamesflag whether only the font names should be parsed or the full font data
Returns
TRUE if the font metrics are valid, FALSE otherwise
Note
Type1 fonts exist in either PFA (PostScript Font ASCII) or PFB (PostScript Font Binary) format. Although this method is capable of reading either format, currently only fonts in PFB format can be used in creating PDF documents.

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