仅在Firefox中下载某些字体时出现问题。:
这个字体工作正常:
@font-face
{
font-family:"Inconsolata";
src:url("/fonts/Inconsolata.ttf");
}
这不是:
@font-face
{
font-family:"MyriadPro-LightCond";
src:url("/fonts/MyriadProLightCond.otf");
}
添加格式不会有任何帮助:
@font-face
{
font-family:"MyriadPro-LightCond";
src:url("/fonts/MyriadProLightCond.otf") format("opentype");
}
我已尝试设置原始策略来修复localhost问题(我甚至将其发布到服务器):
security.fileuri.strict_origin_policy;false
这是控制台日志:
downloadable font: download failed (font-family: "MyriadPro-LightCond" style:normal weight:normal stretch:normal src index:0): status=2147746065
source: http://localhost/app/fonts/MyriadProLightCond.otf
同样,这只适用于某些字体。其他浏览器不抱怨。