From 815544a1f7ce0cd9da6cb632e7309ba31ed53faf Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 18 Dec 2022 13:33:54 -0700 Subject: [PATCH] [font] Adapt paint_glyph to parent transform --- src/hb-font.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hb-font.cc b/src/hb-font.cc index 7aa1a7170..499c6d9fb 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -657,8 +657,18 @@ hb_font_get_glyph_paint_default (hb_font_t *font, void *paint_data, void *user_data) { - // FIXME adaptor like for draw funcs + paint_funcs->push_transform (paint_data, + font->parent->x_scale ? (float) font->x_scale / (float) font->parent->x_scale : 0.f, + font->parent->y_scale ? (font->slant - font->parent->slant) * + (float) font->x_scale / (float) font->parent->y_scale : 0.f, + 0.f, + font->parent->y_scale ? (float) font->y_scale / (float) font->parent->y_scale : 0.f, + 0.f, + 0.f); + font->parent->get_glyph_paint (glyph, paint_funcs, paint_data); + + paint_funcs->pop_transform (paint_data); } DEFINE_NULL_INSTANCE (hb_font_funcs_t) =