diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 4f8fa0123..c5946934b 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -28,6 +28,7 @@ #define HB_OT_COLOR_CBDT_TABLE_HH #include "hb-open-type.hh" +#include "hb-paint.hh" /* * CBLC -- Color Bitmap Location @@ -936,6 +937,18 @@ struct CBDT bool has_data () const { return cbdt.get_length (); } + bool paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const + { + hb_blob_t *blob = reference_png (font, glyph); + if (unlikely (blob == hb_blob_get_empty ())) + return false; + + funcs->image (data, glyph); + + hb_blob_destroy (blob); + return true; + } + private: hb_blob_ptr_t cblc; hb_blob_ptr_t cbdt;