-
Notifications
You must be signed in to change notification settings - Fork 43
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
Variable anchor positioning in sparse masters #640
Comments
no, in the conftest.py::designspace fixture, the second source is not the same as the first, the filename is the same "LayerFont-Regular.ufo", but note how the second has the |
Ohhhh. So the "medium" isn't a second master, and shouldn't affect layout? |
hm.. Well, currently we don't compile features for sparse layers since they can't have features.fea of their own, we only use them for the outlines.. |
Right, but what about anchors...? |
don't know, what do you expect to happen? |
maybe with your variable features.fea you can take those into account, the anchors are still in the glyph, just need to get them from the named layer |
The issue is that the variable feature build is taking into account the anchor positions of anchors in sparse master layers, and the current HEAD does not take into account the anchor positions of anchors in sparse master layers, and I don't know which is the right behaviour. |
I would say taking them into account would be the right behavior, so yours is the correct one. We currently don't because sparse layer masters have no kerning.plist or features.fea of their own, they are just containers of glyph shapes (and yes anchors, so it happens), so we can't/don't write/compile OT features for the master TTFs that are produced off those |
does your code handle the possibility that given anchors are missing from a sparse layer master and treat them as non-participating in the interpolation? that would allow a font developer to control whether they want or not the glyph anchors in sparse layers to contribute to variable mark/mkmk features. Right now they seem to be ignored. |
This should be fixed now. |
This came up while I was testing #635. Consider a test which compiles this designspace file:
ufo2ft/tests/conftest.py
Lines 54 to 93 in 7d0a330
So we have regular at 350, regular again at 450 and bold at 625. Fine. My question is, how does the positioning of the
e
glyph's top anchor vary over the designspace?At 350 it is regular, so:
ufo2ft/tests/data/LayerFont-Regular.ufo/glyphs/e.glif
Line 5 in 7d0a330
At 450 it is still regular, so the same.
At 625, it is bold, so:
ufo2ft/tests/data/LayerFont-Bold.ufo/glyphs/e.glif
Line 5 in 7d0a330
So the X coordinate of the anchor goes 314 at wght=350, 314 at wght=450, and 315 at wght=650.
The Y coordinate goes 556 at wght=350, 556 at wght=450, and 644 at wght=625.
Except that what we test for, the output TTX file, is:
ufo2ft/tests/data/TestVariableFont-TTF.ttx
Lines 320 to 339 in 7d0a330
That's a linear progression from
x=314, y=556
at wght=350 through tox=315, y=644
at wght=650. The medium stop has vanished. In fact, if you ask it to produce a debug feature file, the medium isn't there!I think this is because the medium is the regular, and since we compiled that once, we don't compile it again. And so we end up with the wrong answer. With my PR, we get a debug feature file of:
which clearly looks better, and compiles to:
which I believe to be correct - but which doesn't pass tests.
The text was updated successfully, but these errors were encountered: