【问题标题】:font-face doesn't appear to be working in IE8?font-face 似乎在 IE8 中不起作用?
【发布时间】:2012-03-20 00:29:17
【问题描述】:

我的 CSS 中有以下几行。

@font-face { font-family: Keffeesatz; src: url(/Styles/YanoneKaffeesatz-Light.otf) format("opentype") }
@font-face { font-family: KeffeesatzBold; src: url(/Styles/YanoneKaffeesatz-Bold.otf) format("opentype") }

在 IE9 中,这些显示。在 IE8 中,它使用备用字体 Arial。如何让它在 IE8 中工作?

【问题讨论】:

  • 尝试通过fontsquirrel's generator 运行您的字体,看看它会产生什么效果。要使自定义字体跨浏览器工作,您需要有多种格式的字体。
  • 看起来 fontsquireel 的生成器不适合我。上传文件后,它仍然说我没有上传文件,并且它提供的下载中没有字体。我已经尝试过使用 FireFox 10 和 IE8。今晚回家后我会尝试使用其他浏览器。
  • FontSquirrel 的网站今天对我来说真的非常非常慢。我想知道他们是否有一些问题。您还可以查看一些google web fonts 以了解他们的工作方式。
  • @GGG:是的,有一段时间服务器出了点问题,但又回来了。

标签: css internet-explorer-8 font-face opentype


【解决方案1】:

您需要提供字体的 EOT 版本,以便旧版本的 IE 嵌入它。他们不会识别任何其他格式,这就是您观察到 Arial 的回退的原因。

将您的字体带到Font Squirrel @font-face Generator,它会为您准备好一切,包括一组新的 CSS @font-face 规则,用于覆盖您现有的规则。

【讨论】:

  • 终于让字体松鼠为我工作了。喜欢输出!极好的!谢谢!
【解决方案2】:

Internet Explorer 无法识别您在 CSS3 中的 .ttf (TrueType) 或 .otf (OpenType) 字体,至少目前还没有。 IE 识别 .eot(嵌入式开放类型)。

@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
     url('webfont.woff') format('woff'), /* Modern Browsers */
     url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
     url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

看看here

【讨论】:

  • 可以,但不是 ie9 兼容模式
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-08-25
  • 1970-01-01
  • 1970-01-01
  • 2012-06-03
  • 1970-01-01
相关资源
最近更新 更多