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

Math.floor makes subtle differences in paths #43

Open
forresto opened this issue Sep 12, 2022 · 1 comment
Open

Math.floor makes subtle differences in paths #43

forresto opened this issue Sep 12, 2022 · 1 comment

Comments

@forresto
Copy link

Using American Typewriter (Light).ttf we noticed some subtle differences between Opentype.js (pink) and Typr (black).

typr-vs-opentype

Zooming in on the dot, it looks like some of the curve handles are not tangent when they should be:

image

By removing some of the Math.floor calls here, we were able to make the dot round, and match Opentype's output.
Are those there to solve something else?

else P.MoveTo(p, Math.floor((gl.xs[pr]+x)*0.5), Math.floor((gl.ys[pr]+y)*0.5) );

else P.qCurveTo(p, x, y, Math.floor((x+gl.xs[nx])*0.5), Math.floor((y+gl.ys[nx])*0.5) );

@photopea
Copy link
Owner

But how do we tell how it should actually look like? Did you try to render the dot in any other program, that is not Opentype.js or Typr.js ? I am not able to install your font on Windows 10 :(

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