15 static char encoding
[256];
19 static char *desctoks
[NDESCTOKS
] = {
31 char *spechar
[MAXSPECHARS
];
33 int hash(char *s
, int l
)
44 char token
[MAXTOKENSIZE
];
45 char descfilename
[512];
53 fprintf(ferr
, "readDESC()\n");
54 sprintf(descfilename
, "%s/dev%s/DESC", FONTDIR
, devname
);
55 if ((fd
= open(descfilename
, O_RDONLY
)) < 0) {
56 error(WARNING
, "cannot open file %s\n", descfilename
);
61 while (ustr_str(ustr
, token
, MAXTOKENSIZE
) > 0) {
62 for (i
= 0; i
< NDESCTOKS
; i
++) {
63 if (strcmp(desctoks
[i
], token
) == 0) {
73 fprintf(ferr
, "PDL %s\n", token
);
76 strcpy(encoding
, token
);
77 setencoding(encoding
);
79 fprintf(ferr
, "encoding %s\n", token
);
83 if (!isdigit(*token
)) {
84 error(WARNING
, "readdesc: expecting number of fonts in mount table.\n");
87 fontmnt
= atoi(token
) + 1;
88 for (i
= 0; i
< fontmnt
; i
++)
92 mountfont(++fontindex
, token
);
97 /* I don't really care about sizes */
100 /* device resolution in dots per inch */
101 if (!isdigit(*token
)) {
102 error(WARNING
, "readdesc: expecting device resolution.\n");
105 devres
= atoi(token
);
107 fprintf(ferr
, "res %d\n", devres
);
110 /* I don't really care about horizontal motion resolution */
112 fprintf(ferr
, "ignoring horizontal resolution\n");
115 /* I don't really care about vertical motion resolution */
117 fprintf(ferr
, "ignoring vertical resolution\n");
120 /* unitwidth is the font size at which the character widths are 1:1 */
121 if (!isdigit(*token
)) {
122 error(WARNING
, "readdesc: expecting unitwidth.\n");
125 unitwidth
= atoi(token
);
127 fprintf(ferr
, "unitwidth %d\n", unitwidth
);
130 /* I don't really care about this list of special characters */
132 fprintf(ferr
, "ignoring special character <%s>\n", token
);
138 error(WARNING
, "unknown token %s in DESC file.\n", token
);