用另一种字体样式编号
我有一个带有阿拉伯语自定义字体的网页,但带有该字体的数字以阿拉伯语显示并且不清楚,所以我想用 Arial 字体(仅数字)显示它?
我用过但不工作:
@font-face {
font-family: Arial, Helvetica, sans-serif !important;
src: local("Arial"), local("Arial");
font-style: normal;
unicode-range: U+30-39;
}
回答
您需要命名您的 unicode-range 特定字体。
在排序中,我指示浏览器test为所有应用的字形使用字体,然后回退到Ballet
@import url('https://fonts.googleapis.com/css2?family=Ballet&display=swap');
@font-face {
font-family: 'test';
src: local("Arial");
font-style: normal;
unicode-range: U+30-39;
}
p {
font-size: 4em;
font-family: test, 'Ballet', cursive;
}
<p>Hi there! 1 2 3 4 5</p>