When JRE is installed in windows, Chinese characters are displayed without configuration, but not in Linux. Many characters are often displayed as small squares. The following method can be used to solve this problem, so that the JRE in Linux can display Chinese well.
First, assume that your JRE installation directory is $ jre_dir.
1. Install the simsun. TTF font (which can be copied from Windows XP)
Copy the simsun. TTF font to the $ jre_dir/lib/fonts directory.
2. Modify the font. dir File
Modify the $ jre_dir/lib/fonts/font. dir text file and Add 1 to the number in the first line. For example, change 130 to 131, and then add a line below:
Simsun. TTF-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
3. Delete unnecessary font configuration files
Delete all files starting with fontconfig in the $ jre_dir/lib directory.
CD $ jre_dir/lib
Rm-RF fontconfig *
4. Create your own font configuration file
Create a text file named fontconfig. properties under the $ jre_dir/lib directory and modify its content:
# @ (#) Fontconfig. properties 1.0 06/05/28
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
#
# Version
Version = 1
# Component font Mappings
Serif. Plain. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Serif. Bold. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Serif. italic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Serif. bolditalic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Sansserif. Bold. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Sansserif. italic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Sansserif. bolditalic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Monospaced. Plain. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Monospaced. Bold. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Monospaced. italic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Monospaced. bolditalic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialog. Plain. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialog. Bold. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialog. italic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialog. bolditalic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialoginput. Plain. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialoginput. Bold. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialoginput. italic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
Dialoginput. bolditalic. zh-1 =-sungtil GB-Medium-r-normal -- 0-0-0-0-c-0-gb2312.1988-0
# Search Sequences
Sequence. allfonts = zh-1
# Exclusion ranges
# Font file names
In this way, all configurations are completed.
5. Run the controlpanel Test
CD $ jre_dir/bin
./Controlpanel