static void
glyph_complement()
{
- int i;
- int const nrow = 20, ncol=12;
+ int const nrow = 16, ncol=12;
+ int i, unicol = 32/nrow, col = -1, row = 0;
int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
int npages = 0;
struct glyph const *sorted[nglyphs], *g;
printf("{ pop << /SubsetFonts false >> setdistillerparams } if\n");
printf("%%%%EndProlog\n");
for (i = 0; i < nglyphs; i++) {
- if (i % (nrow*ncol) == 0) {
+ g = sorted[i];
+ if (g->unicode / nrow != unicol ||
+ (g->unicode == -1 && row == nrow)) {
+ if (++col == ncol) {
+ printf("grestore showpage\n");
+ col = -1;
+ }
+ unicol = g->unicode / nrow;
+ row = 0;
+ }
+ if (col == -1) {
++npages;
printf("%%%%Page: %d %d\n", npages, npages);
+ printf("gsave 20 800 translate\n");
+ col = 0;
}
- g = sorted[i];
printf("gsave %d %d translate ",
- 20 + (((i%(nrow*ncol)/nrow) * 40)),
- 800 - ((i%nrow) * 40));
+ (col * 40),
+ -((g->unicode == -1 ? row++ : g->unicode%nrow) * 40));
if (g->unicode != -1)
printf("(U+%04X)", g->unicode);
else
else
printf("/uni%04X ", g->unicode);
printf("exemplify grestore\n");
- if (i % (nrow*ncol) == (nrow*ncol)-1)
- printf("showpage\n");
}
printf("showpage\n");
printf("%%%%EOF\n");