# Font rasterization

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Font_rasterization
> Markdown URL: https://mediated.wiki/source/Font_rasterization.md
> Source: https://en.wikipedia.org/wiki/Font_rasterization
> Source revision: 1305053251
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Process of converting text from vector to raster

This article needs more citations. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Font rasterization" – news · newspapers · books · scholar · JSTOR (November 2009) (Learn how and when to remove this message)

 Especially for small font sizes, rendering of  vectorized fonts in "thumbnail" view can vary significantly with thumbnail size. Here, a small change in the upright= multiplier from 1.70 to 1.75 results in significant and mutually distinct rendering anomalies, possibly due to rounding errors resulting from use of integer font sizes.[*[original research?](https://en.wikipedia.org/wiki/Wikipedia:No_original_research)*]

**Font rasterization** is the process of converting text from a [vector](/source/Vector_graphics) description (as found in scalable fonts such as [TrueType fonts](/source/TrueType_font)) to a [raster](/source/Raster_graphics) or [bitmap](/source/Bitmap) description. This often involves some [anti-aliasing](/source/Spatial_anti-aliasing) on screen text to make it smoother and easier to read. It may also involve [hinting](/source/Font_hinting)—information embedded in the font data that optimizes rendering details for particular character sizes.

## 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.)[1] This form of rendering is also called aliased or "jagged".[2] This is the fastest rendering method in the sense that it requires the least computational effort. However, it has the disadvantage that rendered glyphs may lose definition and become hard to recognize at small sizes. Therefore, many font data files (such as TrueType) contain [hints](/source/Hinting) that help the rasterizer decide where to render pixels for particularly troublesome areas in the glyphs, or sets of hand-tweaked bitmaps to use at specific pixel sizes.[1] As a prototypical example, all versions of [Microsoft Windows](/source/Microsoft_Windows) prior to [Windows 95](/source/Windows_95) (e.g. [Windows 3.1](/source/Windows_3.1)) only provided this type of built-in rasterizer.[2]

Simple rasterization without anti-aliasing

Rasterization with anti-aliasing without hinting

Rasterization with anti-aliasing with hinting. Here pixels are forced to fall into integral pixel coordinates whenever possible.

Rasterization with hinting and subpixel rendering for an RGB flat panel display

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.

Detail of subpixel rendering, showing positions of individual color pixels that make up white font

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](/source/Subpixel_rendering). One proprietary implementation of subpixel rendering is Microsoft's [ClearType](/source/ClearType).

## Currently used rasterization systems

In modern operating systems, rasterization is normally provided by a [shared library](/source/Shared_library) common to many applications. Such a shared library may be built into the [operating system](/source/Operating_system) or the [desktop environment](/source/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.

[Microsoft Windows](/source/Microsoft_Windows) has supported subpixel rendering since [Windows XP](/source/Windows_XP). On the other hand, the standard Microsoft rasterizer without ClearType is an example of one that prioritizes [type designer](/source/Type_designer)'s intent of clarity; by forcing text into integral coordinate positions, following the [type designer](/source/Type_designer)'s intent of hinting, and even not antialiasing certain fonts at certain sizes, following the [type designer](/source/Type_designer)'s intent of the gasp table, it becomes easier to read on the screen, but may appear somewhat different when printed. This has changed with Direct2D/DirectWrite shipping on Windows 7 and Windows Vista platform update, allowing subpixel text positioning to 1/16 pixel sizes.[3]

[Mac OS X](/source/Mac_OS_X)'s [Quartz](/source/Quartz_(graphics_layer)) is distinguished by the use of subpixel positioning; it does not force glyphs into exact pixel locations, instead using various antialiasing techniques,[4] including [subpixel rendering](/source/Subpixel_rendering), to position characters and lines to appear further from the [type designer](/source/Type_designer)'s intent of hinting and closer to the original outline. The result is that the on-screen display looks extremely similar to printed output, but can occasionally be difficult to read at smaller point sizes. The Quartz renderer has, since macOS Mojave, removed subpixel rendering, relying purely on greyscale anti-aliasing instead. This change is acceptable to HiDPI "retina" screens, but makes text on external monitors harder to read.[5]

Most other systems use the [FreeType](/source/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](/source/Skia_Graphics_Engine) (used by [Google Chrome](/source/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](/source/Signed_distance_function)-based renderers and "Slug".[7]

## References

1. ^ [***a***](#cite_ref-win7_1-0) [***b***](#cite_ref-win7_1-1) Greg Hitchcock (with introduction by [Steven Sinofsky](/source/Steven_Sinofsky)) "[Engineering Changes to ClearType in Windows 7](http://blogs.msdn.com/b/e7/archive/2009/06/23/engineering-changes-to-cleartype-in-windows-7.aspx)", MSDN blogs, 23 Jun 2009

1. ^ [***a***](#cite_ref-ie9_2-0) [***b***](#cite_ref-ie9_2-1) [About Text Rendering in Windows Internet Explorer 9](http://msdn.microsoft.com/en-us/library/hh237264(v=vs.85).aspx#rendering_types)

1. **[^](#cite_ref-3)** [MSDN Library : .NET Development : WPF : ClearType Overview](http://msdn2.microsoft.com/en-us/library/ms749295.aspx)

1. **[^](#cite_ref-4)** ["\[ft\] Fwd: Re: Texts Rasterization Exposures"](https://lists.gnu.org/archive/html/freetype/2007-07/msg00007.html). *lists.gnu.org*.

1. **[^](#cite_ref-5)** ["MacOS Mojave removes subpixel anti-aliasing, making non-retina displays blurry | Hacker News"](https://news.ycombinator.com/item?id=17476873). *news.ycombinator.com*.

1. **[^](#cite_ref-6)** ["On slight hinting, proper text rendering, stem darkening and LCD filters"](https://freetype.org/freetype2/docs/hinting/text-rendering-general.html). *freetype.org*.

1. **[^](#cite_ref-7)** ["Slug Font Rendering Library"](https://sluglibrary.com/). *sluglibrary.com*.

## External links

Wikimedia Commons has media related to [Font rasterization](https://commons.wikimedia.org/wiki/Category:Font_rasterization).

- [The Raster Tragedy at Low-Resolution Revisited](http://www.rastertragedy.com) – Beat Stamm's online book about rasterization, with an emphasis on ClearType

- [CS 354 Computer Graphics — path rendering; University of Texas at Austin](https://www.slideshare.net/Mark_Kilgard/23typography-12534604)

- [Texts Rasterization Exposures](https://agg.sourceforge.net/antigrain.com/research/font_rasterization)

- [The Ails Of Typographic Anti-Aliasing](https://www.smashingmagazine.com/2009/11/the-ails-of-typographic-anti-aliasing)

v t e Typography Page Canons of page construction Column Even working Margin Page numbering Paper size Pagination Pull quote Recto and verso Intentionally blank page Paragraph Alignment Leading Line length River Runaround Widows and orphans runt Character Typeface anatomy Counter Diacritics Dingbat Glyph Ink trap Ligature Rotation Subscript and superscript Swash Text figures Tittle Capitalization All caps Camel case Initial Letter case Small caps Snake case Title case Visual distinction Blackboard bold Bold Color printing Italics Oblique Underline Whitespace Horizontal aspects Figure space Kerning Letter spacing Pitch Sentence spacing Thin space Word spacing Vertical aspects Ascender Baseline Body height Cap height Descender Mean line Overshoot x-height Typeface classifications Roman type Serif Antiqua Didone slab serif Sans-serif Blackletter type Bastarda Fraktur Rotunda Schwabacher Gaelic type Insular Uncial Specialist Record type Display typeface script fat face reverse-contrast Punctuation (List) Bullet Dash Hanging punctuation Hyphen minus sign Interpunct Space Vertical bar Typesetting Etaoin shrdlu Font computer monospaced Font catalog For position only Letterpress Lorem ipsum Microprinting Microtypography Movable type Pangram Phototypesetting Punchcutting Reversing type Sort Type color Type design Typeface list Typographic units Agate Cicero Em En Metric units Pica Point traditional point-size names Twip Digital typography Character encoding Hinting Text shaping Rasterization Typographic features Web typography Bézier curves Desktop publishing Typography in other writing systems Arabic Cyrillic PT Fonts East Asian Thai National Fonts Related articles Penmanship Handwriting Handwriting script Calligraphy Lettering Style guide Type design Type foundry History of Western typography Intellectual property protection of typefaces Technical lettering Vox-ATypI classification Related template Punctuation and other typographic symbols Category

---
Adapted from the Wikipedia article [Font rasterization](https://en.wikipedia.org/wiki/Font_rasterization) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Font_rasterization?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
