font-variation-settings
font-variation-settings は CSS の記述子で、 @font-face ルールの中で OpenType または TrueType の低レベルのフォントバリエーションを指定することができます。
構文
css
/* 既定の設定を使用 */
font-variation-settings: normal;
/* OpenType 軸名の値を設定 */
font-variation-settings: "xhgt" 0.7;
値
公式定義
| 関連するアット規則 | @font-face |
|---|---|
| 初期値 | normal |
| 計算値 | 指定通り |
形式文法
例
@font-face ルール内でフォントの太さと幅を設定
css
@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 |
ブラウザーの互換性
BCD tables only load in the browser