[subset] Only used reachable lookups for gsub closure.

This commit is contained in:
Garret Rieger authored and Behdad Esfahbod committed 2018-07-25 13:56:58 -07:00
1 parent c38bd4025f
commit fb58cb4b5c
1 file changed
+8 -4
+8 -4
View File
@@ -56,11 +56,15 @@ _add_gid_and_children (const OT::glyf::accelerator_t &glyf,
static void
_gsub_closure (hb_face_t *face, hb_set_t *gids_to_retain)
{
// TODO(grieger): This uses all lookups, instead collect
// the set of lookups that are relevant.
// See fontTools implementation.
hb_auto_t<hb_set_t> lookup_indices;
hb_ot_layout_collect_lookups (face,
HB_OT_TAG_GSUB,
nullptr,
nullptr,
nullptr,
&lookup_indices);
hb_ot_layout_lookups_substitute_closure (face,
nullptr,
&lookup_indices,
gids_to_retain);
}