首页 > 解决方案 > CSS3111:@font-face 遇到未知错误“在启用不受信任的字体阻止时,在 IE11 中由 icomoon 应用程序创建的图标抛出

问题描述

我通过 icomoon 创建了字体图标。并使用以下代码在网页的 CSS 中添加字体:

@font-face {
  font-family: 'xlfont';
  src: url('./images/spreadsheet/xlicons.eot?-dzszjm');
  src: url('./images/spreadsheet/xlicons.eot?#iefix-dzszjm') format('embedded-opentype'), 
  url('./images/spreadsheet/xlicons.woff?-dzszjm') format('woff'), 
  url('./images/spreadsheet/xlicons.woff') format('woff'), 
  url('./images/spreadsheet/xlicons.ttf?-dzszjm') format('truetype'), 
  url('./images/spreadsheet/xlicons.svg?-dzszjm#ssicons') format('svg');
  font-weight: normal;
  font-style: normal;
}

这在 IE11 中运行良好,直到我启用选项“<a href="https://support.microsoft.com/en-us/help/3053676/windows-10-technical-preview-adds-a-feature-that -blocks-untrusted-font" rel="nofollow noreferrer">不受信任的字体阻止”。启用此选项后,我收到以下错误。

CSS3111: @font-face encountered unknown error.
xlicons.eot

其他人有这样的问题吗?您能否提供任何建议以解决此问题?

标签: cssiconsinternet-explorer-11font-awesomefont-face

解决方案


尝试注释掉embedded-opentype声明行。如果这不起作用,请从堆栈上的另一个答案中考虑以下内容:

CSS3111 通常是由字体的二进制源问题引起的。例如,流行的在线 TTF 到 EOT 转换器之一生成带有不符合 Microsoft 标准的 NAME 表的 EOT 文件,这导致 EOT 字体永远不会在 IE 中加载并产生 CSS3111 错误。因此,当您体验 CSS3111 时,尝试使用不同的 TTF 到 EOT 转换器或字体生成器总是好的。

OG 问题:IE9 - CSS3111:@font-face 遇到未知错误

参考: http: //marinbezhanov.com/how-to-embed-webfonts-properly-and-how-to-solve-the-ambiguous-css3111-font-face-encountered-unknown-error/


推荐阅读