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

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

#include <pdffontsubsetcff.h>

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::wxPdfFontSubsetCff ( const wxString & fileName)

Default constructor.

◆ ~wxPdfFontSubsetCff()

virtual wxPdfFontSubsetCff::~wxPdfFontSubsetCff ( )
virtual

Default destructor.

Member Function Documentation

◆ CreateCidFontDict()

void wxPdfFontSubsetCff::CreateCidFontDict ( )
protected

Create a dictionary for a CID font.

◆ CreateSubset()

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

◆ DecodeInteger()

int wxPdfFontSubsetCff::DecodeInteger ( )
protected

Decode an integer.

◆ DestructDictionary()

void wxPdfFontSubsetCff::DestructDictionary ( wxPdfCffDictionary * dict)

Destruct dictionary.

Parameters
dictreference of the dictionary to be destructed

◆ EncodeInteger()

void wxPdfFontSubsetCff::EncodeInteger ( int value,
wxMemoryOutputStream & buffer )
protected

Encode an integer.

◆ EncodeIntegerMax()

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

Encode an integer using maximal size.

◆ FindDictElement()

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

Find a dictionary element.

◆ FindGlobalSubrsUsed()

void wxPdfFontSubsetCff::FindGlobalSubrsUsed ( )
protected

Find the global subroutines use.

◆ FindLocalAndGlobalSubrsUsed()

void wxPdfFontSubsetCff::FindLocalAndGlobalSubrsUsed ( )
protected

Find the local and global subroutines used.

◆ FindSubrsUsed()

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

Find the subroutines used.

◆ GenerateFontSubset()

void wxPdfFontSubsetCff::GenerateFontSubset ( )
protected

Generate the subset.

◆ GetLocation()

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

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

◆ GetSizeI()

int wxPdfFontSubsetCff::GetSizeI ( )
protected

Get the size of the default font input stream.

◆ ReadByte()

unsigned char wxPdfFontSubsetCff::ReadByte ( )
protected

Read a byte from the default font input stream.

◆ ReadCffFont()

bool wxPdfFontSubsetCff::ReadCffFont ( )
protected

Read a font which is in CFF format.

◆ ReadCidFontDict()

bool wxPdfFontSubsetCff::ReadCidFontDict ( )
protected

Read the font dictionary of a CID font.

◆ ReadFdSelect()

bool wxPdfFontSubsetCff::ReadFdSelect ( )
protected

Read a FD selector.

◆ ReadFontDict()

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

Read a font dictionary.

◆ ReadFontIndex()

bool wxPdfFontSubsetCff::ReadFontIndex ( wxPdfCffIndexArray * index)
protected

Read a font index.

◆ ReadFontName()

bool wxPdfFontSubsetCff::ReadFontName ( )
protected

Read the font name.

◆ ReadGlobalSubroutines()

bool wxPdfFontSubsetCff::ReadGlobalSubroutines ( )
protected

read the global subroutines

◆ ReadHeader()

bool wxPdfFontSubsetCff::ReadHeader ( )
protected

Read the font header.

◆ ReadInt()

int wxPdfFontSubsetCff::ReadInt ( )
protected

Read an integer from the default font input stream.

◆ ReadOffset()

int wxPdfFontSubsetCff::ReadOffset ( int offSize)
protected

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

◆ ReadOperandLength()

int wxPdfFontSubsetCff::ReadOperandLength ( )
protected

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

◆ ReadOperator()

int wxPdfFontSubsetCff::ReadOperator ( )
protected

Read an operator from the default font input stream.

◆ ReadPrivateDict()

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

Read a private dictionary.

◆ ReadShort()

short wxPdfFontSubsetCff::ReadShort ( )
protected

Read a short integer from the default font input stream.

◆ ReadString()

wxString wxPdfFontSubsetCff::ReadString ( int length)
protected

Read a string from the default font input stream.

◆ ReadStrings()

bool wxPdfFontSubsetCff::ReadStrings ( )
protected

Read the list of strings.

◆ ReadTopDict()

bool wxPdfFontSubsetCff::ReadTopDict ( )
protected

Read the top dictionary.

◆ RemoveDictElement()

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

Remove an element from a dictionary.

◆ SeekI()

void wxPdfFontSubsetCff::SeekI ( int offset)
protected

Seek to offset in the default font input stream.

◆ SeekO()

void wxPdfFontSubsetCff::SeekO ( int offset)
protected

Seek offset in the default output stream.

◆ SetDictElementArgument()

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

Set the argument of a dictionary element.

◆ SetRosStrings()

void wxPdfFontSubsetCff::SetRosStrings ( )
protected

Set the ROS strings.

◆ SetTopDictOperatorToCurrentPosition()

void wxPdfFontSubsetCff::SetTopDictOperatorToCurrentPosition ( int op)
protected

Set a top dictionary operator to the current position.

◆ SubsetCharstrings()

void wxPdfFontSubsetCff::SubsetCharstrings ( )
protected

Build the subset of the charstrings' list.

◆ SubsetDictString()

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

Build the subset of a dictionary string.

◆ SubsetDictStrings()

void wxPdfFontSubsetCff::SubsetDictStrings ( wxPdfCffDictionary * dict)
protected

Build the subset of the strings' dictionary.

◆ SubsetFontDict()

void wxPdfFontSubsetCff::SubsetFontDict ( )
protected

Build the subset of the font dictionary.

◆ SubsetStrings()

void wxPdfFontSubsetCff::SubsetStrings ( )
protected

Build the subset of the strings' list.

◆ SubsetSubrs()

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

Build the subset of the subroutines.

◆ TellI()

int wxPdfFontSubsetCff::TellI ( )
protected

Get the current position in the default font input stream.

◆ TellO()

int wxPdfFontSubsetCff::TellO ( )
protected

Get the current position in the default output stream.

◆ WriteCharset()

void wxPdfFontSubsetCff::WriteCharset ( )
protected

Write the charset.

◆ WriteCharStrings()

void wxPdfFontSubsetCff::WriteCharStrings ( )
protected

Write the list of charstrings.

◆ WriteCidFontDict()

void wxPdfFontSubsetCff::WriteCidFontDict ( )
protected

Write the CID font dictionary.

◆ WriteCidPrivateDictAndLocalSub()

void wxPdfFontSubsetCff::WriteCidPrivateDictAndLocalSub ( )
protected

Write a CID private dictionary and local subroutines.

◆ WriteDict()

void wxPdfFontSubsetCff::WriteDict ( wxPdfCffDictionary * dict)
protected

Write a dictionary.

◆ WriteDictOperator()

void wxPdfFontSubsetCff::WriteDictOperator ( wxPdfCffDictElement * op)
protected

Write a dictionary operator.

◆ WriteFdSelect()

void wxPdfFontSubsetCff::WriteFdSelect ( )
protected

Write the FD selector.

◆ WriteFontSubset()

void wxPdfFontSubsetCff::WriteFontSubset ( )
protected

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

◆ WriteGlobalSubrs()

void wxPdfFontSubsetCff::WriteGlobalSubrs ( )
protected

Write the list of global subroutines.

◆ WriteHeader()

void wxPdfFontSubsetCff::WriteHeader ( )
protected

Write the font header.

◆ WriteIndex()

void wxPdfFontSubsetCff::WriteIndex ( wxPdfCffIndexArray * index)
protected

Write an index.

◆ WriteInteger()

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

Write an integer.

◆ WriteLocalSub()

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

Write the local subroutines.

◆ WriteName()

void wxPdfFontSubsetCff::WriteName ( )
protected

Write the font's name.

◆ WritePrivateDict()

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

Write a private dictionary.

◆ WriteStrings()

void wxPdfFontSubsetCff::WriteStrings ( )
protected

Write the list of strings.

◆ WriteTopDict()

void wxPdfFontSubsetCff::WriteTopDict ( )
protected

Write the top dictionary.


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