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