From: Ben Harris Date: Tue, 19 Nov 2024 23:34:47 +0000 (+0000) Subject: Correct bold outlines X-Git-Tag: bedstead-3.246~10 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=534a4a311a601ce6035e9dcd2b41f442306522df;p=bedstead-debian.git Correct bold outlines The weight-changing code in adjust_weight() depended on the direction that outlines were drawn in, so when I changed the direction to match that required by CFF, it started lightening the font when it should have been boldening it. A lot of swapping "next" and "prev" has corrected that. --- diff --git a/bedstead.c b/bedstead.c index 115c3b3..6fc2696 100644 --- a/bedstead.c +++ b/bedstead.c @@ -3968,7 +3968,7 @@ adjust_weight(void) PX = p->prev->v.x; PY = p->prev->v.y; NX = p->next->v.x; NY = p->next->v.y; /* Move left-edge points horizontally */ - if (PY <= Y && Y <= NY) { + if (NY <= Y && Y <= PY) { moves[i].x -= W; /* * These two clauses deal in an ad-hoc way @@ -3977,24 +3977,24 @@ adjust_weight(void) * inside corner gets completely consumed by * boldening. */ - if (W > XQTR_S && PY == Y && PX == X - XQTR_S) { - moves[i].y += W - XQTR_S; - if (NX != X) moves[i].x += W - XQTR_S; - killpoint(p->prev); - } if (W > XQTR_S && NY == Y && NX == X - XQTR_S) { - moves[i].y -= W - XQTR_S; + moves[i].y += W - XQTR_S; if (PX != X) moves[i].x += W - XQTR_S; killpoint(p->next); } + if (W > XQTR_S && PY == Y && PX == X - XQTR_S) { + moves[i].y -= W - XQTR_S; + if (NX != X) moves[i].x += W - XQTR_S; + killpoint(p->prev); + } } /* Move top inner corner points along NE/SW diagonal */ - if (PY < Y && Y > NY && PX > X && X > NX) { + if (NY < Y && Y > PY && NX > X && X > PX) { moves[i].x -= W/2; moves[i].y -= W/2; } /* Move bottom inner corner points along NW/SE diagonal */ - if (PY > Y && Y < NY && PX < X && X < NX) { + if (NY > Y && Y < PY && NX < X && X < PX) { moves[i].x -= W/2; moves[i].y += W/2; }