Firefox webfonts not loading

前端 未结 7 896
既然无缘
既然无缘 2021-01-03 22:30

I\'m having an issue with webfonts only in Firefox, all other browsers (including IE) work perfectly.

My issues is that the webfonts won\'t load at all.

I\'v

7条回答
  •  礼貌的吻别
    2021-01-03 23:27

    Ha, I sat for ages trying to figure this out - for me, the fix was in calling each src separately - i.e, instead of this (fontsquirrel generated code):

    @font-face {
        font-family: 'comic_bookregular';
        src: url('comic_book-webfont.eot');
        src: url('comic_book-webfont.eot?#iefix') format('embedded-opentype'),
             url('comic_book-webfont.svg#comic_bookregular') format('svg');
             url('comic_book-webfont.woff') format('woff'),
             url('comic_book-webfont.ttf') format('truetype'),
    
    font-weight: normal;
    font-style: normal;
    
    }
    

    I did this:

    @font-face {
      font-family: 'comic_bookregular';
        src: url('../fonts/comic_book-webfont.eot');
        src: url('../fonts/comic_book-webfont.eot?#iefix') format('embedded-opentype');
        src: url('../fonts/comic_book-webfont.svg#comic_bookregular') format('svg');
        src: url('../fonts/comic_book-webfont.woff') format('woff');
        src: url('../fonts/comic_book-webfont.ttf') format('truetype');
    
      font-weight: normal;
      font-style: normal;
    
      }
    

    If you look, the fontsquirrel code actually has a ';' where there should be a ',' but just fixing that didn't help. For some reason, closing all the src's with semi-colons did the job when nothing else would.

提交回复
热议问题