From 9461ab70883c4fa0492f5f71c902cdabba627d4f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 16 Dec 2022 23:46:45 -0500 Subject: [PATCH] Try paint_glyph for more tables If the COLR table can't paint the glyph, try glyf, cff1 and cff2 too. --- src/hb-ot-font.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 0975d5ac6..bbb9a5953 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -448,7 +448,12 @@ hb_ot_get_glyph_paint (hb_font_t *font, void *user_data) { #ifndef HB_NO_COLOR - font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data); + if (font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data)) return; +#endif + if (font->face->table.glyf->paint_glyph (font, glyph, paint_funcs, paint_data)) return; +#ifndef HB_NO_CFF + if (font->face->table.cff1->paint_glyph (font, glyph, paint_funcs, paint_data)) return; + if (font->face->table.cff2->paint_glyph (font, glyph, paint_funcs, paint_data)) return; #endif } #endif