RD-Media is providing the default fonts for FPDF only but sometimes you may need some different fonts in your tickets. You can add every font you like, we are not adding these fonts because the package for installing will become to big. Here are the steps to follow:
- Search on the internet for the font you like. And download the .ttf file from the website.
- Go to: http://www.fpdf.org/makefont
- Upload the .ttf file in the uploader and start downloading the .php file and .z file.
- Then upload this font definitions to the next location:
[website-root]/administrator/components/com_ticketmaster/assets/pdf/fpdf/font/
The font is now present at your server, so we can use it in the classes we need:
- [website-root]/administrator/components/com_ticketmaster/classes/createtickets.class.php
- [website-root]/administrator/components/com_ticketmaster/classes/confirmation.php
- [website-root]/administrator/components/com_tcketmaster/classes/special.tickets.class.php
How to use it?
In our example we have uploaded the next files to our server:
- Eunjin.php
- Eunjin.z
Open one of the above files and you will this part of code everywhere:
$pdf->AddPage();
The next text needs to be placed after this statement:
$pdf->AddFont('Eunjin','', 'Eunjin.php');
Then you need to go throug the whole file and replace all font things in the file: (As you can see we have used Arial everywhere in the script:
$pdf->SetFont('Arial', '', $order->ticket_fontsize);
Just replace Arial with 'Eunjin' (in this example) and you are done. (Please make an override of the createtickets.class.php file otherwise it will be overwritten in the next version again.
When using special characters like Russian, Thai or whatever then please make sure this ttf file has these characters in it. (https://code.google.com/p/pyfpdf/wiki/Unicode) && (http://www.fpdf.org/en/tutorial/tuto7.htm)