【问题标题】:@font-face not working in IE, Firefox@font-face 在 IE、Firefox 中不起作用
【发布时间】:2012-06-27 15:54:05
【问题描述】:

我在 .NET 应用程序中使用从 Font Squirrel 生成的 @font-face。字体在本地渲染得很好。但是在发布应用程序时,它只能在服务器上的 Chrome 中运行,而不是 IE/Firefox。我正在使用所有最新版本。

我尝试弄乱 .htaccess 文件并在服务器的 Mime 类型中添加 .otf,但仍然遇到问题。

任何帮助都会很棒。

【问题讨论】:

  • 你有代码要显示吗?
  • @font-face { font-family: 'AsapRegular'; src: url('fonts/Asap-Regular-webfont.eot'); src: url('fonts/Asap-Regular-webfont.eot?#iefix') format('embedded-opentype'), url('fonts/Asap-Regular-webfont.woff') format('woff'), url('fonts/Asap-Regular-webfont.ttf') format('truetype'), url('fonts/Asap-Regular-webfont.svg#AsapItalic') format('svg'); font-weight: normal; font-style: normal; }

标签: fonts font-face windows-server


【解决方案1】:

如果有帮助,这是我用于 Font-Face 的格式:

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

【讨论】:

    【解决方案2】:

    这是我的代码:

    @font-face {
    font-family: 'AsapRegular';
    src: url('fonts/Asap-Regular-webfont.eot');
    src: url('fonts/Asap-Regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/Asap-Regular-webfont.woff') format('woff'),
         url('fonts/Asap-Regular-webfont.ttf') format('truetype'),
         url('fonts/Asap-Regular-webfont.svg#AsapItalic') format('svg');
    font-weight: normal;
    font-style: normal;
    

    }

    【讨论】:

      【解决方案3】:

      我发现了这个问题。当我通过 Visual Studio 发布应用程序时,它没有通过字体生成器创建的字体文件的 12/16。所以我将文件物理地放在了 Windows 服务器上。

      现在一切都像雨一样。

      【讨论】:

        【解决方案4】:

        我发现当通过 Visual Studio 发布 .NET 应用程序时,它并没有将 12/16 的字体文件移动到服务器。在我手动添加它们之后,一切正常。

        【讨论】:

          猜你喜欢
          • 2013-01-04
          • 2012-08-19
          • 2012-08-04
          • 1970-01-01
          • 2012-11-07
          • 1970-01-01
          • 1970-01-01
          • 2015-05-28
          • 1970-01-01
          相关资源
          最近更新 更多