Solve the problem that jfreechart and some Java programs cannot correctly display Chinese characters on Linux.

Source: Internet
Author: User
I have seen many questions on the Internet about the failure to correctly display Chinese characters in the Java program on Linux. Recently, I made a BS application. After Tomcat is deployed to Linux, the charts made with jfreechart cannot correctly display Chinese characters.
After my exploration and research, we can solve this problem smoothly through the following steps.

1. Copy XFree86-libs-4.2.1-13.73.3.i386.rpm, ttfm-1.0-6.i386.rpm to Linux,
Use the rpm-I file name to install these two RPM packages.
2. Copy gbsn00lp. TTF to % JDK directory %/JRE/lib/fonts.
3. Modify the fonts. dir file under % JDK directory %/JRE/lib/fonts/. Add 1 to the first line and add the following to the last line:
Gbsn00lp. TTF-arphic Technology Co.-ar PL sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-iso10646-1
4. Modify the font. properties file under the %/JRE/lib/directory where JDK is located (if the system is a Chinese environment, it is font. properties_zh ).
Replace all the fonts with-arphic Technology Co.-ar PL sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-iso1064-1,
Add the following at the end of the file:
Filename. song_medium_r = gbsn00lp. TTF
Filename. song_medium_ I = gbsn00lp. TTF
Filename. song_bold_r = gbsn00lp. TTF
Filename. song_bold_ I = gbsn00lp. TTF
Filename. fangsong_medium_r = gbsn00lp. TTF
Filename. fangsong_medium_ I = gbsn00lp. TTF
Filename. fangsong_bold_r = gbsn00lp. TTF
Filename. fangsong_bold_ I = gbsn00lp. TTF
Filename. kai_medium_r = gbsn00lp. TTF
Appendedfontpath = % JDK directory %/JRE/lib/Fonts

Forum discussion: http://www.matrix.org.cn/forum.asp
More technical articles: http://www.matrix.org.cn/article.asp
Matrix Java Portal: http://www.matrix.org.cn

Address: http://www.matrix.org.cn/article/1068.html

Ezerg Programming Language

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.