Archived topic
FOUT deviation
1 reply · Started by Shrawan on May 27, 2021
Hello Generatepress,
I've come across a peculiar issue which I'd like to get a solution on
We're hosting font locally and before the actual font loads, we're noticing a standard font loading.
1) When we enable Combine CSS & Cache dynamic CSS options from the Customizer it is a different font, one that is fatter and more rounded
2) When we disable it, it's like a thinner font
Here's what I need help on:
1) Why is there such a deviation (I'm dropping the two links below for your vieweing). Are these font files loading from the Browser or are they local files stored in the theme folder?
2) When I preload the font (through a cache plugin like Breeze or WP-Rocket) I still notice the default font loading before the actual one. The idea of preloading is to ensure we don't have a stark difference. Would you be able to give me a solution as to how I can make the text appear with the locally-hosted font.
Hi there,
in your @font-face CSS you have the:
font-display:swap
This says to the browser use your system font ( which is what you see on first load ) until the requested font is loaded.
More info here on the alternative font-display properties:
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display