wkhtmltopdf is broken and cannot render multiple fonts because of some issues around names. See wkhtmltopdf/wkhtmltopdf#2435
- Pick an 8 or less char name for each font and variation e.g. HelvBold, HelvLite, TimeReg
- Every variation needs to be a separate font file, with all the details renamed in Font Forge using the short name determined before.
- Give the font files the same short name (e.g. HelvBold.ttf)
- Setup the font-family with the same:
To rename a font use the rename_font.fs script attached to this gist with the original font name and the new shortfont as arguments.
rename_font.fs SuperFont-Book.otf BookSupr
Thanks, for this snipped! It worked great, but I had to change line 20 of
rename_font.fs
fromto
to fix
SetFontNames: Bad type for argument
. Also the directoryout
should exist, otherwise save would fail, too.