diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 8ca9350d1..5574ae072 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -119,7 +119,7 @@ struct Glyph hb_bytes_t &dest_bytes /* OUT */) const { GlyphHeader *glyph_header = nullptr; - if (!plan->pinned_at_default && type != EMPTY && all_points.length > 4) + if (!plan->pinned_at_default && type != EMPTY && all_points.length >= 4) { glyph_header = (GlyphHeader *) hb_calloc (1, GlyphHeader::static_size); if (unlikely (!glyph_header)) return false; diff --git a/test/subset/data/Makefile.am b/test/subset/data/Makefile.am index e1747d788..939d468d6 100644 --- a/test/subset/data/Makefile.am +++ b/test/subset/data/Makefile.am @@ -63,6 +63,7 @@ EXTRA_DIST += \ expected/pin_all_at_default \ expected/instance_no_double_free \ expected/mvar_full_instance \ + expected/instance_comp_glyph_empty_child \ fonts \ profiles \ $(NULL) diff --git a/test/subset/data/Makefile.sources b/test/subset/data/Makefile.sources index 8a86ad7b1..0b64cad30 100644 --- a/test/subset/data/Makefile.sources +++ b/test/subset/data/Makefile.sources @@ -54,6 +54,7 @@ TESTS = \ tests/pin_all_at_default.tests \ tests/instance_no_double_free.tests \ tests/mvar_full_instance.tests \ + tests/instance_comp_glyph_empty_child.tests \ $(NULL) # TODO: re-enable once colrv1 subsetting is stabilized. diff --git a/test/subset/data/expected/instance_comp_glyph_empty_child/RobotoMono.default.retain-all-codepoint.wght=700.ttf b/test/subset/data/expected/instance_comp_glyph_empty_child/RobotoMono.default.retain-all-codepoint.wght=700.ttf new file mode 100644 index 000000000..16084db95 Binary files /dev/null and b/test/subset/data/expected/instance_comp_glyph_empty_child/RobotoMono.default.retain-all-codepoint.wght=700.ttf differ diff --git a/test/subset/data/fonts/RobotoMono.ttf b/test/subset/data/fonts/RobotoMono.ttf new file mode 100644 index 000000000..1920be02c Binary files /dev/null and b/test/subset/data/fonts/RobotoMono.ttf differ diff --git a/test/subset/data/tests/instance_comp_glyph_empty_child.tests b/test/subset/data/tests/instance_comp_glyph_empty_child.tests new file mode 100644 index 000000000..ed963c948 --- /dev/null +++ b/test/subset/data/tests/instance_comp_glyph_empty_child.tests @@ -0,0 +1,11 @@ +FONTS: +RobotoMono.ttf + +PROFILES: +default.txt + +SUBSETS: +* + +INSTANCES: +wght=700 diff --git a/test/subset/meson.build b/test/subset/meson.build index 6555b8b13..5c8c1cd26 100644 --- a/test/subset/meson.build +++ b/test/subset/meson.build @@ -56,6 +56,7 @@ tests = [ 'instance_feature_variations', 'instance_no_double_free', 'mvar_full_instance', + 'instance_comp_glyph_empty_child', ] repack_tests = [