css 自定义字体不适用于移动的设备

jxct1oxe  于 2024-01-09  发布在  其他
关注(0)|答案(1)|浏览(157)

我已经使用CSS规则@font-face为我的字体Rajdhani.作品完美的桌面上,但不是在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"),
}

字符串

wvmv3b1j

wvmv3b1j1#

你应该添加其他格式的文件,例如,转到online web font generator并转换字体,然后添加所有类型,因为这与操作系统有关

@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");
}

字符串

相关问题