0

Here is an example. How can I add the font that I downloaded. How is the process?

$pdf = new FPDI();
$pdf->AddPage();
$pdf->setSourceFile('sample source of the template.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0, 210);
$pdf->AddFont('japanesefontnameSample', '', 'japaneseFontsample.ttf', true);
$pdf->SetFont('japanesefontnameSample');
$pdf->SetFontSize(12);
$pdf->SetXY(20, 23);
$pdf->SetTextColor(0, 0, 0);
David Buck
  • 3,752
  • 35
  • 31
  • 35
GDP
  • 1
  • 1
  • 5
  • Have a look at [this](https://stackoverflow.com/questions/25888281/how-do-i-add-a-new-font-to-a-fpdf) answer. – Cornel Verster May 22 '20 at 15:52
  • successfully load the font but still cannot not recognize the japanese font. it became special character like this "サニーライフ镒葉 ". do you know any tff font that i can use for japanese character? – GDP May 23 '20 at 09:41

1 Answers1

0

Are you sure you are using a unicode font? Maybe try some of these and see if you still get strange symbols.

Cornel Verster
  • 1,664
  • 3
  • 27
  • 55