Google Unicode Fonts not rendered properly in mpdf for PHP

0 votes

I want to use Baloo2 Google Font in mpdf to render the Hindi Language.

I'm trying to render the following:

चातुर्यकला त्रिवेदी
But it is rendered as
चातुर् यकला त् रविदी

 

The Code in my file is:

$html = ' आवेदक का नाम  : चातुर्यकला त्रिवेदी';
$filename = 'demofile' . time() . '.pdf';
$mpdf = new \Mpdf\Mpdf([
   'mode' => 'utf-8',
   'default_font' => 'baloo',
]);
   $mpdf->debug = true;
   $mpdf->WriteHTML("p, td {font-family: baloo; color: transparent; white-space: pre; cursor: text; transform-origin: 0% 0%;}", 1);
$mpdf->WriteHTML($html);
$mpdf->Output($filename, 'D');

I've also copied the fonts in the ttfonts directory and also made changes to the fontVariables.php files as follows:

'fontdata' => [    
        "baloo" => [
          'R' => "BalooRegular.ttf",
          'useOTL' => 0xFF,
          'useKashida' => 75,
        ]...
    ];

But I am getting this error in return:

GPOS Lookup Type 5, Format 3 not supported (ttfontsuni.php)

Can someone please help me with this? 

Jun 9, 2022 in PHP by Kichu
• 19,050 points
1,344 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,880 points
3,888 views
0 votes
1 answer
0 votes
1 answer

How to delete element by value in array (not key) using php?

Hello @kartik, Using array_search() and unset, try the following: if (($key = ...READ MORE

answered Sep 16, 2020 in PHP by Niroj
• 82,880 points
1,612 views
0 votes
1 answer

How to properly URL encode a string in PHP?

Hello @kartik, For the URI query use urlencode/urldecode; for ...READ MORE

answered Oct 19, 2020 in PHP by Niroj
• 82,880 points
2,904 views
0 votes
1 answer

How to Check for a Specific Type of Object in PHP

Hello @kartik, You can use instanceof: if ($pdo instanceof PDO) ...READ MORE

answered Oct 30, 2020 in PHP by Niroj
• 82,880 points
1,451 views
0 votes
1 answer

PHP Convert String to SEO Friendly Url For Bengali Language Type

$string = preg_replace("/[^a-z0-9]/u", "$separator", $string);  change the ...READ MORE

answered Feb 14, 2022 in Others by narikkadan
• 63,420 points
893 views
0 votes
0 answers

Laravel/ MSSQL (AWS RDS) General error: 20018 Unicode data

I'm using SQL Server with a Laravel ...READ MORE

Apr 25, 2022 in AWS by Aditya
• 7,680 points
672 views
0 votes
0 answers

Merge PDF files with PHP

Is it possible to merge multiple pdf ...READ MORE

May 27, 2022 in PHP by Kichu
• 19,050 points
1,051 views
0 votes
0 answers

how to change to english number to nepali number in php

I want to change the English numerals ...READ MORE

May 28, 2022 in PHP by Kichu
• 19,050 points
434 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP