【发布时间】:2015-06-23 17:36:05
【问题描述】:
我在这里有一个使用 Lobster 的测试 SVG:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="2400" height="3200" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style>
@import url('http://fonts.googleapis.com/css?family=Lobster');
</style>
</defs>
<text id="SvgjsText1046" font-family="Lobster" fill="#000000" font-size="30px" stroke-width="0" font-style="" font-weight="" text-decoration=" " x="859.9871134019216" y="476.38530927854697" transform="rotate(0 1214.8671520099174 1164.5108891121047) translate(-9360.999092988961 -5185.475896759851) scale(11.885045772324295 11.885045772324297) ">
<tspan id="SvgjsTspan1072" dy="29">TEST</tspan>
<tspan id="SvgjsTspan1073" dy="29">TEST</tspan>
<tspan id="SvgjsTspan1074" dy="29">TEST</tspan>
</text>
</svg>
这在浏览器中渲染得很好,但是在 ImageMagick(使用 php)中转换为 PNG 时,字体不会渲染。
我知道你可以使用 setFont 命令设置单个字体,但是 SVG 可能包含多个字体。
在这种情况下,有没有办法为 ImageMagick 设置字体目录?
【问题讨论】: