From 07034f447bc33bec945629a23b3a2dfc073deeca Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 21 Apr 2013 16:34:18 -0400 Subject: [PATCH] [API] Add hb_ot_layout_lookup_get_coverage() --- src/hb-ot-layout.cc | 25 +++++++++++++++++++++++++ src/hb-ot-layout.h | 6 ++++++ 2 files changed, 31 insertions(+) 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,