int i, unicol = 32/nrow, col = -1, row = 0;
int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
int npages = 0;
+ bool newcol = false;
struct glyph const *sorted[nglyphs], *g;
for (i = 0; i < nglyphs; i++)
printf("%%%%Title: Bedstead Glyph Complement\n");
printf("%%%%LanguageLevel: 2\n");
printf("/xfont /Bedstead findfont 20 scalefont def\n");
+ printf("/nfont /Bedstead findfont 10 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("/centre {\n");
printf(" dup stringwidth pop 2 div neg 0 rmoveto show\n");
printf("} def\n");
+ printf("/label {\n");
+ printf(" lfont setfont centre\n");
+ printf("} def\n");
/* unicode glyphname exemplify -- */
printf("/exemplify {\n");
printf(" xfont setfont dup 14 14 moveto glyphshow\n");
printf(" 0 0 moveto 0 40 lineto 40 40 lineto 40 0 lineto closepath\n");
printf(" 1 setlinewidth stroke\n");
printf("} def\n");
+ printf("/colnum {\n");
+ printf(" nfont setfont 20 42 moveto centre\n");
+ printf("} def\n");
+ printf("/rownums {\n");
+ printf(" nfont setfont 0 1 15 {\n");
+ printf(" dup -40 mul 16.5 add -10 exch moveto\n");
+ printf(" 16 1 string cvrs show\n");
+ printf(" } for\n");
+ printf("} def\n");
printf("/setdistillerparams where\n");
printf("{ pop << /SubsetFonts false >> setdistillerparams } if\n");
printf("%%%%EndProlog\n");
}
unicol = g->unicode / nrow;
row = 0;
+ newcol = true;
}
if (col == -1) {
++npages;
printf("%%%%Page: %d %d\n", npages, npages);
- printf("gsave 20 800 translate\n");
+ printf("gsave 20 700 translate rownums\n");
col = 0;
+ newcol = true;
+ }
+ if (newcol && g->unicode != -1) {
+ printf("gsave %d 0 translate (%03X) colnum grestore\n",
+ col * 40, unicol);
+ newcol = false;
}
printf("gsave %d %d translate ",
(col * 40),