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.
This commit is contained in:
Ben Harris 2024-11-19 23:34:47 +00:00
parent d4d05a4a73
commit 534a4a311a

View File

@ -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;
}