CSS字体系列无法在Firefox中运行

时间:2015-07-30 12:08:30

标签: html css firefox fonts

嘿,我在scss文件中有以下代码:

@font-face {
    font-family: 'tr-icon';
    src:url('../fonts/tr-icon.eot?88d087');
    src:url('../fonts/tr-icon.eot?#iefix88d087') format('embedded-opentype') ,
        url('../fonts/tr-icon.ttf?88d087') format('truetype') ,
        url('../fonts/tr-icon.woff?88d087') format('woff') ,
        url('../fonts/tr-icon.svg?88d087#trends') format('svg') ;
    font-weight: normal;
    font-style: normal;
}
[class^="tr-icon-"], [class*=" tr-icon-"] {
    font-family: 'tr-icon';
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
}

Firefox拒绝了以下错误:

downloadable font: rejected by sanitizer (font-family: "tr-icon" style:normal weight:normal stretch:normal src index:0)

我无法让它发挥作用。我尝试了https://jamie.curle.io/posts/firefox-font-rejected-by-sanitzer/https://github.com/Semantic-Org/Semantic-UI/issues/2121不同的解决办法,但似乎没有任何作用......还有其他想法吗?

1 个答案:

答案 0 :(得分:2)

你试过这个吗?

删除了每行末尾的查询字符串?

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

由于每个网址/路径末尾的查询字符串是您的字体被清理工具拒绝的原因。

相关问题