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>
<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.
| 相关 at-rule |
@font-face
|
|---|---|
| 初始值 |
normal
|
| 计算值 | 如指定 |
normal | [ <string> <number> ]#
@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;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Fonts Module Level 4
The definition of 'font-variation-settings' in that specification. |
工作草案 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
font-variation-settings
|
Chrome 完整支持 62 | Edge 完整支持 79 |
Firefox
完整支持
62
|
IE 不支持 No | Opera 完整支持 49 | Safari 不支持 No | WebView Android 完整支持 62 | Chrome Android 完整支持 62 |
Firefox Android
完整支持
62
|
Opera Android 完整支持 46 | Safari iOS 不支持 No | Samsung Internet Android 完整支持 8.0 |
完整支持
不支持
用户必须明确启用此特征。
font-display
font-family
font-stretch
font-style
font-weight
font-variant
font-feature-settings
src
unicode-range
font
font-family
font-feature-settings
font-kerning
font-language-override
font-optical-sizing
font-size
font-size-adjust
font-smooth
font-stretch
font-style
font-synthesis
font-variant
font-variant-alternates
font-variant-caps
font-variant-east-asian
font-variant-ligatures
font-variant-numeric
font-variant-position
font-variation-settings
font-weight
line-height
line-height-step