opentype.js
opentype.js copied to clipboard
Fill Path instead of stroke path
Thanks for the library to get the bézier path for the text. Currently we get the stroke bézier path for the text, is there is any way to get the fill path bézier data of the text?
Currently for any font getting the stroke path

but what i need is the inner / fill path of the letter

Please suggest how to get the inner/fill bezier path of the text?
I don't get the issue, if you want the letter to be filled, use fill() call of canvas..
Yes i can change the fill color, but I need the bezier path information of that fill area,
I am trying to animate the bezier path of the letter / text, currently its animating the path of the stroke path. But i need to animate the fill section so that it look like hand-writing animation.
Related: #434
I see, this is not something that can easily be computed even only approximated and IMO beyond the scope of this library.
I don't think an opentype/truetype font is something you should use in a usecase like this, because they are constructed differently as you found out. You need a font system that is "stroked" by design or just do the paths manually and avoid font systems all together.
I would agree that this is outside of the scope of what opentype is intended for. A comment in #434 links to a possible solution for this. I'd suggest closing this and #434 @ILOVEPIE
The stroke and fill path should be the same.