void doprologue(void);
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();
return (data[y] >> (XSIZE - x - 1)) & 1;
}
+static bool plottermode = false;
+
int
main(int argc, char **argv)
{
argv++; argc--;
goto next;
}
- if (strcmp(argv[1], "--") == 0) {
+ if (strcmp(argv[1], "--plotter") == 0) {
+ plottermode = true;
+ argv++; argc--;
+ } else if (strcmp(argv[1], "--") == 0) {
argv++; argc--;
break;
} else if (argv[1][0] == '-') {
printf("DisplaySize: -24\n");
printf("AntiAlias: 1\n");
printf("FitToEm: 1\n");
+ if (plottermode) {
+ printf("StrokedFont: 1\n");
+ printf("StrokeWidth: 50\n");
+ }
printf("BeginPrivate: 2\n");
printf(" StdHW 5 [%d]\n", YPIX);
printf(" StdVW 5 [%d]\n", XPIX);
if (glyphs[i].flags & MOS)
domosaic(glyphs[i].data[0],
(glyphs[i].data[0] & 0x20) != 0);
- else
- dochar(glyphs[i].data, glyphs[i].flags);
+ else {
+ if (plottermode)
+ dochar_plotter(glyphs[i].data, glyphs[i].flags);
+ else
+ dochar(glyphs[i].data, glyphs[i].flags);
+ }
printf("EndChar\n");
}
printf("EndChars\n");
emit_path();
}
+static void
+dochar_plotter(char const data[YSIZE], unsigned flags)
+{
+ int x, y;
+
+#define CONNECT(dx, dy) do { \
+ moveto(x * XPIX_S, (YSIZE-y-1) * YPIX_S); \
+ lineto((x+dx) * XPIX_S, (YSIZE-y-1+dy) * YPIX_S); \
+ } while (0)
+
+ clearpath();
+ for (x = 0; x < XSIZE; x++) {
+ for (y = 0; y < YSIZE; y++) {
+ if (GETPIX(x, y)) {
+ if (R) CONNECT(1, 0);
+ if (D) CONNECT(0, -1);
+ if (DR && !D && !R) CONNECT(1, -1);
+ if (DL && !D && !L) CONNECT(-1, -1);
+ }
+ }
+ }
+ emit_path();
+}
+
static void
tile(int x0, int y0, int x1, int y1)
{