Google announced at I/O that their font service will now support the font-display
property which resolves a number of web performance issues. If you’re hearing cries of joy, that’s probably Chris as he punches the air in celebration. He’s wanted this feature for some time and suggests that all @font-face
blocks ought to consider using the property.
Zach Leatherman has the lowdown:
This is big news—it means developers now have more control over Google Fonts web font loading behavior. We can enforce instant rendering of fallback text (when using font-display: swap) rather than relying on the browser default behavior of invisible text for up to 3 seconds while the web font request is in-flight.
It’s also a bit of trailblazing, too. To my knowledge, this is the first web font host that’s shipping support for this very important font-display feature.
Yes, a big deal indeed! You may recall that font-display
instructs the browser how (and kinda when) to load fonts. That makes it a possible weapon to fight fight FOUT and FOIT issues. Chris has mentioned how he likes the optional
value for that exact reason.
@font-face {
font-family: "Open Sans Regular";
src: url("...");
font-display: optional;
}
Oh and this is a good time to remind everyone of Monica Dinculescu’s font-display
demo where she explores all the various font-display
values and how they work in practice. It’s super nifty and worth checking out.
Great news! Google itself recommended using it in their PageSpeed support pages, finally this feature is here.
Finally. This should be a standard feature of all webfont hosting providers.
This was driving me crazy. A welcome addition!
They should split font files into metrics and actual shape. This way the tiny (in comparison) metric can be downloaded quickly and used to layout the page correctly, even when showing fallback typeface. Once the font is available, the layout will not change, just the shape of each letter.
great news! do we know when it’s gonna be implemented?