## AddFont

`AddFont(string family [, string style [, string file]])`

#### Version

1.5

#### Description

Imports a TrueType or Type1 font and makes it available. It is necessary to generate a font definition file first with the makefont.php utility.
The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by `FPDF_FONTPATH` if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated.

#### Parameters

`family`

> Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.

`style`

> Font style. Possible values are (case insensitive):
> - empty string: regular
> - `B`: bold
> - `I`: italic
> - `BI` or `IB`: bold italic
> The default value is regular.

`file`

> The font definition file.
> By default, the name is built from the family and style, in lower case with no space.

#### Example

`$pdf->AddFont('Comic','I');`

is equivalent to:

`$pdf->AddFont('Comic','I','comici.php');`

#### See also

SetFont().

######

Index