They are different font databases, used by different software and in different formats, though with overlaps.
X11
contains fonts used by the X Window System, specifically fonts that are rendered on the server. This is the traditional way of rendering fonts on X. You'll mainly find bitmap fonts in PCF format, as well as a few vector fonts in Type 1 or TrueType format.
Type 1 is the format of PostScript fonts. PostScript was the standard in the printing industry until it was displaced by PDF. Type 1 is good for printing but rendering vector fonts at the small sizes afforded by a typical screen resolution tend to yield poorer results than a well-designed bitmap font.
TrueType is a vector format with additional rendering hints that specify how to pick pixels at small resolutions. Thus TrueType fonts are scalable (you can use them at any size, unlike a bitmap fonts) but give good results even at small sizes. TrueType was developped by Apple and used in Microsoft Windows.
X11's server-side font rendering had some advantages, mostly in setups where the computer running most programs was a big one in a machine room somewhere and users were in front of X terminals running an X server and little else. With server-side rendering, the program sends commands like “display this text”, rather than “display this image” which requires a lot more bandwidth.
The font search path for X11 server-side fonts is configured via xset fp
.
Today, X terminals are rare and network bandwidth has increased a lot, so this is no longer a common concern. Client-side font rendering has become prevalent mainly because it allows anti-aliasing. Anti-aliasing uses gray levels to represent partially-on pixels, which improves the neatness of low-resolution images, especially of text. LCD displays, made subpixel anti-aliasing possible, were the renderer leverages the locations of the pixels to fine-tune the anti-aliasing. A traditional X server can only render vector fonts into monochrome bitmaps (due to the internal architecture of X11, the text renderer does not know the background color, so cannot perform antialiasing). The combination of FreeType and Xft library became the de facto standard to render fonts with antialiasing.
Modern X servers implement the Render extension, which performs server-side composition of images with an alpha channel. This allows the client to render fonts with anti-aliasing and send the result to the server for composition and display.
FreeType supports TrueType and Type1 fonts, as well as the OpenType extension to TrueType. Cmap files are additional mapping tables that specify where the image (or more precisely the rendering instructions) for a character is stored. Its font search path is configured via Fontconfig. The command fc-list
is part of Fontconfig. Fontconfig typically makes all the fonts under /usr/share/fonts
available. FreeType and Fontconfig can be used by applications other than X11, for example for printing.