Search code examples
firefoxwebfontsgoogle-webfonts

Firefox completelly refuses font load due to EOT


I noticed Firefox refuses to load custom fonts on one of my web pages. I'm 90% sure it worked one month ago. Now I use Firefox 43.04 (Windows). The error in the console is:

downloadable font: rejected by sanitizer (font-family: "PT Serif" style:normal weight:bold stretch:normal src index:0) source: https://localhost:8443/project/fonts/2/pt-serif-v8-latin_latin-ext-700.eot

and the html text is rendered with a system font (Times New Roman) instead.

The relevant CSS is:

@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts//pt-serif-v8-latin_latin-ext-700.eot'); /* IE9 Compat Modes */
  src: local('PT Serif Bold'), local('PTSerif-Bold'),
       url('../fonts//pt-serif-v8-latin_latin-ext-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts//pt-serif-v8-latin_latin-ext-700.woff') format('woff'), /* Modern Browsers */
       url('../fonts//pt-serif-v8-latin_latin-ext-700.ttf') format('truetype'), /* Safari, Android, iOS */
}

If I remove both lines with eot, then it works correctly (web font is used).

The question is, why does it reject the entire font family when the problem is just with one format? I need eot for IE (strange, caniuse claims IE supports WOFF since v9, but it does not seem to work with my IE11).

I downloaded the font files thru https://google-webfonts-helper.herokuapp.com/fonts


Solution

  • The CSS line (the one with "Safari, Android, iOS") ends with a comma instead of semicolon. (blush)

    The correct (tested to work) version is:

    @font-face {
      font-family: 'PT Serif';
      font-style: normal;
      font-weight: 700;
      src: url('../fonts//pt-serif-v8-latin_latin-ext-700.eot'); /* IE9 Compat Modes */
      src: local('PT Serif Bold'), local('PTSerif-Bold'),
           url('../fonts//pt-serif-v8-latin_latin-ext-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
           url('../fonts//pt-serif-v8-latin_latin-ext-700.woff') format('woff'), /* Modern Browsers */
           url('../fonts//pt-serif-v8-latin_latin-ext-700.ttf') format('truetype'); /* Safari, Android, iOS */
    }