This proposal introduces a new text-kerning
property:
text-kerning: [ <upoint> <upoint> <length> ] #
The <upoint>
pairs are the left and right code points of a kerning pair and <value>
is the kern value. Kerning pairs and values can be repeated multiple times by separating them with a comma. Kerning is applied to all unicode code point pairs in an element that match the kerning pairs specified in the text-kerning
property of that element.
The <upoint>
token is a single unicode code point, identical to the single unicode code points in the unicode-range
property of the @font-face syntax. Ideally we would modify CSS tokens to introduce a UNICODE-POINT
token that matches a single unicode code point (e.g. u\+[0-9a-f?]{1,6}
) and modify the UNICODE-RANGE
token to use it (e.g. {unicode-point}(-{unicode-point})?
).
Kerning is applied cumulative. This is in line with the "kern" table in OpenType fonts and similar CSS properties such as word-spacing
and letter-spacing
.
When ligatures are available for kerning pairs, the kerning pair is ignored and the ligature is used (unless ligatures are turned off.) Partial matches within a ligature have kerning applied as usual.
If the font-kerning
property is set to none
on an element that also has a text-kerning
property, the text-kerning
property is ignored by the user agent.
text-kerning: U+56 U+41 -0.02em;
This defines a kern pair between "V" and "A" and subtracts 0.02em
from the default kern value.
text-kerning: U+56 U+41 -0.03em, U+54 U+54 1px;
This defines two kerning pairs, the first one decreases the default kern value between "V" and "A" with 0.03em
, and the second one increases the default kern value between "T" and "T" by 1px
.
font-kerning: none;
text-kerning: U+69 U+69 2px;
This should increases the default kern value between "i" and "i" by two pixels, but the property is ignored because font-kerning
is set to none
.
text-kerning: U+66 U+69 -0.1pt;
This decreases the kerning between "f" and "i" by 0.1pt
. If the active font contains an "fi" ligature, the kerning pair is ignored.
For the sake of simplicity and readability, what do you think of the option to use actual characters in quotes, such as