Font rendering and text layouting

From FedoraProject

(Difference between revisions)
Jump to: navigation, search

Revision as of 09:36, 26 June 2008

A page on Fedora Fonts

Rendering

The FreeType library is used for virtually all font loading and rendering within the Fedora desktop. It contains supports for a great variety of Fonts formats, from Type1, to TrueType/OpenType (TTF/OTF), and bitmap formats like PCF and BDF. Nowadays Fedora converges on OpenType (TTF/OTF) fonts in Unicode encoding, and no efforts should be wasted on legacy formats.

Moving one layer up from FreeType, once we've taken a font outline and converted it into an image, we have to send the image to the screen. The Xft library is designed to do this. On modern X servers, it uses the RENDER extension to draw fonts to the screen. For older X servers, it contains fall-back code to do the same rendering through the core X protocol, though less efficiently.

Text Layout

While virtually everything in Fedora renders fonts using the FreeType library and Xft, there is much more diversity in how text layout is done. Text layout for scripts such as Latin or Cyrillic is relatively straightforward. The simple capabilities built into Xft are almost sufficient. But languages such as Arabic and Hindi require more intricate handling. The characters in the input string interact with each other and sophisticated processing is required to determine the right set of glyphs to be drawn to the screen. Right-to-left languages like Arabic and Hebrew are also challenging.

Currently, the Pango library is used by GNOME and other programs based on the GTK+ toolkit for text layout. KDE and other programs based on the Qt toolkit use code built into Qt for the same purpose. OpenOffice.org uses layout code from the ICU library. Nevertheless the current Qt code and the OpenOffice.org layouter are increasingly inadequate.

If text layouting is approaching at last typographer requirements, modern "smart" fonts are several orders of magnitude more complex than previous fonts (and people make use of the new features and expect them to work). The code needed to interpret those fonts is correspondingly more complex. In fact it's getting at the level of complexity big projects are dropping their own text layouters fast and trying to converge on a common text layout library. HarfBuzz will probably dominate free desktops in the coming years.


Idea.png
Fonts in Fedora
The Fonts SIG takes loving care of Fedora fonts. Please join this special interest group if you are interested in creating, improving, packaging, or just suggesting a font. Any help will be appreciated.