[glyf] Revert sign of advance widths back

This commit is contained in:
Behdad Esfahbod 2023-01-12 10:36:39 -07:00
parent c324d99952
commit cfb672f1e5
1 changed files with 4 additions and 4 deletions

View File

@ -93,15 +93,15 @@ struct Glyph
float topSideY = all_points[len - 2].y; float topSideY = all_points[len - 2].y;
float bottomSideY = all_points[len - 1].y; float bottomSideY = all_points[len - 1].y;
unsigned hori_aw = roundf (rightSideX - leftSideX); signed hori_aw = roundf (rightSideX - leftSideX);
if (hori_aw < 0) hori_aw = 0; if (hori_aw < 0) hori_aw = 0;
int lsb = roundf (xMin - leftSideX); int lsb = roundf (xMin - leftSideX);
plan->hmtx_map.set (new_gid, hb_pair (hori_aw, lsb)); plan->hmtx_map.set (new_gid, hb_pair ((unsigned) hori_aw, lsb));
unsigned vert_aw = roundf (topSideY - bottomSideY); signed vert_aw = roundf (topSideY - bottomSideY);
if (vert_aw < 0) vert_aw = 0; if (vert_aw < 0) vert_aw = 0;
int tsb = roundf (topSideY - yMax); int tsb = roundf (topSideY - yMax);
plan->vmtx_map.set (new_gid, hb_pair (vert_aw, tsb)); plan->vmtx_map.set (new_gid, hb_pair ((unsigned) vert_aw, tsb));
} }
bool compile_header_bytes (const hb_subset_plan_t *plan, bool compile_header_bytes (const hb_subset_plan_t *plan,