这篇翻译不完整。请帮忙从英语翻译这篇文章

font-feature-settings CSS属性可让您控制OpenType字体中的高级印刷功能。

语法

/* 默认设置 */
font-feature-settings: normal;

/* 设置OpenType功能标签的值 */
font-feature-settings: "smcp";
font-feature-settings: "smcp" on;
font-feature-settings: "swsh" 2;
font-feature-settings: "smcp", "swsh" 2;

/* 全局值 */
font-feature-settings: inherit;
font-feature-settings: initial;
font-feature-settings: unset;
Note: Web开发者应该尽可能的使用类似 font-variant 这样的短标记属性或者相关的速记标识属性等, 类似 font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position.

该属性是一个比较偏底层的功能接口,用于解决由于没有其他方法去访问和设置OpenType字体某些特性而无法解决一些特殊功能需求.

特别需要注意的是,该CSS属性不应该用来开启大写字母转换.

初始值normal
适用元素all elements. It also applies to ::first-letter and ::first-line.
是否是继承属性yes
适用媒体visual
计算值as specified
Animation typediscrete
正规顺序the unique non-ambiguous order defined by the formal grammar

normal
文本使用默认设置进行布局。
<feature-tag-value>
在呈现文本时,OpenType要素标记值的列表被传递到文本布局引擎以启用或禁用字体特征。标签始终是4个ASCII字符的 <string> 。如果是U + 20 - U + 7E代码点范围以外的字符或字符个数不对,则整个属性无效。 
值是一个正整数。两个关键字on和off分别是1和0的同义词。如果未设置任何值,则默认值为1.对于非布尔型OpenType功能(例如,文体替代),该值意味着要选择特定的字形;对于布尔值,它是一个开关。

形式语法

normal | <feature-tag-value>#

where
<feature-tag-value> = <string> [ <integer> | on | off ]?

实例

/* use small-cap alternate glyphs */
.smallcaps { font-feature-settings: "smcp" on; }

/* convert both upper and lowercase to small caps (affects punctuation also) */
.allsmallcaps { font-feature-settings: "c2sc", "smcp"; }

/* enable historical forms */
.hist { font-feature-settings: "hist"; }

/* disable common ligatures, usually on by default */
.noligs { font-feature-settings: "liga" 0; }

/* enable tabular (monospaced) figures */
td.tabular { font-feature-settings: "tnum"; }

/* enable automatic fractions */
.fractions { font-feature-settings: "frac"; }

/* use the second available swash character */
.swash { font-feature-settings: "swsh" 2; }

/* enable stylistic set 7 */
.fancystyle {
  font-family: Gabriola; /* available on Windows 7, and on Mac OS */
  font-feature-settings: "ss07";
}

规范

Specification Status Comment
CSS Fonts Module Level 3
font-feature-settings
Candidate Recommendation Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 48
Full support 48
Full support 16
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Edge Full support 15Firefox Full support 34
Notes
Full support 34
Notes
Notes The ISO/IEC CD 14496-22 3rd edition suggests using the ssty feature to provide glyph variants more suitable for use in scripts (for example primes used as superscripts). Starting with Firefox 29, this is done automatically by the MathML rendering engine. The ISO/IEC CD 14496-22 3rd edition also suggests applying the dtls feature to letters when placing mathematical accents to get dotless forms (for example dotless i, j with a hat). Starting with Firefox 35, this is done automatically by the MathML rendering engine. You can override the default values determined by the MathML rendering engine with CSS.
Full support 15
Prefixed Notes
Prefixed Implemented with the vendor prefix: -moz-
Notes From Firefox 4 to Firefox 14 (inclusive), Firefox supported an older, slightly different syntax. See OpenType Font Feature support in Firefox 4.
IE Full support 10Opera Full support 35
Full support 35
Full support 15
Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari Full support 9.1
Full support 9.1
No support 4 — 6
WebView Android Full support 4.4Chrome Android Full support 48Edge Mobile Full support YesFirefox Android Full support 34
Notes
Full support 34
Notes
Notes The ISO/IEC CD 14496-22 3rd edition suggests using the ssty feature to provide glyph variants more suitable for use in scripts (for example primes used as superscripts). Starting with Firefox 29, this is done automatically by the MathML rendering engine. The ISO/IEC CD 14496-22 3rd edition also suggests applying the dtls feature to letters when placing mathematical accents to get dotless forms (for example dotless i, j with a hat). Starting with Firefox 35, this is done automatically by the MathML rendering engine. You can override the default values determined by the MathML rendering engine with CSS.
Full support 15
Prefixed Notes
Prefixed Implemented with the vendor prefix: -moz-
Notes From Firefox 4 to Firefox 14 (inclusive), Firefox supported an older, slightly different syntax. See OpenType Font Feature support in Firefox 4.
Opera Android Full support YesSafari iOS Full support 9.3
Full support 9.3
No support 3.2 — 6.1
Samsung Internet Android Full support 5.0

Legend

Full support  
Full support
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

其他参考

文档标签和贡献者

此页面的贡献者: zxsunrise, ljyf5593, yuyx91
最后编辑者: zxsunrise,