[subset] MATH: don't serialize coverage table when iterator is empty

when iterator is empty, just set coverage offset to 0.
serialize() in coverage will at lease write out a 16-bit format header.
pull/3321/head
Qunxin Liu 3 years ago committed by Behdad Esfahbod
parent 1d9ef3a75a
commit 74b46b29e7
  1. 10
      src/hb-ot-math-table.hh
  2. 1
      test/subset/data/Makefile.am
  3. 1
      test/subset/data/Makefile.sources
  4. BIN
      test/subset/data/expected/math_coverage_offset/Caudex-Regular.default.retain-all-codepoint.ttf
  5. BIN
      test/subset/data/expected/math_coverage_offset/Caudex-Regular.glyph-names.retain-all-codepoint.ttf
  6. BIN
      test/subset/data/expected/math_coverage_offset/Caudex-Regular.keep-all-layout-features.retain-all-codepoint.ttf
  7. BIN
      test/subset/data/expected/math_coverage_offset/Caudex-Regular.notdef-outline.retain-all-codepoint.ttf
  8. BIN
      test/subset/data/expected/math_coverage_offset/Caudex-Regular.retain-gids.retain-all-codepoint.ttf
  9. BIN
      test/subset/data/fonts/Caudex-Regular.ttf
  10. 12
      test/subset/data/tests/math_coverage_offset.tests
  11. 1
      test/subset/meson.build

@ -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);
}

@ -52,6 +52,7 @@ EXTRA_DIST += \
expected/variable \
expected/glyph_names \
expected/math \
expected/math_coverage_offset \
expected/post \
fonts \
profiles \

@ -44,6 +44,7 @@ TESTS = \
tests/variable.tests \
tests/glyph_names.tests \
tests/math.tests \
tests/math_coverage_offset.tests \
tests/post.tests \
$(NULL)

@ -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:
*

@ -39,6 +39,7 @@ tests = [
'sbix',
'colr',
'math',
'math_coverage_offset',
# TODO: re-enable once colrv1 subsetting is stabilized.
# 'colrv1.notoemoji',
'colrv1',

Loading…
Cancel
Save