Font-kerning - CSS Property

font-kerning

Summary of characteristics of the font-kerning property

Quick description
Adjusting the kerning between characters.
Status
Standard
Usable for
HTML
Predefined values
auto | normal | none
Percentages
Not applicable.
Initial value
auto
Inherited by default
Yes.
Discrète: during an animation, the font-kerning property passes from one value to another without transition.
Single: single value (no order).
W3C Module
CSS Fonts Module
 🡇  
 🡅  
Document status: WD (Working Draft)

Document status: REC (Recommendation)

Syntax diagram of font-kerning.

Font-kerning property - Syntax diagramSyntax diagram of the font-kerning CSS property. See stylescss.free.fr for details. auto auto normal normal none nonefont-kerning:;font-kerning:;
Syntax diagram of the font-kerning property.
The links in the diagram provide more details about the values.
Download the diagram in SVG.

Description of the font-kerning property.

The property font-kerning defines whether character kerning should be used. Kerning involves adjusting the spacing between letters more or less depending on their shape. For example, the uppercase letters A and V have a shape that allows them to be brought closer together.

The output is more harmonious when kerning is applied, especially when the character size is large.

Fonts of the OTF or WOFF type contain the information necessary for kerning. This is not the case for all formats. On fonts that do not contain this kerning information, font-kerning will have no effect.

Values for font-kerning.

  • font-kerning: auto;

    Default value. The browser chooses whether or not to apply kerning, based on criteria such as the size of the characters.

    AWAY
    font-kerning:auto;
  • font-kerning: normal;

    Kerning is applied. Preference is given to quality rendering, at the expense of a slight decrease in speed. But the kerning processing is light and has little impact on performance.

    AWAY
    font-kerning:normal;
  • font-kerning: none;

    Kerning is not applied. This value aims to improve processing speed.

    AWAY
    font-kerning:none;
  • font-kerning: initial; (auto) font-kerning: inherit; font-kerning: revert; font-kerning: revertLayer; font-kerning: unset;

    Common values ​​are presented on these pages: initial, inherit, revert, revert-layer, unset.

Animation of the font-kerning property.

The property font-kerning can be animated, but for an insignificant visual effect.

J'AVOUE J'EN AI BAVÉ, PAS VOUS ? (2)

(2) Serge Gainsbourg - La Javanaise

Manipulating the font-kerning property programmatically.

Modify kerning permission in Javascript.

In JavaScript, here are two code examples to modify the value of font-kerning. The first uses the typical CSS notation: a hyphen to separate words (kebab-case notation). And the second uses a capital letter to separate words (camel-case notation).

Javascript
let el = document.getElementById('id'); el.style['font-kerning'] = 'none'; // or let el = document.getElementById('id'); el.style.fontKerning = 'none';

Read kerning permission in JavaScript.

Here is a first example of code to read the value of the font-kerning property. It only works if the property has been initialized in the style attribute of the element (so in the HTML code). Values assigned via a CSS selector are not recognized by this code.

Javascript
let el = document.getElementById('id'); let value = el.style['font-kerning']; // or let el = document.getElementById('id'); let value = el.style.fontKerning;

Read the computed value of font-kerning in Javascript.

The computed value is the one that results from the cascade of inheritances: direct value, inherited value, or failing that the initial value of the property, which, in the case of font-kerning, is auto.

Javascript
let el = document.getElementById('id'); let value = window.getComputedStyle(el).getPropertyValue('font-kerning');

Modify the kerning permission with JQuery.

Like Javascript, JQuery also accepts both kebab-case and camel-case writing for the property name.

JQuery
let value = $('#id').css('font-kerning');

Read the computed value of the property font-kerning with JQuery.

JQuery
let value = $('#id').css('font-kerning');

Test it yourself.

Whatever button is used, the result will be the same with font-kerning because this property only accepts predefined values.

Simulator.

The words "AWAY" or "WAVE" in capital letters, alternating A's, V's, and T's, is particularly suitable for the study of kerning. Notice that, without kerning, the first letter seems detached from the rest of the word.

The samples are given in two different fonts.

font-kerning :
AWAY - WAVE
AWAY - WAVE

Browsers compatibility with font-kerning.

The table below illustrates both the consideration of the font-kerning property and the possibility of character kerning, insofar as the font used contains kerning information.

Column 1
Support for the property font-kerning used to manage character spacing.
1
font-kerning
property
Estimated overall support.
19%

Browsers on computers :

Mobile browsers :

Outdated or marginal browsers :

Internet Explorer

KaiOS Browser

Opéra Mobile

Opéra

Safari

Safari sur IOS

Firefox pour Androïd

Samsung Internet

Chrome

Edge

Firefox

Androïd Brower

Chrome pour Androïd

Baidu Browser

QQ Browser

UC Browser pour Androïd

Opéra mini

Historic of the font-kerning 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 properties font-... allow choosing the final appearance of the characters.
    Fonts can be located on the user's computer or downloaded.

    Regarding font-kerning. First appearance of the Font-Kerning property.
    WD
    July 21, 1997
    Working Draft.
    CR
    October 03, 2013
    Candidate Recommendation.
    PR
    August 14, 2018
    Proposed for recommendation.
    REC
    September 20, 2018
    Recommendation .
  • 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.

    Regarding font-kerning. No changes to the font-kerning property.
    WD
    July 11, 2017
    Working Draft.
    CR
    PR
    REC

See also, regarding fonts.

The properties, or other definitions, concerning fonts are numerous. They are grouped in the CSS Fonts Module module. You will find the following definitions in this module:

Properties:

font
Langue française
Shorthand to set most properties for fonts.
font-effect
Langue française
Allows you to apply some effects to the text: relief, border...
font-family
Selects a font from those that are available or downloaded.
font-feature-settings
Langue française
Permet d’exploiter les fonctionnalités spécifiques des polices de caractères OTF, WOFF, etc.
Font-kerning
Adjusting the kerning between characters.
font-language-override
Langue française
Defines the language to be considered when choosing characters.
font-optical-sizing
Langue française
Optimizes the shape of characters based on their size.
font-palette
Langue française
Defines the color palette that can be used for colored fonts.
font-size
Adjusts the font size, which also impacts units like em, ex, etc.
font-size-adjust
Langue française
Definition of the aspect factor of the font.
font-smooth
Langue française
Defines whether and which smoothing algorithm should be used.
font-stretch
Langue française
Changes the stretching or compression of characters.
font-style
Langue française
Selects the italic or oblique font styles.
font-synthesis
Langue française
Allows or disallows calculation of missing styles in the typeface.
font-synthesis-position
Langue française
Whether or not allows the browser to synthesize characters in superscript or subscript.
font-synthesis-small-caps
Langue française
Whether or not allows the browser to calculate the glyphs of characters in small caps.
font-synthesis-style
Langue française
Defines whether the browser is allowed to synthesize italic forms of characters.
font-synthesis-weight
Langue française
Defines whether or not the browser can calculate the bold glyph.
font-variant
Langue française
Shorthand to define advanced typographic attributes: ligatures, character substitution, etc.
font-variant-alternates
Langue française
Defines character substitution (OTF, WOFF fonts).
font-variant-caps
Langue française
Applies character capitalization.
font-variant-east-asian
Langue française
Typography specific to Chinese or Japanese characters.
font-variant-emoji
Langue française
Choose between an emoji or text presentation.
font-variant-ligatures
Langue française
Enables or disables character ligation.
font-variant-numeric
Langue française
Defines how evolved numbers are displayed: fractions, numbers, etc.
font-variant-position
Langue française
Superscript or subscript of characters.
font-variation-settings
Langue française
Provides access to the stylistic possibilities of OTF fonts.
font-weight
Selects a weight for the characters.
font-width
Langue française
Synonymous with font-stretch (character width/enlargement).

Functions:

palette-mix()
Langue française
Establish the mixture of two color palettes from two different typefaces.

At-rules:

@font-face
Langue française
Defines all settings for a downloadable font.
@font-feature-values
Langue française
Defines the typographic variations to use.
@font-palette-values
Langue française
Defines a color palette that can then be applied to a font.

Descriptors :

ascent-override
Langue française
Descriptor for @font-face. Sets the height of the characters above the baseline.
descent-override
Langue française
Descriptor for @font-face. Sets the height of the characters below the baseline.
font-display
Langue française
Descriptor for @font-face. Determines how the browser behaves when faced with fonts that take a long time to load.
line-gap-override
Langue française
Descriptor for @font-face. Sets the line spacing of the font.
src
Langue française
Defines the source of a font file to download, or an image to display.
unicode-range
Langue française
Descriptor for @font-face. Defines the range of character codes to be downloaded into a font.