[glyf] Fix slant-scaling in GlyphHeader too

This commit is contained in:
Behdad Esfahbod 2022-12-22 10:21:07 -07:00
parent 392463bff5
commit 9a0ebd2b2a
1 changed files with 6 additions and 4 deletions

View File

@ -21,10 +21,12 @@ struct GlyphHeader
/* extents->x_bearing = hb_min (glyph_header.xMin, glyph_header.xMax); */ /* extents->x_bearing = hb_min (glyph_header.xMin, glyph_header.xMax); */
int lsb = hb_min (xMin, xMax); int lsb = hb_min (xMin, xMax);
(void) glyf_accelerator.hmtx->get_leading_bearing_without_var_unscaled (gid, &lsb); (void) glyf_accelerator.hmtx->get_leading_bearing_without_var_unscaled (gid, &lsb);
extents->x_bearing = font->em_scale_x (lsb); extents->x_bearing = lsb;
extents->y_bearing = font->em_scale_y (hb_max (yMin, yMax)); extents->y_bearing = hb_max (yMin, yMax);
extents->width = font->em_scale_x (hb_max (xMin, xMax) - hb_min (xMin, xMax)); extents->width = hb_max (xMin, xMax) - hb_min (xMin, xMax);
extents->height = font->em_scale_y (hb_min (yMin, yMax) - hb_max (yMin, yMax)); extents->height = hb_min (yMin, yMax) - hb_max (yMin, yMax);
font->scale_glyph_extents (extents);
return true; return true;
} }