CSS font-language-override Property
The font-language-override CSS property allows to specify the language system of the font. See the values and try examples.
The font-language-override property controls the use of language-specific glyphs. This property can be specified by two values: normal and <string>. The <string> must match a valid BCP 47 language tag. For example, tr for Turkish.
By default, the HTML lang attribute instructs the browser to display glyphs which are designed for a certain language.
The font-language-override property overrides the typeface behavior for a specific language. It's helpful because when a typeface lacks proper language-specific OpenType features (like locl), you can override the default behavior to use glyphs from another language that follow similar typographic rules.
| Initial Value | normal |
|---|---|
| Applies to | All elements. It also applies to ::first-letter and ::first-line. |
| Inherited | Yes. |
| Animatable | Discrete. |
| Version | CSS3 |
| DOM Syntax | object.style.fontLanguageOverride = "normal"; |
Syntax
Syntax of CSS font-language-override Property
font-language-override: normal | <string>;Example of the font-language-override property:
Example of CSS font-language-override Property with normal value
<!DOCTYPE html>
<html>
<head>
<title>The title of the document </title>
<style>
.example1 {
font-language-override: normal;
}
.example2 {
font-language-override: "da";
}
</style>
</head>
<body>
<h2>Font-language-override property example</h2>
<p class="example1">Default language setting.</p>
<p class="example2">Here the font-language-override is set to Danish.</p>
</body>
</html>Values
| Value | Description |
|---|---|
| normal | Instructs the browser to use font glyphs that are appropriate for the language specified by the lang attribute. This is the default value of this property. |
<string> | Instructs the browser to use font glyphs specified by the <string>. |
Practice
What is the purpose of the 'font-language-override' property in CSS?