--- title: font-feature-settings slug: Web/CSS/font-feature-settings tags: - CSS - Fontes CSS - Propriedade CSS - Referencia translation_of: Web/CSS/font-feature-settings ---
A propriedade font-feature-settings
do CSS te dá controle sobre tipografia avançada nas fontes do tipo OpenType.
{{cssinfo}}
/* Use the default settings */ font-feature-settings: normal; /* Set values for OpenType feature tags */ font-feature-settings: "smcp"; font-feature-settings: "smcp" on; font-feature-settings: "swsh" 2; font-feature-settings: "smcp", "swsh" 2; /* Global values */ font-feature-settings: inherit; font-feature-settings: initial; font-feature-settings: unset;
normal
<feature-tag-value>
on
e off
são sinônimos de 1
e 0
respectivamente. Se nenhum valor é definido, o padrão é 1
. Para características OpenType não-booleanas (ex. stylistic alternates), o valor implica em um glifo particular para ser selecionado; para valores booleanos, é um interruptor.{{csssyntax}}
/* 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"; }
Especificacão | Estado | Comment |
---|---|---|
{{SpecName('CSS3 Fonts', '#propdef-font-feature-settings', 'font-feature-settings')}} | {{Spec2('CSS3 Fonts')}} | Initial definition |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Suporte básico |
16.0 {{property_prefix("-webkit")}} |
{{CompatGeckoDesktop("2.0")}} {{property_prefix("-moz")}} [1] |
10.0 | 15.0 {{property_prefix("-webkit")}} | {{CompatSafari("9.1")}} (partial support in versions 4.0-6.0) |
Feature | Android | Android Webview | Chrome para Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Suporte básico | {{CompatAndroid(4.4)}} | {{CompatChrome(48.0)}} (unprefixed) | {{CompatChrome(48.0)}} (unprefixed) |
{{CompatGeckoDesktop("2.0")}} {{property_prefix("-moz")}} [1] |
{{CompatUnknown}} | {{CompatOpera("24")}} | {{CompatSafari("9.3")}} (partial support in versions 3.2-6.1) |
[1] From Gecko 2.0 (Firefox 4.0) to Gecko 14.0 (Firefox 14.0) included, Gecko supported an older syntax, slightly different from the modern one: OpenType Font Feature support in Firefox 4.
[2] The ISO/IEC CD 14496-22 3rd edition suggests to use the ssty
feature to provide glyph variants adjusted to be 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. It also suggests applying the dtls
feature to letters when positing mathematical accent over it, in order 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 always override via CSS the default values determined by the MathML rendering engine.
[3] Starting with Firefox 34, the version prefixed with -moz-
is only kept for backward compatibility purpose. It is controlled by the layout.css.prefixes.font-features
, defaulting to true
. The prefixed property will be removed in the future.