diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 46d0a16d9..a9307f291 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -244,6 +244,8 @@ hb_paint_push_transform_func_t hb_paint_funcs_set_push_transform_func hb_paint_pop_transform_func_t hb_paint_funcs_set_pop_transform_func +hb_paint_color_glyph_func_t +hb_paint_funcs_set_color_glyph_func hb_paint_push_clip_glyph_func_t hb_paint_funcs_set_push_clip_glyph_func hb_paint_push_clip_rectangle_func_t @@ -280,6 +282,7 @@ hb_paint_funcs_set_custom_palette_color_func hb_paint_push_transform hb_paint_pop_transform +hb_paint_color_glyph hb_paint_push_clip_glyph hb_paint_push_clip_rectangle hb_paint_pop_clip diff --git a/src/hb-ft-colr.hh b/src/hb-ft-colr.hh index fa5712f9b..a78028221 100644 --- a/src/hb-ft-colr.hh +++ b/src/hb-ft-colr.hh @@ -320,6 +320,17 @@ _hb_ft_paint (hb_ft_paint_context_t *c, break; case FT_COLR_PAINTFORMAT_COLR_GLYPH: { + c->funcs->push_inverse_root_transform (c->data, c->font); + c->ft_font->lock.unlock (); + if (c->funcs->color_glyph (c->data, paint.u.colr_glyph.glyphID, c->font)) + { + c->ft_font->lock.lock (); + c->funcs->pop_transform (c->data); + return; + } + c->ft_font->lock.lock (); + c->funcs->pop_transform (c->data); + FT_OpaquePaint other_paint = {0}; if (FT_Get_Color_Glyph_Paint (ft_face, paint.u.colr_glyph.glyphID, FT_COLOR_NO_ROOT_TRANSFORM, diff --git a/test/api/results/bad-154 b/test/api/results/bad-154 index 2f4bdfc7a..ce8e4ff69 100644 --- a/test/api/results/bad-154 +++ b/test/api/results/bad-154 @@ -1,40 +1,104 @@ -# random seed: R02S345aec86e0be01a834deb6fc61057f9c +# random seed: R02S0cee2d366e5dbd296a38859c4a84c045 # Start of hb tests # Start of paint tests # Start of ot tests start clip rectangle 0 500 500 1e+03 start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 500 500 1e+03 end clip push group diff --git a/test/api/results/testvf-154 b/test/api/results/testvf-154 index 6da136fbf..f497751cf 100644 --- a/test/api/results/testvf-154 +++ b/test/api/results/testvf-154 @@ -1,10 +1,14 @@ -# random seed: R02S2212d33e4705ca20b6475a83d116b9ab +# random seed: R02S08067256908fbfc782c2c2c09d648be6 # Start of hb tests # Start of paint tests # Start of ot tests start clip rectangle 0 500 500 1e+03 start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 100 100 900 900 + start transform 1 0 -0 1 0 0 + end transform start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 -0 1 0 0 start clip glyph 2