1

我已经为网站上的许多字体实现了@font-face。这是一个托管在 IIS7 上的 asp 网站。目前我正在使用 FF23、Chrome、IE8/9/10 进行测试。我对 IE 中的字体有一些困难。当我没有从我的服务器访问网页时,字体将在 FF 和 Chrome 上正确呈现,但在所有 IE 浏览器上它们不会。当我在服务器(2008 r2)上访问网站时,我使用的是相同的 URL(完全限定的域名)。当我不在服务器上访问时,我使用的是相同的完全限定域名。字体和网站都托管在同一台机器(同一域)上。@font-face 在 FF 或 Chrome 中没有抛出错误,不知道如何签入 ie。

@font-face {
    font-family: 'sf_movie_posterregular';
    src: url('./fonts/customtitle-webfont.eot');
    src: url('./fonts/customtitle-webfont.svg#sf_movie_posterregular') format('svg'),
         url('./fonts/customtitle-webfont.eot?#iefix') format('embedded-opentype'),
         url('./fonts/customtitle-webfont.woff') format('woff'),
         url('./fonts/customtitle-webfont.ttf') format('truetype');

    font-weight: normal;
    font-style: normal;

}
4

2 回答 2

2

将 woff 作为矿类型添加到 IIS。(.woff, 应用程序/字体-woff)

转到 IIS 管理器,选择您的网站,然后从右侧选择 MIME 类型。

于 2013-09-05T21:06:40.620 回答
0

在将“本地”添加到字体后,它可以在所有浏览器中使用。

@font-face {
    font-family: 'sf_movie_posterregular';
    src: url('./fonts/customtitle-webfont.eot');
    src: local( 'sf_movie_posterregular'),
         url('./fonts/customtitle-webfont.svg#sf_movie_posterregular') format('svg'),
         url('./fonts/customtitle-webfont.eot?#iefix') format('embedded-opentype'),
         url('./fonts/customtitle-webfont.woff') format('woff'),
         url('./fonts/customtitle-webfont.ttf') format('truetype');

    font-weight: normal;
    font-style: normal;
于 2013-09-06T15:12:13.490 回答