5

In my /usr/share/fonts/ I have four sub-directories categorizing types of fonts:

  1. cmap
  2. truetype
  3. type1
  4. X11

The command fc-list produces a list of them.

Are these different categories for specific purposes, or simply a result of the evolution of differing trends for designing fonts?

Braiam
  • 35,991
Geeb
  • 2,131
  • 2
  • 16
  • 17
  • It's the result of evolution and various forms of portability. E.g., truetype fonts are used on GUI systems besides X, but (I don't think) the X11 style fonts are. – goldilocks Jan 29 '14 at 13:52

1 Answers1

5

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.

  • bitmap fonts in terminal windows are always preferred, because they give best readable results at fixed size, especially at lower sizes. just my two cents. –  Jan 30 '14 at 07:21
  • 1
    @bersch Vector fonts with good rendering hints and antialiasing are generally considered superior. On monochrome displays, bitmap fonts do give better results, but monochrome displays are really rare these days. – Gilles 'SO- stop being evil' Jan 30 '14 at 09:45
  • good modern fonts can embed bitmap fonts for small sizes and some of them are hinted especially for computer displays and include specific metrics for small sizes, but they are rare. These fonts give best results, because they render exactly and without any aliasing at small sizes. So there is a lot of knowledge inside. Hinting Features. I also saw lately that Gnome can generate fake-slanted and fake-bold fonts. –  Jan 30 '14 at 11:28