Skip to content
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

Rounding is done using fontTools.misc.py23.round3 instead of fontTools.misc.fixedTools.otRound #148

Closed
madig opened this issue Mar 18, 2019 · 1 comment

Comments

@madig
Copy link
Contributor

madig commented Mar 18, 2019

This is problematic, as varLib uses otRound, so static instances do not exactly match their cousins inside a variable font made with varLib. In testing this with Cantarell, I found a large number of off-by-ones between the two rounding methods.

Simply swapping the methods out doesn't work, as round3() takes an ndigits argument, while otRound doesn't. Maybe as a compromise, round3() can be used when there is an ndigits argument, otherwise otRound? Can provide PR.

Edit: although, varLib is not the only possible user. I haven't looked at mutatorMath.

@anthrotype
Copy link
Member

i think it should be ok using the round3 when ndigits is not None, else doins the same as fontTools otRound (i.e. int(math.floor(value + 0.5))) when rounding to full integers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants