Ensure text remains visible during webfont load is showing even after using `font-display: swap`

Viewed 100

I have used font-display:swap in my @font-face. But still in google pagespeed I am getting the warning Ensure text remains visible during webfont load

here is the code for font.

@font-face {
  font-family: Cocogoose-Pro-Condensed-Regular;
  src: url(typsnitt/Ttf/Cocogoose-Pro-Condensed-Regular.ttf)
    format('truetype');
  font-display: swap !important;
}
@font-face {
  font-family: Cocogoose-Pro-Comp-Light;
  src: url(typsnitt/Ttf/Cocogoose-Pro-Comp-Light.ttf)
    format('truetype');
  font-display: swap !important;
}
1 Answers

You have to make sure that the link/file exported has included the property font-display: swap;, it's not enough if you just add it for yourself in the CSS file

Unless you have the actual font file in your local

Related