Answer the question
In order to leave comments, you need to log in
What is the correct way to display all text before loading fonts?
Hello.
Google Pagespeed has this recommendation:
Set All Text to Show While Web Fonts are Loading
To allow the user to see text while the web fonts are not loaded, use the CSS font display feature.
The fonts are connected in the project like this:
@font-face {
font-family: "Museo Sans";
src: local('Museo Sans'), local('MuseoSans'), url("../fonts/museosans/regular.eot?#iefix") format("embedded-opentype"), url("../fonts/museosans/regular.woff2") format("woff2"), url("../fonts/museosans/regular.woff") format("woff"), url("../fonts/museosans/regular.ttf") format("truetype");
font-display: swap;
}
Answer the question
In order to leave comments, you need to log in
@font-face {
font-display: swap;
font-family: "Museo Sans";
src: local('Museo Sans'), local('MuseoSans'),
url("../fonts/museosans/regular.eot?#iefix") format("embedded-opentype"),
url("../fonts/museosans/regular.woff2") format("woff2"),
url("../fonts/museosans/regular.woff") format("woff"),
url("../fonts/museosans/regular.ttf") format("truetype");}
I guess you should use fallback fonts , maybe that will solve the problem.
Through trial and error, I found out that you need to specify the path to the font without../
1 the font must be connected in the header, and not from the css
2 the font in the body is indicated in the type form
that is, you need to specify not only the font that you will use, but also the font that will be used before the desired one is loaded, and if the desired one cannot be loaded for some reason.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question