font-variation-settings
Quick Summary for font-variation-settings (@font-face)
The
font-variation-settings
CSS descriptor allows authors to specify low-level OpenType or TrueType font variations in the @font-face
rule.
Code Usage for font-variation-settings (@font-face)
/* Use the default settings */ font-variation-settings: normal; /* Set values for OpenType axis names */ font-variation-settings: "xhgt" 0.7;
More Details for font-variation-settings (@font-face)
font-variation-settings
The font-variation-settings
CSS descriptor allows authors to specify low-level OpenType or TrueType font variations in the @font-face
rule.
Syntax
/* Use the default settings */ font-variation-settings: normal; /* Set values for OpenType axis names */ font-variation-settings: "xhgt" 0.7;
Values
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.
Formal definition
Related at-rule | @font-face |
---|---|
Initial value | normal |
Computed value | as specified |
Formal syntax
normal | [ <string> <number> ]#
Examples
Setting font weight and stretch in a @font-face rule
@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; }
Specifications
Specification |
---|
CSS Fonts Module Level 4 # font-rend-desc |
See also
font-display
font-family
font-stretch
font-style
font-weight
font-variant
font-feature-settings
src
unicode-range
Last modified: Aug 12, 2021, by MDN contributors
Posted in
12:22 am, February 22, 2022
Add Comment
Other Items in CSS
rgb()
rgba()
:right
right
@right-bottom
:root
rotate
rotate()
rotate3d()
rotateX()
rotateY()
rotateZ()
row-gap
ruby-align
ruby-position
saturate()
scale
scale()
scale3d()
scaleX()
scaleY()
scaleZ()
:scope
scroll-behavior
scroll-margin
scroll-margin-block
scroll-margin-block-end
scroll-margin-block-start
scroll-margin-bottom
scroll-margin-inline
scroll-margin-inline-end
scroll-margin-inline-start
scroll-margin-left
scroll-margin-right
scroll-margin-top
scroll-padding
scroll-padding-block
scroll-padding-block-end
scroll-padding-block-start
scroll-padding-bottom
scroll-padding-inline
scroll-padding-inline-end
scroll-padding-inline-start
scroll-padding-left
scroll-padding-right
scroll-padding-top
scroll-snap-align
scroll-snap-stop
scroll-snap-type
@scroll-timeline