Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SVG到PNG无法呈现字体_Svg_Imagemagick - Fatal编程技术网

SVG到PNG无法呈现字体

SVG到PNG无法呈现字体,svg,imagemagick,Svg,Imagemagick,我有一个svg文件,其中包含在浏览器中工作的自定义字体族。当我将svg转换为任何图像类型(我尝试过png jpg pdf)时,字体会恢复为Arial。我在服务器上有字体,当我使用时,它会显示在字体列表上: convert -list font 以下是SVG代码: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="720" heigh

我有一个svg文件,其中包含在浏览器中工作的自定义字体族。当我将svg转换为任何图像类型(我尝试过png jpg pdf)时,字体会恢复为Arial。我在服务器上有字体,当我使用时,它会显示在字体列表上:

convert -list font
以下是SVG代码:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="720" height="288" viewport-fill="white" xml:space="preserve">
<style>
@font-face {
    font-family: 'ubuntubold';
    src: url('fonts/ubuntu/ubuntu-b-webfont.eot');
    src: url('fonts/ubuntu/ubuntu-b-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/ubuntu/ubuntu-b-webfont.woff') format('woff'),
         url('fonts/ubuntu/ubuntu-b-webfont.ttf') format('truetype'),
         url('fonts/ubuntu/ubuntu-b-webfont.svg#ubuntubold') format('svg');
    font-weight: normal;
    font-style: normal;

}
</style>
</defs>
<g transform="translate(450 149) rotate(0)">
<text font-family="'ubuntubold'" font-size="40" style="stroke: none; stroke-width: 1; stroke-dasharray: ; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: #0038ff; opacity: 1;" transform="translate(-240.54 39)">
<tspan x="0" y="-26" fill="#0038ff">
Bluemoon Entertainment</tspan>
</text>
</g>
</svg>

我知道还有其他的图像转换程序,但我的客户非常坚持我使用imagemagick。

@Robert不确定你的确切意思,但如果你问我是否尝试过在字体名称周围没有单引号,它会给出相同的结果。我遇到同样的问题。你解决过吗?据我所知,似乎你必须在服务器/机器上安装字体,以使其正确渲染;否则,就像你说的,它会回复到ariel。不幸的是没有。。。该项目被搁置,但将于本月底再次恢复。我将评论我的任何更新。
convert -verbose -density 300 test.svg test_density.png