2016-09-26 198 views
1

我们使用的是wkhtmltopdf和wkhtmltoimage的最新版本(0.12.3)。并且遇到了“Frutiger Neue LT W1G Bold”字体的问题。它在所有普通浏览器上都能正常工作,但是在用上面提到的库创建一个图像或pdf后,它会呈现'0'字符错误(它在'0'内有奇怪的圆角)。错字体渲染wkhtmltopdf

应该如何器(Chrome版本53.0.2785.116 64位):

enter image description here

wkhtmltopdf:

enter image description here

wkhtmltoimage:

enter image description here

也许有人得到同样的问题,并知道答案?

我测试了很多不同的@ font-faces,像font-squirrel这样的网站,但没有任何工作。我们尝试了'Gotham Medmium'-Font,甚至使用该字体也得到了一些类似的效果图。

我的HTML/CSS:

<html lang="de" xmlns:og="http://ogp.me/ns#"> 
<head> 
    <meta charset="utf-8"/> 
    <style> 
     html, 
     body { 
      width: 100%; 
      height: 100%; 
      margin: 0; 
     } 
     @font-face { 
      font-family: 'frutiger--test'; 
      src: url(data:font/truetype;charset=utf-8;base64,AAEAAAA....); 
      font-weight: normal; 
      font-style: normal; 
     } 
     span { 
      font-family: 'frutiger--test'; 
      font-size: 100px; 
      font-weight: normal; 
     } 
     .test2 { 
      font-size: 13px; 
      font-weight: normal; 
     } 
    </style> 
</head> 
<body> 
    <span></span> 
    <span class="test2">00004578</span> 
</body> 

回答

1

它可能与0.13中的bug fixed有关。所以你应该更新它。

+1

它与alpha 0.13一起工作。所以是的,它似乎与该错误有关。谢谢! – Pomm0

0

你应该尽量使用非真正的类型格式的字体。如果你有woff2格式的字体,它应该可以正常工作。

+0

我也尝试过woff,woff2,并且做了相同的 – Pomm0