bedstead-%-df.png: df.ps bedstead.pfa
gs -q -dSAFER -dsize=$* -sDEVICE=png16m -o $@ bedstead.pfa $<
+complement.ps: bedstead
+ ./bedstead --glyph-complement > complement.ps
+
+complement.pdf: complement.ps bedstead.pfa
+ gs -q -dSAFER -sDEVICE=pdfwrite -o $@ bedstead.pfa $<
+
.PHONY: clean
clean:
rm -f bedstead *.sfd *.otf *.bdf *.pfa *.png
void dochar(char const data[YSIZE], unsigned flags);
static void dochar_plotter(char const data[YSIZE], unsigned flags);
static void domosaic(unsigned code, bool sep);
-static void dopanose();
+static void dopanose(void);
+static void glyph_complement(void);
struct glyph {
char data[YSIZE];
int extraglyphs = 0;
char *endptr;
+ if (argc == 2 && strcmp(argv[1], "--complement")) {
+ glyph_complement();
+ return 0;
+ }
+
+
while (argc > 1) {
for (i = 0; i < nparams; i++)
if (strcmp(argv[1], params[i].option) == 0) {
clean_path();
emit_path();
}
+
+static void
+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");
+ /* 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(" 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("showpage\n");
+}