diff --git a/src/OT/Layout/GPOS/PairPosFormat1.hh b/src/OT/Layout/GPOS/PairPosFormat1.hh index b4a9a9ad5..4dada1c83 100644 --- a/src/OT/Layout/GPOS/PairPosFormat1.hh +++ b/src/OT/Layout/GPOS/PairPosFormat1.hh @@ -55,7 +55,7 @@ struct PairPosFormat1_3 if (pairSet.len > glyphs->get_population () * hb_bit_storage ((unsigned) pairSet.len) / 4) { - for (hb_codepoint_t g = HB_SET_VALUE_INVALID; glyphs->next (&g);) + for (hb_codepoint_t g : glyphs->iter()) { unsigned i = cov.get_coverage (g); if ((this+pairSet[i]).intersects (glyphs, valueFormat)) diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc index 5ac22e7c8..3a2d5081f 100644 --- a/src/hb-subset-plan.cc +++ b/src/hb-subset-plan.cc @@ -556,9 +556,12 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, if (plan->codepoint_to_glyph->has (cp)) continue; - hb_codepoint_t gid = (*unicode_glyphid_map)[cp]; - plan->codepoint_to_glyph->set (cp, gid); - plan->unicode_to_new_gid_list.push (hb_pair (cp, gid)); + hb_codepoint_t *gid; + if (!unicode_glyphid_map->has(cp, &gid)) + continue; + + plan->codepoint_to_glyph->set (cp, *gid); + plan->unicode_to_new_gid_list.push (hb_pair (cp, *gid)); } plan->unicode_to_new_gid_list.qsort (); } diff --git a/test/subset/data/Makefile.am b/test/subset/data/Makefile.am index 864db2d86..e13053ee5 100644 --- a/test/subset/data/Makefile.am +++ b/test/subset/data/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST += \ $(DISABLED_TESTS) \ expected/32bit_var_store \ expected/basics \ + expected/preprocess \ expected/full-font \ expected/glyf_bug_3131 \ expected/cff-full-font \ diff --git a/test/subset/data/Makefile.sources b/test/subset/data/Makefile.sources index 6437c00d3..22367f958 100644 --- a/test/subset/data/Makefile.sources +++ b/test/subset/data/Makefile.sources @@ -1,6 +1,7 @@ TESTS = \ tests/32bit_var_store.tests \ tests/basics.tests \ + tests/preprocess.tests \ tests/cbdt.tests \ tests/cff-full-font.tests \ tests/cff-japanese.tests \ diff --git a/test/subset/data/expected/preprocess/Roboto-Regular.gids.61,62,63,30D9.ttf b/test/subset/data/expected/preprocess/Roboto-Regular.gids.61,62,63,30D9.ttf new file mode 100644 index 000000000..5f8bff0ad Binary files /dev/null and b/test/subset/data/expected/preprocess/Roboto-Regular.gids.61,62,63,30D9.ttf differ diff --git a/test/subset/data/tests/preprocess.tests b/test/subset/data/tests/preprocess.tests new file mode 100644 index 000000000..ba2a0e2d2 --- /dev/null +++ b/test/subset/data/tests/preprocess.tests @@ -0,0 +1,8 @@ +FONTS: +Roboto-Regular.ttf + +PROFILES: +gids.txt + +SUBSETS: +abcベ diff --git a/test/subset/meson.build b/test/subset/meson.build index 4f360a34f..289cc1649 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -1,5 +1,6 @@ tests = [ 'basics', + 'preprocess', 'full-font', 'cff-full-font', 'japanese',