[VarComposite] Implement RESET_UNSPECIFIED_AXES

Fixes https://github.com/harfbuzz/boring-expansion-spec/issues/79
This commit is contained in:
Behdad Esfahbod 2023-01-18 14:13:12 -07:00
parent 4300a18b85
commit eed5d5efdd
2 changed files with 7 additions and 1 deletions

View File

@ -365,7 +365,11 @@ struct Glyph
comp_points.reset (); 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); item.set_variations (coord_setter, record_points);
if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ()) if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_gid ())

View File

@ -29,6 +29,7 @@ struct VarCompositeGlyphRecord
HAVE_TCENTER_Y = 0x0800, HAVE_TCENTER_Y = 0x0800,
GID_IS_24 = 0x1000, GID_IS_24 = 0x1000,
AXES_HAVE_VARIATION = 0x2000, AXES_HAVE_VARIATION = 0x2000,
RESET_UNSPECIFIED_AXES = 0x4000,
}; };
public: public:
@ -60,6 +61,7 @@ struct VarCompositeGlyphRecord
bool has_more () const { return true; } bool has_more () const { return true; }
bool is_use_my_metrics () const { return flags & USE_MY_METRICS; } 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 hb_codepoint_t get_gid () const
{ {