-
Notifications
You must be signed in to change notification settings - Fork 51
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
No width linking of brace layers #985
Conversation
it's not clear to me what this is doing (or no longer doing), can you please clarify? |
This is mostly a hot fix for a specific project. Brace layer almost always have a different width than the master layers they are attached too. Linking to that width will mess things up. There might be some extra layer that might benefit from linking, so this needs more testing. Until then, this is a draft. |
f79047b
to
3667c04
Compare
I rebased this branch on top of main and will add a test file that has a bad case and gets solved correctly by this branch. I think the required scenario is this (font with Weight and ROUND axes):
Previously, the advance width of the brace layer With this patch, the advance width of the layer @schriftgestalt is that an accurate description of what this patch does? |
That is correct. |
it was getting it form the master they are attached too and that is supposed to have a different width
3667c04
to
0e58873
Compare
@anthrotype @simoncozens This is ready for review. I added a test, and I checked locally that the test was failing before the patch (the glyph had width == 100) and is green after (width == 200 as specified in the file). |
else: | ||
width = None | ||
return width | ||
master = font.masters[layer.layerId] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the important change of the patch, it says to only consider the master of this layer (if any) for the metrics source, and never the "associated master". For intermediate layers it means that there's no metrics source, whereas previously they used the metrics source of their parent layer, which was wrong.
* Add test * No width linking of brace layers it was getting it form the master they are attached too and that is supposed to have a different width * Fix lint --------- Co-authored-by: Jany Belluz <[email protected]>
it was getting it form the master they are attached too and that is supposed to have a different width