MakeFont(string fontfile, [, string enc [, boolean embed]])
fontfileChemin du fichier .ttf, .otf ou .pfb.
encNom de l'encodage à utiliser. Valeur par défaut : cp1252.
embedIndique si la police doit être incorporée ou non. Valeur par défaut : true.
$file en conséquence dans le fichier .php.
<?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,'Changez de police avec FPDF !');
$pdf->Output();
?>
| Encodage | Position |
|---|---|
| cp1250 | 128 |
| cp1251 | 136 |
| cp1252 | 128 |
| cp1253 | 128 |
| cp1254 | 128 |
| cp1255 | 128 |
| cp1257 | 128 |
| cp1258 | 128 |
| cp874 | 128 |
| ISO-8859-1 | absent |
| ISO-8859-2 | absent |
| ISO-8859-4 | absent |
| ISO-8859-5 | absent |
| ISO-8859-7 | absent |
| ISO-8859-9 | absent |
| ISO-8859-11 | absent |
| ISO-8859-15 | 164 |
| ISO-8859-16 | 164 |
| KOI8-R | absent |
| KOI8-U | absent |