-
Notifications
You must be signed in to change notification settings - Fork 475
[VARC] Special-case hidden axes when applying RESET_UNSPECIFIED_AXES to pen.addVarComponent() #3549
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
base: main
Are you sure you want to change the base?
Conversation
I'm a bit uncomfortable with that. Can we change the protocol and send two locations down? |
Hm, then we burden the addVarComponent signature with this problem. Not sure which is better. The way we currently compile with RESET_UNSPECIFIED_AXES already depends on those axes always being at the default: as soon as you set one to a non-default value, the font breaks, as can be seen in (my private build of) FontGoggles: Screen.Recording.2024-05-30.at.20.50.34.movSo those axes are already special, and to me special-casing them here doesn't make things worse. |
Potentially we could amend the spec to say that RESET_UNSPECIFIED_AXES should reset to the current location for non-hidden axes, and to default for hidden axes? |
What if we add a lower-level Let me also think more. In my compiler I drop encoding axes if they have the same value as the parent glyph. Let me think more about your requirements and get back to you. |
I'm having a hard time to come up with a use case for pen.addVarComponent() that is other than mine... There is of course the option that I don't use the pen protocol for this at all, and just read VARC directly. Maybe that makes more sense. There's also your earlier idea if having two flags:
The first is handy when we pass down (user) axes to deeply nested components. The second is what we really need for private axes. |
(Hm, additionally, pen.addVarComponent() doesn't support extracting conditions (which Fontra doesn't yet support), but that also suggests that the pen protocol is perhaps not the right tool to extract variable components.) |
Alternative to #3541.
As explained in #3541 (review), the rawLocation mechanism is needed to meaningfully extract variable components via addVarComponent().
But this gives a bit of a conundrum with the new meaning of RESET_UNSPECIFIED_AXES.
Old meaning: when RESET_UNSPECIFIED_AXES is set, reset unspecified axes to default
New meaning: when RESET_UNSPECIFIED_AXES is set, reset unspecified axes the current font location
Long story short, to implement RESET_UNSPECIFIED_AXES in a useful way for addVarComponent(), we need to special case hidden axes.