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