elibyy / tcpdf-laravel

TCPDF helper for laravel
MIT License
315 stars 74 forks source link

Do TCPDF has support of Urdu font "Jameel Noori Nataleeq"? #134

Open semudassarzahid opened 1 year ago

semudassarzahid commented 1 year ago

I am trying to configure a Urdu font. Reference URL: https://urdufonts.net/fonts/jameel-noori-nastaleeq-regular

As I added the font into TCPDF using script

 PDF::SetTitle('Hello World');
        $fontname = \TCPDF_FONTS::addTTFfont(base_path('storage/fonts/').'Jameel-Noori-Nastaleeq.ttf', 'TrueTypeUnicode');
        PDF::SetFont('jameelnoorinastaleeq');
        PDF::AddPage();
        PDF::Write(0, 'Hello world کوڈ');
        PDF::Output('hello_world.pdf');

What is happening here the font is not being displayed like;

Screenshot 2023-02-27 at 12 25 34 AM

Do anyone know or help me understand the issue behind this behaviour?

Key question: Do TCPDF has built-in support for processing this font? If TCCPDF don't have it's support what is required to add it's encoding? Anyone faced this error before?

Please add your input. Thank you!

Urdu font should be loaded as given in text.