In Linux, JRE does not display Chinese characters. Solution

Source: Internet
Author: User
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

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.