int i;
int const nrow = 20, ncol=12;
int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
+ int npages = 0;
struct glyph const *sorted[nglyphs], *g;
for (i = 0; i < nglyphs; i++)
sorted[i] = &glyphs[i];
qsort(sorted, nglyphs, sizeof(sorted[0]), &byunicode);
- printf("%%!\n");
+ printf("%%!PS-Adobe\n");
+ printf("%%%%Creator: bedstead\n");
+ printf("%%%%Title: Bedstead Glyph Complement\n");
printf("/xfont /Bedstead findfont 20 scalefont def\n");
printf("/lfont /Bedstead findfont 4 scalefont def\n");
printf("/str 50 string def\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("%%%%EndProlog\n");
for (i = 0; i < nglyphs; i++) {
+ if (i % (nrow*ncol) == 0) {
+ ++npages;
+ printf("%%%%Page: %d %d\n", npages, npages);
+ }
g = sorted[i];
printf("gsave %d %d translate 0 0 moveto ",
20 + (((i%(nrow*ncol)/nrow) * 40)),
else
printf("/uni%04X ", g->unicode);
printf("exemplify grestore\n");
- if (i % (nrow*ncol) == (nrow*ncol)-1)
+ if (i % (nrow*ncol) == (nrow*ncol)-1)
printf("showpage\n");
}
printf("showpage\n");
+ printf("%%%%EOF\n");
}