我们的webdesigner创建了一个带有以下font-face的CSS:
@font-face {
font-family: 'oxygenregular';
src: url('oxygen-regular-webfont.eot');
src: url('oxygen-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('oxygen-regular-webfont.woff') format('woff'),
url('oxygen-regular-webfont.ttf') format('truetype'),
url('oxygen-regular-webfont.svg#oxygenregular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
它适用于IE和Firefix.但是有一个问题:在IE上,只有当我使用内部网页链接导航页面时才能正确呈现字体.如果我点击"刷新"或"返回"按钮,则字体将被默认字体(Times New Roman)替换.
目前该网站使用的是HTTPS,但在使用HTTP时遇到了同样的问题.
当我使用内部网站链接导航时,在IE Developer工具的网络选项卡(Shift-F12)中,我看到以下内容:
/Content/oxygen-regular-webfont.eot? GET 200 application/vnd.ms-fontobject
Run Code Online (Sandbox Code Playgroud)
当我使用刷新/返回按钮时,还有两个其他字体的条目:
/Content/oxygen-regular-webfont.woff GET 200 application/x-font-woff
/Content/oxygen-regular-webfont.ttf GET 200 application/octet-stream
Run Code Online (Sandbox Code Playgroud)
CSS文件本身以下列方式加载:
/Content/site.css GET 200 text/css
Run Code Online (Sandbox Code Playgroud)
我试图删除woff和ttf所以我有以下内容:
@font-face {
font-family: 'oxygenregular';
src: url('oxygen-regular-webfont.eot');
src: url('oxygen-regular-webfont.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
但仍然IE的行为方式相同(除了它不再下载woff和ttf):在浏览Back/Refresh时显示不正确的回退字体.
如何使IE在刷新/返回操作上加载正确的字体?