<<<<<<< HEAD ======= >>>>>>> f41276fb72f3f71275eb6ac951a09a4c0d500b98

# AddFont

<<<<<<< HEAD `AddFont(string family [, string style [, string file [, string dir]]])` ======= `AddFont(string family [, string style [, string file]])` >>>>>>> f41276fb72f3f71275eb6ac951a09a4c0d500b98

## Description

Imports a TrueType, OpenType or Type1 font and makes it available. It is necessary to generate a font definition file first with the MakeFont utility.
<<<<<<< HEAD
The definition file (and the font file itself in case of embedding) must be present in:

- The directory indicated by the 4th parameter (if that parameter is set)
- The directory indicated by the `FPDF_FONTPATH` constant (if that constant is defined)
- The `font` directory located in the same directory as `fpdf.php`

If the file is not found, the error "Could not include font definition file" is raised. ======= The definition file (and the font file itself when embedding) must be present in the font directory. If it is not found, the error "Could not include font definition file" is raised. >>>>>>> f41276fb72f3f71275eb6ac951a09a4c0d500b98

## 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`
  <<<<<<< HEAD The name of the font definition file.
  By default, it is built from the family and style, in lower case with no space.
`dir`
  The directory where to load the definition file.
  If not specified, the default directory will be used. ======= The font definition file.
  By default, the name is built from the family and style, in lower case with no space. >>>>>>> f41276fb72f3f71275eb6ac951a09a4c0d500b98

## Example

<<<<<<< HEAD

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

is equivalent to:

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

=======

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

is equivalent to:

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

>>>>>>> f41276fb72f3f71275eb6ac951a09a4c0d500b98

## See also

SetFont

Index