photopea / Typr.js

Typr.js - process fonts in Javascript
MIT License
914 stars 73 forks source link

Math.floor makes subtle differences in paths #43

Open forresto opened 2 years ago

forresto commented 2 years ago

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?

https://github.com/photopea/Typr.js/blob/dad8e9deaf028e17f5f62428306c2a0c41b2cd88/src/Typr.U.js#L266

https://github.com/photopea/Typr.js/blob/dad8e9deaf028e17f5f62428306c2a0c41b2cd88/src/Typr.U.js#L274

photopea commented 2 years ago

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 :(