diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 4ab0188df..bb776483a 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -944,11 +944,15 @@ struct CBDT if (unlikely (blob == hb_blob_get_empty ())) return false; - if (unlikely (!get_extents (font, glyph, &extents))) + if (unlikely (!hb_font_get_glyph_extents (font, glyph, &extents))) return false; + funcs->push_root_transform (data, font); + funcs->image (data, blob, HB_PAINT_IMAGE_FORMAT_PNG, &extents); + funcs->pop_root_transform (data); + hb_blob_destroy (blob); return true; } diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index 4190e6d1e..32b5b074d 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -245,11 +245,15 @@ struct sbix if (blob == hb_blob_get_empty ()) return false; - if (!get_extents (font, glyph, &extents)) + if (!hb_font_get_glyph_extents (font, glyph, &extents)) return false; + funcs->push_root_transform (data, font); + funcs->image (data, blob, HB_PAINT_IMAGE_FORMAT_PNG, &extents); + funcs->pop_root_transform (data); + hb_blob_destroy (blob); return true; } diff --git a/util/hb-cairo-utils.c b/util/hb-cairo-utils.c index 5c1e9da7e..f79e0b73d 100644 --- a/util/hb-cairo-utils.c +++ b/util/hb-cairo-utils.c @@ -123,9 +123,10 @@ read_blob (void *closure, return CAIRO_STATUS_SUCCESS; } +#include void -hb_cairo_paint_glyph_image (hb_font_t *font, - cairo_t *cr, +hb_cairo_paint_glyph_image (cairo_t *cr, + hb_font_t *font, hb_blob_t *blob, hb_tag_t format, hb_glyph_extents_t *extents) @@ -146,10 +147,6 @@ hb_cairo_paint_glyph_image (hb_font_t *font, cairo_matrix_t matrix = {(double) width, 0, 0, (double) height, 0, 0}; cairo_pattern_set_matrix (pattern, &matrix); - hb_position_t x_scale, y_scale; - hb_font_get_scale (font, &x_scale, &y_scale); - cairo_scale (cr, +1./x_scale, -1./y_scale); - cairo_translate (cr, extents->x_bearing, extents->y_bearing); cairo_scale (cr, extents->width, extents->height); cairo_set_source (cr, pattern);