[glyf] minor, use private font coords to simplify

This commit is contained in:
Ebrahim Byagowi 2020-02-18 15:42:48 +03:30
parent dcd2729e71
commit 3b0c58f811
1 changed files with 2 additions and 6 deletions

View File

@ -982,15 +982,11 @@ struct glyf
bool get_extents (hb_font_t *font, hb_codepoint_t gid, hb_glyph_extents_t *extents) const bool get_extents (hb_font_t *font, hb_codepoint_t gid, hb_glyph_extents_t *extents) const
{ {
if (unlikely (gid >= num_glyphs)) return false;
#ifndef HB_NO_VAR #ifndef HB_NO_VAR
unsigned int coord_count; if (font->num_coords && font->num_coords == face->table.gvar->get_axis_count ())
const int *coords = hb_font_get_var_coords_normalized (font, &coord_count);
if (coords && coord_count > 0 && coord_count == face->table.gvar->get_axis_count ())
return get_points (font, gid, points_aggregator_t (font, extents, nullptr)); return get_points (font, gid, points_aggregator_t (font, extents, nullptr));
#endif #endif
if (unlikely (gid >= num_glyphs)) return false;
return glyph_for_gid (gid).get_extents (font, gid, extents); return glyph_for_gid (gid).get_extents (font, gid, extents);
} }