wkhtmltopdf is not rendering fonts and border-radius is incorrect

I have a couple of problems with wkhtmltopdf. I am using wkhtmltopdf 0.12.2 (with patched qt)

I am converting a custom html page to a PDF. The rendered html looks correct on the browser, fonts rendered correctly, border-radius working fine. All that I expected.

When I run the wkhtmltopdf program with the rendered html page as input, some of the styling is rendered but the fonts are not.

I am using a custom font called Brandon Grotesque. I have tried importing it a myriad of ways

  1. Serving it locally on my site
  2. Using base64 encoding
  3. Installing the font locally on the machine
  4. I also tried importing the file from AWS S3 at one point :)

Here are the screenshots of the problem This is the screenshot of the rendered HTML page that will serve as input enter image description here

This is the screenshot of the PDF output enter image description here

Lastly, this is the command that I am using to get the results

xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf --encoding 'utf-8' --print-media-type --page-width 5in --page-height 7in -B 20 -L 5 -R 5 -T 5 --footer-html http://localhost:6116/packing_slip/footer http://localhost:6116/packing_slip/render?<some_query_string> /tmp/packing_slips/32345447_BEWZy_.pdf

Any input would be helpful.


It turns out the font is actually what I was expecting. However, wkhtmltopdf made it bold and removed letter spacing, making it unrecognizable.

For the image. I just had to adjust CSS to make the pdf render a full circle, even though the browser already rendered it properly.


 ? text-align: justify; not working with wkhtmltopdf
 ? wkhtmltopdf unicode and custom fonts on server
 ? wkhtmltopdf unicode and custom fonts on server
 ? wkhtmltopdf unicode and custom fonts on server
 ? use custom fonts with wkhtmltopdf
 ? Wkhtmltopdf not displaying TrueType fonts
 ? Fonts are not taking with the same font-family name using wkhtmltopdf
 ? wkhtmltopdf custom font letter spacing
 ? Drupal wkhtmltopdf font error
 ? Wrong font displayed in PDF when using wkhtmltopdf