Set fedora8 and Firefox Font

Source: Internet
Author: User
Tags cairo rpmbuild
0. Install fedora8

During installation, You must select the Simplified Chinese installation interface, so that the Chinese-related software (such as the input method) and Chinese language packs are installed by default. Otherwise, it will be complicated to manually install these items after installation.

In addition, if you want to compile these software packages in person, you should select "Software Development" when selecting the software package during system installation, otherwise, you cannot compile the RPM package in the following steps. However, this article provides the compiled RPM package, so you do not want to compile your own friends can not install the development package.

After the installation is complete, I usually disable SELinux when I configure the system after the first boot. This is because it is unnecessary for general personal desktop systems, more importantly, it will cause trouble for the running of some software manually installed in the future (for example, some dynamic libraries (such as flash plug-ins) that are not installed with RPM packages, you must use the complex chcon command to change the security attributes before loading ).

The following describes how to use Yum to install all official upgrade packages. We recommend that you modify the/etc/yum. conf file (Red Line) before the upgrade ):

[Main]
Cachedir =/home/Joe/fc8/yum
Keepcache = 1
Debuglevel = 2
......

In this way, yum will not delete the downloaded RPM package, but keep it in the directory of another partition specified by cachedir. When you reinstall fedora next time, you don't have to download these files again.

After the installation and upgrade, we will begin to modify some software packages in Chinese. All the following operations must be performed with the root user login.
1. FreeType: Activate bytecode interpreter and subpixel rendering

Download the latest FreeType source package, such as freetype-2.3.5-3.fc8.src.rpm, from fedora's official FTP or HTTP server. Re-compile and install the RPM package (note that the options for activating bytecode interpreter and subpixel rendering must be added during compilation ):

# Rpmbuild -- rebuild -- with bytecode_interpreter -- with subpixel_rendering/

-- Define = 'dist. zfc8' freetype-2.3.5-3.fc8.src.rpm

# Cd/usr/src/RedHat/RPMS/i386

# Rpm-fvl FreeType *. rpm

Local download:

Freetype-2.3.5-3.zfc8.i386.rpm

Freetype-devel-2.3.5-3.zfc8.i386.rpm

Freetype-demos-2.3.5-3.zfc8.i386.rpm

2. Cairo: optimization of the embolden Algorithm for Dot Matrix Fonts

Download the latest Cairo source code package, such as cairo-1.4.14-1.fc8.src.rpm, from fedora's official FTP or HTTP server. Download the patch provided by sunmoon1997, which optimizes the dot matrix font "pseudo-bold" algorithm under certain conditions. Modify Cairo. spec to include this patch. Then re-compile and install the RPM package:

# Cd/usr/src/RedHat/specs

# Rpmbuild-ba -- Define = 'dist. zfc8 'Cairo. spec

# CD ../RPMS/i386

# Rpm-fvl Cairo *. rpm

Download locally (from source code: rpmbuild -- rebuild -- Define = 'dist. zfc8' cairo-1.4.14-1.zfc8.src.rpm ):

Cairo-1.4.14-1.zfc8.i386.rpm

Cairo-devel-1.4.14-1.zfc8.i386.rpm

3. libxft: optimization of the embolden Algorithm for Dot Matrix Fonts

Download the latest libxft source package, such as libXft-2.1.12-3.fc8.src.rpm, from fedora's official FTP or HTTP server. Download the patch provided by sunmoon1997, which optimizes the dot matrix font "pseudo-bold" algorithm under certain conditions. Modify libxft. spec to include this patch. Then re-compile and install the RPM package:

# Cd/usr/src/RedHat/specs

# Rpmbuild-ba -- Define = 'dist. zfc8' libxft. spec

# CD ../RPMS/i386

# Rpm-fvl libxft *. rpm

Download locally (from source code: rpmbuild -- rebuild -- Define = 'dist. zfc8' libXft-2.1.12-3.zfc8.src.rpm ):

LibXft-2.1.12-3.zfc8.i386.rpm

LibXft-devel-2.1.12-3.zfc8.i386.rpm

4. Install Chinese Fonts

Copy all TrueType fonts (with the extension. TTF ,. TTC ,. TTF files) to a directory under your fedora (for example,/home/Joe/fonts.
5. Add a font configuration file

Copy the font profile f8-local.conf to/etc/fonts/local. CONF file. Note that you should change the line (red line) of the Windows TrueType font directory to the directory you used in the previous step:

<Dir>/home/Joe/fonts </dir>

Then run the following command:

# FC-Cache/home/Joe/Fonts

6. Modify the Chinese font underline position of Firefox

In Firefox's support for Chinese fonts, there has always been a problem that Chinese characters are too close to Chinese characters. Fortunately, someone wrote a patch for Firefox to solve this problem when Firefox uses the pango engine. Fortunately, fedora uses the pango engine by default. Interested friends can download this patch: mozilla-1.5-pango-underline.patch.bz2, recompile Firefox in fedora. However, it is a long process to compile Firefox. If you have no patience, you can download the compiled module libgfx_gtk.so and copy it to the corresponding Firefox directory of the system, replace the original module:

# Cp libgfx_gtk.so/usr/lib/firefox-2.0.0.8/components/

# Chcon system_u: object_r: lib_t/usr/lib/firefox-2.0.0.8/components/libgfx_gtk.so

The above 2nd commands are for users who use SELinux; for users who have been automatically upgraded, the Firefox directory is firefox-2.0.0.9 /.
7. log out, log on again, and set the gnome font

Run the system-preference-perception-font program and select "secondary pixel smoothing (LCD )".

OK! Now your fedora has a beautiful Chinese font!

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.