Question about jfreeChart in Linux

Source: Internet
Author: User
For details about jfreeChart in Linux, refer to general Linux technology-Linux technology and application information. Although the program yesterday solved the Chinese problem, the text in the charts generated by jfreeChart is still displayed as blocks, so I searched the internet again. There are many documents to discuss this problem, the solution is different, but most of them are different from my version. My system environment is Linux RedHat 9.0, tomcat5.5, and jdk1.5. Finally, the solution was found.

In jdk1.5, the order of loading the font configuration file is

(JavaHome refers to the root directory of JRE, the same below ):

JavaHome/lib/fontconfig. OS. Version. properties
JavaHome/lib/fontconfig. OS. Version. bfc
JavaHome/lib/fontconfig. OS. properties
JavaHome/lib/fontconfig. OS. bfc
JavaHome/lib/fontconfig. Version. properties
JavaHome/lib/fontconfig. Version. bfc
JavaHome/lib/fontconfig. properties
JavaHome/lib/fontconfig. bfc

1. First find the correct configuration file and find

Filename.-misc-zysong18030-medium-r-normal -- *-% d-*-c-*-iso10646-1 = ........

Make sure that the font file name and path are correct, for example:

Filename.-misc-zysong18030-medium-r-normal -- *-% d-*-c-*-iso10646-1 =/usr/share/fonts/zh_CN/TrueType/simsun. ttc

2. Rename the fontconfig file to fontconfig. RedHat. properties. Move all unnecessary files starting with fontconfig under $ JAVA_HOME/jre/lib to the newly created bak directory.

3. If there is no font, you can set the font file simsun. ttc (copy one copy from windows to linux, or use other fonts) copy to/usr/share/fonts/zh_CN/TrueType/(this path is the path specified in the configuration file above ).

4. edit the file fonts. dir in the JavaHome/jre/lib/fonts directory, add 1 to the number in the first line, and add the following to the last line:

Simsun. ttf-SungtiL GB-medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0

Save the file.

5. Restart the operating system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.