diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index c2e365dbd..8d0b4317c 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -511,7 +511,8 @@ struct MathGlyphInfo | hb_map_retains_sorting (glyph_map) ; - out->extendedShapeCoverage.serialize_serialize (c->serializer, it); + if (it) out->extendedShapeCoverage.serialize_serialize (c->serializer, it); + else out->extendedShapeCoverage = 0; out->mathKernInfo.serialize_subset (c, mathKernInfo, this); return_trace (true); @@ -884,8 +885,11 @@ struct MathVariants if (!o) return_trace (false); o->serialize_subset (c, glyphConstruction[i], this); } - - out->vertGlyphCoverage.serialize_serialize (c->serializer, new_vert_coverage.iter ()); + + if (new_vert_coverage) + out->vertGlyphCoverage.serialize_serialize (c->serializer, new_vert_coverage.iter ()); + + if (new_hori_coverage) out->horizGlyphCoverage.serialize_serialize (c->serializer, new_hori_coverage.iter ()); return_trace (true); } diff --git a/test/subset/data/Makefile.am b/test/subset/data/Makefile.am index c2dff35e6..f9dd45bc9 100644 --- a/test/subset/data/Makefile.am +++ b/test/subset/data/Makefile.am @@ -52,6 +52,7 @@ EXTRA_DIST += \ expected/variable \ expected/glyph_names \ expected/math \ + expected/math_coverage_offset \ expected/post \ fonts \ profiles \ diff --git a/test/subset/data/Makefile.sources b/test/subset/data/Makefile.sources index 1a56e1e3d..20f334783 100644 --- a/test/subset/data/Makefile.sources +++ b/test/subset/data/Makefile.sources @@ -44,6 +44,7 @@ TESTS = \ tests/variable.tests \ tests/glyph_names.tests \ tests/math.tests \ + tests/math_coverage_offset.tests \ tests/post.tests \ $(NULL) diff --git a/test/subset/data/expected/math_coverage_offset/Caudex-Regular.default.retain-all-codepoint.ttf b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.default.retain-all-codepoint.ttf new file mode 100644 index 000000000..0df9dca60 Binary files /dev/null and b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.default.retain-all-codepoint.ttf differ diff --git a/test/subset/data/expected/math_coverage_offset/Caudex-Regular.glyph-names.retain-all-codepoint.ttf b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.glyph-names.retain-all-codepoint.ttf new file mode 100644 index 000000000..6686d486b Binary files /dev/null and b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.glyph-names.retain-all-codepoint.ttf differ diff --git a/test/subset/data/expected/math_coverage_offset/Caudex-Regular.keep-all-layout-features.retain-all-codepoint.ttf b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.keep-all-layout-features.retain-all-codepoint.ttf new file mode 100644 index 000000000..0df9dca60 Binary files /dev/null and b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.keep-all-layout-features.retain-all-codepoint.ttf differ diff --git a/test/subset/data/expected/math_coverage_offset/Caudex-Regular.notdef-outline.retain-all-codepoint.ttf b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.notdef-outline.retain-all-codepoint.ttf new file mode 100644 index 000000000..1ce1535e5 Binary files /dev/null and b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.notdef-outline.retain-all-codepoint.ttf differ diff --git a/test/subset/data/expected/math_coverage_offset/Caudex-Regular.retain-gids.retain-all-codepoint.ttf b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.retain-gids.retain-all-codepoint.ttf new file mode 100644 index 000000000..f46479b26 Binary files /dev/null and b/test/subset/data/expected/math_coverage_offset/Caudex-Regular.retain-gids.retain-all-codepoint.ttf differ diff --git a/test/subset/data/fonts/Caudex-Regular.ttf b/test/subset/data/fonts/Caudex-Regular.ttf new file mode 100644 index 000000000..669f9f8c9 Binary files /dev/null and b/test/subset/data/fonts/Caudex-Regular.ttf differ diff --git a/test/subset/data/tests/math_coverage_offset.tests b/test/subset/data/tests/math_coverage_offset.tests new file mode 100644 index 000000000..ac333b7be --- /dev/null +++ b/test/subset/data/tests/math_coverage_offset.tests @@ -0,0 +1,12 @@ +FONTS: +Caudex-Regular.ttf + +PROFILES: +default.txt +retain-gids.txt +glyph-names.txt +notdef-outline.txt +keep-all-layout-features.txt + +SUBSETS: +* diff --git a/test/subset/meson.build b/test/subset/meson.build index c75106caf..fb27ffcd3 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -39,6 +39,7 @@ tests = [ 'sbix', 'colr', 'math', + 'math_coverage_offset', # TODO: re-enable once colrv1 subsetting is stabilized. # 'colrv1.notoemoji', 'colrv1',