[ft] Fix extents with negative scales

Fixes https://github.com/behdad/harfbuzz/issues/162
This commit is contained in:
Behdad Esfahbod 2015-11-05 17:33:57 -08:00
parent 73fec3992a
commit c743ec5886
1 changed files with 10 additions and 0 deletions

View File

@ -277,6 +277,16 @@ hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED,
extents->y_bearing = ft_face->glyph->metrics.horiBearingY;
extents->width = ft_face->glyph->metrics.width;
extents->height = -ft_face->glyph->metrics.height;
if (font->x_scale < 0)
{
extents->x_bearing = -extents->x_bearing;
extents->width = -extents->width;
}
if (font->y_scale < 0)
{
extents->y_bearing = -extents->y_bearing;
extents->height = -extents->height;
}
return true;
}