- In magento Invoice page pdf generation has default fonts only, so we can use that fonts only.
- The font families are
- The font families are
- Constants for the standard 14 PDF font names are defined in the Zend_Pdf_Font class:
- Zend_Pdf_Font::FONT_COURIER
- Zend_Pdf_Font::FONT_COURIER_BOLD
- Zend_Pdf_Font::FONT_COURIER_ITALIC
- Zend_Pdf_Font::FONT_COURIER_BOLD_ITALIC
- Zend_Pdf_Font::FONT_TIMES
- Zend_Pdf_Font::FONT_TIMES_BOLD
- Zend_Pdf_Font::FONT_TIMES_ITALIC
- Zend_Pdf_Font::FONT_TIMES_BOLD_ITALIC
- Zend_Pdf_Font::FONT_HELVETICA
- Zend_Pdf_Font::FONT_HELVETICA_BOLD
- Zend_Pdf_Font::FONT_HELVETICA_ITALIC
- Zend_Pdf_Font::FONT_HELVETICA_BOLD_ITALIC
- Zend_Pdf_Font::FONT_SYMBOL
- Zend_Pdf_Font::FONT_ZAPFDINGBATS
- If we want to add our custom font we need to do the following steps,
i) First we need to download the font file(.ttf) from web.ii) and then placed create one folder in root path and put it there - 'font/verdana.ttf'.$cFont = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir().'/font/verdana.ttf');
$pdfPage->setFont($cFont, 36);
- Now the font will apply to the following text in pdf.