自定义字体在移动设备上不起作用

乔治

@font-face为字体Rajdhani使用了CSS规则在台式机上完美运行,但在Android和IOS设备上却不行:

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/rajdhani-light.ttf") format("truetype"),
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/rajdhani-medium.ttf") format("truetype"),
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/rajdhani-regular.ttf") format("truetype"),
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/rajdhani-semibold.ttf") format("truetype"),
}

@font-face {
    font-family: "Rajdhani";
    src: url("/fonts/rajdhani-bold.ttf") format("truetype"),
}
卡纳尔

您还应该添加其他格式的文件,例如,转到在线Web字体生成器并转换字体,然后添加所有类型,因为这与操作系统有关

@font-face {
font-family: "CustomFont";
src: url("CustomFont.eot");
src: url("CustomFont.woff") format("woff"),
url("CustomFont.otf") format("opentype"),
url("CustomFont.svg#filename") format("svg");
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章