Topic: CHINESE LANGUAGE ISSUE - ONLY HAPPEN ON INVOICE

Hi,

I have made changes to the respective files and mysql structure to UTF8 so as to cater for Chinese characters entry and output as required by our users.  And I have successfully made it work.  But I discovered an issue when printing Invoice.  And this issue only happened on printing Invoice but not on other documents such as SO, PO, DO when the home currency and the Invoice currency are different.

Here were what I did to make the system works with Chinese characters:

-   Downloaded the font files: chinese_simplified_cid0, unzipped and place them in reporting/fonts directory
-   Updated the reporting/includes/class.pdf.inc
                    case "ar_EG" :     $fontname = "ae_tholoth";     break;
                    case "zh_CN" :     $fontname = "gbsn00lp";     break;
                    case "zh_TW" :     $fontname = "chinese_traditional_cid0";     break;
                    default :          $fontname = "chinese_simplified_cid0";    break;
-   Updated the encoding in lang\installed_languages.inc with UTF8
        $installed_languages = array (
        0 =>
        array (
        'code' => 'C',
        'name' => 'English',
        'encoding' => 'utf-8',
-   Changed the character set to UTF8.

With this, the system with English Interface allows of Chinese Characters input and print.  We did not encounter any problem when printing PO, SO, Delivery Note with the Chinese Items, Customer names, addresses...etc.  However, we have a problem with Invoice when the home and invoice currencies are different and I will get an error "TCPDF error: Unsupported font type:" when printing the Invoice.   When I change the currency to match with the invoice currency, then it has no problem of printing.

Would someone advise how to solve the problem. 

Thank you.

/Mark

Re: CHINESE LANGUAGE ISSUE - ONLY HAPPEN ON INVOICE

Since the home currency alone works, check if you make the second currency the home currency and see if that works. We can then isolate the issue of the second currency alone being different in the font set used.

Re: CHINESE LANGUAGE ISSUE - ONLY HAPPEN ON INVOICE

Hi APMuthu,

Thanks.  I have found the problem.   A font type was added in rep107.php some time back and it caused the issue with the Chinese fonts.  I have removed this line and the Invoice with non-home currency can be printed now.  Sorry for causing the alarm....

By the way, may I know how do I increase the font size or make the font italic in rep107.php?  Will this rep->Font(+2) work?  Or what should the correct line to add?

Thanks.

/Mark

Re: CHINESE LANGUAGE ISSUE - ONLY HAPPEN ON INVOICE

Kindly state the offending line you removed.

Increasing font size is done with:

$rep->fontSize += 2;

Re: CHINESE LANGUAGE ISSUE - ONLY HAPPEN ON INVOICE

I wanted to increase the font size and I entered

$rep->Font(+2)

And once I removed this, the invoice printed properly.