Hi Ggore,
That won’t work because the pdf engine doesn’t know where the template is located – it only processes the resulting HTML/CSS. It is possible to use the server path instead of a url, but then you need a slightly different code (assuming you put them in your template folder under fonts/
):
@font-face {
font-family: 'Your font';
font-style: normal;
font-weight: normal;
src: local('Your font'), local('Your-font'), url(<?php echo $wpo_wcpdf->export->template_path. '/fonts/'; ?>yourfont.ttf) format('truetype');
}
@font-face {
font-family: 'Your font';
font-style: normal;
font-weight: bold;
src: local('Your font Bold'), local('Your-font-Bold'), url(<?php echo $wpo_wcpdf->export->template_path. '/fonts/'; ?>yourfont-bold.ttf) format('truetype');
}
You only need the ttf/truetype version, all other versions don’t work in the PDF engine.
Also, as noted in the thread that I linked to: if you loaded the font in a wrong way once, you have to clear the PDF engine’s font cache, the easiest way to do that is to simply reinstall the plugin… If you don’t do this, it won’t display the correct font even if you load it the proper way, as it will have (broken) references to those fonts already.
Can you send a PDF to [email protected], with annotations to point out what is wrong so I can take a look at it?
Ewout