Css 可变字体支持中的斜体
我无法使用web字体从普通字体切换到斜体 当我使用字体变化设置时,我只获得正常样式:Css 可变字体支持中的斜体,css,fonts,variable-fonts,Css,Fonts,Variable Fonts,我无法使用web字体从普通字体切换到斜体 当我使用字体变化设置时,我只获得正常样式: font-variation-settings: 'wght' 400, 'ital' 1; 我正在使用一种名为@font-ace的谷歌字体 以下是我如何在CSS中调用字体: @font-face { font-family: 'Petrona'; src: url('fonts/petrona/Petrona-VariableFont_wght.ttf') format('woff2 sup
font-variation-settings: 'wght' 400, 'ital' 1;
我正在使用一种名为@font-ace
的谷歌字体
以下是我如何在CSS中调用字体:
@font-face {
font-family: 'Petrona';
src: url('fonts/petrona/Petrona-VariableFont_wght.ttf') format('woff2 supports variations'),
url('fonts/petrona/Petrona-VariableFont_wght.ttf') format('woff2-variations');
font-weight: 1 900;
font-style: normal;
}
@font-face {
font-family: 'Petrona';
src: url('fonts/petrona/Petrona-Italic-VariableFont_wght.ttf') format('woff2 supports variations'),
url('fonts/petrona/Petrona-Italic-VariableFont_wght.ttf') format('woff2-variations');
font-weight: 1 900;
font-style: italic;
}
body {
font-family: Petrona;
font-variation-settings: 'wght' 400, 'ital' 1;
}
如果我删除第一个@font-face
声明,我会得到斜体字。。。但如果我尝试:
font-variation-settings: 'wght' 400, 'ital' 0;
我仍然得到斜体字
我读过,但我似乎看不出我错在哪里