[font/var] Try to allow "biased" avar's

That map 0 to non-0!
This commit is contained in:
Behdad Esfahbod committed 2025-03-02 16:59:24 -07:00
1 parent 04be808886
commit 1f0aae5280
2 files changed
+4 -7

No files matched your search

+3 -6
View File
@@ -1860,8 +1860,11 @@ hb_font_create (hb_face_t *face)
#endif
#ifndef HB_NO_VAR
// Initialize variations.
if (face && face->index >> 16)
hb_font_set_var_named_instance (font, (face->index >> 16) - 1);
else
hb_font_set_variations (font, nullptr, 0);
#endif
return font;
@@ -2609,12 +2612,6 @@ hb_font_set_variations (hb_font_t *font,
font->serial_coords = ++font->serial;
if (!variations_length && font->instance_index == HB_FONT_NO_VAR_NAMED_INSTANCE)
{
hb_font_set_var_coords_normalized (font, nullptr, 0);
return;
}
const OT::fvar &fvar = *font->face->table.fvar;
auto axes = fvar.get_axes ();
const unsigned coords_length = axes.length;
+1 -1
View File
@@ -186,7 +186,7 @@ struct SegmentMaps : Array16Of<AxisValueMap>
return b;
if (value > 0)
return a;
// Whatever's not 0. Whatever..
// Mapping 0 to whatever's not 0. Whatever..
return a ? a : b;
}