summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/xpdf/GlobalParams.h
Unidiff
Diffstat (limited to 'noncore/unsupported/qpdf/xpdf/GlobalParams.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/xpdf/GlobalParams.h49
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
@@ -1,11 +1,11 @@
1//======================================================================== 1//========================================================================
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
9#ifndef GLOBALPARAMS_H 9#ifndef GLOBALPARAMS_H
10#define GLOBALPARAMS_H 10#define GLOBALPARAMS_H
11 11
@@ -42,14 +42,15 @@ enum DisplayFontParamKind {
42 displayFontTT 42 displayFontTT
43}; 43};
44 44
45class DisplayFontParam { 45class DisplayFontParam {
46public: 46public:
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 {
53 GString *xlfd; 54 GString *xlfd;
54 GString *encoding; 55 GString *encoding;
55 } x; 56 } x;
@@ -76,26 +77,34 @@ enum FontRastControl {
76 77
77//------------------------------------------------------------------------ 78//------------------------------------------------------------------------
78 79
79class PSFontParam { 80class PSFontParam {
80public: 81public:
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
89//------------------------------------------------------------------------ 96//------------------------------------------------------------------------
90 97
91enum PSLevel { 98enum 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//------------------------------------------------------------------------
99 108
100enum EndOfLineKind { 109enum EndOfLineKind {
101 eolUnix, // LF 110 eolUnix, // LF
@@ -122,25 +131,30 @@ public:
122 FILE *getCIDToUnicodeFile(GString *collection); 131 FILE *getCIDToUnicodeFile(GString *collection);
123 UnicodeMap *getResidentUnicodeMap(GString *encodingName); 132 UnicodeMap *getResidentUnicodeMap(GString *encodingName);
124 FILE *getUnicodeMapFile(GString *encodingName); 133 FILE *getUnicodeMapFile(GString *encodingName);
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; }
144 GBool getMapNumericCharNames() { return mapNumericCharNames; } 158 GBool getMapNumericCharNames() { return mapNumericCharNames; }
145 GBool getErrQuiet() { return errQuiet; } 159 GBool getErrQuiet() { return errQuiet; }
146 160
@@ -156,35 +170,44 @@ public:
156 void setPSPaperWidth(int width); 170 void setPSPaperWidth(int width);
157 void setPSPaperHeight(int height); 171 void setPSPaperHeight(int height);
158 void setPSDuplex(GBool duplex); 172 void setPSDuplex(GBool duplex);
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
169private: 187private:
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);
188 void parseYesNo(char *cmdName, GBool *flag, 211 void parseYesNo(char *cmdName, GBool *flag,
189 GList *tokens, GString *fileName, int line); 212 GList *tokens, GString *fileName, int line);
190 GBool setFontRastControl(FontRastControl *val, char *s); 213 GBool setFontRastControl(FontRastControl *val, char *s);
@@ -209,27 +232,35 @@ private:
209 // name [GList[GString]] 232 // name [GList[GString]]
210 GList *toUnicodeDirs; // list of ToUnicode CMap dirs [GString] 233 GList *toUnicodeDirs; // list of ToUnicode CMap dirs [GString]
211 GHash *displayFonts; // display font info, indexed by font name 234 GHash *displayFonts; // display font info, indexed by font name
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
218 GBool psDuplex; // enable duplexing in PostScript? 243 GBool psDuplex; // enable duplexing in PostScript?
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;
233 GString *urlCommand; // command executed for URL links 264 GString *urlCommand; // command executed for URL links
234 GBool mapNumericCharNames;// map numeric char names (from font subsets)? 265 GBool mapNumericCharNames;// map numeric char names (from font subsets)?
235 GBool errQuiet; // suppress error messages? 266 GBool errQuiet; // suppress error messages?