From 845766a6687b6c3aee6f73793a41d7157b4cebe4 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 16 Oct 2021 17:24:26 +0100 Subject: [PATCH] Replace (unused) Book weight with (also unused) Light 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 | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bedstead.c b/bedstead.c index 4079ca3..0d06221 100644 --- a/bedstead.c +++ b/bedstead.c @@ -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); -- 2.30.2