Solving Cross-Browser Line-Height Drift Between hhea and OS/2 Tables
Three Competing Vertical Metric Triplets Inside One Font
Historical divergence between Apple, Microsoft, and Adobe left every OpenType font carrying three separate sets of vertical metrics: hhea (ascender, descender, lineGap), OS/2 typographic metrics (sTypoAscender, sTypoDescender, sTypoLineGap), and Windows clipping bounds (usWinAscent, usWinDescent). When these triplets disagree, UI buttons look vertically off-center between macOS Safari and Windows Chrome.
Bit 7 of OS/2.fsSelection (0x0080, USE_TYPO_METRICS) instructs modern layout engines to prefer sTypoAscender, sTypoDescender, and sTypoLineGap across all operating systems rather than falling back to hhea on macOS and usWin on Windows. Inspecting all three metric sets normalized by unitsPerEm immediately pinpoints baseline shifts.
- Displays raw design units alongside normalized em-box fractions (value / unitsPerEm).
- Checks whether OS/2.fsSelection bit 7 (USE_TYPO_METRICS) is enabled.
- Calculates exact delta between hhea.ascender and OS/2.sTypoAscender.
- Reveals usWinAscent and usWinDescent GDI clipping thresholds for tall stacked diacritics.
- Helps frontend engineers align button padding and single-line badge baselines across macOS and Windows.
- Feeds normalized ascender, descender, and lineGap em ratios directly into CSS fallback override formulas.