【问题标题】:converting svg files with google fonts into png - PHP将带有谷歌字体的svg文件转换为png - PHP
【发布时间】:2013-04-01 12:06:46
【问题描述】:
<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 imagick 将此 svg 转换为 png 时,它只会以默认字体(arial)呈现文本。

有没有办法在转换成 png 时使用相同的谷歌字体来呈现文本?

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

【问题讨论】:

    标签: php svg imagick


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2019-05-23
      • 2016-10-12
      • 1970-01-01
      • 2021-04-24
      • 2015-12-02
      • 1970-01-01
      • 2023-02-26
      • 2011-06-16
      相关资源
      最近更新 更多