From dfcf8b32075cd6cf2e987ebfa45fa5e31204cebe Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 31 Jul 2017 21:35:32 +0100 Subject: [PATCH] Put minimal DSC comments into glyph complement PostScript. --- bedstead.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bedstead.c b/bedstead.c index d1415e8..c48f795 100644 --- a/bedstead.c +++ b/bedstead.c @@ -2142,12 +2142,15 @@ glyph_complement() 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"); @@ -2166,7 +2169,12 @@ glyph_complement() 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)), @@ -2180,8 +2188,9 @@ glyph_complement() 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"); } -- 2.30.2