diff --git a/src/hb-subset-input.cc b/src/hb-subset-input.cc index 028ddf903..e10391739 100644 --- a/src/hb-subset-input.cc +++ b/src/hb-subset-input.cc @@ -203,6 +203,8 @@ hb_subset_input_create_or_fail (void) input->sets.layout_features->add_array (default_layout_features, ARRAY_LENGTH (default_layout_features)); + input->sets.layout_scripts->invert (); // Default to all scripts. + if (input->in_error ()) { hb_subset_input_destroy (input); diff --git a/src/hb-subset-input.hh b/src/hb-subset-input.hh index 07c0e2267..a21a6f352 100644 --- a/src/hb-subset-input.hh +++ b/src/hb-subset-input.hh @@ -50,6 +50,7 @@ struct hb_subset_input_t hb_set_t *name_ids; hb_set_t *name_languages; hb_set_t *layout_features; + hb_set_t *layout_scripts; }; union { diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index f89c8c861..574d45eff 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -555,8 +555,7 @@ hb_subset_plan_create_or_fail (hb_face_t *face, _nameid_closure (face, plan->name_ids); plan->name_languages = hb_set_copy (input->sets.name_languages); plan->layout_features = hb_set_copy (input->sets.layout_features); - plan->layout_scripts = hb_set_create (); - hb_set_invert (plan->layout_scripts); + plan->layout_scripts = hb_set_copy (input->sets.layout_scripts); plan->glyphs_requested = hb_set_copy (input->sets.glyphs); plan->drop_tables = hb_set_copy (input->sets.drop_tables); plan->no_subset_tables = hb_set_copy (input->sets.no_subset_tables); diff --git a/src/hb-subset.h b/src/hb-subset.h index a2799d91e..636e399a6 100644 --- a/src/hb-subset.h +++ b/src/hb-subset.h @@ -100,6 +100,8 @@ typedef enum { /*< flags >*/ * @HB_SUBSET_SETS_NAME_LANG_ID: the set of name lang ids that will be retained. * @HB_SUBSET_SETS_LAYOUT_FEATURE_TAG: the set of layout feature tags that will be retained * in the subset. + * @HB_SUBSET_SETS_LAYOUT_SCRIPT_TAG: the set of layout script tags that will be retained + * in the subset. Defaults to all tags. * * List of sets that can be configured on the subset input. * @@ -113,6 +115,7 @@ typedef enum { HB_SUBSET_SETS_NAME_ID, HB_SUBSET_SETS_NAME_LANG_ID, HB_SUBSET_SETS_LAYOUT_FEATURE_TAG, + HB_SUBSET_SETS_LAYOUT_SCRIPT_TAG, } hb_subset_sets_t; HB_EXTERN hb_subset_input_t *