diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index 0d04a3677..4985d5e83 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1128,7 +1128,7 @@ struct Lookup out->lookupType = lookupType; out->lookupFlag = lookupFlag; - const hb_set_t *glyphset = c->plan->glyphset (); + const hb_set_t *glyphset = c->plan->glyphset_gsub (); unsigned int lookup_type = get_type (); + hb_iter (get_subtables ()) | hb_filter ([this, glyphset, lookup_type] (const OffsetTo &_) { return (this+_).intersects (glyphset, lookup_type); }) @@ -1506,7 +1506,7 @@ struct Coverage bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto it = @@ -1733,7 +1733,7 @@ struct ClassDefFormat1 hb_map_t *klass_map = nullptr /*OUT*/) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->_glyphset_gsub; + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; hb_sorted_vector_t glyphs; @@ -1907,7 +1907,7 @@ struct ClassDefFormat2 hb_map_t *klass_map = nullptr /*OUT*/) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->_glyphset_gsub; + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; hb_sorted_vector_t glyphs; diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 2217d298f..131ded282 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -755,7 +755,7 @@ struct SinglePosFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto it = @@ -870,7 +870,7 @@ struct SinglePosFormat2 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; unsigned sub_length = valueFormat.get_len (); @@ -1129,7 +1129,7 @@ struct PairSet if (unlikely (!c->serializer->extend_min (out))) return_trace (false); out->len = 0; - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; unsigned len1 = valueFormats[0].get_len (); @@ -1250,7 +1250,7 @@ struct PairPosFormat1 { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -1441,7 +1441,7 @@ struct PairPosFormat2 }) ; - const hb_set_t &glyphset = *c->plan->_glyphset_gsub; + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto it = @@ -1728,7 +1728,7 @@ struct CursivePosFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -1904,7 +1904,7 @@ struct MarkBasePosFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -2288,7 +2288,7 @@ struct MarkMarkPosFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 2f41d6781..5f10ecb7e 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -356,7 +356,7 @@ struct Sequence bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; if (!intersects (&glyphset)) return_trace (false); @@ -447,7 +447,7 @@ struct MultipleSubstFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -582,7 +582,7 @@ struct AlternateSet bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto it = @@ -682,7 +682,7 @@ struct AlternateSubstFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -840,7 +840,7 @@ struct Ligature bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; if (!intersects (&glyphset) || !glyphset.has (ligGlyph)) return_trace (false); @@ -1058,7 +1058,7 @@ struct LigatureSubstFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 389d7af8f..da94fa3e1 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1388,9 +1388,11 @@ struct Rule lookup_context); } - void closure_lookups (hb_closure_lookups_context_t *c) const + void closure_lookups (hb_closure_lookups_context_t *c, + ContextClosureLookupContext &lookup_context) const { if (unlikely (c->lookup_limit_exceeded ())) return; + if (!intersects (c->glyphs, lookup_context)) return; const UnsizedArrayOf &lookupRecord = StructAfter> (inputZ.as_array (inputCount ? inputCount - 1 : 0)); @@ -1520,14 +1522,13 @@ struct RuleSet ; } - void closure_lookups (hb_closure_lookups_context_t *c) const + void closure_lookups (hb_closure_lookups_context_t *c, + ContextClosureLookupContext &lookup_context) const { if (unlikely (c->lookup_limit_exceeded ())) return; - - return + hb_iter (rule) | hb_map (hb_add (this)) - | hb_apply ([&] (const Rule &_) { _.closure_lookups (c); }) + | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); }) ; } @@ -1646,9 +1647,16 @@ struct ContextFormat1 void closure_lookups (hb_closure_lookups_context_t *c) const { - + hb_iter (ruleSet) + struct ContextClosureLookupContext lookup_context = { + {intersects_glyph}, + nullptr + }; + + + hb_zip (this+coverage, ruleSet) + | hb_filter (*c->glyphs, hb_first) + | hb_map (hb_second) | hb_map (hb_add (this)) - | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c); }) + | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); }) ; } @@ -1699,7 +1707,7 @@ struct ContextFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -1790,10 +1798,24 @@ struct ContextFormat2 void closure_lookups (hb_closure_lookups_context_t *c) const { + if (!(this+coverage).intersects (c->glyphs)) + return; + + const ClassDef &class_def = this+classDef; + + struct ContextClosureLookupContext lookup_context = { + {intersects_class}, + &class_def + }; + + hb_iter (ruleSet) | hb_map (hb_add (this)) - | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c); }) - ; + | hb_enumerate + | hb_filter ([&] (const hb_pair_t p) + { return class_def.intersects_class (c->glyphs, p.first); }) + | hb_map (hb_second) + | hb_apply ([&] (const RuleSet & _) + { _.closure_lookups (c, lookup_context); }); } void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {} @@ -1944,6 +1966,8 @@ struct ContextFormat3 void closure_lookups (hb_closure_lookups_context_t *c) const { + if (!intersects (c->glyphs)) + return; const LookupRecord *lookupRecord = &StructAfter (coverageZ.as_array (glyphCount)); recurse_lookups (c, lookupCount, lookupRecord); } @@ -2237,9 +2261,11 @@ struct ChainRule lookup_context); } - void closure_lookups (hb_closure_lookups_context_t *c) const + void closure_lookups (hb_closure_lookups_context_t *c, + ChainContextClosureLookupContext &lookup_context) const { if (unlikely (c->lookup_limit_exceeded ())) return; + if (!intersects (c->glyphs, lookup_context)) return; const HeadlessArrayOf &input = StructAfter> (backtrack); const ArrayOf &lookahead = StructAfter> (input); @@ -2357,7 +2383,7 @@ struct ChainRule if (!backtrack_map) { - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); if (!hb_all (backtrack, glyphset) || !hb_all (input, glyphset) || !hb_all (lookahead, glyphset)) @@ -2430,14 +2456,14 @@ struct ChainRuleSet ; } - void closure_lookups (hb_closure_lookups_context_t *c) const + void closure_lookups (hb_closure_lookups_context_t *c, + ChainContextClosureLookupContext &lookup_context) const { if (unlikely (c->lookup_limit_exceeded ())) return; - return + hb_iter (rule) | hb_map (hb_add (this)) - | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c); }) + | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); }) ; } @@ -2558,9 +2584,16 @@ struct ChainContextFormat1 void closure_lookups (hb_closure_lookups_context_t *c) const { - + hb_iter (ruleSet) + struct ChainContextClosureLookupContext lookup_context = { + {intersects_glyph}, + {nullptr, nullptr, nullptr} + }; + + + hb_zip (this+coverage, ruleSet) + | hb_filter (*c->glyphs, hb_first) + | hb_map (hb_second) | hb_map (hb_add (this)) - | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c); }) + | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); }) ; } @@ -2610,7 +2643,7 @@ struct ChainContextFormat1 bool subset (hb_subset_context_t *c) const { TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset (); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); const hb_map_t &glyph_map = *c->plan->glyph_map; auto *out = c->serializer->start_embed (*this); @@ -2707,9 +2740,28 @@ struct ChainContextFormat2 void closure_lookups (hb_closure_lookups_context_t *c) const { + if (!(this+coverage).intersects (c->glyphs)) + return; + + const ClassDef &backtrack_class_def = this+backtrackClassDef; + const ClassDef &input_class_def = this+inputClassDef; + const ClassDef &lookahead_class_def = this+lookaheadClassDef; + + struct ChainContextClosureLookupContext lookup_context = { + {intersects_class}, + {&backtrack_class_def, + &input_class_def, + &lookahead_class_def} + }; + + hb_iter (ruleSet) | hb_map (hb_add (this)) - | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c); }) + | hb_enumerate + | hb_filter([&] (unsigned gid) + { return input_class_def.intersects_class (c->glyphs, gid); }, hb_first) + | hb_map (hb_second) + | hb_apply ([&] (const ChainRuleSet &_) + { _.closure_lookups (c, lookup_context); }) ; } @@ -2800,9 +2852,10 @@ struct ChainContextFormat2 if (unlikely (!c->serializer->check_success (!lookahead_klass_map.in_error ()))) return_trace (false); - unsigned non_zero_index = 0, index = 0; + int non_zero_index = -1, index = 0; bool ret = true; const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups; + auto last_non_zero = c->serializer->snapshot (); for (const OffsetTo& _ : + hb_enumerate (ruleSet) | hb_filter (input_klass_map, hb_first) | hb_map (hb_second)) @@ -2818,19 +2871,20 @@ struct ChainContextFormat2 &backtrack_klass_map, &input_klass_map, &lookahead_klass_map)) + { + last_non_zero = c->serializer->snapshot (); non_zero_index = index; + } index++; } if (!ret) return_trace (ret); - //prune empty trailing ruleSets - --index; - while (index > non_zero_index) - { - out->ruleSet.pop (); - index--; + // prune empty trailing ruleSets + if (index > non_zero_index) { + c->serializer->revert (last_non_zero); + out->ruleSet.len = non_zero_index + 1; } return_trace (bool (out->ruleSet)); @@ -2914,6 +2968,9 @@ struct ChainContextFormat3 void closure_lookups (hb_closure_lookups_context_t *c) const { + if (!intersects (c->glyphs)) + return; + const OffsetArrayOf &input = StructAfter> (backtrack); const OffsetArrayOf &lookahead = StructAfter> (input); const ArrayOf &lookup = StructAfter> (lookahead); @@ -2992,13 +3049,16 @@ struct ChainContextFormat3 TRACE_SERIALIZE (this); auto *out = c->serializer->start_embed> (); - if (unlikely (!c->serializer->allocate_size (HBUINT16::static_size))) return_trace (false); + if (unlikely (!c->serializer->allocate_size (HBUINT16::static_size))) + return_trace (false); - + it - | hb_apply (subset_offset_array (c, *out, base)) - ; + for (auto& offset : it) { + auto *o = out->serialize_append (c->serializer); + if (unlikely (!o) || !o->serialize_subset (c, offset, base)) + return_trace (false); + } - return_trace (out->len); + return_trace (true); } bool subset (hb_subset_context_t *c) const @@ -3326,20 +3386,31 @@ struct GSUBGPOS return_trace (true); } - void closure_features (const hb_map_t *lookup_indexes, /* IN */ - hb_set_t *feature_indexes /* OUT */) const + void prune_features (const hb_map_t *lookup_indices, /* IN */ + hb_set_t *feature_indices /* IN/OUT */) const { - unsigned int feature_count = hb_min (get_feature_count (), (unsigned) HB_MAX_FEATURES); - for (unsigned i = 0; i < feature_count; i++) +#ifndef HB_NO_VAR + // This is the set of feature indices which have alternate versions defined + // if the FeatureVariation's table and the alternate version(s) intersect the + // set of lookup indices. + hb_set_t alternate_feature_indices; + if (version.to_int () >= 0x00010001u) + (this+featureVars).closure_features (lookup_indices, &alternate_feature_indices); + if (alternate_feature_indices.in_error()) { + feature_indices->successful = false; + return; + } +#endif + + for (unsigned i : feature_indices->iter()) { const Feature& f = get_feature (i); - if ((!f.featureParams.is_null ()) || f.intersects_lookup_indexes (lookup_indexes)) - feature_indexes->add (i); + + if (f.featureParams.is_null () + && !f.intersects_lookup_indexes (lookup_indices) + && !alternate_feature_indices.has (i)) + feature_indices->del (i); } -#ifndef HB_NO_VAR - if (version.to_int () >= 0x00010001u) - (this+featureVars).closure_features (lookup_indexes, feature_indexes); -#endif } unsigned int get_size () const diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 24beada3e..d055783a4 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -88,10 +88,17 @@ _gsub_closure_glyphs_lookups_features (hb_face_t *face, &lookup_indices); _remap_indexes (&lookup_indices, gsub_lookups); - //closure features + // Collect and prune features hb_set_t feature_indices; - gsub->closure_features (gsub_lookups, &feature_indices); + hb_ot_layout_collect_features (face, + HB_OT_TAG_GSUB, + nullptr, + nullptr, + nullptr, + &feature_indices); + gsub->prune_features (gsub_lookups, &feature_indices); _remap_indexes (&feature_indices, gsub_features); + gsub.destroy (); } @@ -114,9 +121,15 @@ _gpos_closure_lookups_features (hb_face_t *face, &lookup_indices); _remap_indexes (&lookup_indices, gpos_lookups); - //closure features + // Collect and prune features hb_set_t feature_indices; - gpos->closure_features (gpos_lookups, &feature_indices); + hb_ot_layout_collect_features (face, + HB_OT_TAG_GPOS, + nullptr, + nullptr, + nullptr, + &feature_indices); + gpos->prune_features (gpos_lookups, &feature_indices); _remap_indexes (&feature_indices, gpos_features); gpos.destroy (); } @@ -243,7 +256,11 @@ _populate_gids_to_retain (hb_subset_plan_t* plan, #ifndef HB_NO_VAR if (close_over_gdef) - _collect_layout_variation_indices (plan->source, plan->_glyphset, plan->gpos_lookups, plan->layout_variation_indices, plan->layout_variation_idx_map); + _collect_layout_variation_indices (plan->source, + plan->_glyphset_gsub, + plan->gpos_lookups, + plan->layout_variation_indices, + plan->layout_variation_idx_map); #endif #ifndef HB_NO_SUBSET_CFF diff --git a/test/subset/data/Makefile.sources b/test/subset/data/Makefile.sources index bdc983552..58ba1082c 100644 --- a/test/subset/data/Makefile.sources +++ b/test/subset/data/Makefile.sources @@ -18,6 +18,7 @@ TESTS = \ tests/layout.gpos4.tests \ tests/layout.gpos6.tests \ tests/layout.gpos8.tests \ + tests/layout.gpos8.amiri.tests \ tests/layout.gsub3.tests \ tests/layout.gsub6.tests \ tests/layout.tests \ diff --git a/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf index eff7821ad..6354eff8f 100644 Binary files a/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf index eff7821ad..6354eff8f 100644 Binary files a/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.context/gpos_context1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf index 339bfe8cc..0691569c7 100644 Binary files a/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf index 339bfe8cc..0691569c7 100644 Binary files a/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf index 5588fd3bb..684e99126 100644 Binary files a/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout.retain-all-codepoint.otf index 5588fd3bb..684e99126 100644 Binary files a/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.context/gpos_context3_simple_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.retain-all-codepoint.otf index d9b5dfb09..8dbc8200d 100644 Binary files a/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.retain-all-codepoint.otf index d9b5dfb09..8dbc8200d 100644 Binary files a/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos3/gpos3_font3.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout-retain-gids.retain-all-codepoint.otf index d4f9fc081..3765d20de 100644 Binary files a/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout.retain-all-codepoint.otf index d4f9fc081..3765d20de 100644 Binary files a/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos4/gpos4_multiple_anchors_1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout-retain-gids.retain-all-codepoint.otf index f63634252..0feba1bd6 100644 Binary files a/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout.retain-all-codepoint.otf index f63634252..0feba1bd6 100644 Binary files a/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos6/gpos6_font1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644,623,62D,644,627,645,2E.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644,623,62D,644,627,645,2E.ttf new file mode 100644 index 000000000..f361131df Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644,623,62D,644,627,645,2E.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644,62D,628.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644,62D,628.ttf new file mode 100644 index 000000000..d29849119 Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644,62D,628.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644.ttf new file mode 100644 index 000000000..1b9060690 Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.627,644.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.633,645,627,621,20,644,627.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.633,645,627,621,20,644,627.ttf new file mode 100644 index 000000000..969fda230 Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.633,645,627,621,20,644,627.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.63A,64A,631.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.63A,64A,631.ttf new file mode 100644 index 000000000..54ef72126 Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout-retain-gids.63A,64A,631.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644,623,62D,644,627,645,2E.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644,623,62D,644,627,645,2E.ttf new file mode 100644 index 000000000..57ef1910e Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644,623,62D,644,627,645,2E.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644,62D,628.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644,62D,628.ttf new file mode 100644 index 000000000..a9c3d361e Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644,62D,628.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644.ttf new file mode 100644 index 000000000..a535889e2 Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.627,644.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.633,645,627,621,20,644,627.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.633,645,627,621,20,644,627.ttf new file mode 100644 index 000000000..05774089b Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.633,645,627,621,20,644,627.ttf differ diff --git a/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.63A,64A,631.ttf b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.63A,64A,631.ttf new file mode 100644 index 000000000..8e4c01427 Binary files /dev/null and b/test/subset/data/expected/layout.gpos8.amiri/Amiri-Regular.keep-layout.63A,64A,631.ttf differ diff --git a/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf index 3fabe7185..aee157993 100644 Binary files a/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf index 3fabe7185..aee157993 100644 Binary files a/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos8/gpos_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf index 53dccf982..48b30c79b 100644 Binary files a/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf index 53dccf982..48b30c79b 100644 Binary files a/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos8/gpos_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf index e7cc68d15..2f0e4b9d1 100644 Binary files a/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout.retain-all-codepoint.otf index e7cc68d15..2f0e4b9d1 100644 Binary files a/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gpos8/gpos_chaining3_simple_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf index 1f9075403..3e7ecef82 100644 Binary files a/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf index 1f9075403..3e7ecef82 100644 Binary files a/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gsub6/gsub_chaining1_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf index e76439392..6b55fe6ad 100644 Binary files a/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf index e76439392..6b55fe6ad 100644 Binary files a/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gsub6/gsub_chaining2_multiple_subrules_f1.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout-retain-gids.retain-all-codepoint.otf b/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout-retain-gids.retain-all-codepoint.otf index 737f85a46..2af5abbe5 100644 Binary files a/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout-retain-gids.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout-retain-gids.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout.retain-all-codepoint.otf b/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout.retain-all-codepoint.otf index 737f85a46..2af5abbe5 100644 Binary files a/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout.retain-all-codepoint.otf and b/test/subset/data/expected/layout.gsub6/gsub_chaining3_simple_f2.keep-layout.retain-all-codepoint.otf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,42,43.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,42,43.ttf index aa007bac5..95e055f53 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,42,43.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,42,43.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,43.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,43.ttf index f3be30c5b..1702a1022 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,43.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41,43.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41.ttf index 44c329eb1..c03e8cbf5 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.41.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.43.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.43.ttf index b0a1ea3dc..be5e6d9f4 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.43.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.43.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.CA,CB.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.CA,CB.ttf index 16ad9d515..9798bc48e 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.CA,CB.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout-retain-gids.CA,CB.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,42,43.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,42,43.ttf index d0d9d5a28..33aa3f7f4 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,42,43.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,42,43.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,43.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,43.ttf index f4d881f29..c207f0932 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,43.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41,43.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41.ttf index 9e6dd28f5..70251b38a 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.41.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.43.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.43.ttf index 50260c54d..2109fafc7 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.43.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.43.ttf differ diff --git a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.CA,CB.ttf b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.CA,CB.ttf index 22d5b6198..16c6d432e 100644 Binary files a/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.CA,CB.ttf and b/test/subset/data/expected/layout/Roboto-Regular.smallcaps.keep-layout.CA,CB.ttf differ diff --git a/test/subset/data/fonts/Amiri-Regular.ttf b/test/subset/data/fonts/Amiri-Regular.ttf new file mode 100644 index 000000000..47cb4e14e Binary files /dev/null and b/test/subset/data/fonts/Amiri-Regular.ttf differ diff --git a/test/subset/data/profiles/keep-layout-retain-gids.txt b/test/subset/data/profiles/keep-layout-retain-gids.txt index f4787adef..9248ef68e 100644 --- a/test/subset/data/profiles/keep-layout-retain-gids.txt +++ b/test/subset/data/profiles/keep-layout-retain-gids.txt @@ -1,2 +1,2 @@ ---drop-tables-=GSUB,GPOS +--drop-tables-=GSUB,GPOS,GDEF --retain-gids diff --git a/test/subset/data/profiles/keep-layout.txt b/test/subset/data/profiles/keep-layout.txt index 56da0ffe3..969e34a9b 100644 --- a/test/subset/data/profiles/keep-layout.txt +++ b/test/subset/data/profiles/keep-layout.txt @@ -1 +1 @@ ---drop-tables-=GSUB,GPOS +--drop-tables-=GSUB,GPOS,GDEF diff --git a/test/subset/data/tests/layout.gpos8.amiri.tests b/test/subset/data/tests/layout.gpos8.amiri.tests new file mode 100644 index 000000000..a885cb4d1 --- /dev/null +++ b/test/subset/data/tests/layout.gpos8.amiri.tests @@ -0,0 +1,13 @@ +FONTS: +Amiri-Regular.ttf + +PROFILES: +keep-layout.txt +keep-layout-retain-gids.txt + +SUBSETS: +ال +الأحلام. +غير +سماء لا +الحب diff --git a/test/subset/meson.build b/test/subset/meson.build index 9153e6914..8d3d58bd4 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -11,6 +11,7 @@ tests = [ 'layout.gpos4', 'layout.gpos6', 'layout.gpos8', + 'layout.gpos8.amiri', 'layout.gsub3', 'layout.gsub6', 'layout.gdef',