Install font library in linux

Source: Internet
Author: User
Tags vector font
Install the font library in linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Because I forgot to support Chinese characters when installing linux (redhat enterprise linux 5.0), it is garbled to access the Chinese website from Mozzila after installation, in the "View" menu, even if you select GBK encoding or other Chinese character sets, it is invalid. In addition, Chinese characters in shell are garbled.

I am tired of reinstalling the machine. I don't want to do that. So I chose to perform Chinese-based conversion, and I found some information on the Internet for a long time. (now I can display Chinese characters, but there are still some garbled characters. I will try my best to solve the problem if I have time. Here I will share it first! -Smile !) In addition, you can do this experiment on a real server. If something goes wrong, don't contact me!

Step 1:

Modify the/etc/sysconfig/i18n file. Change en: US. UTF8 to zh_CN.GB18030. The modified content is as follows:

LANG = "zh_CN.GB18030"

LANGUAGE = "zh_CN.GB18030: zh_CN.GB2312: zh_CN"

SUPPORTED = "zh_CN.GB18030: zh_CN: zh"

SYSFONT = "lat0-sun16"

SYSFONTACM = "8859-15"

Step 2:

Install the Chinese Character Library. Font files are generally independent from the system, so I chose to install the font files in windows to linux. You can find them online, the font file in windows is located in C: \ WINDOWS \ Fonts, and three files (simsun. ttc, tahoma. ttf, tahomabd. ttf ).

First, create folders one by one until/usr/share/fonts/default/TrueType is owned. Then, try to copy these three font files to the linux partition/usr/share/fonts/default/TrueType.

Next, we need to configure the video card file/etc/X11/XF86Config -- the system I installed does not have this file. You can get one from other places. I copied it from redhat linux 9.0! X supports TrueType fonts (A Scalable Vector font that can be read by the font rendering engine. There are many font rendering engines, now we want to configure to use the xtt font rendering engine to read the information of the above three font files (such as size, resolution, encoding ). Modify Section "Module", add Load "xtt" to use the xtt engine, and comment out the conflicting # Load "freetype" and # Load "type1 ".

In addition, add the FontPath "/usr/share/fonts/default/TrueType" statement in Section "Files" to let the xtt engine go to this directory to find the font file. The modified files are as follows:

Section "Files"

# RgbPath is the location of the RGB database. Note, this is the name of

# File minus the extension (like ". txt" or ". db"). There is normally

# No need to change the default.

# Multiple FontPath entries are allowed (they are concatenated together)

# By default, Red Hat 6.0 and later now use a font server independent

# The X server to render fonts.

RgbPath "/usr/X11R6/lib/X11/rgb"

FontPath "unix/: 7100"

FontPath "/usr/share/fonts/default/TrueType"

EndSection

Section "Module"

Load "dbe"

Load "extmod"

Load "fbdevhw"

Load "glx"

Load "record"

# Load "freetype"

# Load "type1"

Load "dri"

Load "xtt"

EndSection

Finally, create the configuration file fonts. dir and fonts. scale. The method is very simple. Run the command ttmkfdir> fonts. dir in/usr/share/fonts/default/TrueType to generate a file with content fonts. scale and an empty fonts. dir. Then add a row to fonts. scale (don't forget to modify the number in the first row ):

Ds = y: Artificial Intelligence = 0.3: SimSun. ttf? Misc-SimSun-bold-I-normal? -0-0-0-0-p-0-gbk-0

Copy fonts. scale to fonts. dir. (Run the command cp fonts. scale fonts. dir)

Finally, set/usr/x11R6/lib/X11/fonts/encodings/encoding. dir (this file is also from the other cp) to/usr/share/fonts/default/TrueType.

Restart the machine. OK.
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.