wkhtmltopdf custom font letter spacing

杀马特。学长 韩版系。学妹 提交于 2020-01-04 14:02:53

问题


I'm running wkhtmltopdf on linux server (centos.10.x86_64). I'm trying to add "Times New Roman" font to the page. I see the fonts but on some font sizes it adds spaces between the letters. I tried setting the font by installing it on the machine (ttf) or by calling an external odf that I converted from the ttf or by adding it with base64 (css). It looks good on all, but it inserts spaces between the laters. I also tried to the dpi parameter but still the spaces are generated. Generating the same pdf over MAC works perfectly (probably because the font comes with the machine)

Why does it happen and how can it be fixed ?

Thanks.

The image attached describes the bug. No spaces added in each of the fonts group. The following the image text

abcdefg hijklmno pqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ

回答1:


Was resolved using "svg" font format



来源:https://stackoverflow.com/questions/25908298/wkhtmltopdf-custom-font-letter-spacing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!