Typography

glu is built on a typesetting engine, not a browser engine: paragraphs are broken as a whole with the TeX line-breaking algorithm, text is shaped with real OpenType shaping (ligatures, kerning, script support), and every knob the engine exposes is reachable from CSS. This chapter walks through those knobs from coarse to fine: pick the fonts first, then shape the paragraph, then the line, then the letter, and learn how to see what the engine is doing when something looks off.

  • Choosing fonts covers the built-in families, @font-face, weights and styles, variable fonts, size-adjust and what happens when a glyph is missing.
  • Alignment and line breaking covers text-align, the TeX paragraph breaker, hyphenation, text-indent and drop caps.
  • Lines and leading covers line-height and the two leading models, subscripts and superscripts, and whitespace control.
  • Letterforms covers OpenType features, letter spacing, text decoration and italic correction.
  • Microtypography covers font expansion, the line breaker knobs, and a reference table of all -bag-* properties.
  • Languages and scripts covers lang and hyphenation patterns, direction, and bidirectional text.
  • Debugging shows the trace overlays and how to read the log when the output does not match the expectation.