From: Ben Harris Date: Sun, 17 Nov 2024 10:11:23 +0000 (+0000) Subject: Process pixels in raster order X-Git-Tag: bedstead-3.246~23 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=15b8a9a5842a59cd4c2433e5155061cb486d94d4;p=bedstead.git Process pixels in raster order If we're imitating a CRT character generator, obviously we should process pixels line-by-line, not column-by-column. But that means writing "for (y ...)" before "for (x ...)" which isn't the instinctive way I did it. So now that's corrected and the Y loops are outside the X loops, which should make any debugging output easier to follow. This has been confirmed not to change FreeType rendering at 10.5 ppem. --- diff --git a/bedstead.c b/bedstead.c index 2b79177..b07d267 100644 --- a/bedstead.c +++ b/bedstead.c @@ -4038,8 +4038,8 @@ dochar(struct glyph *g) for (x = 0; x < XSIZE; x++) vstems[x] = 0; for (y = 0; y < YSIZE; y++) hstems[y] = 0; clearpath(); - for (x = 0; x < XSIZE; x++) { - for (y = 0; y < YSIZE; y++) { + for (y = 0; y < YSIZE; y++) { + for (x = 0; x < XSIZE; x++) { if (GETPIX(x, y)) { bool tl, tr, bl, br; @@ -4188,8 +4188,8 @@ dochar_plotter(struct glyph *g) } while (0) clearpath(); - for (x = 0; x < XSIZE; x++) { - for (y = 0; y < YSIZE; y++) { + for (y = 0; y < YSIZE; y++) { + for (x = 0; x < XSIZE; x++) { if (GETPIX(x, y)) { if (R) CONNECT(1, 0); if (D) CONNECT(0, -1);