helvetica font not working in wkhtmltopdf

前端 未结 6 1716
渐次进展
渐次进展 2020-12-08 10:37

I have been trying to use Helvetica font while creating the pdf but the font is not reflected back in pdf.

I did some google and found some solutions but none are wo

6条回答
  •  無奈伤痛
    2020-12-08 10:47

    expanding baxangs answer for linux (x64) users: you install the ttf font file in /usr/share/fonts/font-folder/font-name

    and then in your css file use the fontname which is listed in fc-list, you don't need to use @font-face, just use the fontname in your css

    example Verdana.ttf======

    copy from local machine to server into /usr/share/fonts/Verdana/Verdana.ttf

    fc-list to get the fontname (most likely it'll be Verdana)

    Then use in your css P{ font-family: 'Verdana'}

    and that's it! took me a while to get it fixed.

提交回复
热议问题