wkhtmltopdf自定义字体字母间距 [英] wkhtmltopdf custom font letter spacing

查看:1251
本文介绍了wkhtmltopdf自定义字体字母间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

字母间的空格。我尝试通过在机器上安装字体(ttf)或通过调用从ttf转换的外部odf或通过添加base64(css)来设置字体。它看起来不错,但它插入之间的空隙。我也尝试了dpi参数,但仍然生成空格。
在MAC上生成相同的pdf完全可以工作(可能是因为字体随机附带)

为什么会发生这种情况,怎样才能解决这个问题? p>

谢谢。

附图描述了这个错误。每个字体组中没有添加空格。
以下图片文字

  abcdefg hijklmno pqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 
pre

解决方案

使用svg字体格式解析

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

解决方案

Was resolved using "svg" font format

这篇关于wkhtmltopdf自定义字体字母间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆