The F-Mods: Complete Metric Override System
You'll learn how to combine all CSS font metric overrides into a single, comprehensive fallback system that eliminates layout shift.
What Are the F-Mods?
The "F-Mods" (Font Metric Override Modifiers) are the complete set of CSS properties that let you surgically adjust a fallback font to match your web font's exact dimensions. You've learned each piece individually—size-adjust, ascent-override, descent-override, and line-gap-override—but their real power emerges when you use them together in a coordinated system.
Think of it like adjusting a car seat: you can move it forward/back (size-adjust), tilt the backrest (ascent), adjust the seat height (descent), and set lumbar support (line-gap). Each control does one thing, but together they create a perfect fit.
The Complete Override Pattern
When you apply all four overrides to a fallback font in your @font-face declaration, you're creating a "clone" of your web font's metrics using only system fonts:
@font-face {
font-family: 'Fallback for CustomFont';
src: local('Arial');
size-adjust: 107%;
ascent-override: 90%;
descent-override: 22%;
line-gap-override: 0%;
}
Each property handles one dimensional aspect of the font, and together they ensure that when your fallback font displays (during loading or if the web font fails), text occupies exactly the same space as the web font would—preventing any layout shift.
Why Use All Four Together?
Using only size-adjust gets you close, but professional-grade fallback matching requires all four metrics. Real-world fonts have complex vertical proportions, and only the complete F-Mod system captures them all.
Key Takeaway: The F-Mods are the four font metric override properties (size-adjust, ascent-override, descent-override, line-gap-override) used together to create pixel-perfect fallback fonts that eliminate layout shift entirely.