font-language-override - CSS: Cascading Style Sheets 编辑

The 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."

The 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.

Syntax

The font-language-override property is specified as the keyword normal or a <string>.

Values

normal
Tells the browser to use font glyphs that are appropriate for the language specified by the lang attribute. This is the default value.
<string>
Tells the browser to use font glyphs that are appropriate for the language specified by the string. The string must match a language tag found in the OpenType language system. For example, "ENG" is English, and "KOR" is Korean.

Formal definition

Initial valuenormal
Applies toall elements. It also applies to ::first-letter and ::first-line.
Inheritedyes
Computed valueas specified
Animation typediscrete

Formal syntax

normal | <string>

Examples

Using Danish glyphs

HTML

<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>

CSS

p.para1 {
  font-language-override: normal;
}

p.para2 {
  font-language-override: "DAN";
}

Result

Specifications

SpecificationStatusComment
CSS Fonts Module Level 4
The definition of 'font-language-override' in that specification.
Working DraftInitial definition.

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:102 次

字数:6287

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文