opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

Fill Path instead of stroke path

Open kpomservices opened this issue 4 years ago • 4 comments

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 image

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

Please suggest how to get the inner/fill bezier path of the text?

kpomservices avatar Aug 25 '21 11:08 kpomservices

I don't get the issue, if you want the letter to be filled, use fill() call of canvas..

axkibe avatar Aug 31 '21 09:08 axkibe

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.

kpomservices avatar Sep 01 '21 17:09 kpomservices

Related: #434

danmarshall avatar Dec 07 '21 04:12 danmarshall

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.

axkibe avatar Feb 07 '22 07:02 axkibe

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

Connum avatar Feb 05 '23 12:02 Connum

The stroke and fill path should be the same.

ILOVEPIE avatar Feb 06 '23 19:02 ILOVEPIE