Several methods for installing Chinese fonts in CentOS system

Source: Internet
Author: User
Tags centos

The day before yesterday there was a user response, the generated report form his name is missing a word. A careful examination of the original CentOS system is the default font does not have the word in his name, so it is directly ignored.

In fact, the word is not uncommon, so have to install Chinese fonts, the installation process is very simple, record.
The idea is to copy the fonts in Windows to CentOS, and then execute a few commands.
The fonts in Windows XP are in the C:/windows/fonts directory, each font is a file, such as SIMSUN.TTC
The font file in CentOS is located in/usr/share/fonts/, a directory for each font, such as Wqy-zenhei
The installation process is to first create a new SimSun directory in the CentOS/usr/share/fonts/directory
Then copy the SIMSUN.TTC in Windows to the/usr/share/fonts/simsun directory

The code is as follows Copy Code

#mkdir/usr/share/fonts/simsun
# #拷贝windows中的simsun. TTC to/usr/share/fonts/simsun/

Then execute the following command

#cd/usr/share/fonts/simsun
#mkfontscale
#mkfontdir
#fc-CACHE-FV

Execute the following command to make the font effective

#source/etc/profile

In order for your application to reuse new fonts, you may need to restart your application. Modify the code if necessary

Add, if the above installation fails we can refer to the following method

1, modify the permissions of the font file, so that users other than the root can also use

The code is as follows Copy Code

# Cd/usr/share/fonts/chinese/truetype
# chmod 755 *.ttf

2, the establishment of font caching

The code is as follows Copy Code

# Mkfontscale (if you are prompted to Mkfontscale:command not found, install it yourself # Yum install Mkfontscale)
# Mkfontdir
# FC-CACHE-FV (if prompted Fc-cache:command not found, you will need to install # Yum install fontconfig)

3, restart the computer

# reboot

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.