TCPDF ERROR: Could not include font definition file (SOLVED)

When using TCPDF_FONTS::addTTFfont(), everything seems all right, but you can’t get TCPDF to use the custom TTF fonts. You read online that the problem may be with the fonts directory, so you change permissions on all your TTF font directories, but nothing changes, you are still greeted with the message:

TCPDF ERROR: Could not include font definition file

Well. The problem actually is with the TCPDF fonts directory, not with the system TTF fonts directory

A quick and dirty, and probably not entirely safe solution to the problem is to grant write permissions to everyone on the TCPDF fonts directory, so that TCPDF can write the freshly generated font definition files to it:

  • sudo chmod ugo+w /usr/share/php/tcpdf/fonts


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.