【问题标题】:WOFF based fonts are not working in Firefox, but fine in other browsers基于 WOFF 的字体在 Firefox 中不起作用,但在其他浏览器中很好
【发布时间】:2014-05-05 23:03:57
【问题描述】:

http://thereferraladvantage.com/preview/

base.css 中的 CSS:

@font-face {
  font-family: 'gotham';
  font-weight: 300;
  font-style: normal;
  src: url('../fonts/gotham_light.eot'); /* IE9 Compat Modes */
  src: url('../fonts/gotham_light.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/gotham_light.woff') format('woff'), /* Modern Browsers */
       url('../fonts/gotham_light.ttf')  format('truetype') /* Safari, Android, iOS */
       ;
}

@font-face {
  font-family: 'gotham';
  font-weight: 400;
  font-style: normal;
  src: url('../fonts/gotham_book.eot'); /* IE9 Compat Modes */
  src: url('../fonts/gotham_book.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/gotham_book.woff') format('woff'), /* Modern Browsers */
       url('../fonts/gotham_book.ttf')  format('truetype') /* Safari, Android, iOS */
       ;
}

@font-face {
  font-family: 'gotham';
  font-weight: 400;
  font-style: italic;
  src: url('../fonts/gotham_bookitalic.eot'); /* IE9 Compat Modes */
  src: url('../fonts/gotham_bookitalic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/gotham_bookitalic.woff') format('woff'), /* Modern Browsers */
       url('../fonts/gotham_bookitalic.ttf')  format('truetype') /* Safari, Android, iOS */
       ;
}


@font-face {
  font-family: 'gotham';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/gotham_medium.eot'); /* IE9 Compat Modes */
  src: url('../fonts/gotham_medium.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/gotham_medium.woff') format('woff'), /* Modern Browsers */
       url('../fonts/gotham_medium.ttf')  format('truetype') /* Safari, Android, iOS */
       ;
}



@font-face {
  font-family: 'gotham';
  font-weight: 500;
  font-style: italic;
  src: url('../fonts/gotham_mediumitalic.eot'); /* IE9 Compat Modes */
  src: url('../fonts/gotham_mediumitalic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('../fonts/gotham_mediumitalic.woff') format('woff'), /* Modern Browsers */
       url('../fonts/gotham_mediumitalic.ttf')  format('truetype') /* Safari, Android, iOS */
       ;
}

Firebug 显示浏览器正在调用 woff 和 tff 文件,两个文件的状态均为 200(OK)。我担心的是,它不应该只调用 WOFF,而不是恢复到 TTF 吗?

【问题讨论】:

    标签: css fonts truetype woff eot


    【解决方案1】:

    回答了我自己的问题。跨域嵌入是个问题。 .css 文件是用 www. 调用的,我在没有 www. 的情况下打开该站点。这就是为什么我总是放置强制 www 的 .htaccess 行。如果缺少,请添加,只是一个好习惯。除了我错过了这个,因为我还没有启动它,我只是在测试和修补。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-03
      • 2023-04-06
      • 1970-01-01
      • 2014-08-13
      • 1970-01-01
      相关资源
      最近更新 更多