【发布时间】:2020-05-09 12:43:04
【问题描述】:
我正在阅读有关可变字体的信息,但我不明白这个概念。
有 5 个注册轴 wght、wdth、ital、slnt、opsz。字体粗细已经预先存在,我们每天都在 CSS 中使用它。
那么这里可变字体和常规字体有什么区别呢?
另外,如果我将font-weight: 100 500 的范围放在<p> 元素中,然后使用font-weight: 600,我看不出有任何区别。
即使我将其限制为 500,重量 600 仍然有效。
@font-face {
font-family: "sketch_3dregular";
src: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/57225/IBMPlexSansVar-Roman.woff2")
format("woff2 supports variations"),
url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/57225/IBMPlexSansVar-Roman.woff2")
format("woff2-variations");
font-weight: 100 500;
font-stretch: 85% 100%;
}
html {
font-size: 10px;
margin: 0;
font-family: "sketch_3dregular";
}
p {
font-size: 1.4rem;
line-height: 1.6;
word-spacing: 0.6rem;
font-weight: 600;
}
【问题讨论】:
标签: css font-face font-family typeface