IE 11:在我自己的代码中出现CSS3111错误,google.com/fonts不显示任何字体 [英] IE 11: error CSS3111 in my own code, and google.com/fonts doesn't render any fonts
问题描述
我正在开发一个使用Google字体 Open Sans
的网站:
code>< link href ='https://fonts.googleapis.com/css?family = Open + Sans:400,300,300italital,400italic,600,600italic,700italic,800italic,800,700'rel ='stylesheet'type = 'text / css'>
通常情况下,我在使用Chrome时使用我的网站,但今天我决定看看它的外观IE 11(11.0.10240.16431)。不幸的是, Open Sans
没有被正确加载和呈现。我在开发人员工具控制台中看到很多这些错误:
CSS3111:@ font-face遇到未知错误。
PRmiXeptR36kaC0GEAetxjqR_3kx9_hJXbbyU8S6IN0.woff
想到这很奇怪 - 我以前开发了一个网站加载Google字体在IE 10中正常 - 我前进到
Google字体在IE 11中被破坏了吗?字体在Edge,Chrome,Firefox等中正确加载。我对如何继续在IE中使这些字体工作感到失落。
UPDATE 1
在IE 11中将模拟文档模式设置为8会导致字体正确呈现。 IE 9+仍然展示相同的问题,但是。这是Google的某种不正确的用户代理字符串处理吗?
UPDATE 2
我去了 FontSquirrel 并下载了Open Sans的所有格式。我还导入了ZIP中提供的CSS。不幸的是,IE和现在Firefox继续报告,字体不能使用。 Firefox表示可下载的字体:平台无法使用
UPDATE 3 >
我已经确认IE的所有安全区域的字体下载设置已设置为启用。
对我来说,这个问题是由Windows 10功能不受信任的字体锁定引起的。
使用此功能,您可以开启全局设置,停止用户访问加载由图形设备接口(GDI)处理的不受信任的字体。不受信任的字体是在%windir%/ Fonts目录外安装的任何字体。 https://support.microsoft.com/en-us/kb/3053676
使用组策略禁用不受信任的字体锁定:
- 打开组策略管理编辑器
- 在本地计算机策略下,展开计算机配置,展开管理模板,展开系统,然后单击缓解选项。 / li>
- 在不受信任的字体屏蔽设置中,选择不要屏蔽不受信任的字体
使用注册表编辑器禁止使用不受信任的字体:
- 打开注册表编辑器(regedit.exe),并转到以下注册表子项:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel\ - 如果MitigationOptions键不存在,请右键单击并添加一个新的QWORD 64位)值,将其命名为MitigationOptions。
- 要关闭此功能。 重要:需要重新启动计算机才能使更改生效 。
I am developing a website that uses the Google font
Open Sans
like so:<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700italic,800italic,800,700' rel='stylesheet' type='text/css'>
Normally, I use Chrome when working with my website, but today I decided to see how it looks in IE 11 (11.0.10240.16431) on Windows 10. Unfortunately,
Open Sans
isn't being loaded and rendered properly. I see lots of these errors in the Developer Tools console:CSS3111: @font-face encountered unknown error. PRmiXeptR36kaC0GEAetxjqR_3kx9_hJXbbyU8S6IN0.woff
Thinking that was strange--I had previously developed a site that loaded Google Fonts just fine in IE 10--I headed on over to https://www.google.com/fonts. More
CSS3111
errors, with every custom font being displayed inserif
instead:Is Google Fonts simply broken for IE 11? The fonts do load correctly in Edge, Chrome, Firefox, etc. I am at a loss for how to proceed to get these fonts to work in IE.
UPDATE 1
Setting the emulated document mode to 8 in IE 11 causes the fonts to render correctly. IE 9+ still exhibited the same issues, however. Is this some kind of incorrect user agent string processing by Google, perhaps?
UPDATE 2
I went to FontSquirrel and downloaded Open Sans in all its formats. I also imported the CSS provided in the ZIP. Unfortunately, IE and now Firefox continue to report that the font can't be used. Firefox says
downloadable font: not usable by platform
.UPDATE 3
I've confirmed that IE's Font download setting is set to Enabled for all security zones.
解决方案For me, this issue was caused by a Windows 10 feature called Untrusted Font Blocking. My office network had this turned on in our group policy settings.
Using this feature, you can turn on a global setting that stops users from loading untrusted fonts that are processed by the Graphics Device Interface (GDI). Untrusted fonts are any fonts that are installed outside the %windir%/Fonts directory. https://support.microsoft.com/en-us/kb/3053676
To disable Untrusted Font Blocking using Group Policy:
- Open Group Policy Management Editor
- Under Local Computer Policy, expand Computer Configuration, expand Administrative Templates, expand System, and then click Mitigation Options.
- In the Untrusted Font Blocking setting select Do not block untrusted fonts
To disable Untrusted Font Blocking using Registry Editor:
- Open Registry Editor (regedit.exe) and go to the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel\
- If the MitigationOptions key is not there, right-click and add a new QWORD (64-bit) Value, naming it as MitigationOptions.
- To turn this feature off. Type 2000000000000.
IMPORTANT: A computer restart is required for the changes to take effect
这篇关于IE 11:在我自己的代码中出现CSS3111错误,google.com/fonts不显示任何字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!