-
Notifications
You must be signed in to change notification settings - Fork 45
Related to Fonts
Ks Tan edited this page Nov 30, 2018
·
14 revisions
PHPJasperxml Supported font listed in phpjasperxml/tcpdf/fonts
- All font in report will convert to small letter and remove the blank space to match the font name
- The engine will use Font to render the text, however, if the engine notice some asian font exists in utf text value, it will switch to another font as below table:
Language | Condition | Swich To |
---|---|---|
Chinese | preg_match("/\p{Han}+/u", $utfstring) | cid0cs |
Japanese | preg_match("/\p{Katakana}+/u", $utfstring) | cid0jp |
Korean | preg_match("/\p{Hangul}+/u", $utfstring) | cid0kr |
- To avoid rendering engine swap the font, at Jasper Report Studio, Select text field, properties, Advanced, PDF Font Name, define desire font. Once define here the engine will not convert the to others font
- run below command
cd <phpjasperxml>/tcpdf/tools/tcpdf6/tools
./tcpdf_addfont.php -b -t TrueTypeUnicode -f 33 -i /path/to/your/ttffont.ttf
It will generate required font file. You can verify new font file exists in font folder. If it appear in tools folder, you can copy them to phpjasperxml/tcpdf/fonts. After you add the font, if you feel the font is useful may send pull request to us
If you use a font which is not inside the phpjasperxml/tcpdf/fonts, it will borrow ttf font from operating system, however add the TTF font drastically increase the pdf size. You can use refer 'Add TTF Fonts' to make phpjasperxml support the specific font you wish to use.