1 /* PostScript Printer Description (PPD) file parser
3 * See http://www.adobe.com/supportservice/devrelations/PDFS/TN/5003.PPD_Spec_v4.3.pdf
5 * Copyright 1998 Huw D M Davies
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "windef.h" /* HEAP_ZERO_MEMORY */
26 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
41 /* map of page names in ppd file to Windows paper constants */
47 {"10x11", DMPAPER_10X11},
48 {"10x14", DMPAPER_10X14},
49 {"11x17", DMPAPER_11X17}, /* not in Adobe PPD file spec */
50 {"12x11", DMPAPER_12X11},
51 {"15x11", DMPAPER_15X11},
52 {"9x11", DMPAPER_9X11},
55 {"A3.Transverse", DMPAPER_A3_TRANSVERSE},
56 {"A3Extra", DMPAPER_A3_EXTRA},
57 {"A3Extra.Transverse", DMPAPER_A3_EXTRA_TRANSVERSE},
58 {"A3Rotated", DMPAPER_A3_ROTATED},
60 {"A4.Transverse", DMPAPER_A4_TRANSVERSE},
61 {"A4Extra", DMPAPER_A4_EXTRA},
62 {"A4Plus", DMPAPER_A4_PLUS},
63 {"A4Rotated", DMPAPER_A4_ROTATED},
64 {"A4Small", DMPAPER_A4SMALL},
66 {"A5.Transverse", DMPAPER_A5_TRANSVERSE},
67 {"A5Extra", DMPAPER_A5_EXTRA},
68 {"A5Rotated", DMPAPER_A5_ROTATED},
70 {"A6Rotated", DMPAPER_A6_ROTATED},
71 {"ARCHC", DMPAPER_CSHEET},
72 {"ARCHD", DMPAPER_DSHEET},
73 {"ARCHE", DMPAPER_ESHEET},
75 {"B4Rotated", DMPAPER_B4_JIS_ROTATED},
77 {"B5.Transverse", DMPAPER_B5_TRANSVERSE},
78 {"B5Rotated", DMPAPER_B5_JIS_ROTATED},
79 {"B6", DMPAPER_B6_JIS},
80 {"B6Rotated", DMPAPER_B6_JIS_ROTATED},
81 {"C4", DMPAPER_ENV_C4}, /* use EnvC4 */
82 {"C5", DMPAPER_ENV_C5}, /* use EnvC5 */
83 {"C6", DMPAPER_ENV_C6}, /* use EnvC6 */
84 {"Comm10", DMPAPER_ENV_10}, /* use Env10 */
85 {"DL", DMPAPER_ENV_DL}, /* use EnvDL */
86 {"DoublePostcard", DMPAPER_DBL_JAPANESE_POSTCARD},
87 {"DoublePostcardRotated", DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED},
88 {"Env10", DMPAPER_ENV_10},
89 {"Env11", DMPAPER_ENV_11},
90 {"Env12", DMPAPER_ENV_12},
91 {"Env14", DMPAPER_ENV_14},
92 {"Env9", DMPAPER_ENV_9},
93 {"EnvC3", DMPAPER_ENV_C3},
94 {"EnvC4", DMPAPER_ENV_C4},
95 {"EnvC5", DMPAPER_ENV_C5},
96 {"EnvC6", DMPAPER_ENV_C6},
97 {"EnvC65", DMPAPER_ENV_C65},
98 {"EnvChou3", DMPAPER_JENV_CHOU3},
99 {"EnvChou3Rotated", DMPAPER_JENV_CHOU3_ROTATED},
100 {"EnvChou4", DMPAPER_JENV_CHOU4},
101 {"EnvChou4Rotated", DMPAPER_JENV_CHOU4_ROTATED},
102 {"EnvDL", DMPAPER_ENV_DL},
103 {"EnvISOB4", DMPAPER_ENV_B4},
104 {"EnvISOB5", DMPAPER_ENV_B5},
105 {"EnvISOB6", DMPAPER_ENV_B6},
106 {"EnvInvite", DMPAPER_ENV_INVITE},
107 {"EnvItalian", DMPAPER_ENV_ITALY},
108 {"EnvKaku2", DMPAPER_JENV_KAKU2},
109 {"EnvKaku2Rotated", DMPAPER_JENV_KAKU2_ROTATED},
110 {"EnvKaku3", DMPAPER_JENV_KAKU3},
111 {"EnvKaku3Rotated", DMPAPER_JENV_KAKU3_ROTATED},
112 {"EnvMonarch", DMPAPER_ENV_MONARCH},
113 {"EnvPRC1", DMPAPER_PENV_1},
114 {"EnvPRC10", DMPAPER_PENV_10},
115 {"EnvPRC10Rotated", DMPAPER_PENV_10_ROTATED},
116 {"EnvPRC1Rotated", DMPAPER_PENV_1_ROTATED},
117 {"EnvPRC2", DMPAPER_PENV_2},
118 {"EnvPRC2Rotated", DMPAPER_PENV_2_ROTATED},
119 {"EnvPRC3", DMPAPER_PENV_3},
120 {"EnvPRC3Rotated", DMPAPER_PENV_3_ROTATED},
121 {"EnvPRC4", DMPAPER_PENV_4},
122 {"EnvPRC4Rotated", DMPAPER_PENV_4_ROTATED},
123 {"EnvPRC5", DMPAPER_PENV_5},
124 {"EnvPRC5Rotated", DMPAPER_PENV_5_ROTATED},
125 {"EnvPRC6", DMPAPER_PENV_6},
126 {"EnvPRC6Rotated", DMPAPER_PENV_6_ROTATED},
127 {"EnvPRC7", DMPAPER_PENV_7},
128 {"EnvPRC7Rotated", DMPAPER_PENV_7_ROTATED},
129 {"EnvPRC8", DMPAPER_PENV_8},
130 {"EnvPRC8Rotated", DMPAPER_PENV_8_ROTATED},
131 {"EnvPRC9", DMPAPER_PENV_9},
132 {"EnvPRC9Rotated", DMPAPER_PENV_9_ROTATED},
133 {"EnvPersonal", DMPAPER_ENV_PERSONAL},
134 {"EnvYou4", DMPAPER_JENV_YOU4},
135 {"EnvYou4Rotated", DMPAPER_JENV_YOU4_ROTATED},
136 {"Executive", DMPAPER_EXECUTIVE},
137 {"FanFoldGerman", DMPAPER_FANFOLD_STD_GERMAN},
138 {"FanFoldGermanLegal", DMPAPER_FANFOLD_LGL_GERMAN},
139 {"FanFoldUS", DMPAPER_FANFOLD_US},
140 {"Folio", DMPAPER_FOLIO},
141 {"ISOB4", DMPAPER_ISO_B4},
142 {"ISOB5Extra", DMPAPER_B5_EXTRA},
143 {"Ledger", DMPAPER_LEDGER},
144 {"Legal", DMPAPER_LEGAL},
145 {"LegalExtra", DMPAPER_LEGAL_EXTRA},
146 {"Letter", DMPAPER_LETTER},
147 {"Letter.Transverse", DMPAPER_LETTER_TRANSVERSE},
148 {"LetterExtra", DMPAPER_LETTER_EXTRA},
149 {"LetterExtra.Transverse", DMPAPER_LETTER_EXTRA_TRANSVERSE},
150 {"LetterPlus", DMPAPER_LETTER_PLUS},
151 {"LetterRotated", DMPAPER_LETTER_ROTATED},
152 {"LetterSmall", DMPAPER_LETTERSMALL},
153 {"Monarch", DMPAPER_ENV_MONARCH}, /* use EnvMonarch */
154 {"Note", DMPAPER_NOTE},
155 {"PRC16K", DMPAPER_P16K},
156 {"PRC16KRotated", DMPAPER_P16K_ROTATED},
157 {"PRC32K", DMPAPER_P32K},
158 {"PRC32KBig", DMPAPER_P32KBIG},
159 {"PRC32KBigRotated", DMPAPER_P32KBIG_ROTATED},
160 {"PRC32KRotated", DMPAPER_P32K_ROTATED},
161 {"Postcard", DMPAPER_JAPANESE_POSTCARD},
162 {"PostcardRotated", DMPAPER_JAPANESE_POSTCARD_ROTATED},
163 {"Quarto", DMPAPER_QUARTO},
164 {"Statement", DMPAPER_STATEMENT},
165 {"SuperA", DMPAPER_A_PLUS},
166 {"SuperB", DMPAPER_B_PLUS},
167 {"Tabloid", DMPAPER_TABLOID},
168 {"TabloidExtra", DMPAPER_TABLOID_EXTRA},
172 static WORD UserPageType = DMPAPER_USER;
173 static WORD UserBinType = DMBIN_USER;
175 /***********************************************************************
179 * Copies str into a newly allocated string from the process heap subsituting
180 * hex strings enclosed in '<' and '>' for their byte codes.
183 static char *PSDRV_PPDDecodeHex(char *str)
185 char *buf, *in, *out;
188 buf = HeapAlloc(PSDRV_Heap, 0, strlen(str) + 1);
192 for(in = str, out = buf; *in; in++) {
203 else if(isspace(*in))
207 if(!isxdigit(*in) || !isxdigit(*(in + 1))) {
208 ERR("Invalid hex char in hex string\n");
209 HeapFree(PSDRV_Heap, 0, buf);
213 for(i = 0; i < 2; i++) {
214 if(isdigit(*(in + i)))
215 *out |= (*(in + i) - '0') << ((1-i) * 4);
217 *out |= (toupper(*(in + i)) - 'A' + 10) << ((1-i) * 4);
229 /***********************************************************************
231 * PSDRV_PPDGetTransValue
234 static BOOL PSDRV_PPDGetTransValue(char *start, PPDTuple *tuple)
238 end = strpbrk(start, "\r\n");
239 if(end == start) return FALSE;
240 if(!end) end = start + strlen(start);
241 buf = HeapAlloc( PSDRV_Heap, 0, end - start + 1 );
242 memcpy(buf, start, end - start);
243 *(buf + (end - start)) = '\0';
244 tuple->valtrans = PSDRV_PPDDecodeHex(buf);
245 HeapFree( PSDRV_Heap, 0, buf );
250 /***********************************************************************
252 * PSDRV_PPDGetInvocationValue
254 * Passed string that should be surrounded by `"'s, return string alloced
257 static BOOL PSDRV_PPDGetInvocationValue(FILE *fp, char *pos, PPDTuple *tuple)
259 char *start, *end, *buf;
264 buf = HeapAlloc( PSDRV_Heap, 0, strlen(start) + 1 );
267 end = strchr(start, '"');
269 buf = HeapReAlloc( PSDRV_Heap, 0, buf,
270 len + (end - start) + 1 );
271 memcpy(buf + len, start, end - start);
272 *(buf + len + (end - start)) = '\0';
274 start = strchr(end, '/');
276 return PSDRV_PPDGetTransValue(start + 1, tuple);
279 int sl = strlen(start);
280 buf = HeapReAlloc( PSDRV_Heap, 0, buf, len + sl + 1 );
281 strcpy(buf + len, start);
284 } while( fgets((start = line), sizeof(line), fp) );
287 HeapFree( PSDRV_Heap, 0, buf );
292 /***********************************************************************
294 * PSDRV_PPDGetQuotedValue
296 * Passed string that should be surrounded by `"'s. Expand <xx> as hex
297 * return string alloced from process heap.
299 static BOOL PSDRV_PPDGetQuotedValue(FILE *fp, char *pos, PPDTuple *tuple)
303 if(!PSDRV_PPDGetInvocationValue(fp, pos, tuple))
305 buf = PSDRV_PPDDecodeHex(tuple->value);
306 HeapFree(PSDRV_Heap, 0, tuple->value);
312 /***********************************************************************
314 * PSDRV_PPDGetStringValue
316 * Just strip leading white space.
318 static BOOL PSDRV_PPDGetStringValue(char *str, PPDTuple *tuple)
320 char *start = str, *end;
322 while(*start != '\0' && isspace(*start))
325 end = strpbrk(start, "/\r\n");
326 if(!end) end = start + strlen(start);
327 tuple->value = HeapAlloc( PSDRV_Heap, 0, (end - start) + 1 );
328 memcpy(tuple->value, start, end - start);
329 *(tuple->value + (end - start)) = '\0';
331 PSDRV_PPDGetTransValue(end + 1, tuple);
336 /***********************************************************************
338 * PSDRV_PPDSymbolValue
340 * Not implemented yet.
342 static BOOL PSDRV_PPDGetSymbolValue(char *pos, PPDTuple *tuple)
349 /*********************************************************************
351 * PSDRV_PPDGetNextTuple
353 * Gets the next Keyword Option Value tuple from the file. Allocs space off
354 * the process heap which should be free()ed by the caller if not needed.
356 static BOOL PSDRV_PPDGetNextTuple(FILE *fp, PPDTuple *tuple)
358 char line[257], *opt, *cp, *trans, *endkey;
365 memset(tuple, 0, sizeof(*tuple));
368 if(!fgets(line, sizeof(line), fp))
370 if(line[0] == '*' && line[1] != '%' && strncmp(line, "*End", 4))
374 if(line[strlen(line)-1] != '\n') {
375 ERR("Line too long.\n");
379 for(cp = line; !isspace(*cp) && *cp != ':'; cp++)
383 if(*cp == ':') { /* <key>: */
388 if(*cp == ':') { /* <key> : */
390 } else { /* <key> <option> */
395 tuple->key = HeapAlloc( PSDRV_Heap, 0, endkey - line + 1 );
396 if(!tuple->key) return FALSE;
398 memcpy(tuple->key, line, endkey - line);
399 tuple->key[endkey - line] = '\0';
401 if(gotoption) { /* opt points to 1st non-space character of the option */
402 cp = strpbrk(opt, ":/");
404 ERR("Error in line '%s'?\n", line);
405 HeapFree(GetProcessHeap(), 0, tuple->key);
408 tuple->option = HeapAlloc( PSDRV_Heap, 0, cp - opt + 1 );
409 if(!tuple->option) return FALSE;
410 memcpy(tuple->option, opt, cp - opt);
411 tuple->option[cp - opt] = '\0';
415 cp = strchr(trans, ':');
417 ERR("Error in line '%s'?\n", line);
418 HeapFree(GetProcessHeap(), 0, tuple->option);
419 HeapFree(GetProcessHeap(), 0, tuple->key);
422 buf = HeapAlloc( PSDRV_Heap, 0, cp - trans + 1 );
423 if(!buf) return FALSE;
424 memcpy(buf, trans, cp - trans);
425 buf[cp - trans] = '\0';
426 tuple->opttrans = PSDRV_PPDDecodeHex(buf);
427 HeapFree( PSDRV_Heap, 0, buf );
431 /* cp should point to a ':', so we increment past it */
439 if( (!gotoption && strncmp(tuple->key, "*?", 2) ) ||
440 !strncmp(tuple->key, "*JCL", 4))
441 PSDRV_PPDGetQuotedValue(fp, cp, tuple);
443 PSDRV_PPDGetInvocationValue(fp, cp, tuple);
447 PSDRV_PPDGetSymbolValue(cp, tuple);
451 PSDRV_PPDGetStringValue(cp, tuple);
456 /*********************************************************************
458 * PSDRV_PPDGetPageSizeInfo
460 * Searches ppd PageSize list to return entry matching name or creates new
461 * entry which is appended to the list if name is not found.
464 PAGESIZE *PSDRV_PPDGetPageSizeInfo(PPD *ppd, char *name)
466 PAGESIZE *page = ppd->PageSizes, *lastpage;
469 page = ppd->PageSizes = HeapAlloc( PSDRV_Heap,
470 HEAP_ZERO_MEMORY, sizeof(*page) );
473 for( ; page; page = page->next) {
474 if(!strcmp(page->Name, name))
479 lastpage->next = HeapAlloc( PSDRV_Heap,
480 HEAP_ZERO_MEMORY, sizeof(*page) );
481 return lastpage->next;
485 /**********************************************************************
489 * Returns ptr alloced from heap to first word in str. Strips leading spaces.
490 * Puts ptr to next word in next
492 static char *PSDRV_PPDGetWord(char *str, char **next)
494 char *start, *end, *ret;
497 while(start && *start && isspace(*start))
499 if(!start || !*start) return FALSE;
502 while(*end && !isspace(*end))
505 ret = HeapAlloc( PSDRV_Heap, 0, end - start + 1 );
506 memcpy(ret, start, end - start );
507 *(ret + (end - start)) = '\0';
509 while(*end && isspace(*end))
519 /*******************************************************************************
523 static INT PSDRV_AddSlot(PPD *ppd, LPSTR szName, LPSTR szFullName,
524 LPSTR szInvocationString, WORD wWinBin)
526 INPUTSLOT *slot, **insert = &ppd->InputSlots;
529 insert = &((*insert)->next);
531 slot = *insert = HeapAlloc(PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(INPUTSLOT));
534 ERR("Failed to allocate %i bytes of memory\n", sizeof(INPUTSLOT));
539 slot->FullName = szFullName;
540 slot->InvocationString = szInvocationString;
541 slot->WinBin = wWinBin;
546 /***********************************************************************
552 PPD *PSDRV_ParsePPD(char *fname)
557 char *default_pagesize = NULL;
559 TRACE("file '%s'\n", fname);
561 if((fp = fopen(fname, "r")) == NULL) {
562 WARN("Couldn't open ppd file '%s'\n", fname);
566 ppd = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY, sizeof(*ppd));
568 ERR("Unable to allocate memory for ppd\n");
574 * The Windows PostScript drivers create the following "virtual bin" for
575 * every PostScript printer
577 if (PSDRV_AddSlot(ppd, NULL, "Automatically Select", NULL,
580 HeapFree (PSDRV_Heap, 0, ppd);
585 while( PSDRV_PPDGetNextTuple(fp, &tuple)) {
587 if(!strcmp("*NickName", tuple.key)) {
588 ppd->NickName = tuple.value;
590 TRACE("NickName = '%s'\n", ppd->NickName);
593 else if(!strcmp("*LanguageLevel", tuple.key)) {
594 sscanf(tuple.value, "%d", &(ppd->LanguageLevel));
595 TRACE("LanguageLevel = %d\n", ppd->LanguageLevel);
598 else if(!strcmp("*ColorDevice", tuple.key)) {
599 if(!strcasecmp(tuple.value, "true"))
600 ppd->ColorDevice = TRUE;
601 TRACE("ColorDevice = %d\n", (int)ppd->ColorDevice);
604 else if((!strcmp("*DefaultResolution", tuple.key)) ||
605 (!strcmp("*DefaultJCLResolution", tuple.key))) {
606 sscanf(tuple.value, "%d", &(ppd->DefaultResolution));
607 TRACE("DefaultResolution = %d\n", ppd->DefaultResolution);
610 else if(!strcmp("*Font", tuple.key)) {
613 for(fn = ppd->InstalledFonts; fn && fn->next; fn = fn->next)
616 ppd->InstalledFonts = HeapAlloc(PSDRV_Heap,
617 HEAP_ZERO_MEMORY, sizeof(*fn));
618 fn = ppd->InstalledFonts;
620 fn->next = HeapAlloc(PSDRV_Heap,
621 HEAP_ZERO_MEMORY, sizeof(*fn));
624 fn->Name = tuple.option;
628 else if(!strcmp("*DefaultFont", tuple.key)) {
629 ppd->DefaultFont = tuple.value;
633 else if(!strcmp("*JCLBegin", tuple.key)) {
634 ppd->JCLBegin = tuple.value;
638 else if(!strcmp("*JCLToPSInterpreter", tuple.key)) {
639 ppd->JCLToPSInterpreter = tuple.value;
643 else if(!strcmp("*JCLEnd", tuple.key)) {
644 ppd->JCLEnd = tuple.value;
648 else if(!strcmp("*PageSize", tuple.key)) {
650 page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option);
655 page->Name = tuple.option;
658 for(i = 0; PageTrans[i].PSName; i++) {
659 if(!strcmp(PageTrans[i].PSName, page->Name)) { /* case ? */
660 page->WinPage = PageTrans[i].WinPage;
665 TRACE("Can't find Windows page type for '%s' - using %u\n",
666 page->Name, UserPageType);
667 page->WinPage = UserPageType++;
670 if(!page->FullName) {
672 page->FullName = tuple.opttrans;
673 tuple.opttrans = NULL;
676 page->FullName = HeapAlloc( PSDRV_Heap, 0, strlen(page->Name)+1 );
677 strcpy( page->FullName, page->Name );
680 if(!page->InvocationString) {
681 page->InvocationString = tuple.value;
686 else if(!strcmp("*DefaultPageSize", tuple.key)) {
687 if(default_pagesize) {
688 WARN("Already set default pagesize\n");
690 default_pagesize = tuple.value;
695 else if(!strcmp("*ImageableArea", tuple.key)) {
697 page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option);
700 page->Name = tuple.option;
703 if(!page->FullName) {
704 page->FullName = tuple.opttrans;
705 tuple.opttrans = NULL;
708 #define PIA page->ImageableArea
710 PIA = HeapAlloc( PSDRV_Heap, 0, sizeof(*PIA) );
711 sscanf(tuple.value, "%f%f%f%f", &PIA->llx, &PIA->lly,
712 &PIA->urx, &PIA->ury);
718 else if(!strcmp("*PaperDimension", tuple.key)) {
720 page = PSDRV_PPDGetPageSizeInfo(ppd, tuple.option);
723 page->Name = tuple.option;
726 if(!page->FullName) {
727 page->FullName = tuple.opttrans;
728 tuple.opttrans = NULL;
731 #define PD page->PaperDimension
733 PD = HeapAlloc( PSDRV_Heap, 0, sizeof(*PD) );
734 sscanf(tuple.value, "%f%f", &PD->x, &PD->y);
739 else if(!strcmp("*LandscapeOrientation", tuple.key)) {
740 if(!strcmp(tuple.value, "Plus90"))
741 ppd->LandscapeOrientation = 90;
742 else if(!strcmp(tuple.value, "Minus90"))
743 ppd->LandscapeOrientation = -90;
745 /* anything else, namely 'any', leaves value at 0 */
747 TRACE("LandscapeOrientation = %d\n",
748 ppd->LandscapeOrientation);
751 else if(!strcmp("*UIConstraints", tuple.key)) {
753 CONSTRAINT *con, **insert = &ppd->Constraints;
756 insert = &((*insert)->next);
758 con = *insert = HeapAlloc( PSDRV_Heap, HEAP_ZERO_MEMORY,
763 con->Feature1 = PSDRV_PPDGetWord(start, &start);
764 con->Value1 = PSDRV_PPDGetWord(start, &start);
765 con->Feature2 = PSDRV_PPDGetWord(start, &start);
766 con->Value2 = PSDRV_PPDGetWord(start, &start);
769 else if (!strcmp("*InputSlot", tuple.key))
773 tuple.opttrans = tuple.option;
775 TRACE("Using Windows bin type %u for '%s'\n", UserBinType,
778 /* FIXME - should check for failure */
779 PSDRV_AddSlot(ppd, tuple.option, tuple.opttrans, tuple.value,
782 tuple.option = tuple.opttrans = tuple.value = NULL;
786 * Windows treats "manual feed" as another paper source. Most PPD
787 * files, however, treat it as a separate option which is either on or
790 else if (!strcmp("*ManualFeed", tuple.key) && tuple.option &&
791 !strcmp ("True", tuple.option))
793 /* FIXME - should check for failure */
794 PSDRV_AddSlot(ppd, "Manual Feed", "Manual Feed", tuple.value, DMBIN_MANUAL);
798 else if(!strcmp("*TTRasterizer", tuple.key)) {
799 if(!strcasecmp("None", tuple.value))
800 ppd->TTRasterizer = RO_None;
801 else if(!strcasecmp("Accept68K", tuple.value))
802 ppd->TTRasterizer = RO_Accept68K;
803 else if(!strcasecmp("Type42", tuple.value))
804 ppd->TTRasterizer = RO_Type42;
805 else if(!strcasecmp("TrueImage", tuple.value))
806 ppd->TTRasterizer = RO_TrueImage;
808 FIXME("Unknown option %s for *TTRasterizer\n",
810 ppd->TTRasterizer = RO_None;
812 TRACE("*TTRasterizer = %d\n", ppd->TTRasterizer);
815 if(tuple.key) HeapFree(PSDRV_Heap, 0, tuple.key);
816 if(tuple.option) HeapFree(PSDRV_Heap, 0, tuple.option);
817 if(tuple.value) HeapFree(PSDRV_Heap, 0, tuple.value);
818 if(tuple.opttrans) HeapFree(PSDRV_Heap, 0, tuple.opttrans);
819 if(tuple.valtrans) HeapFree(PSDRV_Heap, 0, tuple.valtrans);
824 ppd->DefaultPageSize = NULL;
825 if(default_pagesize) {
827 for(page = ppd->PageSizes; page; page = page->next) {
828 if(!strcmp(page->Name, default_pagesize)) {
829 ppd->DefaultPageSize = page;
830 TRACE("DefaultPageSize: %s\n", page->Name);
834 HeapFree(PSDRV_Heap, 0, default_pagesize);
836 if(!ppd->DefaultPageSize) {
837 ppd->DefaultPageSize = ppd->PageSizes;
838 TRACE("Setting DefaultPageSize to first in list\n");
847 OPTIONENTRY *optionEntry;
849 for(fn = ppd->InstalledFonts; fn; fn = fn->next)
850 TRACE("'%s'\n", fn->Name);
852 for(page = ppd->PageSizes; page; page = page->next) {
853 TRACE("'%s' aka '%s' (%d) invoked by '%s'\n", page->Name,
854 page->FullName, page->WinPage, page->InvocationString);
855 if(page->ImageableArea)
856 TRACE("Area = %.2f,%.2f - %.2f, %.2f\n",
857 page->ImageableArea->llx, page->ImageableArea->lly,
858 page->ImageableArea->urx, page->ImageableArea->ury);
859 if(page->PaperDimension)
860 TRACE("Dimension = %.2f x %.2f\n",
861 page->PaperDimension->x, page->PaperDimension->y);
864 for(con = ppd->Constraints; con; con = con->next)
865 TRACE("CONSTRAINTS@ %s %s %s %s\n", con->Feature1,
866 con->Value1, con->Feature2, con->Value2);
868 for(option = ppd->InstalledOptions; option; option = option->next) {
869 TRACE("OPTION: %s %s %s\n", option->OptionName,
870 option->FullName, option->DefaultOption);
871 for(optionEntry = option->Options; optionEntry;
872 optionEntry = optionEntry->next)
873 TRACE("\tOPTIONENTRY: %s %s %s\n", optionEntry->Name,
874 optionEntry->FullName, optionEntry->InvocationString);
877 for(slot = ppd->InputSlots; slot; slot = slot->next)
878 TRACE("INPUTSLOTS '%s' Name '%s' (%d) Invocation '%s'\n",
879 slot->Name, slot->FullName, slot->WinBin,
880 slot->InvocationString);