This can be done using CSS's unicode-range
property which exists within @font-face
.
The numbers 0 to 9 exist in Unicode within the range U+0030
to U+0039
. So what you'll need to do is include a font alongside your existing font which specifically targets this range:
@font-face {
font-family: 'My Pre-Existing Font';
...
}
@font-face {
font-family: 'My New Font Which Handles Numbers Correctly';
...
unicode-range: U+30-39;
}
The result of this will be that every instance of Unicode characters U+0030
(0) through to U+0039
(9) will be displayed in the font which specifically targets that range, and every other character will be in your current font.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…