首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用@font-face对多个字体粗细使用多个文件

使用@font-face对多个字体粗细使用多个文件
EN

Stack Overflow用户
提问于 2017-02-08 20:42:22
回答 1查看 2.1K关注 0票数 1

我有多个字体文件,我需要它来映射到一些字体粗细。

代码语言:javascript
运行
复制
@font-face {
    font-family: "custom-font";
    src: url("font300.eot");
    src: url("font300.eot?#iefix") format("embedded-opentype"),
        url("font300.woff2") format("woff2"),
        url("font300.woff") format("woff"),
        url("font300.ttf") format("truetype"),
        url("font300.svg#font-300") format("svg");
    font-weight: 300, normal;
    font-style: normal;
}

@font-face {
    font-family: "custom-font";
    src: url("font500.eot");
    src: url("font500.eot?#iefix") format("embedded-opentype"),
        url("font500.woff2") format("woff2"),
        url("font500.woff") format("woff"),
        url("font500.ttf") format("truetype"),
        url("font500.svg#font500") format("svg");
    font-weight: 500, bold;
    font-style: normal;
}

我需要将字体粗细映射到数字和粗体/普通,这是可能的吗?这不管用。我不想复制整个字体块。

web需要哪些字体打字器?我可以省略一些吗?(eot、woff2、woff、ttf、svg)

谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-02-08 20:52:47

不需要这样做,字体粗度值自动解析为相应的数字,请参阅https://developer.mozilla.org/de/docs/Web/CSS/font-weight,因此只需为数字或速记制定规则即可。

字体类型取决于您要支持的客户端。有关对每种格式的支持,请参阅:

EOT:http://caniuse.com/#feat=eot

WOFF:http://caniuse.com/#feat=woff

WOFF2:http://caniuse.com/#feat=woff2

SVG:http://caniuse.com/#feat=svg-fonts

TTF/OTF:http://caniuse.com/#feat=ttf

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42113450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档