The font-feature-settings property gets or sets one or more values that specify glyph substitution (special font characters such as ligatures and figures) and positioning in fonts that include OpenType layout features.
Overview tablenormal
fontFeatureSettings
font-feature-settings: "OpenType feature tag" Indicator
font-feature-settings: normal
A selection of examples showing some typical uses of the font-feater-settings property.
<p class="smallcaps">Small caps</p>
<p class="ligatures">Ligatures</p>
@font-face {
font-family: 'myMinion';
src: url('MinionPro-Regular.otf') format('opentype');
}
body {
font-family: myMinion;
}
p.smallcaps { font-feature-settings: "smcp" 1; }
p.ligatures{ font-feature-settings: "liga" on; }
Notes
OpenType specification defines many advanced typographic features that can be implemented by font designers. For instance, you can define vertical positioning for a font, substitute glyph forms with ligatures, contextual alternates, stylistic alternates, or swashes, include a set of small caps, and more.
Each defined feature has a corresponding feature tag that identifies its function and effects. Font developers can also define their own features. A feature’s tag determines what the feature does and whether to implement it. The following table lists some of the most common feature tags and their definitions.
For the full list of OpenType layout features, see OpenType layout feature tag registry.
kern
— Kerningsmcp
— Small capitalsliga
— Standard ligaturesdlig
— Discretionary ligaturesss01
, ss02
, ss03
… ss20
— Stylistic sets (font-specific)swsh
— Swashtnum
— Tabular figureslnum
— Lining figuresonum
— Oldstyle figuresIf you are unfamiliar with the font features listed above, the CSS Fonts Module Level 3 specification has good explanations and visual examples of each feature in Section 6, "Font feature properties." Be aware that, though the properties listed correspond to OpenType layout features that might be supported, the properties themselves (font-kerning, font-variant-*, and so on) are not supported.
Whenever possible, Web authors should use the font-variant
property. This property has been designed to handle special cases where no other way to enable or access an OpenType font feature exists.
font-feature-settings
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4