I\'m getting the following error when I try and generate a PDF using the mPDF class:
TTF file \"C:/wamp/www/inc/mpdf/ttfonts/verdana.ttf\": invalid checksum
Following are the steps to add new font family in mpdf library:
newFont.ttf font file(s) to this location /mpdf/ttfonts folder.Edit /mpdf/config_fonts.php OR /mpdf/src/config/FontVariables.php to add an entry to the $this->fontdata array for the new font file(s). Like:
$this->fontdata = array(
"newFont" => array(
'R' => "newFont-Regular.ttf",
'B' => "newFont-Bold.ttf",
'I' => "newFont-Italic.ttf",
'BI' => "newFont-BoldItalic.ttf",
),
font-family: 'newFont'; is now available in the stylesheets.
$mpdfObj = new mPDF('', '', 'newFont');
$mpdfObj->SetFont('newFont');
Now your new font is added.