Continuation of the discussion ...
Hi @calgia, I too am very interested in polishing our "corporate" design of the pdf export via dw2pdf: incorporating our font-class in the pdf. Although I have found the discussion quite useful, I have yet to get it to work. Hence my addition to this string with a summary of my changes and uncertainties.
These are the steps that I have completed.
added the following line to the FontVariables.php file located here: .../lib/plugins/dw2pdf/vendor/mpdf/mpdf/src/Config:
"newfont" => [
'R' => "NewFont.ttf",
],
...
'sans_fonts' => ['dejavusanscondensed', ..., 'newfont',]
added the ttf font in the directory: .../lib/plugins/dw2pdf/vendor/mpdf/mpdf/ttfonts and ensured same ownership and permissions as all of the other fonts in the directory.
added following to the style.css code to my particular template-directory (copy of the default).
body {
font-family: 'newfont';
font-weight: regular;
}
...
h1 {
font-family: 'newfont';
font-size: 24pt;
letter-spacing: 2px;
}
I am uncertain about what should be done in the step referring to the URL: fonts-in-mpdf.
At the moment, I do not even get a rendering of my page and am not sure why.
(Honestly outside of the apache2 error logs I am not sure where to look)
Any help, suggestions or tips are highly appreciated.