COLR implementation

This commit is contained in:
Matthias Clasen 2022-12-14 06:55:01 -05:00 committed by Behdad Esfahbod
parent 71efa0dcf1
commit 6a48ac42f4
2 changed files with 23 additions and 0 deletions

View File

@ -1615,6 +1615,11 @@ struct COLR
return false;
}
void
paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const
{
}
protected:
HBUINT16 version; /* Table version number (starts at 0). */
HBUINT16 numBaseGlyphs; /* Number of Base Glyph Records. */

View File

@ -439,6 +439,20 @@ hb_ot_get_glyph_shape (hb_font_t *font,
}
#endif
#ifndef HB_NO_PAINT
static void
hb_ot_get_glyph_paint (hb_font_t *font,
void *font_data,
hb_codepoint_t glyph,
hb_paint_funcs_t *paint_funcs, void *paint_data,
void *user_data)
{
#ifndef HB_NO_COLOR
font->face->table.COLR->paint_glyph (font, glyph, paint_funcs, paint_data);
#endif
}
#endif
static inline void free_static_ot_funcs ();
static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot_font_funcs_lazy_loader_t>
@ -465,6 +479,10 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot
hb_font_funcs_set_glyph_shape_func (funcs, hb_ot_get_glyph_shape, nullptr, nullptr);
#endif
#ifndef HB_NO_PAINT
hb_font_funcs_set_glyph_paint_func (funcs, hb_ot_get_glyph_paint, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_ot_get_glyph_extents, nullptr, nullptr);
//hb_font_funcs_set_glyph_contour_point_func (funcs, hb_ot_get_glyph_contour_point, nullptr, nullptr);