= Font ascent
The <font ascent> is an upward metric measured from a <text baseline> and used when allocating vertical space for a <font>. It describes the <font>'s layout metrics as a whole, rather than the visible <ascender> of one particular <glyph>. A short letter, a tall letter and an accented form can therefore share the same <font ascent> while having different ink <bounding boxes>.<Visual formatting model details in CSS 2.2 by W3C>[Section 10.8.1: font-wide ascent A and descent D need not match individual glyph extents]{ref}
Suppose a <computer font> has a chosen <font ascent> of 800 <font units> and 1000 <font units> per <em>. At 20 <pixels per em>, the scaled upward metric is 16 <pixels>. This calculation allocates a reference extent; it does not assert that the letters being drawn actually reach 16 <pixels> above the <text baseline>.
The field used must be stated. <OpenType> provides `ascender` in `hhea` and `sTypoAscender` in `OS/2`, while some older layout paths use other metrics. The `sTypoAscender`, `sTypoDescender` and `sTypoLineGap` fields are intended to work together for typographic line spacing. Their ascent-minus-descent need not equal `unitsPerEm`.<OS 2 and Windows Metrics Table by Microsoft>[sTypoAscender: default line spacing, legacy differences and independence from unitsPerEm]{ref}
Combining a <font ascent> with the corresponding <font descent> and <font line gap> gives a consistent basis for choosing <line height>. Mixing fields chosen under different conventions can instead change the spacing even when the nominal <font size> is unchanged.
Back to article page