Font-variant-ligatures - CSS Property
Summary of characteristics of the font-variant-ligatures property
normal | none | common-ligatures | no-common-ligatures | historical-ligatures | no-historical-ligatures | discretionary-ligatures | no-discretionary-ligatures | contextual | no-contextualnormalDiscrète: during an animation, the font-variant-ligatures property passes from one value to another without transition.Per grammar: serialization in the order of syntax.Syntax diagram of font-variant-ligatures.
font-variant-ligatures property.The links in the diagram provide more details about the values.
Download the diagram.
Description of the font-variant-ligatures property.
font-variant-ligatures allows you to turn character ligatures on or off, that is, the fact that some letters, when they come one after another, can be connected
to each other or even form a new letter. Here are the most common ligatures:
The main ligature characters exist in the Unicode set, but they aren’t directly available on the keyboard: you need to know their code (or the HTML entity to use them). OTF fonts offer the possibility to automatically replace certain letter pairs with the corresponding ligature. It’s obviously much easier for writers, who can just type their text without getting into computer coding.
font-variant-ligatures is the easiest property to use, but you can also check out shorthand property font-variant, which lets you enable or disable
multiple OTF font options in a single line.
As for font-feature-settings , it's a much more complex property to use, but it allows low-level control over all the possibilities of OTF fonts.

Quelques précisions sur les ligatures.
So, a ligature basically means replacing a pair of letters with another character, which is more aesthetic or easier to read. The Unicode character set
includes many ligatured letters like œ, æ, fi, etc. But for the replacement to be automatic
(which font-variant-ligatures claims to do), the font also needs to have a substitution table so that browsers know what to replace the letter pairs with.
Of course, the author of the page always has the option to use The entities to enforce the characters of their choice, but browsers can now take on that job themselves.
Ligatures are typographical subtleties: we could just ignore them. But reading tablets and e-books are becoming more and more common: Amazon's Kindle, Kobo, PocketBook, etc. It would be a shame if these e-books performed worse than their predecessors, the paper books.
Several types of ligatures.
Spelling ligatures.
Not using these ligatures is considered a spelling mistake. Spell checkers actually flag these omissions. In French, it's mainly the two characters
œ and æ, which also exist in uppercase Œ and Æ. Other languages also have
their own orthographic ligatures like ß in German.
Aesthetic ligatures (common-ligatures).
Some letters, when they come together, have shapes that overlap or create a result that looks a bit off to purists. This is especially the case with serif
fonts like 'Times New Roman'. For example, an f followed by an i makes the dot on the i collide with the loop of the
f. You can conveniently replace these two letters with the fi character.
Another ligature is very commonly used, the one that consists of replacing the letters e and t with &.
Optional ligatures (discretionary-ligatures).
Font designers sometimes change the shape of certain characters when they come before or after another character. This is to even out the spacing between each character, or just for aesthetic reasons.
st =>
Historical ligatures (historical-ligatures).
They've kind of fallen into oblivion, but it can be interesting to bring them back to create a vintage typography effect. Unfortunately, very few fonts include these characters.
Contextual ligatures (contextual).
Finally, CSS talks to us about contextual ligatures. They aren't really ligatures: it actually refers to replacing certain character glyphs with others that are more aesthetic, more decorative, or just different. These replacements can happen only in certain cases, like when the character is the first or last in a word.
Values for font-variant-ligatures.
The font used for the examples and the simulator is the Kleymissky font (copyright gluk).
- font-variant-ligatures: normal;
Default value. The characters are rendered as they are defined by default in the font. Some ligatures are used, others are not. In general, this value is equivalent to
common-ligaturesandcontextual.DifficultFontKleymissky
normal - font-variant-ligatures: none;
No ligature is used.
DifficultFontKleymissky
none - font-variant-ligatures: common-ligatures; font-variant-ligatures: no-common-ligatures;
Turning common ligatures on or off: for example fi => fi
Matches the OTF styles
ligaandclig. Refer to thefont-feature-settingsproperty for a more complete description of what OpenType fonts can do.
For OTF (Open Type Font) fonts, this option is enabled by default.
In the examples below, you can clearly see the dots on the
ihitting the loop of thefwhen common ligatures are turned off. When you enable these ligatures, the dots and loops merge. Similarly, the twofs in 'difficult' are identical without ligatures, but with ligatures, the secondfis bigger.Difficult, finalFontKleymissky
common-ligaturesDifficult, finalFontKleymissky
no-common-ligatures - font-variant-ligatures: discretionary-ligatures; font-variant-ligatures: no-discretionary-ligatures;
Turning on or off the ligatures specific to the font being used. The font designer is free to choose which discretionary ligatures they want to include. So you'll need to check the font's documentation to find out.
Corresponds to the OTF style
dlig.Test TactFontWarnock
discretionary-ligaturesTest TactFontWarnock
no-discretionary-ligatures - font-variant-ligatures: historical-ligatures; font-variant-ligatures: no-historical-ligatures;
Turning ligatures on or off as they were used in mechanical printing.
Corresponds to the OTF style
hlig. - font-variant-ligatures: contextual; font-variant-ligatures: no-contextual;
Turning contextual ligatures on or off. It's not really about ligatures per se, but more about different forms for certain characters depending on the characters that come before or after. On OTF fonts, this option is turned on by default.
For example, below, many characters are different.
Corresponds to the OTF style
calt.Make Love
Not WarFontKleymissky
contextualMake Love
Not WarFontKleymissky
no-contextual - font-variant-ligatures: initial; (
normal) font-variant-ligatures: inherit; font-variant-ligatures: revert; font-variant-ligatures: revert-layer; font-variant-ligatures: revert-rule; font-variant-ligatures: unset;Links to the presentation of these different values:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the font-variant-ligatures property.
The three animations below really highlight the differences in behavior of each font. And consequently, the difficulty of handling ligatures any way other than in a way specific to the font being used.
Kleymisskydoes add a ligature between thefand thei, but it also adds loops on the first and last letters of each word. Which should be included in thecontextual-ligatures.Warnockalso applies ligatures to the letter pairsstandct. Which other fonts don’t do.- As for
Comic Jens, it's a humorous font with some very specific ligatures: you can see the three lettersLOL, in uppercase or lowercase, turn into a new symbol.
end effect
Kleymissky
end effect
Warnock
LOL lol
Comic Jens
Simulator.
The effect of the font-variant-ligatures property really depends on the font you use. Pay special attention to the character pairs fi and
ff, which are the ones most often handled.
fi ff tf ft jf fj fz ct st
Browsers compatibility with font-variant-ligatures.
The font-variant-ligatures property is well recognized by current browsers, but you should keep in mind that its effect is very dependent on the font used.
font-variant-ligatures property, which defines whether ligatures should be rendered, and which ligatures (common, historical, contextual, etc.).font-variant-ligaturesproperty
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Samsung Internet

Safari

Safari sur IOS

Chrome

Edge

Firefox

Opéra

Chrome pour Androïd

Androïd Brower

Firefox pour Androïd

KaiOS Browser

Opéra mini
Historic of the font-variant-ligatures property.
-
CSS Fonts Module Level 3
This specification concerns fonts. A font contains the visual representation of characters. In its simplest form, it is just a matter of associating character codes with their shapes.
Within a typeface family, the shapes are defined but can vary in stroke thickness, slant, width, etc. The CSS propertiesfont-...allow choosing the final appearance of the characters.
Fonts can be located on the user's computer or downloaded.Regardingfont-variant-ligatures:
First definition of thefont-variant-ligaturesproperty.July 21, 1997Working Draft.October 03, 2013Candidate Recommendation.August 14, 2018Proposed for recommendation.September 20, 2018Recommendation . -
CSS Fonts Module Level 4
This level 4 of the specification on fonts reprises what is defined in level 3. It adds the possibility to define what happens when a font takes a long time to load or is missing. It also adds support for colored fonts and clarifies many points still poorly defined in level 3.
Regardingfont-variant-ligatures:
No change regarding the definition of thefont-variant-ligaturesproperty.July 11, 2017Working Draft. -
CSS Fonts Module Level 5
Regardingfont-variant-ligatures:
No change to thefont-variant-ligaturesproperty.June 29, 2021Working Draft.
See also, about fonts.
The CSS Fonts Module specification covers everything related to fonts: typography, using the features of modern font formats, downloading fonts, and so on.
Properties:






em, ex, etc.








Functions:

At-rules:



Descriptors :

@font-face. Sets the height of the characters above the baseline.

@font-face. Sets the height of the characters below the baseline.

@font-face. Determines how the browser behaves when faced with fonts that take a long time to load.

@font-face. Sets the line spacing of the font.

@font-face. Defines the range of character codes to be downloaded into a font.


