问题
Trying to use Imagemagick's conversion tool to do basic SVG to PNG conversions, but the text positions are completely out of whack.
For example, here's a vertical list of words in SVG:
SVG:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="360" height="360" version="1.1" style="display:block;">
<rect width="100%" height="100%" fill="#FFFF00"/>
<text x="0" y="20" font-size="12" text-anchor="start" fill="black" transform="">HELLO</text>
<text x="0" y="40" font-size="12" text-anchor="start" fill="black" transform="">HELLO</text>
<text x="0" y="60" font-size="12" text-anchor="start" fill="black" transform="">HELLO</text>
</svg>
Which looks like this:
Convert with Imagemagick:
convert test.svg test.png
Result: test.png
来源:https://stackoverflow.com/questions/53417436/imagemagick-svg-to-png-conversion-screws-up-text-position