[embolden] Fix glyph_extents in hb-ft
This commit is contained in:
parent
61a1a88940
commit
b350122fb3
16
src/hb-ft.cc
16
src/hb-ft.cc
|
@ -657,6 +657,22 @@ hb_ft_get_glyph_extents (hb_font_t *font,
|
||||||
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 (font->x_strength || font->y_strength)
|
||||||
|
{
|
||||||
|
/* Y */
|
||||||
|
int y_shift = font->y_strength;
|
||||||
|
if (font->y_scale < 0) y_shift = -y_shift;
|
||||||
|
extents->y_bearing += y_shift;
|
||||||
|
extents->height -= y_shift;
|
||||||
|
|
||||||
|
/* X */
|
||||||
|
int x_shift = font->x_strength;
|
||||||
|
if (font->x_scale < 0) x_shift = -x_shift;
|
||||||
|
if (font->embolden_in_place)
|
||||||
|
extents->x_bearing -= x_shift / 2;
|
||||||
|
extents->width += x_shift;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue