ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  About Chinese fonts
Posted by clg on Feb-08-2012 10:45
I need to use chinese fonts as y-axis labels,but it didn't show correct words.
I have used iconv("big5","utf-8",$font) to change the elements of array, but it still didn't work.
How do I solve this problem?

Thanks

  Re: About Chinese fonts
Posted by Peter Kwan on Feb-08-2012 17:45
Hi clg,

If you have a big5 text string, you can convert to utf8 and pass to ChartDirector. Make sure you are using a font that contains Chinese characters. If you are using Linux/FreeBSD/Solaris, make sure the font file is in the active ChartDirector fonts subdirectory and is readable by the web server anonymous user.

An example is:

$c->addTitle(iconv("big5", "utf-8", $myBig5ChartTitleText), "mingliu.ttc", 12);

If the above still does not solve the problem, is it possible to provide a working example and the resulting chart to illustrate the problem? For example, you may modify the "Simple Bar Chart" sample code to include some Chinese characters, and then attached the modified sample code file and the resulting chart image.

If you cannot provide a working example (eg. because the problem cannot be reproduced with the "Simple Bar Chart", or only occurs using data from your database), please inform me of your code anyway (please attach the exact file, because I need to see the exact encoding), and most importantly, the resulting chart image. If you cannot post your code in this forum, please email me at pkwan@advsofteng.net.

I need those information because I need the details to further diagnose the problem. For example, exactly how the "iconv" is used? Is your original text really big5? Are your code using a Chinese font (eg. mingliu.ttc)? On Linux/FreeBSD/Solaris machines, is the font file in the ChartDirector fonts subdirectory, so that ChartDirector can access it? See the actual code, and the actual chart image can help to diagnose the problem. Even the chart image just contain "garbage characters", we will still read the garbage characters and see the exact encoding it is using.

Regards
Peter Kwan