wxPdfDocument 0.9.2
Public Member Functions | Protected Member Functions
wxPdfFontSubsetCff Class Reference

Class representing OpenType Font Subsets. (For internal use only) More...

#include <pdffontsubsetcff.h>

List of all members.

Public Member Functions

 wxPdfFontSubsetCff (const wxString &fileName)
 Default constructor.
virtual ~wxPdfFontSubsetCff ()
 Default destructor.
void DestructDictionary (wxPdfCffDictionary *dict)
 Destruct dictionary.
wxMemoryOutputStream * CreateSubset (wxInputStream *inFont, wxPdfChar2GlyphMap *glyphsUsed, bool includeCmap=false)
 Create subset of a font.

Protected Member Functions

bool ReadCffFont ()
 Read a font which is in CFF format.
bool ReadHeader ()
 Read the font header.
bool ReadFontName ()
 Read the font name.
bool ReadTopDict ()
 Read the top dictionary.
bool ReadStrings ()
 Read the list of strings.
bool ReadGlobalSubroutines ()
 read the global subroutines
bool ReadFontIndex (wxPdfCffIndexArray *index)
 Read a font index.
bool ReadFontDict (wxPdfCffDictionary *dict, int dictOffset, int dictSize)
 Read a font dictionary.
bool ReadFdSelect ()
 Read a FD selector.
bool ReadCidFontDict ()
 Read the font dictionary of a CID font.
bool ReadPrivateDict (wxPdfCffDictionary *privateDict, wxPdfCffIndexArray *localSubIndex, int offset, int size)
 Read a private dictionary.
wxPdfCffDictElement * FindDictElement (wxPdfCffDictionary *dict, int key)
 Find a dictionary element.
void SetDictElementArgument (wxPdfCffDictionary *dict, int key, wxMemoryOutputStream &buffer)
 Set the argument of a dictionary element.
void RemoveDictElement (wxPdfCffDictionary *dict, int key)
 Remove an element from a dictionary.
int DecodeInteger ()
 Decode an integer.
void EncodeIntegerMax (int value, wxMemoryOutputStream &buffer)
 Encode an integer using maximal size.
void EncodeInteger (int value, wxMemoryOutputStream &buffer)
 Encode an integer.
void SeekI (int offset)
 Seek to offset in the default font input stream.
int TellI ()
 Get the current position in the default font input stream.
int GetSizeI ()
 Get the size of the default font input stream.
unsigned char ReadByte ()
 Read a byte from the default font input stream.
short ReadShort ()
 Read a short integer from the default font input stream.
int ReadInt ()
 Read an integer from the default font input stream.
int ReadOffset (int offSize)
 Read an offset of specific size from the default font input stream.
int ReadOperandLength ()
 Read the length of an operand from the default font input stream.
int ReadOperator ()
 Read an operator from the default font input stream.
wxString ReadString (int length)
 Read a string from the default font input stream.
void GenerateFontSubset ()
 Generate the subset.
void SetRosStrings ()
 Set the ROS strings.
void SubsetCharstrings ()
 Build the subset of the charstrings' list.
void SubsetFontDict ()
 Build the subset of the font dictionary.
void CreateCidFontDict ()
 Create a dictionary for a CID font.
void SubsetStrings ()
 Build the subset of the strings' list.
void SubsetDictString (wxPdfCffDictionary *dict, int op)
 Build the subset of a dictionary string.
void SubsetDictStrings (wxPdfCffDictionary *dict)
 Build the subset of the strings' dictionary.
void SeekO (int offset)
 Seek offset in the default output stream.
int TellO ()
 Get the current position in the default output stream.
void WriteFontSubset ()
 Write the font's subset to the default output stream.
void WriteHeader ()
 Write the font header.
void WriteName ()
 Write the font's name.
void WriteTopDict ()
 Write the top dictionary.
void WriteDict (wxPdfCffDictionary *dict)
 Write a dictionary.
void WriteDictOperator (wxPdfCffDictElement *op)
 Write a dictionary operator.
void SetTopDictOperatorToCurrentPosition (int op)
 Set a top dictionary operator to the current position.
int GetLocation (wxPdfCffDictionary *dict, int op)
 Get the location of a dictionary in the default output stream.
void WriteStrings ()
 Write the list of strings.
void WriteGlobalSubrs ()
 Write the list of global subroutines.
void WriteCharset ()
 Write the charset.
void WriteFdSelect ()
 Write the FD selector.
void WriteCharStrings ()
 Write the list of charstrings.
void WriteCidFontDict ()
 Write the CID font dictionary.
void WriteCidPrivateDictAndLocalSub ()
 Write a CID private dictionary and local subroutines.
void WritePrivateDict (int dictNum, wxPdfCffDictionary *parentDict, wxPdfCffDictionary *privateDict)
 Write a private dictionary.
void WriteLocalSub (int dictNum, wxPdfCffDictionary *privateDict, wxPdfCffIndexArray *localSubIndex)
 Write the local subroutines.
void WriteIndex (wxPdfCffIndexArray *index)
 Write an index.
void WriteInteger (int value, int size, wxMemoryOutputStream *buffer)
 Write an integer.
void FindLocalAndGlobalSubrsUsed ()
 Find the local and global subroutines used.
void SubsetSubrs (wxPdfCffIndexArray &subrIndex, wxPdfSortedArrayInt &subrsUsed)
 Build the subset of the subroutines.
void FindSubrsUsed (int fd, wxPdfCffIndexArray &localSubIndex, wxPdfSortedArrayInt &hSubrsUsed, wxArrayInt &lSubrsUsed)
 Find the subroutines used.
void FindGlobalSubrsUsed ()
 Find the global subroutines use.

Detailed Description

Class representing OpenType Font Subsets. (For internal use only)


Constructor & Destructor Documentation

wxPdfFontSubsetCff::wxPdfFontSubsetCff ( const wxString &  fileName)

Default constructor.

virtual wxPdfFontSubsetCff::~wxPdfFontSubsetCff ( ) [virtual]

Default destructor.


Member Function Documentation

void wxPdfFontSubsetCff::CreateCidFontDict ( ) [protected]

Create a dictionary for a CID font.

wxMemoryOutputStream* wxPdfFontSubsetCff::CreateSubset ( wxInputStream *  inFont,
wxPdfChar2GlyphMap *  glyphsUsed,
bool  includeCmap = false 
)

Create subset of a font.

Parameters:
inFontstream containing the font data
glyphsUseda list of used glyphs
includeCmapflag whether to include the CMap table
Returns:
the stream containing the font subset
int wxPdfFontSubsetCff::DecodeInteger ( ) [protected]

Decode an integer.

void wxPdfFontSubsetCff::DestructDictionary ( wxPdfCffDictionary *  dict)

Destruct dictionary.

Parameters:
dictreference of the dictionary to be destructed
void wxPdfFontSubsetCff::EncodeInteger ( int  value,
wxMemoryOutputStream &  buffer 
) [protected]

Encode an integer.

void wxPdfFontSubsetCff::EncodeIntegerMax ( int  value,
wxMemoryOutputStream &  buffer 
) [protected]

Encode an integer using maximal size.

wxPdfCffDictElement* wxPdfFontSubsetCff::FindDictElement ( wxPdfCffDictionary *  dict,
int  key 
) [protected]

Find a dictionary element.

void wxPdfFontSubsetCff::FindGlobalSubrsUsed ( ) [protected]

Find the global subroutines use.

void wxPdfFontSubsetCff::FindLocalAndGlobalSubrsUsed ( ) [protected]

Find the local and global subroutines used.

void wxPdfFontSubsetCff::FindSubrsUsed ( int  fd,
wxPdfCffIndexArray &  localSubIndex,
wxPdfSortedArrayInt &  hSubrsUsed,
wxArrayInt &  lSubrsUsed 
) [protected]

Find the subroutines used.

void wxPdfFontSubsetCff::GenerateFontSubset ( ) [protected]

Generate the subset.

int wxPdfFontSubsetCff::GetLocation ( wxPdfCffDictionary *  dict,
int  op 
) [protected]

Get the location of a dictionary in the default output stream.

int wxPdfFontSubsetCff::GetSizeI ( ) [protected]

Get the size of the default font input stream.

unsigned char wxPdfFontSubsetCff::ReadByte ( ) [protected]

Read a byte from the default font input stream.

bool wxPdfFontSubsetCff::ReadCffFont ( ) [protected]

Read a font which is in CFF format.

bool wxPdfFontSubsetCff::ReadCidFontDict ( ) [protected]

Read the font dictionary of a CID font.

bool wxPdfFontSubsetCff::ReadFdSelect ( ) [protected]

Read a FD selector.

bool wxPdfFontSubsetCff::ReadFontDict ( wxPdfCffDictionary *  dict,
int  dictOffset,
int  dictSize 
) [protected]

Read a font dictionary.

bool wxPdfFontSubsetCff::ReadFontIndex ( wxPdfCffIndexArray *  index) [protected]

Read a font index.

bool wxPdfFontSubsetCff::ReadFontName ( ) [protected]

Read the font name.

bool wxPdfFontSubsetCff::ReadGlobalSubroutines ( ) [protected]

read the global subroutines

bool wxPdfFontSubsetCff::ReadHeader ( ) [protected]

Read the font header.

int wxPdfFontSubsetCff::ReadInt ( ) [protected]

Read an integer from the default font input stream.

int wxPdfFontSubsetCff::ReadOffset ( int  offSize) [protected]

Read an offset of specific size from the default font input stream.

int wxPdfFontSubsetCff::ReadOperandLength ( ) [protected]

Read the length of an operand from the default font input stream.

int wxPdfFontSubsetCff::ReadOperator ( ) [protected]

Read an operator from the default font input stream.

bool wxPdfFontSubsetCff::ReadPrivateDict ( wxPdfCffDictionary *  privateDict,
wxPdfCffIndexArray *  localSubIndex,
int  offset,
int  size 
) [protected]

Read a private dictionary.

short wxPdfFontSubsetCff::ReadShort ( ) [protected]

Read a short integer from the default font input stream.

wxString wxPdfFontSubsetCff::ReadString ( int  length) [protected]

Read a string from the default font input stream.

bool wxPdfFontSubsetCff::ReadStrings ( ) [protected]

Read the list of strings.

bool wxPdfFontSubsetCff::ReadTopDict ( ) [protected]

Read the top dictionary.

void wxPdfFontSubsetCff::RemoveDictElement ( wxPdfCffDictionary *  dict,
int  key 
) [protected]

Remove an element from a dictionary.

void wxPdfFontSubsetCff::SeekI ( int  offset) [protected]

Seek to offset in the default font input stream.

void wxPdfFontSubsetCff::SeekO ( int  offset) [protected]

Seek offset in the default output stream.

void wxPdfFontSubsetCff::SetDictElementArgument ( wxPdfCffDictionary *  dict,
int  key,
wxMemoryOutputStream &  buffer 
) [protected]

Set the argument of a dictionary element.

void wxPdfFontSubsetCff::SetRosStrings ( ) [protected]

Set the ROS strings.

void wxPdfFontSubsetCff::SetTopDictOperatorToCurrentPosition ( int  op) [protected]

Set a top dictionary operator to the current position.

void wxPdfFontSubsetCff::SubsetCharstrings ( ) [protected]

Build the subset of the charstrings' list.

void wxPdfFontSubsetCff::SubsetDictString ( wxPdfCffDictionary *  dict,
int  op 
) [protected]

Build the subset of a dictionary string.

void wxPdfFontSubsetCff::SubsetDictStrings ( wxPdfCffDictionary *  dict) [protected]

Build the subset of the strings' dictionary.

void wxPdfFontSubsetCff::SubsetFontDict ( ) [protected]

Build the subset of the font dictionary.

void wxPdfFontSubsetCff::SubsetStrings ( ) [protected]

Build the subset of the strings' list.

void wxPdfFontSubsetCff::SubsetSubrs ( wxPdfCffIndexArray &  subrIndex,
wxPdfSortedArrayInt &  subrsUsed 
) [protected]

Build the subset of the subroutines.

int wxPdfFontSubsetCff::TellI ( ) [protected]

Get the current position in the default font input stream.

int wxPdfFontSubsetCff::TellO ( ) [protected]

Get the current position in the default output stream.

void wxPdfFontSubsetCff::WriteCharset ( ) [protected]

Write the charset.

void wxPdfFontSubsetCff::WriteCharStrings ( ) [protected]

Write the list of charstrings.

void wxPdfFontSubsetCff::WriteCidFontDict ( ) [protected]

Write the CID font dictionary.

void wxPdfFontSubsetCff::WriteCidPrivateDictAndLocalSub ( ) [protected]

Write a CID private dictionary and local subroutines.

void wxPdfFontSubsetCff::WriteDict ( wxPdfCffDictionary *  dict) [protected]

Write a dictionary.

void wxPdfFontSubsetCff::WriteDictOperator ( wxPdfCffDictElement *  op) [protected]

Write a dictionary operator.

void wxPdfFontSubsetCff::WriteFdSelect ( ) [protected]

Write the FD selector.

void wxPdfFontSubsetCff::WriteFontSubset ( ) [protected]

Write the font's subset to the default output stream.

void wxPdfFontSubsetCff::WriteGlobalSubrs ( ) [protected]

Write the list of global subroutines.

void wxPdfFontSubsetCff::WriteHeader ( ) [protected]

Write the font header.

void wxPdfFontSubsetCff::WriteIndex ( wxPdfCffIndexArray *  index) [protected]

Write an index.

void wxPdfFontSubsetCff::WriteInteger ( int  value,
int  size,
wxMemoryOutputStream *  buffer 
) [protected]

Write an integer.

void wxPdfFontSubsetCff::WriteLocalSub ( int  dictNum,
wxPdfCffDictionary *  privateDict,
wxPdfCffIndexArray *  localSubIndex 
) [protected]

Write the local subroutines.

void wxPdfFontSubsetCff::WriteName ( ) [protected]

Write the font's name.

void wxPdfFontSubsetCff::WritePrivateDict ( int  dictNum,
wxPdfCffDictionary *  parentDict,
wxPdfCffDictionary *  privateDict 
) [protected]

Write a private dictionary.

void wxPdfFontSubsetCff::WriteStrings ( ) [protected]

Write the list of strings.

void wxPdfFontSubsetCff::WriteTopDict ( ) [protected]

Write the top dictionary.


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