I want to write a hindi text in my pdf.
At first, I downloaded the
ttffont file from google fontsAfter that I included the
ttffile insidefont < unifontAfter that, I added the fonts into my code:
<?php require('tfpdf.php'); $pdf = new tFPDF(); $pdf->AddPage(); $pdf->AddFont('NotoSerifDevanagari-Regular','','NotoSerifDevanagari-Regular.ttf',true); $pdf->SetFont('NotoSerifDevanagari-Regular','',10); $pdf->Cell(40,10,'पूसीरे के रेसुब ने नाबालिगों समेत 12 लोगों को बचाया'); $pdf->Output(); ?>
The resultant text in the pdf shows like this: screenshot of my pdf
Here, as you can see the word नाबालिगों is incorrectly spelled. Why? How do I fix this?