12#ifndef _PDF_FONT_SUBSET_CFF_H_
13#define _PDF_FONT_SUBSET_CFF_H_
16#include <wx/dynarray.h>
17#include <wx/mstream.h>
19#include <wx/wfstream.h>
29class wxPdfCffIndexArray;
31WX_DECLARE_HASH_MAP(
long,
wxPdfCffDictElement*, wxIntegerHash, wxIntegerEqual, wxPdfCffDictionary);
48 void DestructDictionary(wxPdfCffDictionary* dict);
57 wxMemoryOutputStream* CreateSubset(wxInputStream* inFont,
58 wxPdfChar2GlyphMap* glyphsUsed,
59 bool includeCmap =
false);
78 bool ReadGlobalSubroutines();
81 bool ReadFontIndex(wxPdfCffIndexArray* index);
84 bool ReadFontDict(wxPdfCffDictionary* dict,
int dictOffset,
int dictSize);
90 bool ReadCidFontDict();
93 bool ReadPrivateDict(wxPdfCffDictionary* privateDict, wxPdfCffIndexArray* localSubIndex,
int offset,
int size);
99 void SetDictElementArgument(wxPdfCffDictionary* dict,
int key, wxMemoryOutputStream& buffer);
102 void RemoveDictElement(wxPdfCffDictionary* dict,
int key);
108 void EncodeIntegerMax(
int value, wxMemoryOutputStream& buffer);
111 void EncodeInteger(
int value, wxMemoryOutputStream& buffer);
114 void SeekI(
int offset);
123 unsigned char ReadByte();
132 int ReadOffset(
int offSize);
135 int ReadOperandLength();
141 wxString ReadString(
int length);
144 void GenerateFontSubset();
147 void SetRosStrings();
150 void SubsetCharstrings();
153 void SubsetFontDict();
156 void CreateCidFontDict();
159 void SubsetStrings();
162 void SubsetDictString(wxPdfCffDictionary* dict,
int op);
165 void SubsetDictStrings(wxPdfCffDictionary* dict);
168 void SeekO(
int offset);
174 void WriteFontSubset();
186 void WriteDict(wxPdfCffDictionary* dict);
192 void SetTopDictOperatorToCurrentPosition(
int op);
195 int GetLocation(wxPdfCffDictionary* dict,
int op);
201 void WriteGlobalSubrs();
207 void WriteFdSelect();
210 void WriteCharStrings();
213 void WriteCidFontDict();
216 void WriteCidPrivateDictAndLocalSub();
219 void WritePrivateDict(
int dictNum, wxPdfCffDictionary* parentDict, wxPdfCffDictionary* privateDict);
222 void WriteLocalSub(
int dictNum, wxPdfCffDictionary* privateDict, wxPdfCffIndexArray* localSubIndex);
225 void WriteIndex(wxPdfCffIndexArray* index);
228 void WriteInteger(
int value,
int size, wxMemoryOutputStream* buffer);
231 void FindLocalAndGlobalSubrsUsed();
234 void SubsetSubrs(wxPdfCffIndexArray& subrIndex, wxPdfSortedArrayInt& subrsUsed);
237 void FindSubrsUsed(
int fd, wxPdfCffIndexArray& localSubIndex,
238 wxPdfSortedArrayInt& hSubrsUsed, wxArrayInt& lSubrsUsed);
241 void FindGlobalSubrsUsed();
245 wxInputStream* m_inFont;
246 wxMemoryOutputStream* m_outFont;
251 wxArrayInt m_usedGlyphs;
255 wxPdfCffDictionary* m_topDict;
256 wxPdfCffDictionary* m_privateDict;
258 wxPdfCffIndexArray* m_stringsIndex;
259 wxPdfCffIndexArray* m_charstringsIndex;
260 wxPdfCffIndexArray* m_globalSubrIndex;
261 wxPdfCffIndexArray* m_localSubrIndex;
263 wxPdfCffIndexArray* m_stringsSubsetIndex;
264 wxPdfCffIndexArray* m_charstringsSubsetIndex;
266 wxArrayInt m_fdSelect;
273 wxArrayPtrVoid m_fdDict;
274 wxArrayPtrVoid m_fdPrivateDict;
275 wxArrayPtrVoid m_fdLocalSubrIndex;
277 wxArrayInt m_fdSelectSubset;
278 int m_numSubsetFontDicts;
279 wxArrayInt m_fdSubsetMap;
280 wxArrayInt m_privateDictOffset;
284 wxPdfSortedArrayInt* m_hGlobalSubrsUsed;
285 wxArrayInt m_lGlobalSubrsUsed;
286 wxPdfSortedArrayInt* m_hLocalSubrsUsed;
287 wxArrayInt m_lLocalSubrsUsed;
Class representing CFF decoder for charstrings of type 1 and 2. (For internal use only)
Definition: pdfcffdecoder.h:35
Definition: pdffontsubsetcff.cpp:80
Definition: pdfcffdecoder.cpp:197
Class representing OpenType Font Subsets. (For internal use only)
Definition: pdffontsubsetcff.h:36
Compile time switches for the wxPdfDocument component.