我的网页显示波斯语文本,如预期一样使用Yekan字体。为什么英文文本不正确地使用Alger以外的字体?
@font-face { <!-- Persian Font -->
font-family: Yekan;
src: url(Fonts/BYekan.ttf);
unicode-range:U+0600-06FF;
}
@font-face { <!-- English Font -->
font-family: Alger;
src: url(Fonts/ALGER.TTF);
unicode-range: U+0020-007F;
}发布于 2015-08-29 16:24:50
只能向元素添加一种字体。
花招:试着给他们取同样的名字:
@font-face { /* Persian Font */
font-family: 'MyFont';
src: url(Fonts/BYekan.ttf);
unicode-range: U+0600-06FF;
}
@font-face { /* English font */
font-family: 'MyFont';
src: url(Fonts/ALGER.TTF);
unicode-range: U+0020-007F;
}用法:
body {
font-family: 'MyFont';
}这应该可以解决你的问题,但我不能测试它,因为我是在手机上。
https://stackoverflow.com/questions/32287257
复制相似问题