cosmic-text
cosmic-text copied to clipboard
Vector path output
It would be useful to have a way to output vector paths as an alternative to rendering pixels to an image.
The docs are a bit too sparse for me to tell, so I hope this question is alright :) Is the draw function the only output method at the moment? + is the intention that it's used to draw pixels to an output texture?
I think theoretically you could use BufferLine::layout with your own texture atlas / glyph caching solution.
I see, thanks! I understand a bit more now. So swash is giving us textures for each glyph, which draw then enumerates.
Would it be reasonable to experiment with putting a texture atlas on the GPU and rendering the glyphs as individual quads, in the hope that it could offload some cpu work?
If I ever get around to integrating cosmic-text with KAS this would be my approach — see here (essentially this is already implemented over kas-text which has a slightly different cache key).
Note that the actual glyph rastering still happens on the CPU in my code, but it's extremely fast already.
The swash cache allows you to get vector output.