-
Notifications
You must be signed in to change notification settings - Fork 93
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
Variation alternates not processed for statics #1042
Comments
interpolated static fonts are not handled inside ufo2ft actually, but in fontmake.instatiator module, see: fontmake/Lib/fontmake/instantiator.py Lines 425 to 432 in 6a8b290
if you are using fontmake to build the fonts, it should work. |
I moved the issue to fontmake repository where I think it belongs. If you could, it'd be good to upload a test file that reproduces the issue. |
It's something in my source file, but I can't say what. I created a test file, removed features, some font info metadata (nothing axis-related) and all glyphs except Generating from the original source fails the swap. Generated with I added the two test files ( I'm gonna need an adult here. |
Update: The pair |
Update: I kind of got to the bottom: Personally, I would just add this and be done with it. Understandably though, you may want to find out why it's getting added more than once. Printing
which leads me to believe that the error is actually in |
I think that logically the substitution should only ever be applied once, but because of the way this is implemented in fontmake.instatiator, literally swapping outlines while keeping both glyphs around, if one attempts to do it again, it has the effect of restoring the initial state. Maybe it'd make sense to patch it like you proposed above.. |
yeah, I think that makes sense. If this were a GSUB kind of substitution, and multiple consecutive rules wanted to replace the same glyph to something else, only the first one would actually trigger, subsequent ones would be no-op. So it makes sense for the process_rules_swaps() to work the same way for interpolated statics. |
Do you want me to write a test for it? I don't really know how to design it, especially given that my sparse source works and the full source fails. Or shall I just PR the one little change as is? |
looks like many of the rules overlap one another in the DS file generated from your glyphs source, which may be the reason the same glyphs get swapped multiple times.. If I look at the glyphsLib code that is responsible for producing this, I see that it calls fontTools.featureVars' @simoncozens I think you wrote that piece of code. Instead of unioning the mappings, should this not add one DS rule per (box, mapping) as returned from overlay method? |
@yanone yeah it's no immediately obvious how to come up with a minimal reproducer, but the fix looks correct from a logical point of view. Perhaps just check |
-> #1043 |
I'm not sure whether this is intentional, but it feels a lot like an oversight:
ufo2ft
(both stable release as well as repo version) isn’t processing the alternates for static fonts, see below (static vs. variable).The master UFO do contain the relevant substitutions (and they work in variable):
Always happy to help with further debugging. It's a commercial font so I can't post a source but can invite you to my repo.
The text was updated successfully, but these errors were encountered: