static void doalias(char const *alias_of);
static void dopanose(void);
static void glyph_complement(void);
+static void bdf_gen(int size);
/* U(N) sets the code point and name of a glyph not in AGLFN */
#define U(N) 0x ## N, 0x ## N >= 0x10000 ? "u" #N : "uni" #N
int
main(int argc, char **argv)
{
+ bool gen_bdf = false;
int i;
int extraglyphs = 0;
char *endptr;
if (strcmp(argv[1], "--plotter") == 0) {
plottermode = true;
argv++; argc--;
+ } else if (strcmp(argv[1], "--bdfgen") == 0) {
+ gen_bdf = true;
} else if (strcmp(argv[1], "--") == 0) {
argv++; argc--;
break;
next:;
}
+ if (gen_bdf) {
+ bdf_gen(10);
+ return EXIT_SUCCESS;
+ }
+
if (argc > 1) {
char data[YSIZE];
int i, y;
printf("showpage\n");
printf("%%%%EOF\n");
}
+
+static void
+bdf_gen(int px_height)
+{
+ int px_width = (px_height * XPIX * XSIZE) / (YPIX * YSIZE);
+ int base = (px_height * 200) / (YPIX * YSIZE);
+ int i;
+
+ printf("%%!\n");
+ printf("/d [1 0 0 1 0 0] %d %d <ff 00> makeimagedevice def\n",
+ (px_width + 7) / 8 * 8, px_height);
+ printf("d setdevice\n");
+ printf("/Bedstead findfont %d scalefont setfont\n", px_height);
+ printf("/f (%%stdout) (w) file def\n");
+ printf("/buf %d string def\n", (px_width + 7) / 8);
+ printf("(\\\n");
+ printf("STARTFONT 2.1\n");
+ printf("FONT bedstead-%d\n", px_height);
+ printf("SIZE %d 75 75\n", px_height);
+ printf("FONTBOUNDINGBOX %d %d 0 %d\n", px_width, px_height, -base);
+ printf("CHARS %d\n", nglyphs);
+ for (i = 0; i < nglyphs; i++) {
+ struct glyph *g = &glyphs[i];
+ printf("STARTCHAR %s\n", g->name);
+ printf("ENCODING %d\n", g->unicode);
+ printf("SWIDTH %d 0\n", (int)(XPIX * XSIZE));
+ printf("DWIDTH %d 0\n", px_width);
+ printf("BBX %d %d 0 %d\n", px_width, px_height, -base);
+ printf("BITMAP\n");
+ printf(") print\n");
+ printf("erasepage\n");
+ printf("0 %d moveto\n", base);
+ printf("/%s glyphshow\n", g->name);
+ printf("%d -1 0 {\n", px_height - 1);
+ printf(" d exch buf copyscanlines\n");
+ printf(" f exch writehexstring (\n) print\n");
+ printf("} for\n");
+ printf("(\\\n");
+ printf("ENDCHAR\n");
+ }
+ printf("ENDFONT\n");
+ printf(") print\n");
+}