diff --git a/src/OT/Var/VARC/VARC.hh b/src/OT/Var/VARC/VARC.hh index 3f5181ae7..273b1ae7a 100644 --- a/src/OT/Var/VARC/VARC.hh +++ b/src/OT/Var/VARC/VARC.hh @@ -205,7 +205,7 @@ struct VARC release_scratch (scratch); if (ret) - *extents = f_extents.to_glyph_extents (); + *extents = f_extents.to_glyph_extents (font->x_scale < 0, font->y_scale < 0); return ret; } diff --git a/src/hb-geometry.hh b/src/hb-geometry.hh index 5f83ecbb3..b6b7e8bf5 100644 --- a/src/hb-geometry.hh +++ b/src/hb-geometry.hh @@ -88,13 +88,16 @@ struct hb_extents_t } } - hb_glyph_extents_t to_glyph_extents () const + hb_glyph_extents_t to_glyph_extents (bool xneg = false, bool yneg = false) const { hb_position_t x0 = (hb_position_t) roundf (xmin); hb_position_t y0 = (hb_position_t) roundf (ymin); hb_position_t x1 = (hb_position_t) roundf (xmax); hb_position_t y1 = (hb_position_t) roundf (ymax); - return hb_glyph_extents_t {x0, y0, x1 - x0, y1 - y0}; + return hb_glyph_extents_t {xneg ? x1 : x0, + yneg ? y0 : y1, + xneg ? x0 - x1 : x1 - x0, + yneg ? y1 - y0 : y0 - y1}; } Float xmin = 0;