'arabic fonts in Laravel pdf file issue
For generating pdf files in my Laravel app, I used niklasravnsborg/laravel-pdf package that it supports arabic language, No I want add custom fonts, I followed the documentation but it's not working, the text was showin with the default font of the package (I don't know what is..)
this is config/pdf.php :
...
'font_path' => base_path('/resources/fonts/'),
'font_data' => [
'NotoKufiArabic' => [
'R' => 'NotoKufiArabic-VariableFont_wght.ttf', // regular font // I tried also NotoKufiArabic-Regular
'B' => 'NotoKufiArabic-Bold.ttf', // optional: bold font
'I' => 'NotoKufiArabic-Medium.ttf', // optional: italic font
'BI' => 'NotoKufiArabic-SemiBold.ttf' ,// optional: bold-italic font
'useOTL' => 0xFF, // required for complicated langs like Persian, Arabic and Chinese
'useKashida' => 75, // required for complicated langs like Persian, Arabic and Chinese
]
// ...add as many as you want.
]
css code in blade :
body {
font-family: "NotoKufiArabic", sans-serif;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

