1. Go to this page and download the library: Download zanysoft/laravel-pdf library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$fontdata = array(
'examplefont' => [
'R' => 'ExampleFont-Regular.ttf', // regular font
'B' => 'ExampleFont-Bold.ttf', // optional: bold font
'I' => 'ExampleFont-Italic.ttf', // optional: italic font
'BI' => 'ExampleFont-Bold-Italic.ttf', // optional: bold-italic font
]
// ...add as many as you want.
);
$pdf->addCustomFont($fontdata, true);
// If your font file is unicode and "OpenType Layout" then set true. Default value is false.