To create new font, you should use this tutorial from TCPDF:
To use this new font, you must add it to Html2Pdf, by using the following method:
$html2pdf->addFont($family, $style, $file);
The parameters are:
Parameter | Default | Description |
---|---|---|
$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):
|
|
$file | The font definition file. By default, the name is built from the family and style, in lower case with no spaces. |
If you want to add font for normal and for bold style, you must call the addFont
method twice, one for each font file.
WARNING: In 4em parameter constructor of Html2pdf, you must specify whether you use a Unicode font (true) or an old font (false).
You have just to se the new font family name in your css.
You can set the default font to use with the following method:
$html2pdf->setDefaultFont($default);