PHP code example of laurentmuller / fpdf2-make-font

1. Go to this page and download the library: Download laurentmuller/fpdf2-make-font 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/ */

    

laurentmuller / fpdf2-make-font example snippets


makeFont(string fontFile [, string encoding [, boolean embed [, boolean subset]]])



makeFont('C:\\Windows\\Fonts\\comic.ttf','cp1252');

$pdf->addFont('Comic', PdfFontStyle::REGULAR, 'comic.php');

$pdf->addFont('Comic', PdfFontStyle::BOLD, 'comicbd.php');



makeFont('CevicheOne-Regular.ttf', 'cp1252');

use fpdf\Enums\PdfFontStyle;
use fpdf\PdfDocument;

$pdf = new PdfDocument();
$pdf->addFont('CevicheOne', PdfFontStyle::REGULAR, 'CevicheOne-Regular.php');
$pdf->addPage();
$pdf->setFont('CevicheOne', PdfFontStyle::REGULAR, 45);
$pdf->write(10, 'Enjoy new fonts with FPDF!');
$pdf->output();
console
php src\makeFont.php C:\Windows\Fonts\comic.ttf cp1252
console
php src\makeFont.php CevicheOne-Regular.ttf cp1252