Fonts from the DejaVu family:
Fonts from the GNU FreeFont family:
You can also make your own fonts by pointing your browser to font/unifont/makefonts/makefonts.php and following instructions (if you're on Windows).true
as the fourth parameter of AddFont()
.<?php
require('sfpdf.php');
$pdf = new sFPDF();
$pdf->AddPage();
// Add a Unicode font (uses UTF-8)
$pdf->AddFont('DejaVu','','dejavusanscondensed.php',true);
$pdf->SetFont('DejaVu','',14);
// Load a UTF-8 string from a file and print it
$txt = file_get_contents('HelloWorld.txt');
$pdf->Write(8,$txt);
// Select a standard font (uses windows-1252)
$pdf->SetFont('Arial','',14);
$pdf->Ln(10);
$pdf->Write(5,'The file size of this PDF is only 17 KB.');
$pdf->Output();
?>