Imagemagick svg to png conversion screws up text position

一曲冷凌霜 提交于 2020-01-16 17:04:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!