仅为数字设置font-family

时间:2014-07-07 09:11:59

标签: html css fonts

在我的项目中,我设置了font-family: 'Droid Arabic Naskh'。 我有数字问题。数字将以阿拉伯语显示,但我希望数字以英语显示。 如何为仅显示英文数字的数字设置一种特殊字体?

我测试了这个:

@font-face {
    font-family: "Droid Arabic Naskh" !important;
    font-style: normal !important;
    font-weight: 400 !important;
    src: url("font-awesome/fonts/DroidNaskh-Regular.eot?#iefix") format("embedded-opentype"),
    url("font-awesome/fonts/DroidNaskh-Regular.woff") format("woff"),
    url("font-awesome/fonts/DroidNaskh-Regular.ttf") format("truetype") !important;
}

@font-face {
    font-family: "Droid Arabic Naskh" !important;
    font-style: normal !important;
    font-weight: 700 !important;
    src: url("font-awesome/fonts/DroidNaskh-Bold.eot?#iefix") format("embedded-opentype"),
    url("font-awesome/fonts/DroidNaskh-Bold.woff") format("woff"),
    url("font-awesome/fonts/DroidNaskh-Bold.ttf") format("truetype") !important;
}

@font-face {
    font-family: arial;
    src: url("font-awesome/fonts/arial.ttf") format("truetype") !important;
    unicode-range: U+30-39;
}

body{font-family:'Droid Arabic Naskh', arial }

1 个答案:

答案 0 :(得分:0)

我认为您必须定义两个范围:

@font-face {
    font-family: your_font;
    src: url("font-awesome/fonts/YOUR_FONT.ttf");
}
@font-face {
    font-family: your_font;
    src: url("font-awesome/fonts/arial.ttf");
    unicode-range: U+30-39;
}


body{font-family:'your_font' }