johnbentcope / vpype-ttf

Vpype addon to write text to the vpype pipeline in glyphs
MIT License
6 stars 1 forks source link

Wonky Shapes #1

Closed tatarize closed 1 year ago

tatarize commented 1 year ago

So the reason the shapes are wonky is that they are either all lines or quadratic bezier curves.

https://github.com/opentypejs/opentype.js/blob/c37fcdfbd89c1bd0aac1cecb2b287dfb7d00cee0/src/tables/glyf.js#L214

Here's MIT code that does that correctly. I ran into a font that would have like 3 OFF_CURVE points in a row and it rendered completely mangled. I checked OpenType.js.org and the had a glyph checker and it had different numbers of control points and resulting points. I hunted down the code from there.

It's a little weird but it fixes all the wonky text.

image

Less wonky inner-p contour.

johnbentcope commented 1 year ago

Closed in https://github.com/johnbentcope/vpype-ttf/pull/2