使用ImageMagick将SVG与自定义字体转换为PNG [英] Converting SVG with custom fonts to PNG using ImageMagick
问题描述
我正在使用ImageMagick将SVG转换为PNG,所有这些都像魅力一样,直到我尝试使用@ font-face然后在SVG文件中添加自定义字体。在Batik这个工作正常,但现在在ImageMagick我不能让它工作。
I'm converting SVG's to PNG using ImageMagick and all works like a charm until I tried adding custom fonts using @font-face and then in the SVG file. In Batik this worked fine but now in ImageMagick I just cant get it to work.
我可以将字体更改为convert -list font中列出的字体但是我可能必须经常更改字体所以我想指向转换时的字体文件,而不是使用font-face或其他解决方案无关紧要。
I can change the fonts to the ones listed in "convert -list font" but I will probably have to change fonts often so I want to point to the font-file on convert somehow instead using font-face or other solution doesnt matter.
SVG文件还可以包含多个字体系列,我的ImageMagick安装包括rsvg委托。
The SVG files can also contain multiple font-families and my ImageMagick install includes rsvg delegate.
任何想法?谢谢!
推荐答案
尝试 rsvg-convert
(命令行程序)由 librsvg2
包提供。
Try rsvg-convert
(a command line program) provided by librsvg2
package.
我在Amazon Linux上遇到与ImageMagick相同的问题(但在我的Ubuntu桌面上却没有)。
我认为ImageMagick的SVG处理相当差。它无法正确识别display:none样式属性。
I have the same problem with ImageMagick on Amazon Linux (but not on my Ubuntu desktop). I think the SVG handling of the ImageMagick is rather poor. It does not recognize "display: none" style property correctly.
这篇关于使用ImageMagick将SVG与自定义字体转换为PNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!