I’ve figured out (for now) how to manually define fonts to be used by your script. I’m going to document it here for anyone who needs this assistance until such time that your script will allow for some customization. I love your script, I hope you continue to develop it.
First, ensure the font file you have is a true type font. I wasted a fair bit of time because my .TTF file was actually open type font. I found an online converter.
Inside send-pdf.php (classes folder), make the following adjustments.
Look for the following line in / around line 643:
$mpdf = new \Mpdf\Mpdf([‘mode’ => ‘utf-8’,……
Add to that list of configuration variables the following (replacing the font file name and the font friendly name with your own requirements):
‘fontDir’ => array_merge($fontDirs, [WPCF7PDF_DIR . ‘/fonts’,]),
‘fontdata’ => $fontData + [‘futurastdlight’ => [‘R’ => ‘FuturaStdLight.ttf’]],
‘default_font’ => ‘futurastdlight’,
Create a ‘fonts’ folder inside the root of the send-pdf-for-contact-form-7 folder in your webserver and upload your font file to that folder.
This changes the entire font using in the PDF. I could not figure out how to use CSS styling within the plugin body itself where you create the PDF layout.
Referenced these instructions: https://mpdf.github.io/fonts-languages/fonts-in-mpdf-7-x.html