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
Refactor vertical metrics checks (attempt 2) #3244
Conversation
e336df5
to
b5f97dd
Compare
One possible test case for this is Titillium Web and Cairo, there was a post about this on Google Fonts discuss I have been trying to get to: https://groups.google.com/g/googlefonts-discuss/c/zB1h6ZtvW30 |
The general/typical vertical metrics challenges I'm aware of are....
|
A couple of thoughts:
|
I've got this covered. If the user adds Vietnamese, the winAsccent and winDescent will need to change. If the user changes the win values, they will also need to enable fsSelection bit 7 and ensure that the typo metrics now use the old version's win metrics.
Yep, the existing check is fine.
I won't cover this situation in this PR. At DaMa, we actually set the win metrics so that tall glyphs with vowel marks wouldn't get clipped. If you just set the win metrics to the tallest glyphs, it will cut of cantillation/vowel marks etc.
Perhaps this should be implemented in fontTools merge (it may already have it implemented). I think you want to lowest/greatest value for each of the three sets.
This can happen in a future PR. Atm, I'm waiting for Win users to upgrade so they're not using version of windows that have the MVAR issue. Thanks Dave for listing these. They are most helpful. |
@felipesanches once you're happy, I will update the release notes. This PR doesn't include the check, 1. Check vertical metrics. This can be added as a separate PR. |
Please, always add relevant entries to CHANGELOG even before I review PRs, as it is a regular mandatory procedure for any code submission. |
@felipesanches Changelog updated. PTAL. |
|
||
# FAIL with a changed vertical metric value | ||
remote2 = deepcopy(remote) | ||
ttFont2 = deepcopy(ttFont) |
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.
@m4rc1e, I've seen you using deepcopy
in the past just like you do here. I am not sure this is actually needed, though. My guess is that by reusing a ttFont
variable and assigning to it a new instance of a fontTools.ttLib.TTFont
object, the previous instance would be destroyed as python's garbage collection would delete it. Are you sure we need deepcopy
? Or maybe there's more in the way it behaves that I am not fully aware of. If so please let me know.
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.
Plain ol copy
doesn't work on TTFont objects. I guess could just reinstantiate the TTFonts but I think this is more cumbersome than just calling deepcopy
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.
Just to double check, I replaced deepcopy
with copy
and it didn't work.
@felipesanches thank you for the feedback and apologies on the forgetting the constants. I have no clue why pylint is raising an error though but I will look into it. |
6ef8ef4
to
9ddddc0
Compare
@felipesanches there's definitely something wrong with pylint. I just reverted my last commit back to 9ddddc0 which previously passed. Perhaps it has been upgraded and introduced a breaking change? |
I thought I was going insane but you've mentioned it here, #3255 (comment). I'll pick Simon's commit since he's already fixed this. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
|
@felipesanches thanks for merging Simon's pr which fixed pylint. This pr can be reviewed again. |
thanks @m4rc1e ;-) |
I'm going to refactor the vertical metric checks into the following four separate checks:
This will be much cleaner than our current setup.