Open pandamouse opened 4 years ago
@pandamouse did you find a solution for this ? I'm having the same issue
Running catalina v10.15.7 with wkhtmltopdf v0.12.6 (with patched qt)
edit: add more information for devs for future
@Ribeiro-Tiago Nope. Just used the non duo tone icons instead. In my case the code rendering the icons is shared with other parts that could show the duo tone so I just override the duo tone css in the pdf specific section. But for most people it should be sufficient to just use .fas or whatever instead of .fad.
// wkhtmltopdf seems to have issues rendering the :after
// so we are using fas ttf and hiding the :after
// override Font Awesome Duotone :after
.fad {
position: relative;
font-family: 'Font Awesome 5 Pro';
font-weight: 900;
}
.fad::before {
position: static;
}
.fad::after{
display: none !important;
}
yeah I had to go down the same route.
One other solution that I thought of was to use the svg / sprite icons instead of webfonts but time consumption wise was preferrable to just change to non-duotones. Unfortunate, thanks though
@Ribeiro-Tiago : you know what? Your answer actually saved my day! Indeed, for an unknwon reason my fontawesome icons wouldn't render at all once on production - and yet I'm using the base64 fonticon (and everything works fine in dev env)... I think this is because my production environment is running Ubuntu 21...
I... actually didn't think about using SVGs directly... That will be a good enough solution for me :-)
wkhtmltopdf version(s) affected: 0.12.5 (with patched qt)
OS information Ubuntu 18.04 Bionic Beaver
Description When rendering html containing Font Awesome Duotone icon the :after css content (typically the lighter back layer using unicode U+10FXXX) fails to resolve from the ttf (which is embedded using base64 in the @font-face) while the :before css content does resolve from the same ttf, resulting in the icon being rendered with a lighter background of a square with a question mark.
How to reproduce (Don't think I'm allowed to put the ttf content in here)
This would show in the browser but in the pdf generated from wkhtmltopdf it shows
Expected behavior When converted into PDF I'm expecting the icon to display properly. It should render instead.
Possible Solution