Merge pull request #3893 from googlefonts/preprocess_test

[subset] Fix testing of preprocess
pull/3894/head
Behdad Esfahbod 2 years ago committed by GitHub
commit a4a4078632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/hb-ot-layout-gsubgpos.hh
  2. 8
      src/hb-subset-input.cc
  3. BIN
      test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.layout-test-retain-gids.41,42,43.otf
  4. BIN
      test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.layout-test-retain-gids.41,42.otf
  5. BIN
      test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.layout-test-retain-gids.retain-all-codepoint.otf
  6. BIN
      test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.layout-test.41,42,43.otf
  7. BIN
      test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.layout-test.41,42.otf
  8. BIN
      test/subset/data/expected/layout.context/gpos_context2_multiple_subrules_f1.layout-test.retain-all-codepoint.otf
  9. BIN
      test/subset/data/expected/layout.gdef-attachlist/IndicTestJalandhar-Regular.default.retain-all-codepoint.ttf
  10. BIN
      test/subset/data/expected/layout.gdef-attachlist/IndicTestJalandhar-Regular.drop-hints.retain-all-codepoint.ttf
  11. BIN
      test/subset/data/expected/layout.gdef-attachlist/IndicTestJalandhar-Regular.keep-gdef.retain-all-codepoint.ttf
  12. BIN
      test/subset/data/expected/layout.gsub5/gsub_context2_multiple_subrules_f2.layout-test-retain-gids.41,42,43.otf
  13. BIN
      test/subset/data/expected/layout.gsub5/gsub_context2_multiple_subrules_f2.layout-test-retain-gids.41,42.otf
  14. BIN
      test/subset/data/expected/layout.gsub5/gsub_context2_multiple_subrules_f2.layout-test-retain-gids.retain-all-codepoint.otf
  15. BIN
      test/subset/data/expected/layout.gsub5/gsub_context2_multiple_subrules_f2.layout-test.41,42,43.otf
  16. BIN
      test/subset/data/expected/layout.gsub5/gsub_context2_multiple_subrules_f2.layout-test.41,42.otf
  17. BIN
      test/subset/data/expected/layout.gsub5/gsub_context2_multiple_subrules_f2.layout-test.retain-all-codepoint.otf
  18. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.default.627,644,62D,628.ttf
  19. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.default.633,6D2.ttf
  20. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.default.63A,64A,631.ttf
  21. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.default.retain-all-codepoint.ttf
  22. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.retain-gids.627,644,62D,628.ttf
  23. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.retain-gids.633,6D2.ttf
  24. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.retain-gids.63A,64A,631.ttf
  25. BIN
      test/subset/data/expected/layout.notonastaliqurdu/NotoNastaliqUrdu-Regular.retain-gids.retain-all-codepoint.ttf
  26. 2
      test/subset/generate-expected-outputs.py
  27. 2
      util/hb-subset.cc

@ -2421,6 +2421,7 @@ struct ContextFormat2_5
const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups;
bool ret = true;
int non_zero_index = -1, index = 0;
auto snapshot = c->serializer->snapshot();
for (const auto& _ : + hb_enumerate (ruleSet)
| hb_filter (klass_map, hb_first))
{
@ -2432,8 +2433,10 @@ struct ContextFormat2_5
}
if (coverage_glyph_classes.has (_.first) &&
o->serialize_subset (c, _.second, this, lookup_map, &klass_map))
o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
non_zero_index = index;
snapshot = c->serializer->snapshot();
}
index++;
}
@ -2447,6 +2450,7 @@ struct ContextFormat2_5
out->ruleSet.pop ();
index--;
}
c->serializer->revert (snapshot);
return_trace (bool (out->ruleSet));
}

@ -468,6 +468,9 @@ hb_subset_preprocess (hb_face_t *source)
hb_set_clear (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
hb_set_invert (hb_subset_input_set(input, HB_SUBSET_SETS_UNICODE));
hb_set_clear (hb_subset_input_set(input, HB_SUBSET_SETS_GLYPH_INDEX));
hb_set_invert (hb_subset_input_set(input, HB_SUBSET_SETS_GLYPH_INDEX));
hb_set_clear (hb_subset_input_set(input,
HB_SUBSET_SETS_LAYOUT_FEATURE_TAG));
hb_set_invert (hb_subset_input_set(input,
@ -483,6 +486,11 @@ hb_subset_preprocess (hb_face_t *source)
hb_set_invert (hb_subset_input_set(input,
HB_SUBSET_SETS_NAME_ID));
hb_set_clear (hb_subset_input_set(input,
HB_SUBSET_SETS_NAME_LANG_ID));
hb_set_invert (hb_subset_input_set(input,
HB_SUBSET_SETS_NAME_LANG_ID));
hb_subset_input_set_flags(input,
HB_SUBSET_FLAGS_NOTDEF_OUTLINE |
HB_SUBSET_FLAGS_GLYPH_NAMES |

@ -35,6 +35,7 @@ def generate_expected_output(input_file, unicodes, profile_flags, instance_flags
"--no-overlap-flag",
"--no-recalc-bounds",
"--no-recalc-timestamp",
"--no-harfbuzz-repacker", # disable harfbuzz repacker so we aren't comparing to ourself.
"--output=%s" % instance_path,
input_file]
args.extend(instance_flags)
@ -45,6 +46,7 @@ def generate_expected_output(input_file, unicodes, profile_flags, instance_flags
args = ["fonttools", "subset", input_path]
args.extend(["--drop-tables+=DSIG",
"--drop-tables-=sbix",
"--no-harfbuzz-repacker", # disable harfbuzz repacker so we aren't comparing to ourself.
"--unicodes=%s" % unicodes,
"--output-file=%s" % fonttools_path])
args.extend(profile_flags)

@ -120,7 +120,7 @@ struct subset_main_t : option_parser_t, face_options_t, output_options_t<false>
for (unsigned i = 0; i < num_iterations; i++)
{
hb_face_destroy (new_face);
new_face = hb_subset_or_fail (face, input);
new_face = hb_subset_or_fail (orig_face, input);
}
bool success = new_face;

Loading…
Cancel
Save