答案 0 :(得分:5)
据我所知,不可能直接在HTML中指定字形,但您可以通过font-feature-settings
和font-variant
在CSS中使用样式集和其他OpenType功能。浏览器支持非常好。
示例:
<p>A quick brown fox jumps over the lazy dog.</p>
<p>A quick brown fox jumps over the lazy do<span class="ss01">g</span>.</p>
<style>
@import url('https://fonts.googleapis.com/css?family=Roboto+Slab:100');
body {
font-size: 48px;
text-align: center;
font-family: "Roboto Slab";
font-weight: 100;
font-style: normal;
}
.ss01 {
font-feature-settings: "ss01" 1;
}
</style>
关于font-feature-settings
的MDN文章:https://developer.mozilla.org/en/docs/Web/CSS/font-feature-settings
关于font-variant
的MDN文章:https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant
'fontinfo'工具:http://code.thisarmy.com/fontsinfo/