Linux fonts (mostly X11)
This document is an incomplete draft.
Fonts in Linux can be used by several different applications, and
sometimes in several different ways for each application. Since
they have not been designed into some kind of framework, there is
little similarity, to the point that often different applications
use distinct copies of the very same font file, in different
It is possible to partially retrofit some sensible framework in
this mess; it is also important to know some of the various little
details, because they practically matter quite a bit.
In practice, a reasonable “vanilla” setup can be
done without looking at every little detail. Here are some
- Just use mainstream typefaces, and in particular, for screen
work, sans serif and monospace ones. It's usually rather
pointless to have lots of typefaces and in particular lots of
- The only formats that matter are X11
TrueType, and Type 1 (and Type 1 no longer matters much), and
possibly MetaFont for TeX users.
- It is important for fonts to be available in bold and
italic, even for monotype fonts used for writing code/email, as
many editors use bold and italic for prettification; it is also
important the the metrics for bold and italic monospace fonts be
the same as those for roman, to avoid spacing and line length
changes as a result of prettification.
- The quality of TrueType fonts depends largely on hints
within the font, and that of Type 1 fonts depends on hints in
the rasterizer, and just about only the Adobe proprietary
rasterizer does a really good job with Type 1 fonts on screen;
however recent versions (>= 2.2) of FreeType2 have a hinting
rasterizer that gets good results with Type1 font, and these
are rather better than for unhinted TrueType fonts.
The consequence is that only PCF and a few TrueType fonts
(those that contains lots of hints) display well on screen.
- The best quality fonts for screen work are the PCF
ones, and of the scalable ones the TrueType
Microsoft/Monotype web fonts, the classic Adobe Type1
fonts, and then
or rather its much updated and extended variant
(which is much better hinted).
The Google web fonts
are probably going to be the major standard for
freeware GUIs as they are failry comprehensive and
well designed and have metrics equivalent to those of
the very popular
Microsoft web fonts
(which are better hinted).
Bitstream Cyberbit for Unicode
is probably the most extensive Unicode font.
are not too bad (but Dustismo Roman is very coarse), and Vera
and Luxi have relatively poor hinting which means they render
well only if antialiased, especially at low
resolutions like 75DPI.
If you have
MS Windows it is nice to
use Arial and Lucida Console too. If you have MS Windows 2000
or later, they have good Palatino and Symbol in TrueType too.
Various standard TrueType fonts come with MS Office, for
example Book Antiqua, Bookman Old Style, and New Century
Schoolbok are nice too. Bodoni and Gill Sans may also be
available, but they are not essential.
- OpenOffice.org, version up to 1.1.0, comes with a set of
TrueType Macromedia fonts equivalent to the Adobe 14, with
changed names. Later versions only have Bistream Vera and
- For printing (and screen use with the Type1 FreeType2
Type1 clone fonts of the Adobe 35 are nice (and they are
included with X11 and GhostScript); if you have the Adobe
Acrobat Reader, it comes with a set of original Adobe 14 Type
1 fonts too. X11 also comes with Type 1 versions of Adobe
Utopia and Bitstream Charter, which are quite nice
- Various versions of X11 and Java come with B&H Lucida
and Luxi, in TrueType (older versions of Java have them in
Type1 format too).
- Some Linux distributions and packages come with a nice
selection of gratisware fonts, which is an easy way to find
the fonts mentioned above.
- Leave the base X11 (and TeX) fonts in the usual directories,
and create two directories for selected TrueType and Type 1
fonts, for example
- Get the fonts recommended above and sort them out in those two
directories. Then add configuration information for X11
$GS_FONTPATH) and OpenOffice.org
$SAL_FONTPATH_PRIVATE, or use symbolic links
share/fonts or use
- Under X, make sure that the
freetype module is
loaded before the
bitmap module. The
freetype module can also handle bitmap fonts, and
bitmap module has an important misdesign with
respect to DPI handling.
These terms give a somewhat simplified guide to some important
- An alphabet is a collection of characters; a
character is an abstract concept, and cannot be read, written or
spoken. The same character can be in different alphabets. Note
that a pictogram counts as a character here.
- Character set
- A character set is a collection of character
codes, which are numbers each of which corresponds to
a character in the same alphabet. The same character code can
correspond to the same character in different character sets.
- An encoding is a way to represent character codes belonging
to a character set as bits and bytes in computer memory. The
same encoding can represent the same character code in
different encodings, and viceversa the same character code can
be represented very differently in different encodings.
- A glyph is a shape that represents a character. The same
character can be represented by many different glyphs.
- The action of taking a non perceivable representation of
some entity and turning it into another perceivable one. For
example, rendering a MIDI file to sound, or a glyph outline to
- A program that renders bitmaps from some other representation
of an entity, for example a glyph outline, or an entire web
- Renderable glyphs
- A renderable glyph is some representation of a glyph that
can be rendered visually. Within digital fonts renderable
glyphs are usually pixmaps, or outlines/programs that can be
rasterized to pixmaps. In some case a digital font contains all
three types of renderable glyphs.
- A font is a collection of renderable glyphs.
- A typeface is a collection of fonts with a similar or
compatible visual style.
- Digital font
- A digital font is a font organized as a table of rasterizable
glyphs, so that each glyph has a numerical position within the
font. Some digital fonts can contain the same glyphs arranged
in a different order. The same digital font file can
contain several digital fonts, all sharing the same renderable
glyphs, but in different positions.
- Font system
- A font system is some set of software that allows program to
access and render digital fonts.
Sometimes the terms used above are used somewhat
interchangeably, either by mistake, or because it often happens
that for convenience the same values are given to different
entities. For example, a character code can be used also as the
position of a rasterizable glyph in a digital font, and as its
own representation in an encoding.
Also, things re much more complicated than can be briefly
described here; for practical purposes some alphabets contain not
just characters but also parts of characters, and so therefore
digital fonts for those alphabets.
There are some resonable discussions of some of these
issues, for example this
introduction to Unicode
and these comments on the
relationship between Unicode and fonts
both of which contains generally useful concepts.
- Verbose, text based bitmap font for X11.
- Binary bitmap font compiled from BDF, with
endian dependent representation.
- Binary bitmap font compiled from BDF, with a platform and
endian independent representation.
- Type 3 PostScript font, can contain any PostScript command.
- Type 1 PostScript font program in text format.
- Type 1 PostScript font program in binary format.
- Multiple master PostScript font program.
- TrueType font program.
- OpenType font program.
There is another similar
list of formats in the Fonts FAQ.
What follows is not legal advice, but personal opinions of a
legally unqualified programmer.
Typeface licensing is very, very different from country to
country, but font file licensing is more uniform.
The most important concept for typefaces is that virtually no
mainstream typefaces are original, essentially all are subtle
variations of designs that might be several centuries old.
In general what really matters is the situation in the USA; in
it typefaces cannot be copyrighted, but they can be trademarked.
Therefore there are many clones of the same typeface, with
different and sometimes subtly allusive names.
In other countries typefaces, and thus fonts, may be subject to
design patents or similar legal restrictions.
As to font files, in the USA bitmap font files in the USA
cannot quite be copyrighted, because the underlying typefaces
cannot be; but scalable font files can be copyrighted, because
they are programs.
As to scalable font programs, there are several classes of
licensing, which reflect those for programs in general, but with
some important twists. The most important ones are whether the
font program is licensed for both print and screen use (screen
use is usually not an issue, font program publishers make most
of their money from printer fonts) and whether it is licensed
for redistribution, and in particular for a embedding into the
file that uses it (usually font program publishers make lots of
money from selling to printing shops). There are several
pitfalls, but fortunately font program licensing is enforced
- Open source
- Licenses for font programs that are distributed with an open
source or free software license, and can be modified and
redistributed without restrictions.
- Freely redistributable
- Licences for font programs that can be redistributed without
restriction, standalone or embedded, but not modified.
- These licences allow redistribution of font programs but
only as embedded in structured printable document formats.
- For non commercial use
- Licenses that allow use of a font only in non commercial
organizations for non commercial purposes.
- For personal use
- Licenses allowing use of a font only by inviduals, and
usually not in the course of a commercial activity.
- For use with a printer
- These licences, common for Type1 fonts, allow sue of the
font with a fixed number of printers, and usually with any
number of related computers.
Microsoft Typography has a useful
list of fonts bundled with common products
from Microsoft and other companies.
There are first some pseudo font families, generic typeface
names which are as a rule mapped to an actual typeface name:
Dialog (form captions),
DialogInput (form fields).
- The generic Fontconfig names are a subset of the CSS2 ones:
monospace. Xft1 used
mono, but these are
obsolete like Xft1. As a special case
sans serif is usually taken as a synonym of
activeFont (active window); in
StandardFont (desktop icons).
Then there are fonts which implement specific typefaces
or typeface families:
- base X11 bitmaps fonts
- These include bitmap versions of the Adobe 14, some terminal
fonts, and some utility fonts, usually in a number of common
sizes at 100dpi and 75 dpi. Since they have been hand tuned,
they usually look best on screens, and render most quickly
and reliably. Recent versions incorporate the
-misc-fixed- UCS extended fonts
which are very useful.
- There are quite a few variants of Helvetica, often but not
always with different names, and as a rule they are quite
suitable for screen use, in part because of the lack of
serifs, in part because it is a typeface that lends itself
well to small bitmaps. The X bitmap version is particularly
legible. The Arial font is a clone of Helvetica, and allegedly
it has the same metrics as the Adobe Helvetica typeface.
- There are endless variants of Courier, for example Bitstream
Type 1 and Speedo freeware, URW Type1 freeware, Adobe bitmap
freeware, and IBM Type1 freeware. But lots lots more.
Usually it is the best monospaced font for a few reasons:
- It is usually available in both roman and bold with
exactly the same metrics, in particular the X bitmap
- The bitmap and some other versions usually are hand
tweaked for low resolutions.
- Some of its variants are fairly compact, in particular
in the vertical dimension, which means they are nice for
editing source code.
- Adobe 14
- Courier (medium, bold, italic, bold italic), Helvetica®
(medium, bold, italic, bold italic), Times® (medium, bold,
italic, bold italic), Symbol and ITC Zapf Dingbats®.
ITC Avant Garde Gothic® (book, oblique, demi, demi
oblique), ITC Bookman® (light, italic, demi, demi italic),
Courier (medium, oblique, bold, bold oblique), Helvetica®
(medium, oblique, bold, bold oblique), Helvetica Narrow
(medium, oblique, bold, bold oblique), New Century Schoolbook
(roman, italic, bold, bold italic), Palatino® (medium,
italic, bold italic), Symbol, Times® (roman, italic, bold,
bold italic), ITC Zapf Chancery® (italic) and ITC Zapf
- Lucida Bright, Lucida Sans, Lucida TypeWriter.
HP PCL 45
Albertus® (medium, extra bold), Antique Olive™
(medium, italic, bold),Clarendon™ Condensed,
Coronet™, Courier (medium, italic, bold, bold italic),
Garamond™ Antiqua, Garamond Halbfett Kursive, Letter
Gothic™ (medium, italic, bold), Marigold™, CG
Omega™ (medium, italic, bold, bold italic), CG
Times™ (medium, italic, bold, bold italic), Univers®
medium (medium, italic), Univers Bold (bold, bold italic),
Univers Condensed (medium, italic, bold, bold italic),
Arial® (medium, italic, bold, bold italic), Times New
Roman® (medium, italic, bold, bold italic), Symbol and
- Adobe Utopia, Bitstream Charter
- These two typefaces have been contributed as gratisware to
the X project in Type 1 format. They are nice legible fonts
that unfortunately almost nobody uses.
- Microsoft Web
- The Microsoft web core fonts are a set of rather bland but
quite legible and very well hinted Truetype fonts. They come
with a peculiar but liberal license: they are free of charge
and can be freely distributed, but only by offering them for
download, and with no modifications to their packaging.
- Liberation fonts are
and metric compatible with the 3 most common Microsoft
fonts. They are not well hinted.
- CrossCore typefaces are
(thus metric compatible with the 3 most common
Microsoft fonts) and the related fonts are part of the
Google web fonts
collection, being called Arimo,
They have a more liberal license than the
Liberation fonts and therefore have been extended.
They are not well hinted.
- Droid are fonts created for
mobile phones running the Android
platform, but they are platform independent and freeware.
They have been incorporated into the
Google Web Fonts
which supercede them.
Google Web Fonts
- Google have released a
large set of freeware fonts for use in the
which includes an extended version of the
typeface fonts under different names. Like the
Liberation typeface fonts they have metrics identical
to those of the popular
Microsoft Web fonts;
Arimo" is equivalent
to Arial, Cousine is compatible with
Courier New and Tinos is equivalent to Times New Roman.
There are also many other fonts, including an
updated version of the
and many decorative fonts.
- Vera is a Bitstream typeface that has been released, fairly
uniquely, under an open source license. It is fairly good
quality even if hinting is not extensive. It has been
updated and extended in a few variants, and it has
been effectively superceded by
- DejaVu is a derivative of Vera, with
many extensions and some more hinting.
- Bitstream Cyberbit
- Cyberbit is an old but very extensive TrueType font which
supports a very large subset of Unicode. It can be freely
- Computer Modern
- Computer Modern is a group of
typefaces specified in MetaFont
for TeX. They have been
converted in different ways to other formats like Type 1
and TrueType a few times. The main difficulties have been
that by default TeX uses a particularly obsolete character
set, and hinting.
Fortunately here are now some quality conversions to more
common character sets and formats; the format converted to is
usually Type 1, for which fortunately recently the
FreeType rasterizer has been notably improved. Some of the
- Very elegant font from Poland, with a good character set and
nice set of variants.
- Non Latin with Latin subset
- Greek Magenta set.
- Uyghur UKIJ
have both Latin and Cyrillic characters in
addition to Arabic ones for
in a wide variety of typefaces.
- GNU Unifont
- Dustismo Sans
- GNU free
- StarOffice and OpenOffice used to be bundled with a
set of Type1 and later TrueType fonts which are
similar to the classic Adobe set, called Arioso (Zapf
Calligraphic), Chevara, ChevaraOutline, Conga,
Helmet (Helvetica) Helmet Condensed (Helvetica
Condensed), StarBats (Zapf Dingbats), StarMath
(Symbol), Timmons (Times).
- URW Type1
has contributed a full set of Type1 fonts similar to
the classic Adobe set, and they are bundled with
and with the sample X implementation. They are
Bookman L (Bookman), Century Schoolbook L
(New Century Schoolbook), Chancery L (Zapf Chancery),
Gothic L (Avant Garde), Nimbus Mono L
(Courier), Nimbus Roman No9 L (Times), Nimbus
Sans L (Helvetica), Palladio L (Palatino),
Standard Symbols L (Symbol).
- B&H Lucida and Luxi
- Lucida and
Luxi are similar typefaces,
designed by B&H, and they are available free of
charge by being bundled with Sun's Java implementation.
Lucida is also included in PCF format with the X
sample implementation. The scalable versions are not
very well hinted (if at all).
- Agfa Monotype Thorndale, Albany and Cumberland
- These fonts are proprietary versions of Time (Thorndale),
Helvetica (Albany) and Courier (Cumberland), specially
optimized for display on mobile phones, PDAs and other low DPI
screens; they are included with SUSE 9.3 Pro.
Artifex have produced a
with a list of the output of several font rasterizers.
The FreeType project started with the goal of developing a
TrueType rasterizer, but is now extended to be a fully general
font library supporting all the most important
source font formats, in particular PCF, BDF, TrueType, Type1
and OpenType. In general the results are of fairly good
FreeType2 is used inside several renderers, including the X
freetype, and some font X font servers.
X11 bitmap fonts exist in a source format, BDF, and
can be compiled into a much more efficient binary
format, PCF, which is host dependent.
Almost only the fonts bundled with the sample X
implementation are available in X11 bitmap format.
These are of very high quality, as they have been hand
tuned at all available pixel sizes, and include the
classic Adobe font set plus several other popular
These fonts can be rendered (very simply, as they are
already bitmaps) by the
bitmap module of
the X11 server, they can be served by the X11 font
server, and they can also be rendered by the
library which means they are available under
Fontconfig and most other font systems too.
The X11 Type 1 renderer in the module
included in the
xfs font server almost always
produces results that are not as good as those of FreeType2,
which also can render Type1 fonts.
t1lib library turns Type1 fonts into bitmaps.
is a fairly complete PostScript interpreter, so it
needs a font engine. It used to have its own for Type1
and Type3 fonts, but it now mostly uses FreeType2 so
it can also handle TrueType fonts.
- X11 module
- This module only handles PCF fonts, and has two important
limitations in most X implementations until at least XFree86
4.4 and Xorg 6.8.2:
- It cannot be disabled.
- It forces the font DPI to either 100 or 75 if
0 (screen resolution).
- X11 module
- This module contains the old Type 1 rasterizer, like the
xfs font server, and generally rasterizes Type
1 fonts less well than the FreeType2 Type1 rasterizer
contained in the
- X11 module
- This module renders using the FreeType2 library and can
handle X11 bitmap fonts, TrueType fonts and Type 1 fonts.
In practice it is the only module that should be specified,
xtt module is preferred for Asian
- X11 module
- This module contains the FreeType2 font library like the
freetype module, but with additional logic for
the handling of large Asian fonts with specific character
- X11 standard font server
- X11 font server
- X11 font server
- X11 font server
- Obsolete in XFree86 release 4.x and later ones.
The way to select X fonts is with an
It is very useful to be able to specify X11 fonts in a form
that is independent of the actual monitor DPI.
Unfortunately many (including myself until recently)
think erroneously that this is done by using
* as the specification for the DPI fields in
This is incorrect, because a
* in the XLFD only
filters/matches XLFDs, does not in itself mean
whatever is the screen resolution.
In practice, this means that the actual resolution selected
* depends on the order of directories in the
font path: because the selected font will be the first of
all those that match, and these are usually returned in the
order in which the corresponding font directories are
listed in the font path and in the font catalog files
The correct way to specify the current screen resolution
is to use
0 as the DPI in the XLFD. But this
does not work with
:unscaled bitmaps fonts,
because these only strictly match the available, explicitly
declared, DPIs. However, it works even with bitmap fonts if
one does not specify
:unscaled, and since an
unscaled font is preferred if it is close, this will usually
It usually is a good idea to play it safe, and list each
bitmap font directory twice, first with
and then without, and then list the scalable fonts.
With this order the unscaled bitmap font paths, which have
the best on screen quality, will be preferred, but the
0 DPI specifier will then match the right DPI in
the scalable bitmaps font paths, and then the outline fonts will
be matched if no suitable bitmap font is available, for
Unfortunately there is an entertaining bit of code in the
* XXX - we'll want this as long as bitmap instances are prevalent
* so that we can match them from scalable fonts
if (res.x_resolution < 88)
res.x_resolution = 75;
res.x_resolution = 100;
It effect is to force the font DPI to either 75 or 100
depending on the screen resolution, if it has been specified
as 0. Too bad for those who have screens with a different DPI.
Because of various limitations of the traditional X11 font
system (orientation, full metrics, ...) a new server based
font system has been designed and implemented called
which is considerably more general and flexible, and can be
integrated with the X protocol using the
It is has
numerous compelling advantages over Fontconfig/Xft2
but since the proponents of the latter are rather more vocal
and active and politically astute, the latter has been widely
These are obsolete, pray that you never need to deal with
this font system.
The single most important detail about Xft2/Fontconfig is
that by default the FreeType library it uses is compiled
without hinting bytecode support.
Unfortunately the built-in autohinter is not very good, even
if it has improved to the point of usability. If you can do so
legally, it is a good idea to enable the bytecode hinter.
- With GTK 2.0, setting this to
1 enables use
of Fontconfig. In GTK versions starting with 2.2 this is
Setting this option to a numerical value greater than
0 produces various debugging outputm
according to the following table:
I found this info
GhostScript uses a completely different font
system from all other applications, based on
Fontmap font lists.
OpenOffice.org is an integrated
suite of office tools, including a word processor. When
running under Linux it uses its own font system, currently
based around the FreeType2 font rasterizer.
As written in the
OpenOffice.org uses by default Fontconfig/XFt2, but uses an
old version of the FreeType2 libraries.
You can force it to use a new version by using
This package can also be configured to use a set of per-user
extra fonts in the
user/font/ directory in its
per-user installation directory.
DeFoMa is not a mere font system,
but a meta-font system, in that it can be used to
configure a number of font systems it manages.
Some of the better or freer fonts are:
These are pointers to some of the entries in my
where font related issues are discussed:
Antialiasing, gamma, Freetype2, FontConfig
Antialiased text less bold and fuzzy with dark backgrounds
Some Mac OSX NX font issues
The new Microsoft ClearType oriented fonts
Summarizing the font situation
Discoveries about Fontconfig configuration files
Sample Fontconfig configuration files
Freetype2 font rendering and quality
Fedora rewrites font server config.
Some font files for Unicode are big, and increase the
size of a process a lot with client-side font rendering.
The native X font system forces DPI to either 75 or
100 unless explicitly specified.
Distros by default only use client-side rendering but
do not make available bitmap fonts through it.
Priority of the various X font modules. Prefer
Discovered Type 1 fonts for Computer Modern,
and that Freetype renders Type 1 fonts well.
The issues with client-side fonts.
The complexities of the UNIX/Linux/X font systems,
when selecting a Mozilla/Firefox GUI font.
The way to select X fonts is wtih an
but identifying fonts under
is not quite as clear (my impression is that overall
Fontconfig is pretentious, unfinished and ill conceived, but
we have to deal with it regardless).
user configuration manual
it appears that Fontconfig font specifiers contain, in this
- An optional list of comma-separated typeface families.
- Optionally, a dash followed by a comma separated list of
point sizes (which can be fractional).
- Optionally, a sequence of properties, each of which
consists of a colon, and either a property name, an equal
sign, and a value, or a name that implies both a property
name and a specific value.
Unfortunately the manual does not quite list which names and
values may be used in properties.
By looking at other parts of the manual it seems that these
might be the same as those that can be specified in an XML
configuration line, and therefore:
- For typeface family, any of the typefaces available. it is
possible to get a list of these with the
fc-list command. Note that it appears that the
style also gets listed, which is quite
important as apparently there are no standard values for it,
and it overrides the
foundry: Font foundry name.
- For weights,
(optionally prefixed by
- For slants,
oblique (optionally prefixed by
- For types of spacing,
charcell (optionally prefixed by
false): whether glyphs can
false): whether the glyphs
pixelsize (floating point): pixel size.
dpi (floating point): target dots per
scale (floating point): scale factor for
aspect (floating point): stretches glyphs
horizontally before hinting.
charset (string): unicode character sets
encoded by the font.
lang: comma separated list of RFC-3066-style
languages this font supports.
Finally note that quite bizarrely the GNOME font specifiers
look similar to, but are not compatible with the Fontconfig
ones, even if GNOME uses only Fontconfig.
Some possible examples:
might be equivalent to the XLFD
might be equivalent to the XLFD