Jump to content

PDF Fonts


KevinTH

Recommended Posts

I have been experimenting trying to get the currency symbol for Thai baht showing correctly. It's a B with a vertical slash as in

 

฿

 

Works fine in the portal and printable invoices

 

Image1.jpg

 

but has problems in PDF invoices which all my clients prefer.

 

I've experimented with the 3 different fonts provided.

 

Helvetica

 

hevetica.jpg

 

Freesans

 

freesans.jpg

 

dejavusans

 

dejavusans.jpg

 

As you will see the last two (freesans & dejavusans) are completely messed up and of no use at all. Only helvetica gets close but the Thai baht currency symbol doesn't work and shows _3647; (ignore the _) instead of ฿

 

Could anyone shed any light on this? Much appreciated.

Link to comment
Share on other sites

if your settings don't reveal an answer, another possible solution would be to use a different pdf font - i've sent you a pm on how to do this.

 

e.g, here is a part of an invoice using a custom pdf font that shows the baht symbol without a problem.

 

http://prntscr.com/2k4042

 

i'll check with a mod to see if I can publish the method on the forum.

Link to comment
Share on other sites

KevinTH,

 

I apologize for the confusion here. I wrote a reply but it appears not to have posted, after the reply was made I also changed the prefix. I have restored the prefix to a more accurate state.

 

In this case I think your best bet forward may be to open a ticket with our support team so they can investigate this further. WHMCS does not define default database collations, it uses what the database is setup to use. That can vary from install to install.

 

Have a great day.

 

Nate C

Link to comment
Share on other sites

As one of the moderators on this forum I would be happy to see you share the solution you are using.

ok Nate - the reason I was going to contact a mod was because I thought there might be copyright issues with this solution, but i'm sure if there are, you can always delete the post! :roll:

 

ideally you need to find a free font (ttf or otf) that contains your baht symbol (Unicode Alt +0E3F) - this can then be converted to a pdf font at the site below. (btw, there is a way to do this in PHP using TCPDF, but this is a drag/drop solution - so much easier for the non-technical!).

 

http://fonts.snm-portal.com/

 

not all fonts that contain the baht symbol will convert successfully to a usable pdf font format - I think Verdana is one that will, and Tahoma is another... although whether these are classed as "free fonts" that can be converted for this purpose, I don't know.

 

you certainly should not convert any commercially available fonts to a pdf font format without permission.

 

anyway, if you drag/drop your selected font into the above site, it will convert it to the three files that WHMCS needs for its pdf fonts.

 

save them locally and then upload these three files to the includes/fonts directory of whmcs.

 

then go to general settings -> invoices and change the pdf font (TCPDF Font Family) to custom and enter the font name.

 

in the image below, I quickly switched the currency to use the baht symbol and changed to using a custom pdf font (Tahoma) - the image below is part of the resulting pdf invoice.. as you can see, the baht symbol is shown correctly.

 

http://prntscr.com/2k4042

 

I believe that this is only a bug in the sense that none of the PDF fonts that are currently included with whmcs, have the baht symbol within them - one possible solution might be for WHMCS to manually add the symbol to their fonts and convert them again.

Link to comment
Share on other sites

I agree, I just wonder if that is the root of where this issue is coming from. What is the "System Charset" set to under Setup > General Settings > Localisation in the admin? Have you opened a ticket with WHMCS?

 

iso-8859-1:

 

encodes what it refers to as "Latin alphabet no. 1," consisting of 191 characters from the Latin script. This character-encoding scheme is used throughout the Americas, Western Europe, Oceania, and much of Africa.

 

I understand the Baht symbol is not in that character set and I don't require any Thai character other than the currency symbol.

 

- - - Updated - - -

 

Thanks everybody for all your help and advice. It's Saturday here and I have appointments with friends all weekend. I'll get back to you all on Monday.

Link to comment
Share on other sites

  • 3 weeks later...

Temporary bug fix Again!!! In folder includes/classes/TCPDF/fonts extract this files http://goo.gl/hwLgF2 and all pdfs are OK for me now. For invoices I'm using freesans font.

 

I'm completely disappointed with this buggy version. This is my second workaround for major bugs. I completely do not understand why this was released with so many bugs. But I understand that I pay for something which broke my clients functionality and lost my days!!!

Edited by neo2shyalien
Link to comment
Share on other sites

Hello,

 

I can confirm that the font directory moved in 5.3.3. It moved as part of an upgrade to TCPDF which should resolve some other bugs customers had with it. If you depend on custom fonts, you need to copy them there.

 

Have a great day,

 

Nate C

 

We dont talking about for some "custom fonts". FreeSans is default WHMCS and should have full support of it. But it's missing from TCPDF folder and this cause the bug with unreadable invoices. So I dont want to be rude but this response is completely pointless.

Edited by neo2shyalien
Link to comment
Share on other sites

neo2shyalien,

 

I apologize for not addressing the concern you raised in this thread. Freesans was a font that was shipped by PCPDF that we included. When we upgraded to a new PCPDF version in 5.3.3 they shipped new fonts and removed Freesans and we followed their lead.

 

I have opened case 4037 to look at adding these fonts back into what we distribute.

 

Thanks for your report and thanks for sticking with the forum thread until we get it right,

 

Nate C

Link to comment
Share on other sites

Hello,

 

This thread has become an example of why I am normally aggressive in closing bug report forum threads. The thread began around finding the correct font to use to show the thai baht. It was picked up to discuss the change in font location in 5.3.3. Used to discuss the removal of one of the fonts shipped in 5.2 by TCPDF. Now db2000 is raising a different issue, which is the pdf template not using the custom font setting.

 

Db2000, your issue has already been reported and case 4007 was opened to track it and get it resolved. To prevent further confusion I am going to close this thread.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated