svgo
svgo copied to clipboard
any reason to not merge <text> and <textspans> when possible?
This is probably right on the line of what's appropriate to bring up here rather than on some svg forum, but on the off chance that it is a place svgo could be improved:
I was surprised when svgo (well, svgomg - if this is something specific to that implementation, I apologize, you can just ignore me) gave me this output
<svg viewBox="0 0 241 33" xmlns="http://www.w3.org/2000/svg">
<title>
my sample text
</title>
<text transform="translate(-132 -29)" fill="#FFF" fill-rule="evenodd" font-weight="500" font-family="ProximaNova-Semibold, Proxima Nova" font-size="36">
<tspan x="130" y="54">my sample text</tspan>
</text>
</svg>
Is there a reason the text and textspan weren't merged into this?
<text x="-2" y="25" fill="#FFF" fill-rule="evenodd" font-weight="500" font-family="ProximaNova-Semibold, Proxima Nova" font-size="36">
Not bad idea for a plugin! However, the case is somewhat rare and some details like positioning (x, y attributes and so on) should be considered.