获取 wkhtmltopdf 来识别用户字体文件夹
我想我的问题已经在这里指出了...我已将一些非标准字体安装到我的 ~/.fonts 目录中并运行“mkfontdir”和“mkfontscale”。当我用“fc-list”列出字体时,这些字体就会显示出来。问题仍然是 wkhtmltopdf 无法识别它们。其他系统字体(如“Courier 10 Pitch”)可以被识别......只是不是我的用户目录中的字体。那么有没有办法让 wkhtmltopdf (或者 webkit)识别我的文件夹中的字体?我需要通过 ssh 做些什么吗?或者我可以在 ruby 中设置一个选项吗?
I think I have my problem pinpointed here...I've installed some non-standard fonts into my ~/.fonts directory and run 'mkfontdir' and 'mkfontscale'. The fonts show up when I list them with 'fc-list'. The problem remains that wkhtmltopdf doesn't recognize them. Other system fonts like 'Courier 10 Pitch' are recognized...just not what's in my user directory. So is there a way to get wkhtmltopdf (or for that matter, webkit) to recognize the fonts in my folder? Is there something I have to do over ssh or is there an option I can set in ruby?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题还存在吗?我刚刚尝试使用虚拟 Ubuntu 服务器,并且字体工作没有任何问题,尽管我从存储库获得的版本是 0.9.9,这是相当旧的。我的过程:
wkhtmltopd test.html test.pdf
我在本地检查了 pdf,然后在另一台计算机上检查,自定义字体甚至在那里工作,即使我没有已经安装了字体。 http://temp-share.com/show/dPf3m39HW <- 生成的 PDF(我希望该链接不是太临时)。
Does the problem still exist? I just tried with a virtual Ubuntu server and got fonts working without any problems even though the version I got from the repositories is 0.9.9 which is pretty old. My process:
wkhtmltopd test.html test.pdf
I checked the pdf locally and then on another computer and the custom font even worked there even though I didn't have the font installed. http://temp-share.com/show/dPf3m39HW <- generated PDF (I hope the link is not too temporary).