gpt4 book ai didi

ruby-on-rails - wkhtmltoimage 的字体渲染问题

转载 作者:行者123 更新时间:2023-12-04 18:32:38 24 4
gpt4 key购买 nike

我有一个使用 wkhtmltoimage 呈现图像的 Rails 应用程序。图像中使用的字体是 Lucida Grande,通过 inline data-uris 包含在内。在我的本地 Mac 上一切正常,但在远程服务器(Ubuntu 12.10)上,字体看起来很奇怪。两者都使用 wkhtmltoimage 0.10.0 rc2。

左边是在我的 Mac 上生成的,右边是在 Ubuntu 服务器上生成的。

Mac enter image description here

有什么想法吗?

最佳答案

不幸的是,我还没有找到解决这个问题的方法。但是今天我很幸运找到了解决方法! :)

读完 Thomas Fuchs 的 Embedding Canvas and SVG charts in emails我走的是激进的方式,完全取代了 wkhtmltoimage 幻影JS .我也用了他的gist安装一些依赖项。结果如下:

wkhtmltoimage 本地和远程:

enter image description here
enter image description here

幻影JS 本地和远程:

enter image description here
enter image description here

尽管仍有细微的差别,但 PhantomJS 的工作做得非常好!所以我现在将使用它,并关闭这个问题:)

关于ruby-on-rails - wkhtmltoimage 的字体渲染问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15358708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com