glyph_complement()
{
int i;
- char uni[10];
int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
printf("%%!\n");
printf("/xfont /Bedstead findfont 20 scalefont def\n");
printf("/lfont /Bedstead findfont 4 scalefont def\n");
printf("/str 50 string def\n");
+ printf("/label {\n");
+ printf(" lfont setfont\n");
+ printf(" dup stringwidth pop 2 div neg 0 rmoveto show\n");
+ printf("} def\n");
/* unicode glyphname exemplify -- */
printf("/exemplify {\n");
- printf(" xfont setfont dup 10 14 moveto glyphshow\n");
- printf(" lfont setfont 10 36 moveto str cvs show\n");
- printf(" dup -1 eq { pop } { 10 2 moveto (U+) show 16 str cvrs\n");
- printf(" dup length 1 3 { pop (0) show } for show } ifelse\n");
+ printf(" xfont setfont dup 14 14 moveto glyphshow\n");
+ printf(" 0.1 setlinewidth\n");
+ printf(" 14 10 moveto 14 30 lineto 26 30 lineto 26 10 lineto\n");
+ printf(" closepath stroke\n");
+ printf(" 20 36 moveto str cvs label\n");
+ printf(" 20 2 moveto label\n");
printf(" 0 0 moveto 0 40 lineto 40 40 lineto 40 0 lineto closepath\n");
printf(" 1 setlinewidth stroke\n");
printf("} def\n");
for (i = 0; i < nglyphs; i++) {
- if (glyphs[i].name == NULL)
- sprintf(uni, "uni%04X", glyphs[i].unicode);
- printf("gsave %d %d translate 0 0 moveto "
- "%d /%s exemplify grestore\n",
- 20 + ((i/20) * 40),
- 800 - ((i%20) * 40), glyphs[i].unicode,
- glyphs[i].name ? glyphs[i].name : uni);
+ printf("gsave %d %d translate 0 0 moveto ",
+ 20 + (((i%240)/20) * 40), 800 - ((i%20) * 40));
+ if (glyphs[i].unicode != -1)
+ printf("(U+%04X)", glyphs[i].unicode);
+ else
+ printf("()");
+ if (glyphs[i].name != NULL)
+ printf("/%s ", glyphs[i].name);
+ else
+ printf("/uni%04X ", glyphs[i].unicode);
+ printf("exemplify grestore\n");
+ if (i % 240 == 239) printf("showpage\n");
}
printf("showpage\n");
}