-
Notifications
You must be signed in to change notification settings - Fork 475
[varLib] Clarification regarding avar segment maps #1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
I see ... in that case the normalization done in varLib may be buggy. If I understand it correctly, for my example the normalization should look like this:
Is that correct? |
Basically, yes. The one comment is that, since the user range max is the same as the default, then selectable instances can never land in normalized space in the range (0, +1]. So your earlier question, "What would an additional 1 to 1 mapping do?" is valid: it will not have any effect in cases like this. But it has trivial impact and is a small thing for font tools to do. |
I'll follow up on the OpenType list thread. I like to suggest we only require 0->0 mapping. The others are not needed really. |
Thanks all. #1014 fixes the issue about the default mappings. The rest was a misinterpretation on my part. |
The avar spec says:
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:
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.The text was updated successfully, but these errors were encountered: