diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index c80ca7d7f..3b7ea47ea 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -591,6 +591,31 @@ hb_ot_layout_collect_lookups (hb_face_t *face, } } +void +hb_ot_layout_lookup_get_coverage (hb_face_t *face, + hb_tag_t table_tag, + unsigned int lookup_index, + hb_set_t *glyphs /* OUT */) +{ + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return; + + switch (table_tag) + { + case HB_OT_TAG_GSUB: + { + const OT::SubstLookup& l = hb_ot_layout_from_face (face)->gsub->get_lookup (lookup_index); + l.add_coverage (glyphs); + return; + } + case HB_OT_TAG_GPOS: + { + const OT::PosLookup& l = hb_ot_layout_from_face (face)->gpos->get_lookup (lookup_index); + l.add_coverage (glyphs); + return; + } + } +} + void hb_ot_layout_lookup_collect_glyphs (hb_face_t *face, hb_tag_t table_tag, diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index 134f1a6c1..07ccc051b 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -192,6 +192,12 @@ hb_ot_shape_plan_collect_lookups (hb_shape_plan_t *shape_plan, hb_tag_t table_tag, hb_set_t *lookup_indexes /* OUT */); +void +hb_ot_layout_lookup_get_coverage (hb_face_t *face, + hb_tag_t table_tag, + unsigned int lookup_index, + hb_set_t *glyphs /* OUT */); + void hb_ot_layout_lookup_collect_glyphs (hb_face_t *face, hb_tag_t table_tag,