Solution to Chinese garbled characters in JFreeChart and Chinese character verification codes in Linux

Source: Internet
Author: User
Cause: first, the garbled problem between JFreeChart and the Chinese verification code is irrelevant to the jsp code, because the Java virtual machine cannot find the font file, therefore, similar Chinese garbled characters of Swing or AWT are also applicable to the environment: first, the garbled problem between JFreeChart and the Chinese verification code is irrelevant to the jsp code ,... cause: first, the garbled problem between JFreeChart and the Chinese verification code is irrelevant to the jsp code. it is caused by the failure to find the font file on the Java VM. Therefore, the Chinese garbled problem of Swing or AWT of the same type is also applicable.

Environment: first, the garbled problem between JFreeChart and the Chinese verification code has nothing to do with the jsp code, because the Java virtual machine cannot find the font file, so the same type of Swing or AWT Chinese garbled problem is also applicable

Environment:
JDK (the JDK version is very important. if it is 1.4.2, the font configuration file under the JRE directory is not the same)
RedHat4.0
Tomcat5.0

Solution:
1. confirm that zysong. ttf exists in the % JavaHome %/jre/lib/fonts directory.
2. run the "ttmkfdir-o fonts. dir" command in the % JavaHome %/jre/lib/fonts directory to regenerate the fonts. dir file.
3. confirm that the/usr/share/fonts/zh_CN/TrueType directory exists. if not, mkdir is created.
4. confirm that zysong. ttf exists in the/usr/share/fonts/zh_CN/TrueType directory.
5. in the % JavaHome %/jre/lib Directory, run cp fontconfig. RedHat.3.properties. src fontconfig. properties
6. restart tomcat!

Download fonts are provided below

Zysong.rar (4.3 MB): http://up.2cto.com/2012/0210/20120210075453573.rar
Description: Chinese font.
Related Article

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.