Install Chinese fonts for jre in Linux

Source: Internet
Author: User
Preface:

Due to the strength of Java, many software are compiled with it. However, if your JRE does not support Chinese, garbled characters will occur when you install this Java Chinese software (Chinese is not supported by default ). If this is the case, read this article to solve the problem.

 

 

Body:

First, find the font you need. For example, I copied it from the Windows system. C:/Windows/fonts has many fonts. I only copied simhei. TTF and simsun. TTC.

 

After installing Java, go to the Java installation directory $ java_home.
/JRE/lib/fonts/you can see a lot of fonts (create mkdir fonts if it does not exist)
,

In Fonts
Create a new directory named fallback (use this name. It is said that Ubuntu will find the font in this directory when it cannot find the set font ), and copy the font you need to this directory.

$ Mkdir fallback

$ Sudo CP font path/simhei. TTF fallback/


$ Sudo CP

Font path

/Simsun. TTC fallback/

 

Next, we should note that many documents do not describe this, that is, the permission of the font file must be readable.
!

I did not pay attention to it here, but I finally discovered it after several days.


$ Sudo chmod-r 644 fallback

 

Then, run the following command in the fallback directory:


$ Mkfontscale & mkfontdir


In this case, fonts. DIR is generated in the fallback directory.
And fonts. Scale
File, and then append the content of fonts. scale to the fonts. dir directory of the parent directory (if there is no such content, directly create touch ../fonts. dir
),



$ Cat fonts. scale>.../fonts. dir

 

This should be done. If not, the FC-Cache refresh the font cache.

 

Reference Directory:

This article from: http://www.linuxeden.com/html/softuse/20100113/70072.html

 

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.