The font-variation-settings
CSS descriptor allows authors to specify low-level OpenType or TrueType font variations in the @font-face
rule.
The font-variation-settings
CSS descriptor allows authors to specify low-level OpenType or TrueType font variations in the @font-face
rule.
/* Use the default settings */ font-variation-settings: normal; /* Set values for OpenType axis names */ font-variation-settings: "xhgt" 0.7;
normal
Text is laid out using default settings.
<string> <number>
When rendering text, the list of OpenType axis names is passed to the text layout engine to enable or disable font features. Each setting is always a <string>
of 4 ASCII characters, followed by a <number>
indicating the axis value. If the <string>
has more or fewer characters or contains characters outside the U+20 - U+7E codepoint range, the whole property is invalid. The <number>
can be fractional or negative.
Related at-rule | @font-face |
---|---|
Initial value | normal |
Computed value | as specified |
@font-face { font-family: "OpenTypeFont"; src: url("open_type_font.woff2") format("woff2"); font-weight: normal; font-style: normal; font-variation-settings: "wght" 400, "wdth" 300; }
Specification |
---|
CSS Fonts Module Level 4 # font-rend-desc |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
font-variation-settings |
No | No | 62 | No | No | No | No | No | 62 | No | No | No |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-variation-settings