MakeFont(string fontfile, [, string enc [, boolean embed]])
fontfilePath to the .ttf, .otf or .pfb file.
encName of the encoding to use. Default value: cp1252.
embedWhether to embed the font or not. Default value: true.
$file in the .php file accordingly.
<?php
require('makefont/makefont.php');
MakeFont('c:\\Windows\\Fonts\\comic.ttf','cp1252');
?>
$pdf->AddFont('Comic','','comic.php');
$pdf->AddFont('Comic','B','comicbd.php');
<?php
require('makefont/makefont.php');
MakeFont('calligra.ttf','cp1252');
?>
<?php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddFont('Calligrapher','','calligra.php');
$pdf->AddPage();
$pdf->SetFont('Calligrapher','',35);
$pdf->Write(10,'Enjoy new fonts with FPDF!');
$pdf->Output();
?>
| Encoding | Position |
|---|---|
| cp1250 | 128 |
| cp1251 | 136 |
| cp1252 | 128 |
| cp1253 | 128 |
| cp1254 | 128 |
| cp1255 | 128 |
| cp1257 | 128 |
| cp1258 | 128 |
| cp874 | 128 |
| ISO-8859-1 | N/A |
| ISO-8859-2 | N/A |
| ISO-8859-4 | N/A |
| ISO-8859-5 | N/A |
| ISO-8859-7 | N/A |
| ISO-8859-9 | N/A |
| ISO-8859-11 | N/A |
| ISO-8859-15 | 164 |
| ISO-8859-16 | 164 |
| KOI8-R | N/A |
| KOI8-U | N/A |