Home > Centos 4/5 GNU/Linux, Public > Display Microsoft fonts like in Windows in CentOS/Fedora

Display Microsoft fonts like in Windows in CentOS/Fedora

Staying in front of your computer for hours and hours with the default fonts can be a challenge on Linux/Unix. I, for one, can’t work properly without the Windows fonts comfort :)

Having the windows fonts working on Unix systems is fairly easy, but on Red Hat-based operating systems such as CentOS or Fedora, can be a real nightmare. The most critical aspect of having the Microsoft fonts to display properly on CentOS in compiling freetype with bytecode interpreter enabled. Let’s go through this procedure.

This tutorial assumes you have the 3 most popular community repositories enabled (Karanbir Singh, Dag Wieers and Dries).

1. Create the system source tree:

$ su
# mkdir -p /usr/src/redhat/SPECS

2. Download the latest version of the Freetype source code from a CentOS repository – For instance: freetype-2.*.el5.src.rpm – To your desktop (has to have a .src.rpm extension) and install the source:

# rpm -Uvh ./Desktop/freetype-2.1.9-1.0.rf.src.rpm

3. Open the spec (make) file in a text editor:

# gedit /usr/src/redhat/SPECS/freetype.spec

And enable the bytecode interpreter changing this line:

%define without_bytecode_interpreter    1

To:

%define without_bytecode_interpreter    0

(And not the opposite!)
Save.

4. Install some essential compilation tools and a few upgrades:

# yum install gcc-c++ rpm-build xorg-x11-deprecated-libs-devel xorg-x11-devel automake autoconf libtool zlib-devel libX11-devel

5. Build Freetype:

# cd /usr/src/redhat/SPECS
# rpmbuild -ba freetype.spec

6. Now you should have your RPMs:

# cd /usr/src/redhat/RPMS/i386 && ls
freetype-2.1.9-1.2.rf.i386.rpm        freetype-devel-2.1.9-1.2.rf.i386.rpm
freetype-demos-2.1.9-1.2.rf.i386.rpm  freetype-utils-2.1.9-1.2.rf.i386.rpm
#

7. Install the new version of Freetype:

# rpm -Uvh --force *

8. Download the Microsoft fonts and extract them:

# mkdir /usr/share/fonts/TTF
# tar xvjpf msfonts.tbz -C /usr/share/fonts/TTF/

Download the fontconfig files and extract them into your fontconfig directory:

# tar xvjpf fontconfig.tbz -C /etc/fonts/

9. Make sure the fonts directory is listed in the fontconfig configuration file:

# gedit /etc/fonts/fonts.conf

ie:

<dir>/usr/share/fonts/TTF</dir>

Save.

10. Log out from Gnome/KDE and relog in. Here’s how your fonts should look like:

Open site http://www.utusan.com.my

:)

  1. January 15, 2008 at 4:51 pm | #1

    Pi install msttcorefonts tu. Kalau nak senang, cari yg RPM-ready.

  2. January 15, 2008 at 11:55 pm | #2

    Fedora / Centos
    Here we will need a little more job

    1. Install the software needed

    sudo yum install rpm-build cabextract

    2. Download the specs to build the RPM

    wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec

    3. Build the RPM

    rpmbuild -ba msttcorefonts-2.0-1.spec

    4. Install the RPM

    rpm -ivh /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

  3. February 8, 2008 at 10:49 pm | #3

    Excellent – many thanks !!

  4. February 27, 2009 at 6:58 am | #4

    Nice stuff. Btw, avoid msfonts-rules.conf from font config files. Font looks much better without it.

  5. May 21, 2009 at 2:36 pm | #5

    Hi all,

    I have a small problem. How can I restore the linux font after installing microsoft font????

    Thanks in advance.

  6. pkc
    March 18, 2011 at 1:32 am | #6

    Still works for CentOS 5.5. I have stumble across this blog posting a few times over the last couple years after lots of Googling. Thanks!

  7. jamal
    October 20, 2011 at 1:04 pm | #7

    Merci infiniment

    Jamal from maroc ;)

  1. December 24, 2008 at 2:47 pm | #1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.