Closed fatuhoku closed 8 years ago
first of all you have to make sure Times New Roman
is installed in your system,
then, (just my personal experience), I believe wkhtmltopdf always uses the fallback font when multiple fonts are specified. so please try to use one font in each font-family definition:
font-family: 'Times New Roman';
Okay, I've managed to get it working. Thanks!
Hi @fatuhoku how did you manage to get it working?
I put times-new-roman.ttf
and times-new-roman-bold.ttf
to /vendor/assets/fonts
, and then also added:
// fonts.scss
// Times New Roman and Arial are included for PDF generation
@font-face {
font-family: 'Times New Roman';
src: font-url('times-new-roman.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Times New Roman';
src: font-url('times-new-roman-bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
Now you can use font-family: 'Times New Roman'
in your CSS and it'll be recognized!
@pallymore Thanks! You help me with this problem. I`m all day search this solution)
By using
wkhtmltopdf-heroku
I was expecting it to help me install some very basic fonts. But everything appears as Verdana.This may be a dupe of #20 but I was hoping for some guidance.