1
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="overflow: hidden; position: relative;" width="100%" version="1.1" height="100%"><defs><style> @import url(http://fonts.googleapis.com/css?family=Faster+One);</style></defs><text transform="matrix(1,0,0,1,0,0)" style="text-anchor: middle; ; font-size: 100px;" x="10%" y="32.36134453781513%" text-anchor="middle" font="" stroke="none" fill="#000000" font-family="   Faster One   , cursive" font-size="78%" id="text2"><tspan dy="NaN">hii</tspan></text></svg>

当我尝试使用 PHP将此svg转换为pngimagick时,它仅以默认字体(arial)呈现文本。

转换为 png 时,有什么方法可以使用相同的谷歌字体来呈现文本?

任何帮助将不胜感激。提前致谢。

4

1 回答 1

0

PhantomJS 可以通过一些工作来渲染 SVG,包括 Google 字体。https://github.com/ariya/phantomjs/issues/10592

于 2013-04-22T23:58:46.497 回答