[font] Make set_variation() respect currently-set variations
Fixes https://github.com/harfbuzz/harfbuzz/issues/4143
This commit is contained in:
parent
91627daee2
commit
5226d69733
|
@ -2690,6 +2690,14 @@ hb_font_set_variation (hb_font_t *font,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize design coords. */
|
/* Initialize design coords. */
|
||||||
|
if (font->design_coords)
|
||||||
|
{
|
||||||
|
assert (coords_length == font->num_coords);
|
||||||
|
for (unsigned int i = 0; i < coords_length; i++)
|
||||||
|
design_coords[i] = font->design_coords[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (unsigned int i = 0; i < coords_length; i++)
|
for (unsigned int i = 0; i < coords_length; i++)
|
||||||
design_coords[i] = axes[i].get_default ();
|
design_coords[i] = axes[i].get_default ();
|
||||||
if (font->instance_index != HB_FONT_NO_VAR_NAMED_INSTANCE)
|
if (font->instance_index != HB_FONT_NO_VAR_NAMED_INSTANCE)
|
||||||
|
@ -2701,6 +2709,7 @@ hb_font_set_variation (hb_font_t *font,
|
||||||
hb_ot_var_named_instance_get_design_coords (font->face, font->instance_index,
|
hb_ot_var_named_instance_get_design_coords (font->face, font->instance_index,
|
||||||
&count, design_coords);
|
&count, design_coords);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned axis_index = 0; axis_index < coords_length; axis_index++)
|
for (unsigned axis_index = 0; axis_index < coords_length; axis_index++)
|
||||||
if (axes[axis_index].axisTag == tag)
|
if (axes[axis_index].axisTag == tag)
|
||||||
|
|
Loading…
Reference in New Issue