resvg
resvg copied to clipboard
Nested `tspan` positioning is weird
SVG:
<svg xmlns="http://www.w3.org/2000/svg" width="1500" height="600" viewBox="0 0 1500 600">
<text x="50" y="550" text-anchor="start" dominant-baseline="text-after-edge"
font-family="Nunito" fill="white"
style="filter:drop-shadow(0 3px 7px black)">
<tspan x="50" dy="-190" font-size="120px" font-weight="800">Every Time ✅</tspan>
<tspan x="50" dy="113" font-size="66px" font-weight="800">
<tspan>hello</tspan>
world
</tspan>
</text>
</svg>
Render (notice how "hello" got shifted):
My understanding is that it should be still in line.
Hm yeah, seems like a bug.
Looks like a dominant-baseline bug, but this is a super undocumented feature, so who knows how it should work exactly.