Objective
report found in Chinese garbled and Chinese fonts are not neat (overlapping), the first consideration is whether the operating system has a Chinese font, in CentOS 7 the prompt command is not valid in the Discovery Input command to view the font list:
650) this.width=650; "src=" http://img.blog.csdn.net/20160525144652327 "alt=" here to write a picture description "/>
as you can see, not only there is no Chinese font, not even the font library, then the next record on Linux CentOS7 How to install the font library and the Chinese font.
Installing the Font Library
in the CentOS 4.x start with Fontconfig to install the font library, enter the following command:
yum-y install Fontconfig
/usr/shared Span style= "font-size:14px;font-family: ' The song body '; color: #555555;" You can see the fonts Span style= "font-size:14px;font-family: ' The song body '; color: #555555;" > and fontconfig Span style= "font-size:14px;font-family: ' The song body '; color: #555555;" > directory (not previously):
650) this.width=650 ; "Src=" http://img.blog.csdn.net/20160525145746674 "alt=" here to write the picture description "/>
Next, you can add Chinese fonts to our font library.
Add Chinese font
in theCentOS, the location of the font library is exactly what you see in theFontsdirectory, so the first thing we have to do is to find the Chinese font file placed in the directory, and the Chinese font file in ourWindowsyou can find it in the system, openCunder the platewindows/fontsDirectory: 650) this.width=650; "src=" http://img.blog.csdn.net/20160525150849773 "alt=" here to write a picture description "/>
server, here I choose Arial and boldface (both fonts are used in the report), You can see that there are two suffixes named ttf and TTC file:
650) this.width=650; "src=" http://img.blog.csdn.net/20160525151022286 "alt=" Write a picture description "/>
We need to create a new /usr/shared/fonts Create a new directory under directory chinese :
650) this.width=650; "src=" http://img.blog.csdn.net/20160525151335431 "alt=" Write a picture description "/>
then you upload the above two fonts to /usr/shared/fonts/chinese directory, you can:
650) this.width=650; "src=" http://img.blog.csdn.net/20160525151824061 "alt=" here to write a picture description "/>
immediately following the changes needed Chinese permissions for the directory:
chmod - R 755 /usr/share/fonts/chinese
Next you need to install Ttmkfdir to search all the font information in the directory and summarize the generated Fonts.scale file, enter the command:
yum-y Install Ttmkfdir
when you see the prompt, it indicates that the installation was successful:
650) this.width=650; "src=" http://img.blog.csdn.net/20160525161847562 "alt=" here to write a picture description "/>
and then execute Ttmkfdir command can:
Ttmkfdir - e /usr/share/x11/fonts/encodings/encodings.dir
The last step is to modify the font configuration file, first open the configuration file through the editor:
vi/etc/fonts/fonts . conf
can see a Font List , that is, the font list, where we need to add the Chinese font location added in:
650) this.width=650; "src=" http://img.blog.csdn.net/20160525162529288 "alt=" here to write a picture description "/>
and then enter : Wq Save the exit, and finally don't forget to flush the in-memory font cache, so you don't have to reboot Restarted :
FC -cache
so all the steps were done, and finally passed fc-list look at the font list:
650) this.width=650; "src=" http://img.blog.csdn.net/20160525164056044 "alt=" here to write a picture description "/>
You can see that the Chinese fonts have been successfully installed, so that the installation process is complete, and again to see the report can be found in Chinese style and content can be displayed properly.
This article is from the "Stop fighting = Stop Life" blog, make sure to keep this source http://53cto.blog.51cto.com/9899631/1789849
CentOS 7 Install Font Library & Chinese fonts