How do I add a new font to a fpdf?

Janinekey picture Janinekey · Sep 17, 2014 · Viewed 8.9k times · Source

How can I add the Gotham-book font to fpdf. Most explanations are unclear and very difficult to understand. I need an example. Please can someone assist?

Answer

Janinekey picture Janinekey · Sep 17, 2014

Nevermind Got my answer

Go to http://www.fpdf.org/makefont/

Convert your .ttf file

Download the .php and the .z file

Add these files to the following folder: fpdf/font
(This is the default folder structure that you need to download in order for your fpdf to work)

This is the code I have used in my file:

$fpdf->AddFont('Gotham','','Gotham-Book.php');
    $fpdf->SetFont('Gotham','',11);