I've read many, many topics about the hassle with multiple font-styles/faces when using wkhtmltopdf.
We are currently experiencing problems when using Nunito (provided by Google webfonts) in regular style and bold style on the same page. We have tried many (possible) solutions, but none of them has given us a solution yet.
We tried the following solutions, but no one succeeded yet:
- Change the font family name using FontForge
- Convert the fonts using fontsquirrel
- Manually convert fonts to base64 using openssl (mac)
- Convert to base64 http://www.opinionatedgeek.com/dotnet/tools/base64encode/default.aspx
- Using remote includes for fonts (from google webfont)
- Change the fonts to SVG
All the above methods did not work. The browser does render it correctly, but wkhtmltopdf seems to be rendering it different.
We have published a few testcase's on: http://bannes.nl/fonts
If anyone has a suggestion on how to fix this, please let me know. In case you are using mac and have installed wkhtmltopdf, please feel free to test the cases on http://bannes.nl/fonts. I have included the output PDF for every testcase in their directory.
Hope someone has got a suggestion on how to fix this!
Best regards,
Robin