CSS

字体变形的设置 | font-variation-settings

font-variation-settings

font-variation-settingscss属性提供了对OpenType或TrueType字体变化的低级控制,方法是指定您想要更改的功能的四个字母轴名称以及它们的变化值。

/* Use the default settings */ font-variation-settings: normal; /* Set values for OpenType axis names */ font-variation-settings: "XHGT" 0.7; /* Global values */ font-variation-settings: inherit; font-variation-settings: initial; font-variation-settings: unset;

font-feature-settings在更低的层次上工作,而不是允许您指定字体特征标签和值。

注:只要有可能,Web作者应该使用其他控制字体显示的方法,如font-variant速记属性或相关的长时间财产。此属性是一个低级特性,用于处理没有其他方式启用或访问OpenType字体功能的特殊情况。

初始值normal
应用于all elements. It also applies to ::first-letter and ::first-line.
继承yes
适用媒体visual
计算值as specified
动画类型a transform
规范顺序per grammar

语法

此属性可以采取以下两种形式之一:

  • 关键字值normal

  • 或者是<string>后面是<number>.这可能会重复,<string> <number>用逗号分隔的元组。

如果<string>在U+20-U+7e码点范围外有或多或少的字符或包含字符,整个属性无效。大<number>可以是小数,也可以是负数。

取值

normal使用默认设置布局文本。

形式语法

normal | [ <string> <number> ]#

实例

TBD

规范

SpecificationStatusComment
CSS Fonts Module Level 4The definition of 'font-variation-settings' in that specification.Editor's DraftInitial definition

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support59.0.?53.0 (53.0)???

FeatureAndroidAndroid WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support????53.0 (53.0)???