Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/GlobalParams.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/GlobalParams.h | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/GlobalParams.h b/noncore/unsupported/qpdf/xpdf/GlobalParams.h index ecbb5fc..b651110 100644 --- a/noncore/unsupported/qpdf/xpdf/GlobalParams.h +++ b/noncore/unsupported/qpdf/xpdf/GlobalParams.h | |||
@@ -2,7 +2,7 @@ | |||
2 | // | 2 | // |
3 | // GlobalParams.h | 3 | // GlobalParams.h |
4 | // | 4 | // |
5 | // Copyright 2001 Derek B. Noonburg | 5 | // Copyright 2001-2002 Glyph & Cog, LLC |
6 | // | 6 | // |
7 | //======================================================================== | 7 | //======================================================================== |
8 | 8 | ||
@@ -45,8 +45,9 @@ enum DisplayFontParamKind { | |||
45 | class DisplayFontParam { | 45 | class DisplayFontParam { |
46 | public: | 46 | public: |
47 | 47 | ||
48 | GString *name; // font name for 8-bit fonts; | 48 | GString *name; // font name for 8-bit fonts and named |
49 | // collection name for CID fonts | 49 | // CID fonts; collection name for |
50 | // generic CID fonts | ||
50 | DisplayFontParamKind kind; | 51 | DisplayFontParamKind kind; |
51 | union { | 52 | union { |
52 | struct { | 53 | struct { |
@@ -79,10 +80,16 @@ enum FontRastControl { | |||
79 | class PSFontParam { | 80 | class PSFontParam { |
80 | public: | 81 | public: |
81 | 82 | ||
82 | GString *pdfFontName; | 83 | GString *pdfFontName; // PDF font name for 8-bit fonts and |
83 | GString *psFontName; | 84 | // named 16-bit fonts; char collection |
85 | // name for generic 16-bit fonts | ||
86 | int wMode; // writing mode (0=horiz, 1=vert) for | ||
87 | // 16-bit fonts | ||
88 | GString *psFontName; // PostScript font name | ||
89 | GString *encoding; // encoding, for 16-bit fonts only | ||
84 | 90 | ||
85 | PSFontParam(GString *pdfFontNameA, GString *psFontNameA); | 91 | PSFontParam(GString *pdfFontNameA, int wModeA, |
92 | GString *psFontNameA, GString *encodingA); | ||
86 | ~PSFontParam(); | 93 | ~PSFontParam(); |
87 | }; | 94 | }; |
88 | 95 | ||
@@ -92,7 +99,9 @@ enum PSLevel { | |||
92 | psLevel1, | 99 | psLevel1, |
93 | psLevel1Sep, | 100 | psLevel1Sep, |
94 | psLevel2, | 101 | psLevel2, |
95 | psLevel2Sep | 102 | psLevel2Sep, |
103 | psLevel3, | ||
104 | psLevel3Sep | ||
96 | }; | 105 | }; |
97 | 106 | ||
98 | //------------------------------------------------------------------------ | 107 | //------------------------------------------------------------------------ |
@@ -125,19 +134,24 @@ public: | |||
125 | FILE *findCMapFile(GString *collection, GString *cMapName); | 134 | FILE *findCMapFile(GString *collection, GString *cMapName); |
126 | FILE *findToUnicodeFile(GString *name); | 135 | FILE *findToUnicodeFile(GString *name); |
127 | DisplayFontParam *getDisplayFont(GString *fontName); | 136 | DisplayFontParam *getDisplayFont(GString *fontName); |
128 | DisplayFontParam *getDisplayCIDFont(GString *collection); | 137 | DisplayFontParam *getDisplayCIDFont(GString *fontName, GString *collection); |
129 | GString *getPSFile() { return psFile; } | 138 | GString *getPSFile() { return psFile; } |
130 | int getPSPaperWidth() { return psPaperWidth; } | 139 | int getPSPaperWidth() { return psPaperWidth; } |
131 | int getPSPaperHeight() { return psPaperHeight; } | 140 | int getPSPaperHeight() { return psPaperHeight; } |
132 | GBool getPSDuplex() { return psDuplex; } | 141 | GBool getPSDuplex() { return psDuplex; } |
133 | PSLevel getPSLevel() { return psLevel; } | 142 | PSLevel getPSLevel() { return psLevel; } |
134 | PSFontParam *getPSFont(GString *fontName); | 143 | PSFontParam *getPSFont(GString *fontName); |
144 | PSFontParam *getPSFont16(GString *fontName, GString *collection, int wMode); | ||
135 | GBool getPSEmbedType1() { return psEmbedType1; } | 145 | GBool getPSEmbedType1() { return psEmbedType1; } |
136 | GBool getPSEmbedTrueType() { return psEmbedTrueType; } | 146 | GBool getPSEmbedTrueType() { return psEmbedTrueType; } |
147 | GBool getPSEmbedCIDPostScript() { return psEmbedCIDPostScript; } | ||
148 | GBool getPSEmbedCIDTrueType() { return psEmbedCIDTrueType; } | ||
137 | GBool getPSOPI() { return psOPI; } | 149 | GBool getPSOPI() { return psOPI; } |
150 | GBool getPSASCIIHex() { return psASCIIHex; } | ||
138 | GString *getTextEncodingName() { return textEncoding; } | 151 | GString *getTextEncodingName() { return textEncoding; } |
139 | EndOfLineKind getTextEOL() { return textEOL; } | 152 | EndOfLineKind getTextEOL() { return textEOL; } |
140 | GString *findFontFile(GString *fontName, char *ext1, char *ext2); | 153 | GString *findFontFile(GString *fontName, char *ext1, char *ext2); |
154 | GString *getInitialZoom() { return initialZoom; } | ||
141 | FontRastControl getT1libControl() { return t1libControl; } | 155 | FontRastControl getT1libControl() { return t1libControl; } |
142 | FontRastControl getFreeTypeControl() { return freetypeControl; } | 156 | FontRastControl getFreeTypeControl() { return freetypeControl; } |
143 | GString *getURLCommand() { return urlCommand; } | 157 | GString *getURLCommand() { return urlCommand; } |
@@ -159,29 +173,38 @@ public: | |||
159 | void setPSLevel(PSLevel level); | 173 | void setPSLevel(PSLevel level); |
160 | void setPSEmbedType1(GBool embed); | 174 | void setPSEmbedType1(GBool embed); |
161 | void setPSEmbedTrueType(GBool embed); | 175 | void setPSEmbedTrueType(GBool embed); |
176 | void setPSEmbedCIDPostScript(GBool embed); | ||
177 | void setPSEmbedCIDTrueType(GBool embed); | ||
162 | void setPSOPI(GBool opi); | 178 | void setPSOPI(GBool opi); |
179 | void setPSASCIIHex(GBool hex); | ||
163 | void setTextEncoding(char *encodingName); | 180 | void setTextEncoding(char *encodingName); |
164 | GBool setTextEOL(char *s); | 181 | GBool setTextEOL(char *s); |
182 | void setInitialZoom(char *s); | ||
165 | GBool setT1libControl(char *s); | 183 | GBool setT1libControl(char *s); |
166 | GBool setFreeTypeControl(char *s); | 184 | GBool setFreeTypeControl(char *s); |
167 | void setErrQuiet(GBool errQuietA); | 185 | void setErrQuiet(GBool errQuietA); |
168 | 186 | ||
169 | private: | 187 | private: |
170 | 188 | ||
189 | void parseFile(GString *fileName, FILE *f); | ||
171 | void parseNameToUnicode(GList *tokens, GString *fileName, int line); | 190 | void parseNameToUnicode(GList *tokens, GString *fileName, int line); |
172 | void parseCIDToUnicode(GList *tokens, GString *fileName, int line); | 191 | void parseCIDToUnicode(GList *tokens, GString *fileName, int line); |
173 | void parseUnicodeMap(GList *tokens, GString *fileName, int line); | 192 | void parseUnicodeMap(GList *tokens, GString *fileName, int line); |
174 | void parseCMapDir(GList *tokens, GString *fileName, int line); | 193 | void parseCMapDir(GList *tokens, GString *fileName, int line); |
175 | void parseToUnicodeDir(GList *tokens, GString *fileName, int line); | 194 | void parseToUnicodeDir(GList *tokens, GString *fileName, int line); |
176 | void parseDisplayFont(GList *tokens, GBool isCID, DisplayFontParamKind kind, | 195 | void parseDisplayFont(GList *tokens, GHash *fontHash, |
196 | DisplayFontParamKind kind, | ||
177 | GString *fileName, int line); | 197 | GString *fileName, int line); |
178 | void parsePSFile(GList *tokens, GString *fileName, int line); | 198 | void parsePSFile(GList *tokens, GString *fileName, int line); |
179 | void parsePSPaperSize(GList *tokens, GString *fileName, int line); | 199 | void parsePSPaperSize(GList *tokens, GString *fileName, int line); |
180 | void parsePSLevel(GList *tokens, GString *fileName, int line); | 200 | void parsePSLevel(GList *tokens, GString *fileName, int line); |
181 | void parsePSFont(GList *tokens, GString *fileName, int line); | 201 | void parsePSFont(GList *tokens, GString *fileName, int line); |
202 | void parsePSFont16(char *cmdName, GList *fontList, | ||
203 | GList *tokens, GString *fileName, int line); | ||
182 | void parseTextEncoding(GList *tokens, GString *fileName, int line); | 204 | void parseTextEncoding(GList *tokens, GString *fileName, int line); |
183 | void parseTextEOL(GList *tokens, GString *fileName, int line); | 205 | void parseTextEOL(GList *tokens, GString *fileName, int line); |
184 | void parseFontDir(GList *tokens, GString *fileName, int line); | 206 | void parseFontDir(GList *tokens, GString *fileName, int line); |
207 | void parseInitialZoom(GList *tokens, GString *fileName, int line); | ||
185 | void parseFontRastControl(char *cmdName, FontRastControl *val, | 208 | void parseFontRastControl(char *cmdName, FontRastControl *val, |
186 | GList *tokens, GString *fileName, int line); | 209 | GList *tokens, GString *fileName, int line); |
187 | void parseURLCommand(GList *tokens, GString *fileName, int line); | 210 | void parseURLCommand(GList *tokens, GString *fileName, int line); |
@@ -212,6 +235,8 @@ private: | |||
212 | // [DisplayFontParam] | 235 | // [DisplayFontParam] |
213 | GHash *displayCIDFonts;// display CID font info, indexed by | 236 | GHash *displayCIDFonts;// display CID font info, indexed by |
214 | // collection [DisplayFontParam] | 237 | // collection [DisplayFontParam] |
238 | GHash *displayNamedCIDFonts;// display CID font info, indexed by | ||
239 | // font name [DisplayFontParam] | ||
215 | GString *psFile; // PostScript file or command (for xpdf) | 240 | GString *psFile; // PostScript file or command (for xpdf) |
216 | int psPaperWidth; // paper size, in PostScript points, for | 241 | int psPaperWidth; // paper size, in PostScript points, for |
217 | int psPaperHeight; // PostScript output | 242 | int psPaperHeight; // PostScript output |
@@ -219,14 +244,20 @@ private: | |||
219 | PSLevel psLevel; // PostScript level to generate | 244 | PSLevel psLevel; // PostScript level to generate |
220 | GHash *psFonts; // PostScript font info, indexed by PDF | 245 | GHash *psFonts; // PostScript font info, indexed by PDF |
221 | // font name [PSFontParam] | 246 | // font name [PSFontParam] |
247 | GList *psNamedFonts16;// named 16-bit fonts [PSFontParam] | ||
248 | GList *psFonts16; // generic 16-bit fonts [PSFontParam] | ||
222 | GBool psEmbedType1; // embed Type 1 fonts? | 249 | GBool psEmbedType1; // embed Type 1 fonts? |
223 | GBool psEmbedTrueType;// embed TrueType fonts? | 250 | GBool psEmbedTrueType;// embed TrueType fonts? |
251 | GBool psEmbedCIDPostScript;// embed CID PostScript fonts? | ||
252 | GBool psEmbedCIDTrueType;// embed CID TrueType fonts? | ||
224 | GBool psOPI; // generate PostScript OPI comments? | 253 | GBool psOPI; // generate PostScript OPI comments? |
254 | GBool psASCIIHex; // use ASCIIHex instead of ASCII85? | ||
225 | GString *textEncoding;// encoding (unicodeMap) to use for text | 255 | GString *textEncoding;// encoding (unicodeMap) to use for text |
226 | // output | 256 | // output |
227 | EndOfLineKind textEOL;// type of EOL marker to use for text | 257 | EndOfLineKind textEOL;// type of EOL marker to use for text |
228 | // output | 258 | // output |
229 | GList *fontDirs; // list of font dirs [GString] | 259 | GList *fontDirs; // list of font dirs [GString] |
260 | GString *initialZoom; // initial zoom level | ||
230 | FontRastControl t1libControl;// t1lib rasterization mode | 261 | FontRastControl t1libControl;// t1lib rasterization mode |
231 | FontRastControl // FreeType rasterization mode | 262 | FontRastControl // FreeType rasterization mode |
232 | freetypeControl; | 263 | freetypeControl; |