cosmic-text icon indicating copy to clipboard operation
cosmic-text copied to clipboard

Vector path output

Open i509VCB opened this issue 3 years ago • 4 comments

It would be useful to have a way to output vector paths as an alternative to rendering pixels to an image.

i509VCB avatar Oct 29 '22 05:10 i509VCB

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?

Plecra avatar Mar 07 '23 08:03 Plecra

I think theoretically you could use BufferLine::layout with your own texture atlas / glyph caching solution.

dhardy avatar Mar 07 '23 09:03 dhardy

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?

Plecra avatar Mar 07 '23 10:03 Plecra

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.

dhardy avatar Mar 07 '23 10:03 dhardy

The swash cache allows you to get vector output.

jackpot51 avatar Jun 12 '24 15:06 jackpot51