Search code examples
phpfontsfpdf

tPDF error after reuploading ttf "Undefined font: dejavu"


I am using the tFPDF package

$pdf=new tFPDF();
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('DejaVu', '', 12);

and it used to work. I had to reupload the font folder and since then I get the error message

FPDF error: Undefined font: dejavu

but the file DejaVuSansCondensed.ttf is definitely in the fonts folder. I even changed the mod to 777 because I thought maybe access rights are the problem, but it is still not working. What else could cause this error?


enter image description here


Solution

  • okay I just found the solution sorry for the post.

    https://stackoverflow.com/a/38520012/2311074

    Delete all *.php and *.dat files in font/unifont folder except ttfonts.php. All this files will be re-created (with right path).