chiark / gitweb /
Replace (unused) Book weight with (also unused) Light
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 16 Oct 2021 16:24:26 +0000 (17:24 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 16 Oct 2021 19:06:33 +0000 (20:06 +0100)
This is roughly equivalent to moving rising edges one subpixel later,
thinning vertical and horizontal lines by one pixel.  The actual shift
is slightly smaller to ensure that the points of "0" etc don't end up
crossing over themselves.

bedstead.c

index 4079ca3a18d24d57d27bb629c62e7985b251de41..0d0622107238523a873e7a1fb0c0060c43c72fc2 100644 (file)
@@ -181,6 +181,22 @@ static int const nwidths = sizeof(widths) / sizeof(widths[0]);
 
 struct width const *width = &widths[0];
 
+/* Size of output pixels in font design units (usually 1000/em) */
+#define XPIX (width->xpix)
+#define YPIX 100
+
+/* Internally, we work in pixels 100 design units square */
+#define XPIX_S 100
+#define YPIX_S 100
+
+#define XSCALE ((double)XPIX_S / (double)XPIX)
+#define YSCALE ((double)YPIX_S / (double)YPIX)
+
+/* Position of diagonal lines within pixels */
+/* 29 is approximately 100 * (1-1/sqrt(2)) */
+#define XQTR_S 29
+#define YQTR_S 29
+
 static struct weight {
        char const *option;
        char const *suffix;
@@ -194,10 +210,10 @@ static struct weight {
                500,
        },
        {
-               "--book",
-               " Book",
-               -25,
-               400,
+               "--light",
+               " Light",
+               2 * XQTR_S - 100,
+               300,
        },
        {
                "--bold",
@@ -211,22 +227,6 @@ static int const nweights = sizeof(weights) / sizeof(weights[0]);
 
 struct weight const *weight = &weights[0];
 
-/* Size of output pixels in font design units (usually 1000/em) */
-#define XPIX (width->xpix)
-#define YPIX 100
-
-/* Internally, we work in pixels 100 design units square */
-#define XPIX_S 100
-#define YPIX_S 100
-
-#define XSCALE ((double)XPIX_S / (double)XPIX)
-#define YSCALE ((double)YPIX_S / (double)YPIX)
-
-/* Position of diagonal lines within pixels */
-/* 29 is approximately 100 * (1-1/sqrt(2)) */
-#define XQTR_S 29
-#define YQTR_S 29
-
 static 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);