= Text shaping
<Text shaping> turns a sequence of <Unicode> <text characters> into a layout of <glyphs> from a chosen <computer font>. The result includes <glyph indices>, positions and <glyph advances>. A <text character> therefore does not determine a visible shape independently of its neighbors, writing system and selected <computer font>.<Shaping concepts in the HarfBuzz Manual>[Text shaping: Unicode input, font-dependent two-dimensional glyph layout and shaping models]{ref}
For example, the stored sequence `f` followed by `i` can become a single <typographic ligature>. Contextual Arabic forms illustrate a different requirement: a letter's neighbors influence the selected <glyph>. <Glyph substitution> chooses forms, while <glyph positioning> places the chosen forms; <kerning> adjusts their spacing. These operations can preserve the original <Unicode> text, so copying text should not be implemented by reading <glyph indices> as if they were <code points>.<Glyph Substitution Table by Microsoft>[Overview: Arabic contextual forms, Latin ligatures and the character/glyph distinction]{ref}
<Text shaping> precedes <rasterization>: first determine what shapes to draw and where; then determine the <pixels> that represent those shapes at the requested size.
Back to article page