diff --git a/src/OT/Color/COLR/COLR.hh b/src/OT/Color/COLR/COLR.hh index 9d8af5d45..e685afe87 100644 --- a/src/OT/Color/COLR/COLR.hh +++ b/src/OT/Color/COLR/COLR.hh @@ -2096,8 +2096,29 @@ struct COLR { accelerator_t (hb_face_t *face) { colr = hb_sanitize_context_t ().reference_table (face); } + ~accelerator_t () { this->colr.destroy (); } +#ifndef HB_NO_PAINT + bool + get_extents (hb_font_t *font, + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const + { + return colr->get_extents (font, glyph, extents); + } + + bool paint_glyph (hb_font_t *font, + hb_codepoint_t glyph, + hb_paint_funcs_t *funcs, void *data, + unsigned int palette_index, + hb_color_t foreground, + bool clip = true) const + { + return colr->paint_glyph (font, glyph, funcs, data, palette_index, foreground, clip); + } +#endif + bool is_valid () { return colr.get_blob ()->length; } void closure_glyphs (hb_codepoint_t glyph, @@ -2131,7 +2152,7 @@ struct COLR const DeltaSetIndexMap *get_delta_set_index_map_ptr () const { return colr->get_delta_set_index_map_ptr (); } - private: + public: hb_blob_ptr_t colr; }; diff --git a/src/hb-ot-color.cc b/src/hb-ot-color.cc index 37d42e08d..1436fe563 100644 --- a/src/hb-ot-color.cc +++ b/src/hb-ot-color.cc @@ -204,7 +204,7 @@ hb_ot_color_palette_get_colors (hb_face_t *face, hb_bool_t hb_ot_color_has_layers (hb_face_t *face) { - return face->table.COLR->has_v0_data (); + return face->table.COLR->colr->has_v0_data (); } /** @@ -221,7 +221,7 @@ hb_ot_color_has_layers (hb_face_t *face) hb_bool_t hb_ot_color_has_paint (hb_face_t *face) { - return face->table.COLR->has_v1_data (); + return face->table.COLR->colr->has_v1_data (); } /** @@ -240,7 +240,7 @@ hb_bool_t hb_ot_color_glyph_has_paint (hb_face_t *face, hb_codepoint_t glyph) { - return face->table.COLR->has_paint_for_glyph (glyph); + return face->table.COLR->colr->has_paint_for_glyph (glyph); } /** @@ -266,7 +266,7 @@ hb_ot_color_glyph_get_layers (hb_face_t *face, unsigned int *layer_count, /* IN/OUT. May be NULL. */ hb_ot_color_layer_t *layers /* OUT. May be NULL. */) { - return face->table.COLR->get_glyph_layers (glyph, start_offset, layer_count, layers); + return face->table.COLR->colr->get_glyph_layers (glyph, start_offset, layer_count, layers); } diff --git a/src/hb-ot-face-table-list.hh b/src/hb-ot-face-table-list.hh index 11c64ef47..ee05cd05b 100644 --- a/src/hb-ot-face-table-list.hh +++ b/src/hb-ot-face-table-list.hh @@ -139,7 +139,7 @@ HB_OT_ACCELERATOR (AAT, hvgl) /* OpenType color fonts. */ #ifndef HB_NO_COLOR -HB_OT_CORE_TABLE (OT, COLR) +HB_OT_ACCELERATOR (OT, COLR) HB_OT_CORE_TABLE (OT, CPAL) HB_OT_ACCELERATOR (OT, CBDT) HB_OT_ACCELERATOR (OT, sbix) diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc index 1cf14f3eb..d17f08807 100644 --- a/src/hb-ot-face.cc +++ b/src/hb-ot-face.cc @@ -36,6 +36,7 @@ #include "hb-ot-name-table.hh" #include "hb-ot-post-table.hh" #include "OT/Color/CBDT/CBDT.hh" +#include "OT/Color/COLR/COLR.hh" #include "OT/Color/sbix/sbix.hh" #include "OT/Color/svg/svg.hh" #include "hb-ot-layout-gdef-table.hh"