[varLib] Clarification regarding avar segment maps
See original GitHub issueThe avar spec says:
Axis value maps can be provided for any axis, but are required only if the normalization mapping for an axis is being modified. If the segment map for a given axis has any value maps, then it must include at least three value maps: -1 to -1, 0 to 0, and 1 to 1. These value mappings are essential to the design of the variation mechanisms and are required even if no additional maps are specified for a given axis.
-
Currently,
varLib._add_fvar_avar
doesn’t enforce this. Should it? -
When an axis doesn’t cover the full range from -1 to 1, it makes no sense to include the entries as described.
For example, take a wdth axis from Condensed to Normal. The mappings may be:
-1.0 to -1.0
-0.5 to -0.3
0.0 to 0.0
What would an additional 1 to 1 mapping, as required by the spec, do? There is no master at 1.0 for this axis. If something has to be added to the segment map, it should be 1.0 to 0.0
, making the range from 0 to 1 effectively flat. If that is the intent of the spec, the wording should be changed.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Yes, varLib should enforce this to ensure fonts are valid. This is an old requirement, originating in GX:
“A segment must always have at least three correspondence pairs: minus one mapping to minus one, zero mapping to zero, and one mapping to one.”
Your example considers a width axis from Condensed to Normal, but those values are defined only in “user” space, not normalized space. The ‘avar’ table is a transformation entirely within normalized space which is always defined as having axes going from -1 to +1. An ‘fvar’ table may happen to define an axis in which default and min or default and max are the same, in which case nothing changes between -1 and 0, or between 0 and +1. But that is a consideration in the mapping from “user” space to normalized space that is independent of the ‘avar’ transformation that happens entirely within normalized space.
Thanks all. #1014 fixes the issue about the default mappings. The rest was a misinterpretation on my part.