Optimize non-slant extents code

pull/4021/head
Behdad Esfahbod 2 years ago
parent 73dab7f784
commit d2aa2397ba
  1. 3
      src/hb-font.hh
  2. 3
      src/hb-ft.cc

@ -188,8 +188,11 @@ struct hb_font_t
float y2 = em_fscale_y (extents->y_bearing + extents->height);
/* Apply slant. */
if (slant_xy)
{
x1 += hb_min (y1 * slant_xy, y2 * slant_xy);
x2 += hb_max (y1 * slant_xy, y2 * slant_xy);
}
extents->x_bearing = floorf (x1);
extents->y_bearing = floorf (y1);

@ -630,8 +630,11 @@ hb_ft_get_glyph_extents (hb_font_t *font,
float y2 = y1 + y_mult * -ft_face->glyph->metrics.height;
/* Apply slant. */
if (slant_xy)
{
x1 += hb_min (y1 * slant_xy, y2 * slant_xy);
x2 += hb_max (y1 * slant_xy, y2 * slant_xy);
}
extents->x_bearing = floorf (x1);
extents->y_bearing = floorf (y1);

Loading…
Cancel
Save