Archived topic
Ensure text remains visible during webfont load
1 reply · Started by Renan on March 17, 2020
Hi There,
I've already added the function generatepress
add_filter( 'generate_google_font_display', function() {
return 'swap';
} );
I also added the css font face, but the message still appears
@font-face {
font-family: 'Pacifico';
font-style: normal;
font-weight: 400;
src: local('Pacifico Regular'), local('Pacifico-Regular'), url(https://fonts.gstatic.com/s/pacifico/v12/FwZY7-Qmy14u9lezJ-6H6MmBp0u-.woff2) format('woff2');
font-display: swap;
}
And I also added in the header.php with display=swap
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
what can I do?
Website: http://blogtestes.mobills.com.br/
Hi there,
Something on your website is using the webfontloader javascript library to load the fonts. I don't believe it's possible to use swap with the javascript: https://github.com/typekit/webfontloader/issues/409
You'll want to use the CSS method.