It is mandatory to call this method at least once before printing text
or the resulting document would not be valid. The font can be either a
standard one or a font added via the {@link addFont()} method. Standard
fonts use Windows encoding cp1252 (Western Europe).
The method can be called before the first page is created and the font
is retained from page to page.
If you just wish to change the current font size, it is simpler to call
{@link setFontSize()}.
public setFont ( string $family, string $style = '', integer $size = null, boolean $force = false ) | ||
$family | string | Family font. It can be either a name defined by {@link addFont()} or one of the standard families (case insensitive): - Courier (fixed-width) - Helvetica or Arial (sans serif) - Times (serif) - Symbol (symbolic) - ZapfDingbats (symbolic) It is also possible to pass an empty string. In that case, the current family is retained. |
$style | string | Font style. Possible values are (case insensitive): - empty string: regular - B: bold - I: italic - U: underline or any combination. Bold and italic styles do not apply to Symbol and ZapfDingbats. |
$size | integer | Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12. |
$force | boolean | Force the setting of the font. Each new page will require a new call to {@link setFont()} and setting this to true will make sure that the checks for same font calls will be skipped. |