Reputation: 11
I need to work on using open source/free font with TCPDF. Specifically Noto or Code2000. But it doesn't work well, and displays other font instead. Basically I want to have nice font, works with multiple language, and support bold and italic.
I did Google about this, but no luck. Tried the following method:
Did anyone ever succeed? Are there another workaround on this?
Thanks!
Upvotes: 1
Views: 2531
Reputation: 7483
I had the same problem.
make sure you have these 2 lines set
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$lg['a_meta_charset'] = 'UTF-8';
$pdf->setLanguageArray($lg);
$pdf->SetFont('dejavusans', '', 8);
dejavusans
Font has the required data for several languages.
Upvotes: 1