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