Font rasterization
This article needs additional citations for verification. (November 2009) |
Font rasterization is the process of converting text from a
Types of rasterization
The simplest form of rasterization is simple line-drawing with no anti-aliasing of any kind. In Microsoft's terminology, this is called bi-level (and more popularly "black and white") rendering because no intermediate shades (of gray) are used to draw the glyphs. (In fact, any two colors can be used as foreground and background.)
A more complicated approach is to use standard anti-aliasing techniques from computer graphics. This can be thought of as determining, for each pixel at the edges of the character, how much of that pixel the character occupies, and drawing that pixel with that degree of opacity. For example, when drawing a black (000000) letter on a white (FFFFFF) background, if a pixel ideally should be half filled (perhaps by a diagonal line from corner to corner) it is drawn 50% gray (BCBCBC). Over-simple application of this procedure can produce blurry glyphs. For example, if the letter includes a vertical line that should be one pixel wide but falls exactly between two pixels, it appears on screen as a two-pixel-wide gray line. This blurriness trades clarity for accuracy. However, modern systems often force lines to fall within integral pixel coordinates, which makes glyphs look sharper, but also makes lines slightly wider or thinner than they would have looked on a printed sheet of paper.
Most computer displays have pixels made up of multiple subpixels (typically one each for red, green, and blue, which are combined to produce the full range of colours). In some cases, particularly with flat panel displays, it is possible to exploit this by rendering at the subpixel resolution rather than using whole pixels, which can increase the effective resolution of the screen. This is generally known as subpixel rendering. One proprietary implementation of subpixel rendering is Microsoft's ClearType.
Currently used rasterization systems
In modern operating systems, rasterization is normally provided by a shared library common to many applications. Such a shared library may be built into the operating system or the desktop environment, or may be added later. In principle, each application may use a different font rasterization library, but in practice most systems attempt to standardize on a single library.
Most other systems use the FreeType library, which depending on the settings, can fall anywhere between Microsoft's and Apple's implementations; it supports hinting and anti-aliasing, and optionally performs subpixel rendering and positioning. FreeType also offers some features not present in either implementation such as color-balanced subpixel rendering and gamma correction.[6]
Applications may also bring their own font rendering solutions. Graphics frameworks like Skia Graphics Engine (used by Google Chrome) occasionally use their own font renderer. Video games and other 3D applications may also need faster, GPU-based renderers such as various SDF-based renderers and "Slug".[7]
References
- ^ a b Greg Hitchcock (with introduction by Steven Sinofsky) "Engineering Changes to ClearType in Windows 7", MSDN blogs, 23 Jun 2009
- ^ a b About Text Rendering in Windows Internet Explorer 9
- ^ MSDN Library : .NET Development : WPF : ClearType Overview
- ^ "[ft] Fwd: Re: Texts Rasterization Exposures". lists.gnu.org.
- ^ "MacOS Mojave removes subpixel anti-aliasing, making non-retina displays blurry | Hacker News". news.ycombinator.com.
- ^ "On slight hinting, proper text rendering, stem darkening and LCD filters". freetype.org.
- ^ "Slug Font Rendering Library". sluglibrary.com.
External links
- The Raster Tragedy at Low-Resolution Revisited – Beat Stamm's online book about rasterization, with an emphasis on ClearType
- CS 354 Computer Graphics — path rendering; University of Texas at Austin
- Texts Rasterization Exposures
- The Ails Of Typographic Anti-Aliasing