--- title: font-feature-settings slug: Web/CSS/font-feature-settings tags: - CSS - CSS 字体 - CSS 属性 - 参考 translation_of: Web/CSS/font-feature-settings ---
font-feature-settings
属性用于控制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;
{{cssinfo}}
normal
<feature-tag-value>
/* 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 |
---|---|---|
{{SpecName('CSS3 Fonts', '#propdef-font-feature-settings', 'font-feature-settings')}} | {{Spec2('CSS3 Fonts')}} | Initial definition |
{{Compat("css.properties.font-feature-settings")}}