0
votes

I am using TCPDF 6.0.20, PHP 5.3.8.

Since my PDF will contain some Chinese Character (Simplified and Traditional), I decide to use font name: cid0cs.

Now, since a lot of users replied that they don't have that font installed, I need to embed this font to the PDF.

However, from http://www.tcpdf.org/fonts.php it just said how to embed a ttf file using addTTFfont(), but NO WAY to create that font.

The only file that I found in tcpdf/fonts/ is cid0cs.php, which is NOT a ttf file.

I tried run the script in tcpdf/tools/tcpdf_addfont.php and use the command line below:

c:\tcpdf>php tools/tcpdf_addfont.php -t CID0CS -o . -i fonts/cid0cs.php

and it returns: --- ERROR: can't add fonts/cid0cs.php

Can anyone please tell me how to create that cid0cs.ttf file so that I can embed it using addTTFfont()?

Thank you in advance.

2

2 Answers

0
votes

I found the solution and record the process in my blog post below:

http://alucard-blog.blogspot.hk/2013/06/tcpdf-how-to-display-chinese-character.html

The key point is: I found the font that can display Traditional and Simplified Chinese.

0
votes
  1. cmd and run php
  2. run this command : \ABSOLUTE PATH TO\tcpdf_addfont.php -i \ABSOLUTE PATH TO\myfont.ttf
  3. if it works fine, you will find 3 files of myfont in /TCPDF/fonts
  4. you might find some help here : http://queirozf.com/entries/adding-a-custom-font-to-tcpdf