From eed5d5efdd37bfbf06f52b67a5dd9d170576d2ee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 Jan 2023 14:13:12 -0700 Subject: [PATCH] [VarComposite] Implement RESET_UNSPECIFIED_AXES Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/79 --- src/OT/glyf/Glyph.hh | 6 +++++- src/OT/glyf/VarCompositeGlyph.hh | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index 9834acefc..39a5f1e6e 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -365,7 +365,11 @@ struct Glyph comp_points.reset (); - coord_setter_t coord_setter (hb_array (font->coords, font->num_coords)); + auto component_coords = coords; + if (item.is_reset_unspecified_axes ()) + component_coords = hb_array (font->coords, font->num_coords); + + coord_setter_t coord_setter (component_coords); item.set_variations (coord_setter, record_points); if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) diff --git a/src/OT/glyf/VarCompositeGlyph.hh b/src/OT/glyf/VarCompositeGlyph.hh index adb5c1e41..3685da791 100644 --- a/src/OT/glyf/VarCompositeGlyph.hh +++ b/src/OT/glyf/VarCompositeGlyph.hh @@ -29,6 +29,7 @@ struct VarCompositeGlyphRecord HAVE_TCENTER_Y = 0x0800, GID_IS_24 = 0x1000, AXES_HAVE_VARIATION = 0x2000, + RESET_UNSPECIFIED_AXES = 0x4000, }; public: @@ -60,6 +61,7 @@ struct VarCompositeGlyphRecord bool has_more () const { return true; } bool is_use_my_metrics () const { return flags & USE_MY_METRICS; } + bool is_reset_unspecified_axes () const { return flags & RESET_UNSPECIFIED_AXES; } hb_codepoint_t get_gid () const {