0

I am trying to write Bengoli in my pdf which i am generating by MPDF library.

$mpdf = new \Mpdf\Mpdf([

            
            'margin_top'=>10,
            'margin_buttom'=>10,


        ]);

there is no errors , external fonts which i am trying to use for Bengoli is not effecting my content,I have tried DejaVu Sans it works for few languages but can't figure out which will work for bengoli, I have both english and Bengoli content in same page so when i use other fonts or external fonts i get ?????????? [][[][][][][][], English content is ok with other fonts but for bengoli nothing seems to work.

Shiba Das
  • 350
  • 4
  • 12
  • What do you mean by "not working"? If there is any error message, please share it – Nico Haase Mar 13 '21 at 20:27
  • @NicoHaase sorry for not explaining more, there is no errors , external fonts which i am trying to use for Bengoli is not effecting my content, I have both english and Bengoli content in same page so when i use other fonts or external fonts i get ?????????? [][[][][][][][], i was looking for a proper font which will support both Bengoli and English, luckily FreeSerif done the trick for me after lots of trying and searching. – Shiba Das Mar 14 '21 at 06:49
  • Please share more details, like the code triggering the problem – Nico Haase Mar 14 '21 at 14:15

1 Answers1

2

After lots searching i have found a simple solution for my project, which is to use FreeSerif which is already included in mpdf.

    $mpdf = new \Mpdf\Mpdf([

        'default_font' => 'FreeSerif',
        'mode' => 'utf-8',
        'margin_top'=>10,
        'margin_buttom'=>10,


    ]); 

I have added below two lines :

    'default_font' => 'FreeSerif',
        'mode' => 'utf-8',

when initializing mpdf.

Shiba Das
  • 350
  • 4
  • 12