W3cubDocs

/CSS

font-language-override

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.

Initial value normal
Applies to all elements. It also applies to ::first-letter and ::first-line.
Inherited yes
Media visual
Computed value as specified
Animation type discrete
Canonical order the unique non-ambiguous order defined by the formal grammar

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 syntax

normal | <string>

Example

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

Specification Status Comment
CSS Fonts Module Level 3
The definition of 'font-language-override' in that specification.
Candidate Recommendation Initial definition.

Browser CompatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support No No 34
34
24 — 34
Disabled
Disabled From version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
4
Prefixed
Prefixed Requires the vendor prefix: -moz-
No No No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No No No 34
34
24 — 34
Disabled
Disabled From version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
4
Prefixed
Prefixed Requires the vendor prefix: -moz-
No No No

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/font-language-override