Font-Face无法使用Chrome

时间:2014-02-09 18:00:51

标签: css sass font-face

我正在研究一些前端项目,我遇到了font-face的问题。 Firefox的字体还可以,但Chrome看起来很难看,就像Time News Roman ..

以下代码用于将字体导入我的Sass项目:

@font-face {
  font-family: 'aHeadline';
  src: local(' Headline'),
  url('../fonts/headline.woff') format('woff'),
  url('../fonts/headline.ttf') format('truetype'),
  url('../fonts/headline.svg') format('svg');
  src: url('../fonts/headline.eot') format('embedded-opentype');
  font-weight: normal;
  font-style: normal;
}

以下是现场演示http://185.13.36.42/T/foo.html

注意:字体来自Font Squirrel webfont generator

1 个答案:

答案 0 :(得分:1)

只需稍微改变语法。这对你有用:

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