Try paint_glyph for more tables

If the COLR table does not paint the glyph,
try SVG, CBDT and sbix too, before giving up
on color.
This commit is contained in:
Matthias Clasen 2022-12-17 01:04:35 -05:00 committed by Behdad Esfahbod
parent e6c5a616aa
commit 6079173a52
1 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,7 @@
#include "hb-ot-color-cbdt-table.hh" #include "hb-ot-color-cbdt-table.hh"
#include "hb-ot-color-sbix-table.hh" #include "hb-ot-color-sbix-table.hh"
#include "hb-ot-color-colr-table.hh" #include "hb-ot-color-colr-table.hh"
#include "hb-ot-color-svg-table.hh"
/** /**
@ -449,6 +450,11 @@ hb_ot_get_glyph_paint (hb_font_t *font,
{ {
#ifndef HB_NO_COLOR #ifndef HB_NO_COLOR
if (font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data)) return; if (font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
if (font->face->table.SVG->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
#ifndef HB_NO_OT_FONT_BITMAP
if (font->face->table.CBDT->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
if (font->face->table.sbix->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
#endif
#endif #endif
if (font->face->table.glyf->paint_glyph (font, glyph, paint_funcs, paint_data)) return; if (font->face->table.glyf->paint_glyph (font, glyph, paint_funcs, paint_data)) return;
#ifndef HB_NO_CFF #ifndef HB_NO_CFF