I have some multi-line text and I am using <text>
and <tspan>
to handle this. I want each line to be centered, so I am using in the main <text>
tag text-anchor="middle"
. However, even with dx=0
, the entire block is still shifted by the total length text.
How can I do multi-lined <tspan>
centered SVG text?
e.g.
<text text-anchor="middle" font-size="12px">
This would normally be centered
<tspan>
this should be too.
</tspan>
</text>