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 ):
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:
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