Forums

How to add unicode font to TCPDF action?

grzybu 03 Jul, 2015
Hi,

I wonder if I can add unicode font to TCPDF? I want to simply add "freesans" font but no matter what I do with fonts directory I still have only "courier, helvetica and times) in font choice list.
Is there any way to add more fonts to the pdf?
GreyHead 03 Jul, 2015
Hi gryzbu,

You can try adding it to the font list around line 193 of /administrator/components/com_chronoforms5/chronoforms/actions/tcpdf/tcpdf.php
		$fonts = array('courier' => 'courier', 'helvetica' => 'helvetica', 'times' => 'times');

Bob
grzybu 03 Jul, 2015
Thanks,
I've added this and I see new font in the list.
I have freesans.php file in tcpdf/fonts dir, but when pdf is beeing generated I got error:

TCPDF ERROR: Could not include font definition file: freesans

Where the font files should be placed?
GreyHead 03 Jul, 2015
Hi grzybu,

I got this to work - I had to copy all the freesans font metric files from the TCPDF folder as well as the freesans,php file.

Bob
grzybu 03 Jul, 2015
Where did you copied those fonts?
This is what I have in administrator/components/com_chronoforms5/chronoforms/actions/tcpdf/tcpdf/fonts dir:

courier.php      freesansbi.ctg.z  freesansbi.z   freesansb.z     freesansi.ctg.z  freesansi.z   freesans.z     times.php
freesansb.ctg.z  freesansbi.php    freesansb.php  freesans.ctg.z  freesansi.php    freesans.php  helvetica.php
grzybu 03 Jul, 2015
OK, I got it. I had to copy this to system php/tcpdf/fonts dir and now it works perfects. Thanks🙂
This topic is locked and no more replies can be posted.