gpt4 book ai didi

css - 如何修复 wkhtmltopdf 中蒙特塞拉特的不良字体渲染

转载 作者:行者123 更新时间:2023-12-02 21:05:03 25 4
gpt4 key购买 nike

我们使用 wkhtmltopdf 生成 PDF,并且需要使用 Montserrat 字体,该字体可从 Google Fonts 以 ttf 形式获取。

该字体似乎大部分都可以工作,但存在渲染问题。看起来 wkhtmltopdf 已将字体转换为矢量并应用了一些过度平滑的处理。特别注意“p”和“o”:

Font rendering discrepancies in wkhtmltopdf

我们正在 Ubuntu 14.04 服务器上运行 wkhtmltopdf 0.12.2.1(带有修补的 qt)。该字体本地安装到服务器的 /usr/share/fonts 中。我没有注意到其他字体有任何类似的地方。

到目前为止我们尝试过的事情:

非常感谢任何建议。

最佳答案

使用 @font-face css 属性嵌入 GothamPro 字体时也有类似的问题。又花了很多时间,用SVG字体解决:将src: url('GothamPro.ttf')改为src: url('GothamPro.svg') format("svg ");

关于css - 如何修复 wkhtmltopdf 中蒙特塞拉特的不良字体渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37809737/

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