0

I am trying to import a font into TCPDF but I get gibberish text instead? What could I be doing wrong? Thanks in advance!

Here is the code:

$fontname = TCPDF_FONTS::addTTFfont('Montserrat-ExtraBold.ttf', 'TrueTypeUnicode', '', 96);
$pdf->SetFont($fontname, '', 8, '', true);

And here is the result:

enter image description here

Charles Dy
  • 13
  • 2
  • Hi, your path to ```addTTFfont('/path_to_font/Montserrat-ExtraBold.ttf', 'TrueTypeUnicode', '', 96)``` is incorrect.. Please have a look at this answer as well -> [this](https://stackoverflow.com/questions/5263588/how-to-implement-custom-fonts-in-tcpdf) might help you...... – Anant V Apr 21 '23 at 07:47

0 Answers0