3

I am using Century Gothic font in my HTML and then converting it in to PDF. It works perfectly on my mac, but on my Slackware 14.1 server, when I convert the HTMl in to the PDF, the font is not rendered as smoothly as it should be.

I read several ways to include non-standard fonts in the HTML, as @font-face, or adding the entire font in the CSS file as an encoded font and both these methods worked for me in the HTML. The HTML is rendered perfectly in the browser, it's the PDF which is not getting a correct Century Gothic. Any help is highly appreciated.

Thank you

Suhas
  • 39
  • 2
  • Just to be clear: A display, connected to your linux box, shows the correct font when running a browser on your linux box? – Erich Kitzmueller Feb 20 '15 at 13:09
  • Are you sure this isn't just a display issue? Have you tried zooming the PDF, i.e. is it still "not smooth" when viewed at, say, 250%? – LocEngineer Feb 20 '15 at 13:14
  • Well the server doesn't have any GUI, but I got your question. I uninstalled the font on my machine and then checked the HTML version of the server. – Suhas Feb 20 '15 at 13:16
  • @LocEnginner yeah the PDF looks crooked completely... The words are not clear when the PDF is generated... they look weird.. sometimes overlap each other... – Suhas Feb 20 '15 at 13:24
  • Ensure all fonts are available for wkhtmltopdf as well (depending on your settings) – Déjà vu Feb 20 '15 at 13:46
  • @ring0 - yes, all the fonts are available... mainly there is just one Century Gothic... and I use that as an embedded font. If you can check the css used in the above webpage, you can see it... – Suhas Feb 20 '15 at 13:54

1 Answers1

0

I did some research too and it seems that this is a known bug with qt-webkit. See the issue documentation here: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2193

Sorry to not have better news for you. Maybe just try with a supported font that's close enough to what you like it to look?

LocEngineer
  • 2,847
  • 1
  • 16
  • 28
  • thanks a lot dude for the efforts... such a bummer... I guess I will have to switch over to something else... I was even looking to build a server just to serve the wkhtmltopdf properly... Use that as a wkhtmltopdf service... but I'm not sure if there is enough ROI on that... Thanks anyways man... appreciate it... – Suhas Feb 20 '15 at 13:51
  • I'm using wkhtmltopdf myself, so it was worth the research. Been obviously lucky with my choice of font. (Gil Sans) – LocEngineer Feb 20 '15 at 13:58
  • Yeah you are lucky... I am trying to apply some fixes of my own it's working out not too bad... Thanks again... – Suhas Feb 24 '15 at 08:35