In Linux, JRE does not display Chinese characters. Solution

Source: Internet
Author: User
In Linux, JRE does not display Chinese solutions-general Linux technology-Linux programming and kernel information. For details, refer to the following section. 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
Related Article

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.