wxMaxima
Loading...
Searching...
No Matches
pdffontparsertype1.h
Go to the documentation of this file.
1
2// Name: pdffontparsertype1.h
3// Purpose:
4// Author: Ulrich Telle
5// Created: 2009-05-24
6// Copyright: (c) Ulrich Telle
7// Licence: wxWindows licence
9
11
12#ifndef _PDF_FONT_PARSER_TYPE1_H_
13#define _PDF_FONT_PARSER_TYPE1_H_
14
15// wxWidgets headers
16#include <wx/arrstr.h>
17#include <wx/string.h>
18#include <wx/stream.h>
19
20#if wxUSE_UNICODE
21
22// wxPdfDocument headers
23#include "wx/pdffontdatatype1.h"
25#include "wx/pdffontparser.h"
26
27class wxPdfCffIndexArray;
28
30class WXDLLIMPEXP_PDFDOC wxPdfFontParserType1 : public wxPdfFontParser
31{
32public:
34 wxPdfFontParserType1();
35
37 virtual ~wxPdfFontParserType1();
38
40
45 wxPdfFontData* IdentifyFont(const wxString& fontFileName, int fontIndex);
46
48
55 bool ParseFont(const wxString& fileName, wxInputStream* fontFile, wxInputStream* metricFile, bool onlyNames);
56
58
64 bool LoadFontData(wxPdfFontData* fontData);
65
67
71 bool ReadAFM(wxInputStream& afmFile);
72
74
78 bool ReadPFM(wxInputStream& pfmFile);
79
81
89 bool ReadPFX(wxInputStream* pfxFile, bool onlyNames);
90
91private:
93 wxMemoryOutputStream* ConvertMACtoPFB(wxInputStream* macFontStream);
94
96 bool CheckType1Format(wxInputStream* stream, int& start, int& length);
97
99 bool MetricIsAFM(wxInputStream* stream);
100
102 bool MetricIsPFM(wxInputStream* stream);
103
105 bool ReadPfbTag(wxInputStream* stream, unsigned char& blocktype, int& blocksize);
106
108 void CheckRestrictions(long fsType);
109
111 void SkipComment(wxInputStream* stream);
112
114 void SkipSpaces(wxInputStream* stream);
115
117 void SkipLiteralString(wxInputStream* stream);
118
120 void SkipString(wxInputStream* stream);
121
123 void SkipProcedure(wxInputStream* stream);
124
126 void SkipArray(wxInputStream* stream);
127
129 void SkipToNextToken(wxInputStream* stream);
130
132 wxString GetToken(wxInputStream* stream);
133
135 wxString GetLiteralString(wxInputStream* stream);
136
138 wxString GetArray(wxInputStream* stream);
139
141 bool ParseDict(wxInputStream* stream, int start, int length, bool onlyNames);
142
144 bool IsHexDigit(char digit);
145
147 void DecodeHex(wxInputStream* inStream, wxOutputStream* outStream);
148
150 void DecodeEExec(wxMemoryOutputStream* eexecStream, wxOutputStream* outStream, unsigned short seed, int lenIV);
151
153 bool GetPrivateDict(wxInputStream* stream, int start);
154
156 void ParseFontMatrix(wxInputStream* stream);
157
159 void ParseEncoding(wxInputStream* stream);
160
162 void ParseSubrs(wxInputStream* stream);
163
165 void ParseCharStrings(wxInputStream* stream);
166
168 void ParsePrivate(wxInputStream* stream);
169
171 void ReadBinary(wxInputStream& inStream, int start, int size, wxOutputStream& outStream);
172
173 bool m_skipArray;
174
175 wxPdfFontDescription m_fontDesc;
176 wxPdfFontDataType1* m_fontData;
177 wxArrayString m_encodingVector;
178 wxPdfFontType1GlyphWidthMap* m_glyphWidthMap;
179 int m_missingWidth;
180
181 bool m_embedAllowed;
182 bool m_subsetAllowed;
183
184 wxInputStream* m_privateDict;
185 bool m_isPFB;
186 bool m_privateFound;
187 bool m_fontDirAfterPrivate;
188 wxString m_encoding;
189 long m_lenIV;
190
191 wxPdfCffIndexArray* m_charStringsIndex;
192 wxPdfCffIndexArray* m_subrsIndex;
193};
194
195#endif // wxUSE_UNICODE
196
197#endif
Class representing Type 1 fonts. (For internal use only)
Definition: pdffontdatatype1.h:31
Base class for all fonts. (For internal use only)
Definition: pdffontdata.h:55
Class representing a font description.
Definition: pdffontdescription.h:24
Class representing font parsers.
Definition: pdffontparser.h:25
Definition of font data for Type1 fonts.
Interface of the wxPdfFontDescription class.
Interface of the TrueType/OpenType font parsing support classes.