问题描述
我正在为使用自定义创建的Webfont的客户端开发项目.当我实现以下样式时,webfont会在Chrome,Safari,Firefox和Opera中显示正确的字距调整:
I am working on a project for a client that uses a custom created webfont. The webfont displays with correct kerning in Chrome, Safari, Firefox and Opera when I implement the following styles:
text-rendering: optimizeLegibility;
font-feature-settings: "kern";
在IE10/IE11中,无论是否使用上述样式,字体都不会显示正确的字距.我尝试了多种选择,但均未成功.对于每个MDN,IE10 +中都支持font-feature-settings属性.实际上,当我检查时,可以看到应用了font-feature-settings:kern,但是字距调整没有变化.任何建议将不胜感激,谢谢.
In IE10/IE11, the font does not display with correct kerning with or without the above styles. I have tried a variety of options without success. Per MDN, the font-feature-settings property is supported in IE10+. In fact, when I inspect I can see that the font-feature-settings: kern -- being applied but there is no change to the kerning. Any suggestions would be appreciated, thanks.
推荐答案
Microsoft的此主题的演示页面显示的语法与您使用的语法不同:
Microsoft's demo page on this subject shows a different syntax than you're using:
/* enable kerning data */
.kerning {
text-rendering: optimizeLegibility;
-moz-font-feature-settings: "kern=1";
-ms-font-feature-settings: "kern" 1;
}
请注意两个特定于MS的差异:
Note two MS-specific differences:
-
font-feature-settings
属性具有-ms-
前缀. - 值
"kern"
后跟空格和分号前的值.
- The
font-feature-settings
property has a-ms-
prefix. - The value
"kern"
is followed by a space and a value before the semicolon.
这篇关于webfont在IE10,IE11中有错误的字距调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!