= Text baseline
A <text baseline> is the reference line used to align <glyphs> in a run of text. It supplies a placement reference rather than the edge of every visible shape. In a horizontal <coordinate system> with the baseline at $y=0$, a <descender> can extend below the line, while an <ascender> extends above the main body of a lowercase letter. Aligning ink <bounding boxes> at their bottom edges would therefore fail to align the writing.<Glyph Metrics in the FreeType documentation>[Section 1: baseline, pens and layouts]{ref}
The reference depends on the writing system and layout. <OpenType> distinguishes an alphabetic baseline (`romn`), a hanging baseline (`hang`) and a mathematical baseline (`math`), among others. The last is the reference about which mathematical forms are centred; it need not coincide with the alphabetic baseline. Vertical layout also requires an appropriate baseline convention.<Baseline Tags by Microsoft>[Registered baseline tags and their meanings in horizontal and vertical axes]{ref}
For a simple horizontal run, start the logical <pen position> at $(x_0,y_0)$ on the chosen <text baseline>. A <glyph advance> $(a,0)$ moves the next <pen position> to $(x_0+a,y_0)$. A vertical placement adjustment can move an accent <glyph> while leaving that baseline and the subsequent logical positions intact. This distinction lets <glyph positioning> align the run while placing individual forms precisely.
Back to article page