The Layout Pipeline

Pango fundementally operates with paragraphs of text. The reason for working a paragraph at a time is that bidirectional reordering can affect the order of text within a paragraph but not beyond that. The steps Pango takes to lay out a paragraph are listed below. Not all of these steps need to be implemented as separate passes over the text. The input to the process is a piece of UTF-8 encoded text and a PangoAttributeList that applies to that text. The attribute list includes attributes for language tag, font properties, and other attributes that do not affect to the layout process, such as foreground color.

  1. Modify the language tags on the text using information about the possible language tags for each Unicode character point. (Not yet implemented, see the design document for font selection.)

  2. Determine the bidirectional levels for the text.

  3. Determine a language engine for each character in the text from the language tag and code point.

  4. Determine a font for each character in the text from the attributes for that character and the language tag.

  5. Determines a shaper for each character by querying the font for that character.

  6. Split the text into segments with consistent font, shaper, directional level and language tag.

  7. Convert the characters in each segment into positioned glyphs. (Glyphs are represented as a PangoGlyphString).

  8. Determine how many segments fit on each line. Break the segments to fit as necessary.

  9. Reorder the segments on each line from logical order to visual order.

The output of this process is list of PangoGlyphStrings per line. These are then fed into the renderer.

Last modified 15-Feb-2000
Owen Taylor <>