PHP Manual
Prev |  | Next

# PDF_set_font

PDF_set_font -- Selects a font face and size

## Description

`void pdf_set_font`(int pdf document, string font name, double size, int encoding, int embed);

The PDF_set_font() function sets the current font face, font size and encoding. You will need to provide the Adobe Font Metrics (afm-files) for the font in the font path (default is ./fonts). The last parameter `encoding` can take the following values: 0 = builtin, 1 = pdfdoc, 2 = macroman, 3 = macexpert, 4 = winansi. An encoding greater than 4 and less than 0 will default to winansi. winansi is often a good choice. If the last parameter is set to 1 the font is embedded into the pdf document otherwise it is not.

> Note: This function has to be called after PDF_begin_page() in order to create a valid pdf document.

> Note: This function does not need the afm files for winansi encoding if pdflib 2.0 support is activated.

Prev | Home | Next
PDF_show_xy | Up | PDF_set_leading