From: Ben Harris Date: Sat, 26 Oct 2024 11:23:28 +0000 (+0100) Subject: Stop bold line-drawing characters overflowing character cell X-Git-Tag: bedstead-3.246~5^2~3 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=664f000a590a875f4dfed6ed319c7a1110792652;p=bedstead-debian.git Stop bold line-drawing characters overflowing character cell In XLFD terms, Bedstead is a "character cell" font, where every character fits entirely within its cell (defined by advance width, ascent, and descent). Bedstead Bold maintained this because it thickened into the unused column to the left of each character. However, combining the new continuous line-drawing with emboldening led to bold line-drawing characters that extended beyond their character cell. This led FontForge to make the SPACING property of the BDF file "M" (for monospace) rather the "C". This commit simply clips the X co-ordinate of points in a bolded character at zero. That's safe because line-drawing characters are guaranteed not to be doing anything diagonal in the left-most column. This is slightly ugly, in that the bold characters aren't quite so algorithmically derived from the non-bold ones, but in most cases there'll be another line-drawing character to the left anyway. --- diff --git a/bedstead.c b/bedstead.c index 8ab8dcc..3a5f1a1 100644 --- a/bedstead.c +++ b/bedstead.c @@ -3462,6 +3462,8 @@ adjust_weight(void) assert(p->prev != NULL); p->v.x += moves[i].x; p->v.y += moves[i].y; + /* Make sure line-drawing characters don't overflow. */ + if (p->v.x < 0) p->v.x = 0; } }