asanrivas
asanrivas

Reputation: 11

Unicode font convert in TCPDF

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:

  1. TCPDF font converter.
  2. ttf2ufm (https://github.com/PhenX/ttf2ufm)

Did anyone ever succeed? Are there another workaround on this?
Thanks!

Upvotes: 1

Views: 2531

Answers (1)

Accountant م
Accountant م

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

Related Questions