[embolden] Update glyph_extents in hb-ot-font

This commit is contained in:
Behdad Esfahbod 2023-02-07 13:46:13 -07:00
parent aef002e0d9
commit 560a65e456
1 changed files with 15 additions and 0 deletions

View File

@ -208,6 +208,21 @@ struct hb_font_t
extents->width = ceilf (x2) - extents->x_bearing; extents->width = ceilf (x2) - extents->x_bearing;
extents->height = ceilf (y2) - extents->y_bearing; extents->height = ceilf (y2) - extents->y_bearing;
if (x_strength || y_strength)
{
/* Y */
int y_shift = y_strength;
if (y_scale < 0) y_shift = -y_shift;
extents->y_bearing += y_shift;
extents->height -= y_shift;
/* X */
int x_shift = x_strength;
if (x_scale < 0) x_shift = -x_shift;
if (embolden_in_place)
extents->x_bearing -= x_shift / 2;
extents->width += x_shift;
}
} }