3 ms·
You can't size other SVG elements around text ones since you don't know how much space the text element will occupy.
by rjsw 1y ago
You can't size other SVG elements around text ones since you don't know how much space the text element will occupy.
- skrebbel 1y agoI don't mean HTML text nodes, I mean still the single big SVG like they do now, but with SVG <text> elements instead of <path> elements. They do know (I suppose) how much space that element would take since they're asking HarfBuzz to tell them.
- rjsw 1y agoYou can't know the size of an SVG <text> element.
- skrebbel 1y agowhy not? if you control the font and the font size then can't you have harfbuzz tell you how wide each glyph is going to be, and it'll fit precisely? (assuming the browser also uses harfbuzz for this, which it does)
- rjsw 1y agoBecause SVG isn't defined to call into harfbuzz. You don't control the font if the SVG fragment is embedded in HTML.