use custom fonts with wkhtmltopdf

前端 未结 9 1435
难免孤独
难免孤独 2020-12-03 01:12

I am trying to use custom fonts in my PDF generated with wkhtmltopdf. I read that you can\'t use google webfonts and that wkhtmltopdf uses truetype .ttf file. Can anyone con

9条回答
  •  -上瘾入骨i
    2020-12-03 01:46

    Since it is a Google Web font you need not to write @font-face in you style sheet just use following link tag in your source code:

    
    

    and

     
    

    will work.

    By the way, in your code you are defining @font-face family as font-family: Jolly; and using it as p { font-family: 'Jolly Lodger', cursive; } that is wrong, because it's mismatching font-family name.

提交回复
热议问题