Gentoo Chinese font beautification

Source: Internet
Author: User
Tags file permissions

Install the necessary components and fonts

#emerge Cairo Fontconfig libxft FreeType
#emerge arphicfonts wqy-bitmapfont cjkuni-fonts corefonts Ttf-bitstream-vera

Then use the local.conf provided by grass grasses (setting the local.conf to be safer than changing fonts.conf) to show the perfect Jiang Fanying


Thanks to linuxsir.org net friend grass to provide this file

File:/etc/fonts/local.conf

==========================================================================

==========================================================================

==========================================================================

========================================================================== gentoo HOWTO Add font 2008-08-22 15:00

Add manually

If you need to manually add fonts that are not available or available in the portage, you can add them manually by following these steps. Here take SIMSUN.TTC as an example. Copy Fonts

Copy the font file into a folder under/usr/share/fonts, such as/usr/share/fonts/ttf. And then modify the file permissions

code: Modifying permissions
# chmod 644/USR/SHARE/FONTS/TTF/SIMSUN.TTC
Modify/etc/x11/xorg.conf

Ensure that the/etc/x11/xorg.conf section "Files" have a corresponding path, such as:

file: /etc/x11/xorg.conf
section "Files"
...
Fontpath "/usr/share/fonts/ttf"
...
Endsection
produce fonts.dir and Fonts.scale

This step is intended to enable programs that use the X core font API to take advantage of this font. Examples of such procedures are xterm,emacs,xmms and so on.

Install X11-apps/mkfontdir and X11-apps/mkfontscale and produce fonts.dir and Fonts.scale

Code: Installing Mkfontdir and Mkfontscale
$ emerge Mkfontdir Mkfontscale
$ cd/usr/share/fonts/ttf
$ sudo mkfontdir
$ sudo mkfontscale
Update cache for Fontconfig

This step is intended to enable programs that use Fontconfig to configure fonts to use this font. The QT program and the GTK+2 program belong to this category.

Code: FC-CACHE-FV

$ sudo fc-cache-fv

Verify that the installation was successful
hint. After you've done these steps, you may need to reboot your X and continue with the following actions
installs x11-apps/xlsfonts using the program

of the X core font API, and performs xlsfonts to see if you can list the font names that you just installed. The X core font has a long name, such as:

Code: x Core font name
-misc-simsun-medium-r-normal--0-0-0-0-c-0-ascii-0 
-misc-simsun-medium-r-normal--0-0-0-0-c-0-gb18030.2000-0
-misc-simsun-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
-misc-simsun-medium-r-normal--0-0-0-0-c-0-gbk-0
-misc-simsun-medium-r-normal--0-0-0-0-c-0-ibm-cp850
- Misc-simsun-medium-r-normal--0-0-0-0-c-0-iso10646-1
-misc-simsun-medium-r-normal--0-0-0-0-c-0-iso8859-1
-misc-simsun-medium-r-normal--0-0-0-0-c-0-iso8859-15
-misc-simsun-medium-r-normal--0-0-0-0-c-0-koi8-r

If there is one, then xmms such a program can be used.

prompt. the xlsfonts command needs to be executed under X terminal, or you need to add a parameter-display displayname specify displayname
programs that use Fontconfig

Perform fc-list to see if you can list the font names that you just installed.

==========================================================================

==========================================================================

==========================================================================

==========================================================================

let Gentoo the Chinese and English fonts show a more beautiful collection NEW: Quick installation Gentoo | Old one: in Emacs, use C + + programming make Gentoo Chinese and English fonts more beautiful


Gentoo first we have to copy the SIMSUN.TTC and Tahoma.ttf Tahomab.ttf under Widnows to the Gentoo font directory, and then

# Mkfontscale
# Mkfontdir
# fc-cache-f-V

We then modify the Fontconfig configuration file/etc/fonts/fonts.conf to advance simsum in sans and serif order, for example
<!--
Serif faces
-->
<alias>
<family>bitstream Vera serif</family>
<family>Times</family>
<family>times New roman</family>
<family>nimbus Roman No9 l</family>
<family>SimSun</family>
<family>luxi serif</family>
<family>kochi mincho</family>
<family>ar PL Sungtil gb</family>
<family>ar PL mingti2l big5</family>
<family>baekmuk batang</family>
<default><family>serif</family></default>
</alias>

<!--
Sans-serif faces
-->
<alias>
<family>bitstream Vera sans</family>
<family>Helvetica</family>
<family>Arial</family>
<family>Verdana</family>
<family>nimbus Sans l</family>
<family>SimSun</family>
<family>luxi sans</family>
<family>kochi gothic</family>
<family>ar PL Kaitim gb</family>
<family>ar PL Kaitim big5</family>
<family>baekmuk dotum</family>
<default><family>sans-serif</family></default>
</alias>

(The middle part is slightly)

<alias>
<family>serif</family>
<prefer>
<family>bitstream Vera serif</family>
<family>times New roman</family>
<family>nimbus Roman No9 l</family>
<family>SimSun</family>
<family>luxi serif</family>
<family>Times</family>
<family>kochi mincho</family>
<family>ar PL Sungtil gb</family>
<family>ar PL mingti2l big5</family>
<family>baekmuk batang</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>bitstream Vera sans</family>
<family>Verdana</family>
<family>nimbus Sans l</family>
<family>SimSun</family>
<family>luxi sans</family>
<family>Arial</family>
<family>Helvetica</family>
<family>kochi gothic</family>
<family>ar PL Kaitim gb</family>
<family>ar PL Kaitim big5</family>
<family>baekmuk dotum</family>
</prefer>
</alias>


Start X, in "desktop"--> "preferences"--> "Font" in the "Application Font", "Desktop font", "Window Title font" All selected as Tahoma, so changed the order of Chinese fonts, When you encounter a font that is not recognized by an English font, you will automatically choose SimSun as the Chinese font.

At this time because did not turn off the SimSun AntiAlias, the Chinese font display is still a bit ugly, you can add the following code in/etc/fonts/fonts.conf to turn off the SimSun font of AA effect:
 <!--to close SimSun aa; 
<match target= "Font"
<test qual= "any" name= "Family"
< String>simsun</string>
</test>
<edit name= "AntiAlias" mode= "Assign"
<bool> False</bool>
</edit>
</match>

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.