css - 基于 WOFF 的字体在 Firefox 中不起作用,但在其他浏览器中正常

标签 css fonts truetype woff eot

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 文件是用 www. 调用的,我打开网站时没有 www.这就是为什么我总是把强制 www 的 .htaccess 行放在。如果缺少则添加,这是一个很好的做法。除了我错过了这个,因为我还没有启动它,我只是在测试和修补。

关于css - 基于 WOFF 的字体在 Firefox 中不起作用,但在其他浏览器中正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23483358/

相关文章:

c++ - SDL_FreeSurface 未释放 RAM/RAM 溢出

javascript - 为什么 window.onscroll 函数表现得很奇怪?

php - 我已经从数据库创建了这个表。现在如果有人更新了表中的值,它如何反射(reflect)回数据库中?

javascript - 在 Fabric.js 中使用远程网络字体初始化加载文本

html - 如何在 css 中使用 arial narrow?

fonts - 编辑 .ttf 字体文件以添加缺少的符号

javascript - Three.js 不拉伸(stretch)网格纹理(图像) - 使其覆盖其容器

IE 中的 CSS 圆 Angular

fonts - 在Mathematica中可以控制数字样式吗?

python - 在 Tkinter 中加载 TrueType 字体文件而不将其安装在字体文件夹中