我正在尝试使用 TFPDF 以 PDF 格式显示泰米尔语内容。我已经下载了泰米尔语字体 TSCu_SaiIndira.ttf 并将其存储在路径中C:\wamp\www\tfpdf\font\unifont
。存储在记事本中的泰米尔语单词是“பெயர்கள்”。当我运行下面的代码时,它会打印不同的字母
<?php
require('tfpdf.php');
$pdf = new tFPDF();
$pdf->AddPage();
// Add a Unicode font (uses UTF-8)
$pdf->AddFont('DejaVu','','TSCu_SaiIndira.ttf',true);
$pdf->SetFont('DejaVu','',14);
// Load a UTF-8 string from a file and print it
$txt = file_get_contents('HelloWorld.txt');
$pdf->Write(8,$txt);
// Select a standard font (uses windows-1252)
$pdf->SetFont('Arial','',14);
$pdf->Ln(10);
$pdf->Write(5,'The file size of this PDF is only 12 KB.');
$pdf->Output();
?>
我是编码新手。我已经阅读了针对相关问题发布的所有答案,但没有任何结果。