gpt4 book ai didi

css - @font-face EOT 不通过 HTTPS 加载

转载 作者:数据小太阳 更新时间:2023-10-29 09:11:03 25 4
gpt4 key购买 nike

总结

我在 IE 7、8、9 中通过 HTTPS 使用 @font-face 时遇到问题 - 它根本没有加载。包含的 HTML 页面是否托管在 HTTPS 上并不重要,当我尝试通过 HTTP 加载 EOT 字体时它可以工作,而 HTTPS 则不能。有人见过这种行为吗?

托管字体的服务器正在发送正确的 content-type="application/vnd.ms-fontobject"

我试过多种字体,所以不是特定于字体。

字体生成于 Font Squirrel

CSS 语法

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

示例页面

http://gregnettles.net/dev/font-face-test.html

最佳答案

我在使用 HTTPS 时遇到了这个问题,但 HTTP 没有。出于某种原因,IE 会继续使用不同的字体选项,而忽略 200 OK 响应。

在我的例子中,问题出在字体的 HTTP header Cache-Control: no-cache 上。虽然这适用于 HTTP,但在 HTTPS 上它会导致 Internet Explorer 忽略下载的字体。

我最好的猜测是这是这种行为的变体:

KB 815313 - Prevent caching when you download active documents over SSL (archive)

因此,如果您看到 IE 在开发人员工具 WebView 中处理每种字体,可能值得检查您是否有 Cache-Control header 并将其删除。

关于css - @font-face EOT 不通过 HTTPS 加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7748140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com