linebender / piet

An abstraction for 2D graphics.
Apache License 2.0
1.23k stars 95 forks source link

Better text render method for piet-svg with <path> #543

Open matthunz opened 1 year ago

matthunz commented 1 year ago

I think piet-svg would greatly benefit from rendering text as a <path> element rather than <text>.

This would allow us to get the exact size of text before drawing, instead of just a best guess. The current design seems to render the text on the host machine before letting whatever machine that views the SVG decide it's own dimensions.

This could be done with something like text-to-svg but probably rewritten in rust (tm)

matthunz commented 1 year ago

I just started a work in progress SVG font renderer that could solve this: font-svg