A bunch of text layout fixes
Mainly this is the fixes #806 (closed), and also some problems that I found while debugging that.
The context is making https://commons.wikimedia.org/wiki/File:S-Bahn_RheinNeckar2020.svg render correctly - #806 (closed) is part of that. With this MR, that file finally renders with the correct text layout!
- Inside
<text>
, first lay out each chunk's spans according to text direction, and applytext-anchor
at the end to the whole chunk. - As a hack for librsvg's lack of support for multiple dx/dy values, apply a chunk's dx/dy independently of the layout of its spans. That is, lay out spans, then apply
text-anchor
, then apply dx/dy from the chunk.