Solving the problem of Chinese garbled characters and Chinese fonts missing in Linux

Source: Internet
Author: User



-----------------------------Exception Info----------------------
----Net.sf.jasperreports.engine.util.JRFontNotFoundException:Font ' Yue à 綋 ' is not available to the JVM. See the Javadoc for more details.

-----------font xx not found in Linux environment


There are two types of---solution, the first one is not limited by the deployment environment, the second is constrained by the deployment environment, the Linux environment that is not deployed to a place needs to be set up, does not conform to loosely coupled software design principles,
It is recommended that the first type of


The first way to add a font jar

Specific steps: Import the desired font file in ireport, then import it into a jar package, add it to the project's Classpath directory, and build path to add it in.


The second way is to add the required fonts to the Linux service because the default Windows is GB encoded (GB18050 or GB2312) and Linux defaults to Unicode-encoded

Copy the Chinese font of Windows (typically in the C:\Windows\Fonts directory) to the Linux/usr/share/fonts/chinese/truetype directory

-----Example: The following is an example of a imitation font
Installation steps:
1, Simfang.ttf Copy to/usr/share/fonts below
2. Execute the following commands sequentially
Mkfontscale
Mkfontdir
Fc-cache

Simfang.ttf This is a font file, in C:\WINDOWS\Fonts this directory has




Linux under the JDK Chinese garbled
Reference Blog Address: http://blog.csdn.net/a19881029/article/details/9031743


This article from "There is nothing, know in Providence" blog, please be sure to keep this source http://yangsj.blog.51cto.com/8702844/1697065

Solving the problem of Chinese garbled characters and Chinese fonts missing in Linux

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.