Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. CSS
  3. Reference
  4. Properties
  5. font-language-override

font-language-override

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Thefont-language-overrideCSS property controls the use of language-specific glyphs in a typeface.

By default, HTML'slang attribute tells browsers to display glyphs designed specifically for that language. For example, a lot of fonts have a special character for the digraphfi 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."

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

css
/* 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: inherit;font-language-override: initial;font-language-override: revert;font-language-override: revert-layer;font-language-override: unset;

Thefont-language-override property is specified as the keywordnormal or a<string>.

Values

normal

Tells the browser to use font glyphs that are appropriate for the language specified by thelang 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 theOpenType language system. For example, "ENG" is English, and "KOR" is Korean.

Formal definition

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

Formal syntax

font-language-override =
normal|
<string>

Examples

Using Danish glyphs

HTML

html
<p>Default language setting.</p><p>  This is a string with the <code>font-language-override</code> set to Danish.</p>

CSS

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

Result

Specifications

Specification
CSS Fonts Module Level 4
# font-language-override-prop

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp