From 6a48ac42f4f8404ecf64fda876141a0d1c48a56c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 14 Dec 2022 06:55:01 -0500 Subject: [PATCH] COLR implementation --- src/hb-ot-color-colr-table.hh | 5 +++++ src/hb-ot-font.cc | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 2636a8c87..1fe3ee420 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -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. */ diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 840510342..0975d5ac6 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -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 @@ -465,6 +479,10 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t