【问题标题】:Font-Face is not working with Chrome字体无法与 Chrome 一起使用
【发布时间】:2014-02-10 04:35:44
【问题描述】:

我正在做一些前端项目,但我遇到了字体问题。该字体在 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

【问题讨论】:

标签: css sass font-face


【解决方案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;
}

【讨论】:

  • 确实如此!您在哪里找到此解决方案?
  • 在“fontsquirrel.com”(道具!)字体生成器提出这个解决方案之后,我使用这种方式。我还为您的演示测试了它,以防其他原因导致问题。
猜你喜欢
  • 1970-01-01
  • 2023-04-10
  • 1970-01-01
  • 1970-01-01
  • 2017-01-18
  • 1970-01-01
  • 1970-01-01
  • 2018-01-06
  • 2021-12-30
相关资源
最近更新 更多