作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们使用 wkhtmltopdf 生成 PDF,并且需要使用 Montserrat 字体,该字体可从 Google Fonts 以 ttf 形式获取。
该字体似乎大部分都可以工作,但存在渲染问题。看起来 wkhtmltopdf 已将字体转换为矢量并应用了一些过度平滑的处理。特别注意“p”和“o”:
我们正在 Ubuntu 14.04 服务器上运行 wkhtmltopdf 0.12.2.1(带有修补的 qt)。该字体本地安装到服务器的 /usr/share/fonts
中。我没有注意到其他字体有任何类似的地方。
到目前为止我们尝试过的事情:
-webkit-font-smoothing
和 text-rendering
--zoom 1.3
标志 https://github.com/wkhtmltopdf/wkhtmltopdf/issues/45 非常感谢任何建议。
最佳答案
使用 @font-face
css 属性嵌入 GothamPro 字体时也有类似的问题。又花了很多时间,用SVG字体解决:将src: url('GothamPro.ttf')
改为src: url('GothamPro.svg') format("svg ");
关于css - 如何修复 wkhtmltopdf 中蒙特塞拉特的不良字体渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37809737/
This question already has an answer here: LinkedHashMap variable is not accessable out side the fore
提前致歉。这似乎是一个简单的任务,但几个小时后在 Google 上进行猜测/检查,我仍然无法弄清楚。 我正在为我公司提供的 API 编写一个 Java 便捷包装器库。其中一个类看起来像这样: clas
我是一名优秀的程序员,十分优秀!