我想知道其他人是否遇到过这个问题 - @font-face 字体在 Chrome 中无法正确呈现,有时它们会,有时不会,这实际上是问题所在,因为我无法自己跟踪问题所在。在其他浏览器中一切都很好。我正在使用 Icomoon 字体及其语法:
@font-face {
font-family: 'entypo';
src:url('/fonts/entypo.eot');
src:url('/fonts/entypo.eot?#iefix') format('embedded-opentype'),
url('/fonts/entypo.svg#entypo') format('svg'),
url('/fonts/entypo.woff') format('woff'),
url('/fonts/entypo.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: 'entypo';
content: attr(data-icon);
speak: none;
font-weight: normal;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to have a class per icon */
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: 'entypo';
font-style: normal;
speak: none;
font-weight: normal;
-webkit-font-smoothing: antialiased;
line-height:1;
}
.htaccess 在字体文件夹中:
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
root .htaccess 具有相同的规则。
所以我不知道还有什么问题,并且弄乱了我的字体。非常感谢您的帮助!