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.