static struct glyph {
union {
- char data[YSIZE];
+ /* Top row (and left column) don't appear in ROM. */
+ char data[YSIZE - 1];
char const *alias_of;
};
int_least32_t unicode;
getpix(char const data[YSIZE], int x, int y, unsigned flags)
{
- if (x < 0 || x >= XSIZE || y < 0 || y >= YSIZE)
+ /*
+ * Pixel co-ordinates count from (0,0) in the top left of the
+ * character cell. In the glyph array, the top row isn't
+ * represented and the columns are right-aligned in a char.
+ * Like the top row, the left column of the character cell
+ * always reads as 0.
+ */
+ if (x < 1 || x >= XSIZE || y < 1 || y >= YSIZE)
return 0;
else
- return (data[y] >> (XSIZE - x - 1)) & 1;
+ return (data[y - 1] >> (XSIZE - x - 1)) & 1;
}
static bool plottermode = false;
do {
printf(" %g %g %s 1\n",
(double)p->v.x / XSCALE,
- (double)p->v.y / YSCALE - 3*YPIX,
+ (double)p->v.y / YSCALE - 2*YPIX,
p == p0 && p->next ? "m" : "l");
p1 = p->next;
p->prev = p->next = NULL;
{
clearpath();
- if (code & 1) tile(0 + sep, 8 + sep, 3, 11);
- if (code & 2) tile(3 + sep, 8 + sep, 6, 11);
- if (code & 4) tile(0 + sep, 4 + sep, 3, 8);
- if (code & 8) tile(3 + sep, 4 + sep, 6, 8);
- if (code & 16) tile(0 + sep, 1 + sep, 3, 4);
- if (code & 32) tile(3 + sep, 1 + sep, 6, 4);
+ if (code & 1) tile(0 + sep, 7 + sep, 3, 10);
+ if (code & 2) tile(3 + sep, 7 + sep, 6, 10);
+ if (code & 4) tile(0 + sep, 3 + sep, 3, 7);
+ if (code & 8) tile(3 + sep, 3 + sep, 6, 7);
+ if (code & 16) tile(0 + sep, 0 + sep, 3, 3);
+ if (code & 32) tile(3 + sep, 0 + sep, 6, 3);
clean_path();
emit_path();
}
{
clearpath();
- if (code & 1) tile(0 + sep, 6 + sep, 3, 11);
- if (code & 2) tile(3 + sep, 6 + sep, 6, 11);
- if (code & 4) tile(0 + sep, 1 + sep, 3, 6);
- if (code & 8) tile(3 + sep, 1 + sep, 6, 6);
+ if (code & 1) tile(0 + sep, 5 + sep, 3, 10);
+ if (code & 2) tile(3 + sep, 5 + sep, 6, 10);
+ if (code & 4) tile(0 + sep, 0 + sep, 3, 5);
+ if (code & 8) tile(3 + sep, 0 + sep, 6, 5);
clean_path();
emit_path();
}