这是不可能在HTML据我所知直接指定字形,但你可以通过CSS使用样式集等的OpenType功能font-feature-settings和font-variant.浏览器支持非常好.
例:
<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>
Run Code Online (Sandbox Code Playgroud)
MDN文章font-feature-settings:https://developer.mozilla.org/en/docs/Web/CSS/font-feature-settings
MDN文章font-variant:https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant
Thisarmy的'fontinfo'工具:http://code.thisarmy.com/fontsinfo/
| 归档时间: |
|
| 查看次数: |
2194 次 |
| 最近记录: |