[ Prev ] [ Index ] [ Next ]

The Linux Font System

Linux fonts look a bit blurry with a vanilla Fedora Core install. This is because there are certain patent issues that force the freetype 1 and freetype 2 font engine to disable certain components. The most significant of this is the Bytecode Interpreted and the Sub-Pixel Rendering features. Enabling this and installing the ms core fonts and bitstream vera fonts (now replaced by DejaVu) make a big difference. The most significant gains in the font rendering can be achived by changing Free Type to byte code interpreted (see #1), installing the bitstream-vera (or Deja-Vu) font and installing the MS Core Fonts

1. Enable Bytecode Interpreted

The freetype2 font engine that is installed with fedora core has the byte code interpreted and the sub-pixel rendering features disabled due to patent and licensing issues. Enabling both the bytecode interpreted feature and the subpixel rendering of the freetype font engine delivers significant rendering improvements and is quite easily done with the following steps:

2. Doco on freetype and fonts in Fedora Core

The doumentation for the Freetype Font Engine is availble from mjmwired.net, see the following urls:

3. Installing the Microsoft TrueType fonts (msttcorefonts)

image Todo: This section basically a list, redo to make it more readable and separate out commands image Tip: The lastest version of spec file (version 2.0, release 1) is available as msttcorefonts-2.0-1.spec

The msttcorefonts package provide fonts like Tahoma, Verdana, Arial and so on. The msttcorefonts spec, available from corefonts.sourceforge.net, will download the relevant font files (using wget(1)) and install them to the local font directories.

Rebuilding the msttcorefonts requires that wget, rpmbuild and cabextract are installed. The cabextract utility is maintained at cabextract.org.uk. Download the rpm version here or downoload the cabextract tarball. In addition, the chkfontpath utility must be available, and this needs xorg-x11-xfs.i386 xorg-x11-xfs-utils.i386, (the latter two can be installed via yum)

The process of installing the fonts is essentially that of running rpmbuild on the spec file. However, certain changes may be required, depending on how utilities like cabextract and chkfontpath have been installed. For example, if cabextract has been installed from a tarball (and not the rpm), then the spec file must be edited to remove the BuildPrereq: cabextract. The other default settings for downloading the font files will actually work for the rebuild, however it maybe sensible to change the source url for the location of the core fonts to point to a server that is close by.

3.A Steps for installing the msttcorefonts

image Warning: If installing from behind a firewall, be sure to configure http_proxy for wget (see proxy)

First of all, make sure relevant programs and libraries are are installed (xorg-x11-xfs and chkfontpath):

bash # yum install xorg-x11-xfs.i386 xorg-x11-xfs-utils.i386 rpm-build.i386
bash # wget http://linuxsoft.cern.ch/cern/slc5X/i386/yum/os/chkfontpath-1.10.1-1.1.i386.rpm
bash # rpm -Uvh chkfontpath-1.10.1-1.1.i386.rpm
bash # wget http://www.cabextract.org.uk/cabextract-1.2.tar.gz
bash # tar zxvf cabextract-1.2.tar.gz
bash # cd cabextract-1.2
bash # ./configure
bash # make
bash # make install

RPM source specs belong in the SPECS directory, so copy or wget(1) the msttcorefonts.spec file to this location:

bash # cd /usr/src/redhat/SPECS
bash # wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec

Next, remove (or comment out) any BuildPrereq entries as relevant (e.g., the BuildPrereq:cabextract if cabextract has been installed from tarball) and execute rpmbuild:

bash # rpmbuild -bb msttcorefonts-2.0-1.spec

The rpmbuild will create a noarch rpm in the RPMS, which should be installed:

bash # cd /usr/src/redhat/RPMS/noarch
bash # rpm -Uvh msttcorefonts-2.0-1.noarch.rpm

4. Bitstream-vera Fonts (DejaVu)

The Bitstream-vera typeface are an excellent opensource TrueType font implementation. The vera typeface (designed by J. Lyles of Bitstream) are based on the Prima font set from Bitstream (source wikipedia). The Vera typeface is implemented with full instruction hinting, which is important as fonts with instruction hinting drasticly improve the rendering quality of the font.

The Vera typeface covers only common punctuation and the Latin alphabet with some diacritics (source Wikipedia). However, the liberal nature of the bitstream-vera typeface allows other typefaces to be built on top of vera. This is precisely what's happening with the DejaVu Fonts project, which is a derivative of the vera typeface. The DejaVu fonts expand on vera with additional glyphs (font symbols) and DejaVu fonts are the preferred fonts delivered with gnome and kde. Fonts included in the vera typeface are serif, sans-serif and monospace.

Ensure that the bitstream-vera and msttcorefonts (see #3 above) are installed. This will ensure a high quality font rendering in applications such as web browsers especially if the bytecode interpreted and subpixel rendering options of the freetype font rendering subsystem are enabled.

Here is a list of the Fonts based on the Vera set of typefaces (i.e., fonts with a similar licensing or fonts that are based on the vera typeface and therefore have the same licensing) are:

Be sue to restart the font system after installing new fonts. This can be done with the init.d script for xfs(1):

bash # /etc/init.d/xfs restart

Stuart Moorfoot © 22 Aug 2006 foo@bund.com.au


Backlinks: :rpm