Font-synthesis - CSS Property

font-synthesis

Summary of characteristics of the font-synthesis property

Quick description
Allows or disallows calculation of missing styles in the typeface.
Status
Standard
Predefined values
none | small-caps | style | weight | position
Percentages
Not applicable.
Initial value
weight style small-caps position
Inherited by default
Yes.
Discrète: during an animation, the font-synthesis property passes from one value to another without transition.
Per grammar: serialization in the order of syntax. Values can be entered in any order.
W3C Module
CSS Fonts Module
 🡇  
 🡅  
Document status: WD (Working Draft)

Document status: REC (Recommendation)

Syntax diagram of font-synthesis.

Font-synthesis property - Syntax diagramSyntax diagram of the font-synthesis CSS property. See https://www.stylescss.com for details. none none weight weight style style small-caps small-caps position positionfont-synthesis:;font-synthesis:;
Syntax diagram of the font-synthesis property.
The links in the diagram provide more details about the values.
Download the diagram.

Description of the font-synthesis property.

font-synthesis allows or not the browser to generate character styles that aren't defined in the font (like italics, bold, etc). Most fonts include at least italic and bold styles, but that's not always the case. Especially fancy fonts or Asian character fonts often don't have any variants.

Calculating bold character shapes, and especially italic ones, sometimes gives bad results. It's better to disable it then, and just display standard characters. That's the role of the property font-synthesis.

font-synthesis is a short-hand property that lets you set the values of the following four properties all at once:

Defines whether or not the browser can calculate the bold glyph. .
Defines whether the browser is allowed to synthesize italic forms of characters..
Whether or not allows the browser to calculate the glyphs of characters in small caps.
Whether or not allows the browser to synthesize characters in superscript or subscript.

Values for font-synthesis.

  • font-synthesis: none;

    The browser doesn’t synthesize anything: if the requested style variant is in the font, it’s shown; otherwise, the characters are displayed in normal.

  • font-synthesis: weight;

    The browser is allowed to synthesize the missing weight of character shapes in the font.

  • font-synthesis: style;

    The browser is allowed to synthesize italic or oblique styles if they are missing in the font.

  • font-synthesis: small-caps;

    The browser is allowed to synthesize characters in small caps.

  • font-synthesis: position;

    The browser is allowed to calculate the position of characters in superscript or subscript.

  • font-synthesis: weight style small-caps position;

    Default value. The browser is allowed to synthesize missing character strokes in the font, styles like italic and oblique, small capitals, and the position of the text (superscript or subscript).

    All other combinations of values are valid. Remember that in any case, the synthesis will only be used if the requested stylistic variant is not included in the font.

  • font-synthesis: initial; (weight style small-caps position) font-synthesis: inherit; font-synthesis: revert; font-synthesis: revert-layer; font-synthesis: revert-rule; font-synthesis: unset;

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

Animation of the font-synthesis property.

Although possible, animating font-synthesis is really of little interest.

Simulator.

The font used for the example is Montserrat, which we deliberately downloaded without any variants. So the browser has to calculate bold, italics, etc.

Note: the position (superscript and subscript) is only supported by Firefox  .

font-synthesis :
This text has bold, italic
but also small caps text
as well as superscript and subscript text.

Browsers compatibility with font-synthesis.

The shorthand property font-synthesis is well recognized by browsers. But refer to the individual properties for more details on their support.

Column 1
Support for the shorthand property font-synthesis, which includes the values of all the properties font-synthesis....
1
font-synthesis
property
Estimated overall support.
94%

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-synthesis property.

font-synthesis was initially a standalone property, allowing or not the synthesis of bold or italic characters. Level 4 of the specification makes it a shorthand property for other properties whose name starts with font-synthesis....

  • 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-synthesis:
    First definition of the font-synthesis property. It allows you to authorize or not the synthesis of bold or italic characters.
    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-synthesis:
    font-synthesis becomes a shorthand property allowing you to authorize or not numerous alterations of characters: bold, italics, capitals and position (superscript or index).
    WD
    July 11, 2017
    Working Draft.
    CR
    PR
    REC
  • CSS Fonts Module Level 5

    WD
    June 29, 2021
    Working Draft.
    CR
    PR
    REC

See also about fonts.

There are many properties related to fonts. 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
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
Shorthand to define advanced typographic attributes: ligatures, character substitution, etc.
font-variant-alternates
Defines character substitution (OTF, WOFF fonts).
font-variant-caps
Applies character capitalization.
font-variant-east-asian
Typography specific to Chinese or Japanese characters.
⚠
font-variant-emoji
Choose between an emoji or text presentation.
font-variant-ligatures
Enables or disables character ligation.
font-variant-numeric
Defines how evolved numbers are displayed: fractions, numbers, etc.
⚠
font-variant-position
Superscript or subscript of characters.
font-variation-settings
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.