diff --git a/util/helper-cairo-user.hh b/util/helper-cairo-user.hh index d3f5e6aa8..6822b959a 100644 --- a/util/helper-cairo-user.hh +++ b/util/helper-cairo-user.hh @@ -363,6 +363,13 @@ render_color_glyph (cairo_scaled_font_t *scaled_font, hb_font_paint_glyph (font, glyph, get_cairo_paint_funcs (), (void *)&paint_data); + hb_glyph_extents_t hb_extents; + hb_font_get_glyph_extents (font, glyph, &hb_extents); + extents->x_bearing = (double) hb_extents.x_bearing / x_scale; + extents->y_bearing = (double) hb_extents.y_bearing / y_scale; + extents->width = (double) hb_extents.width / x_scale; + extents->height = (double) hb_extents.height / y_scale; + hb_font_destroy (paint_data.unscaled_font); return CAIRO_STATUS_SUCCESS;