特殊字符上的后备字体 [英] Fallback fonts on special characters
问题描述
我想知道是否可以,当使用@ font-face时,有一个回退设置,如果我的页面上的文本包含字体(例如日语字符)中没有考虑的字符,只有那些字符以一种基本字体显示,每隔一个字符保留为自定义字体?
我想像一个段落中可能会混合使用两种字体
您所描述的是浏览器的默认行为 - 它应该自然地回退到缺少字符的基本字体。
但是,有时自定义字体使用空白字符,在这种情况下,您可以尝试使用 unicode-range
p>
例如:
@ font-face {
字体家庭:BBCBengali
src:url(fonts / BBCBengali.ttf)format(opentype);
unicode-range:U + 00-FF;
}
Unfortunatelly there是浏览器支持问题。
I was wondering if it's possible to, when using @font-face, have a fallback setup so that if the text on my page contains characters that are not accounted for within the font (Japanese characters for example), only those characters are presented in a basic font and every other character remains as the custom font?
I'm imagining that potentially there'd be a mix of two fonts within one paragraph on occasion.
What you described is the default behaviour of a browser - it should naturally fall back to basic font for missing characters.
However, sometimes custom fonts use blank characters, in that case you can try using the unicode-range
For example:
@font-face {
font-family: BBCBengali;
src: url(fonts/BBCBengali.ttf) format("opentype");
unicode-range: U+00-FF;
}
Taken from this interesting article: Creating Custom Font Stacks with Unicode-Range
Unfortunatelly there are browser support issues.
这篇关于特殊字符上的后备字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!