Google字体无法在FireFox上呈现

时间:2017-05-20 08:55:59

标签: html css firefox fonts

我在样式表上使用谷歌字体如下:

@import url('https://fonts.googleapis.com/css?family=Roboto');
@import url('https://fonts.googleapis.com/css?family=Oswald');

.font1{
    font-family: 'Roboto', sans-serif !important;
}

.font2{
    font-family: 'Oswald', sans-serif !important;
}

和我的HTML

<p class="font1">Some text here</p>

文字在Chrome和IE上以适当的字体呈现,无法在Firefox上呈现。我检查了Firefox上的DOM Inspector上的Font部分,它正确显示如下

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  src: local("Roboto"), local("Roboto-Regular"), url("https://fonts.gstatic.com/s/roboto/v16/CWB0XYA8bzo0kSThX0UTuA.woff2") format("woff2");
  unicode-range: U+0-FF, U+131, U+152-153, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}

可能是什么原因?帮助赞赏。

1 个答案:

答案 0 :(得分:0)

Font Awesome not working in Firefox & IE

查看上面的问题。这个问题似乎有一个可行的解决办法。

  

如果您希望Firefox在计算机上安装时使用该字体,则需要添加本地规则。请参阅https://developer.mozilla.org/Web/CSS/@font-face

@font-face { font-family: 'FontAwesome'; src: local(''FontAwesome'); }