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

标签 ruby-on-rails ubuntu font-face wkhtmltoimage

我有一个使用 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/

相关文章:

ruby-on-rails - ActionController::UnknownFormat in Devise::SessionsController#rails 4 中的新功能

ruby-on-rails - 使用 link_to 或 button_to rails 访问嵌套路线时遇到问题

ruby-on-rails - 添加/usr/bin/gcc-4.2 到路径 - 安装 ruby

python - 为 python GUI 应用程序授予 root 权限以在 ubuntu 中运行命令

css - IE 10 在本地使用@font-face,但在从服务器查看页面时不起作用

css - 如何访问字体?

html - 将自定义字体添加到 asp.net 应用程序

ruby-on-rails - Handlebars.js & i18n-js,新助手

ubuntu - 编译 CUDA 查找错误的 CUDA 版本

linux - 如何一起使用 git log 和 grep?