Optical Sizing with font-optical-sizing
You'll learn how to enable automatic optical adjustments that make variable fonts more readable at different sizes.
What Is Optical Sizing?
Imagine reading a billboard versus reading fine print on a medicine bottle. The letters need to be shaped differently for each context—not just scaled bigger or smaller. Billboard letters can have delicate details, while tiny text needs thicker strokes and more open spacing to stay legible.
Optical sizing is a feature in some variable fonts that automatically adjusts these subtle design details based on the text size. When enabled, the font will use heavier strokes, wider spacing, and simpler shapes at small sizes, then switch to more refined, delicate details at larger sizes.
The font-optical-sizing Property
This CSS property controls whether these automatic adjustments happen:
h1 {
font-family: 'MyVariableFont', sans-serif;
font-size: 48px;
font-optical-sizing: auto; /* default - enables optical sizing */
}
p {
font-family: 'MyVariableFont', sans-serif;
font-size: 14px;
font-optical-sizing: none; /* disables optical sizing */
}
Values:
auto(default): The browser automatically applies optical sizing adjustments based on font-sizenone: Disables optical adjustments; the font uses a single design regardless of size
When to Use It
Most of the time, leave it at auto. The font designer has carefully crafted these adjustments for optimal readability. You might use none if you want consistent letterforms across all sizes for artistic reasons, but this usually hurts readability.
Note: Only variable fonts with an optical sizing axis (opsz) support this feature.
Key Takeaway: font-optical-sizing: auto lets variable fonts automatically optimize their design for better readability at any size—trust the type designer's expertise and leave it enabled.