我从http://www.google.com/webfonts嵌入了三个Google字体(Dosis,Open Sans,Lato)
除了IE9之外,它们都能正常工作:
CSS3111: @font-face encountered unknown error.
2HG_tEPiQ4Z6795cGfdivPY6323mHUZFJMgTvxaG2iE.eot
CSS3111: @font-face encountered unknown error.
KlmP_Vc2zOZBldw8AfXD5g.eot
CSS3111: @font-face encountered unknown error.
zLhfkPOm_5ykmdm-wXaiuw.eot
并偶尔打破整个网站 .
可以做些什么来解决这个问题?
6 回答
当您使用desubroutinized字体时也会发生此错误,没有任何版本的Internet Explorer似乎能够处理 .
如果使用fonttools包中的pyftsubset生成字体文件,请确保未设置
--desubroutinize
标志 .我找到了这个答案,它比接受的答案更直接地解决了这个问题,这真的,不应该是答案:)
资料来源:http://www.marinbezhanov.com/web-development/16/how-to-embed-webfonts-properly-and-how-to-solve-the-ambiguous-css3111-font-face-encountered-unknown-error/
我使用下面的
@font-face
解决了IE 9上的问题:我们发现由于新的Windows 10策略,您会收到相同的错误 . 如果在Windows 10 IE11上发生错误,解决方案可以是:
IE 11: error CSS3111 in my own code, and google.com/fonts doesn't render any fonts
评论EOT字体的第二个源声明对我有用 . 确保你在第一个声明“src:url(”../ fonts / webfonts / Helvetica Neue.eot“);”
在Chrome,Firefox,Sarafi,IE9-10-11上测试过 .
希望以下注释对您有用:
<IfModule mod_headers.c> Headers 集Access-Control-Allow-Origin http://mydomain.com“ </ IfModule>配置 </ FilesMatch>
See the reference