Installing Microsoft TrueType fonts on RHEL5, Step by Step

I'm doing some experimentation with JpGraph on Red Hat Enterprise Linux 5.5. So I wanted to install some TrueType fonts. Here's a step-by-step of how I did it, following the superb instructions given here.

Installed the rpm-build utility.

# yum install rpm-build

Then installed the cabextract utility, available on EPEL.

# yum install cabextract

Downloaded the latest spec file for msttcorefonts:

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

Created a ~/.rpmmacros file containing one line:

%_topdir %(echo $HOME)/rpmbuild

Then I followed the instructions to create necessary directories:

$ mkdir -p ~/rpmbuild/BUILD
$ mkdir -p ~/rpmbuild/RPMS/noarch

Built the rpm:

$ rpmbuild -bb msttcorefonts-2.0-1.spec

For me, it stopped once during the build with a 500 error from Sourceforge:

Resolving hivelocity.dl.sourceforge.net... 74.50.111.26
Connecting to hivelocity.dl.sourceforge.net|74.50.111.26|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2010-04-12 13:26:10 ERROR 500: Internal Server Error.

error: Bad exit status from /var/tmp/rpm-tmp.51326 (%prep)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.51326 (%prep)

I simply ran the previous command again and it worked.

Installed the rpm as root:

# rpm -ivh /home/john/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

I now see that the fonts are in /usr/share/

# find /usr -name *ttf -print

...
/usr/share/fonts/msttcorefonts/georgiaz.ttf
/usr/share/fonts/msttcorefonts/comic.ttf
/usr/share/fonts/msttcorefonts/times.ttf
/usr/share/fonts/msttcorefonts/timesbi.ttf
/usr/share/fonts/msttcorefonts/impact.ttf
/usr/share/fonts/msttcorefonts/verdanaz.ttf
/usr/share/fonts/msttcorefonts/georgiab.ttf
/usr/share/fonts/msttcorefonts/arialbi.ttf
/usr/share/fonts/msttcorefonts/arialbd.ttf
/usr/share/fonts/msttcorefonts/ariblk.ttf
/usr/share/fonts/msttcorefonts/trebucbd.ttf
/usr/share/fonts/msttcorefonts/couri.ttf
/usr/share/fonts/msttcorefonts/trebuc.ttf
/usr/share/fonts/msttcorefonts/timesi.ttf
/usr/share/fonts/msttcorefonts/verdanab.ttf
/usr/share/fonts/msttcorefonts/timesbd.ttf
/usr/share/fonts/msttcorefonts/courbd.ttf
/usr/share/fonts/msttcorefonts/arial.ttf
/usr/share/fonts/msttcorefonts/georgiai.ttf
/usr/share/fonts/msttcorefonts/ariali.ttf
/usr/share/fonts/msttcorefonts/courbi.ttf
/usr/share/fonts/msttcorefonts/comicbd.ttf
/usr/share/fonts/msttcorefonts/webdings.ttf
/usr/share/fonts/msttcorefonts/trebucbi.ttf
/usr/share/fonts/msttcorefonts/georgia.ttf
/usr/share/fonts/msttcorefonts/trebucit.ttf
/usr/share/fonts/msttcorefonts/cour.ttf
/usr/share/fonts/msttcorefonts/tahoma.ttf
/usr/share/fonts/msttcorefonts/verdanai.ttf
/usr/share/fonts/msttcorefonts/verdana.ttf
/usr/share/fonts/msttcorefonts/andalemo.ttf
...

Reference: An easy way to install Microsoft's TrueType core fonts on linux

Topic: 

Comments

There is a error in your tutorial.

where you read:

rpmbuild -bb msttcorefonts-2.0-1.noarch.rpm

should be:

rpmbuild -bb msttcorefonts-2.0-1.spec

Fixed.

Not quite,
you left noarch there: rpmbuild -bb msttcorefonts-2.0-1.noarch.spec => rpmbuild -bb msttcorefonts-2.0-1.spec

Fixed. For real.

Thank you John,
Helpful and to the point.
Note that the version has been updated to 2.5.
Script-wise, all that is required is to change the minor number to a 5.

The utility cabextract is no longer available via yum. What is another way to download it and get it installed?

For those running Ubuntu, a much simpler way to do this is simply to copy Ubuntu's /usr/share/fonts/truetype directory to your Centos server.