chiark / gitweb /
Process pixels in raster order
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 17 Nov 2024 10:11:23 +0000 (10:11 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 17 Nov 2024 10:11:23 +0000 (10:11 +0000)
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.

bedstead.c

index 2b791775b63390ccc47ae9f5f2e7efa395f3dd77..b07d267f95a6287db297175c760185879a3104ef 100644 (file)
@@ -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);