font-language-override
CSS property controls the use of language-specific glyphs in a typeface.
/* Keyword value */ font-language-override: normal; /* <string> values */ font-language-override: "ENG"; /* Use English glyphs */ font-language-override: "TRK"; /* Use Turkish glyphs */ /* Global values */ font-language-override: initial; font-language-override: inherit; font-language-override: unset;
By default, HTML's
lang
attribute tells browsers to display glyphs designed specifically for that language. For example, a lot of fonts have a special character for the digraph
fi
that merge the dot on the "i" with the "f." However, if the language is set to Turkish the typeface will likely know not to use the merged glyph; Turkish has two versions of the "i," one with a dot (
i
) and one without (
ı
), and using the ligature would incorrectly transform a dotted "i" into a dotless "i."
font-language-override
property lets you override the typeface behavior for a specific language. This is useful, for example, when the typeface you're using lacks proper support for the language. For instance, if a typeface doesn't have proper rules for the Azeri language, you can force the font to use Turkish glyphs, which follow similar rules.
font-language-override
property is specified as the keyword
normal
或
<string>
.
normal
lang
attribute. This is the default value.
<string>
| 初始值 |
normal
|
|---|---|
| 适用于 |
所有元素。它还适用于
::first-letter
and
::first-line
.
|
| 继承 | yes |
| 计算值 | 如指定 |
| 动画类型 | discrete |
normal | <string>
<p class="para1">Default language setting.</p>
<p class="para2">This is a string with the <code>font-language-override</code> set to Danish.</p>
p.para1 {
font-language-override: normal;
}
p.para2 {
font-language-override: "DAN";
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Fonts Module Level 4
The definition of 'font-language-override' in that specification. |
工作草案 | 初始定义。 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
font-language-override
|
Chrome 不支持 No | Edge 不支持 No |
Firefox
完整支持
34
|
IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No |
Firefox Android
完整支持
34
|
Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
完整支持
不支持
用户必须明确启用此特征。
要求使用供应商前缀或不同名称。
font-variant
,
font-variant-position
,
font-variant-east-asian
,
font-variant-caps
,
font-variant-ligatures
,
font-variant-numeric
,
font-variant-alternates
,
font-synthesis
,
font-kerning
.
font
font-family
font-feature-settings
font-kerning
font-language-override
font-optical-sizing
font-size
font-size-adjust
font-smooth
font-stretch
font-style
font-synthesis
font-variant
font-variant-alternates
font-variant-caps
font-variant-east-asian
font-variant-ligatures
font-variant-numeric
font-variant-position
font-variation-settings
font-weight
line-height
line-height-step