RuiwenTang / Skity

A light weight 2D Vector Graphic renderer library writing in c++ for OpenGL3.3+ / OpenGLES3.0+ / Vulkan 1.1+/ WebGL2 with WASM
https://ruiwentang.github.io/Skity/
MIT License
219 stars 28 forks source link

Convert glyph outlined path to single line bezier path #12 #36

Closed alyfreym closed 1 year ago

alyfreym commented 1 year ago

Hi its possible using this lib convert outlined glyph path to single line path? I pin example image what I mean. Any suggestion please, or article. Group 3

RuiwenTang commented 1 year ago

What do you mean single line path ?. As far as I known, the path of glyph outline is almost one or more closed path which is releated to the glyph shape

alyfreym commented 1 year ago

When I convert text to path, tools give me outline represented glyph, you can see this on photo 1 left side. I need imitate character glyph using single line path.

RuiwenTang commented 1 year ago

Like stroke glyph with hairlines ?

alyfreym commented 1 year ago

Yes. I try to implement handwriting text effect. animate outlined glyph it just follows its contour, but if I just have a lines, this is what I need.

RuiwenTang commented 1 year ago

I think, my lib can do the stroke glyph rendering, but it just follow the path I get from freetype. And as I known, if you want animated the path, you should convert all straight line to bezier curve.

alyfreym commented 1 year ago

I want to repeat the outline of the font with one line. This is what I DON'T NEED

https://user-images.githubusercontent.com/29518174/202905226-ba033023-c62f-4142-ab5f-751db2536380.mp4

This is what I need

https://user-images.githubusercontent.com/29518174/202905337-477be5a6-fab1-44ae-b69e-0d7e2ea54375.mp4

alyfreym commented 1 year ago

I think, my lib can do the stroke glyph rendering, but it just follow the path I get from freetype. And as I known, if you want animated the path, you should convert all straight line to bezier curve.

when I convert to bezier it is "double outlined" I don't know how to say it right sorry. but i need conversion single lined like on video above

RuiwenTang commented 1 year ago

I want to repeat the outline of the font with one line. This is what I DON'T NEED

Comp.1.mp4 This is what I need

Comp.1_2.mp4

The path get from a ttf file, is like the Comp.1.mp4 shows, it's not double outlined , because all glyph outline needs to use closed path to descript how to draw the glyph shape. I'm not sure if I described clearly.