Ubuntu install fonts

Command installation:

 

        Take Microsoft Yahei font as an example (other dot matrix fonts such as Song Ti and Hei Ti are the same), our Yahei font file is: Yahei.ttf (placed in your home directory) (under the Fonts directory of the widows directory) Find the font you need)
Since I have a dual system, I directly copied msyh.ttf and msyhbd.ttf from Win7 to Ubuntu


1 Create a new folder under /usr/share/fonts/, such as the winFonts directory, and prepare to put all the fonts copied from windows in this directory, here is to put the Yahei font Yahei.ttf in
sudo mkdir -p / usr/share/fonts/winFonts


2 Then copy the font file to this folder
sudo cp /home/username (user name)/fonts/Yahei.ttf /usr/share/fonts/winFonts/


3 Then, change the permissions:
sudo chmod 644 /usr/share/fonts/winFonts/Yahei.ttf 

(It is okay to change to 755, but at least 444. The permission to modify the Yahei font file is 644, that is, the current user reads and writes, the current group user reads only, and other users read only)


4 Start the installation:
cd /usr/share/fonts/winFonts/
sudo mkfontscale (create the fonts.scale file of Yahei font, it is used to control the font rotation and scaling)
sudo mkfontdir (create the fonts.dir file of Yahei font, it uses To control the generation of bold and italic fonts)
sudo fc-cache -fv (create font cache information, that is, let the system recognize Yahei)


5. sudo gedit /etc/fonts/language-selector.conf (optional)
(open the language selection setting file)
respectively find
Bitstream Vera Serif
Bitstream Vera Sans
Bitstream Vera Sans Mono
and add
Microsoft YaHei respectively


6. In the menu System-Preferences-Font can find "Microsoft Yahei"

 

Fonts can also be installed in batches. Create a Fonts folder in the main directory. (All fonts are placed in it)
sudo mkdir -p /usr/share/fonts/winFonts
sudo cp /home/zengq/Fonts/* /usr/share/fonts/winFonts/
Then, change the permissions:
Code:
sudo chmod 644 /usr /share/fonts/winFonts/*
Start the installation:
cd /usr/share/fonts/winFonts/
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv

 

Fontmtraix install fonts:

 

Fontmatrix software download address:

http://dl.getdropbox.com/u/378247/Software/Ubuntu/fontmatrix_0.4.2-2_i386.deb

Or install through Leadsine, ubuntu software center

 

Open Fontmatrix, the software is in English, we need to use two operations

1: File => Import => select the folder where the font is located => select the font to be installed => OK

2:Edit => Active All current => OK

 

Delete font

 

Delete the font, directly delete the winFonts folder, and then sudo fc-cache -fv

Guess you like

Origin blog.csdn.net/hn_tzy/article/details/88850161