diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index c77ec12fb..c15a42b0f 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -4261,6 +4261,7 @@ struct GSUBGPOS } void prune_langsys (const hb_map_t *duplicate_feature_map, + const hb_set_t *layout_scripts, hb_hashmap_t> *script_langsys_map, hb_set_t *new_feature_indexes /* OUT */) const { @@ -4269,6 +4270,8 @@ struct GSUBGPOS unsigned count = get_script_count (); for (unsigned script_index = 0; script_index < count; script_index++) { + const Tag& tag = get_script_tag (script_index); + if (!layout_scripts->has (tag)) continue; const Script& s = get_script (script_index); s.prune_langsys (&c, script_index); } diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index c34f6722b..f58061832 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -259,7 +259,7 @@ _closure_glyphs_lookups_features (hb_subset_plan_t *plan, _GSUBGPOS_find_duplicate_features (*table, lookups, &feature_indices, &duplicate_feature_map); feature_indices.clear (); - table->prune_langsys (&duplicate_feature_map, langsys_map, &feature_indices); + table->prune_langsys (&duplicate_feature_map, plan->layout_scripts, langsys_map, &feature_indices); _remap_indexes (&feature_indices, features); table.destroy ();