int descent=2; /* font descent wrt baseline */
int startrow; /* row to start glyph */
- int rowlen=4; /* number of digits per row */
+ int rowlen; /* number of digits per row */
unsigned rowout;
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (strncmp (inbuf, "ENCODING ", 9)) continue;
sscanf (&inbuf[9], "%d", &thispoint); /* get code point */
+ while (fgets (inbuf, MAXBUF - 1, stdin)) {
+ if (!strncmp (inbuf, "DWIDTH ", 7)) break;
+ }
+ sscanf (&inbuf[7], "%d", &rowlen);
+ rowlen >>= 2;
+
/* Read bounding box values from BBX line */
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (!strncmp (inbuf, "BBX ", 4)) break;
while (fgets (inbuf, MAXBUF - 1, stdin)) {
if (!strncmp (inbuf, "END", 3)) break;
sscanf (inbuf, "%X", &rowout);
- /* Now force glyph to a 16x16 grid even if they'd fit in 8x16 */
- if (bbxx <= 8) rowout <<= 8; /* shift left for 16x16 glyph */
+ if (rowlen >= 4 && bbxx <= 8) rowout <<= 8; /* force 8x16 input to 16x16 grid */
rowout >>= bbxxoff;
fprintf (stdout, "%0*X", rowlen, rowout);
rownum++;