Font-synthesis - CSS Property
Summary of characteristics of the font-synthesis property
none | small-caps | style | weight | positionweight style small-caps positionDiscrè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.Syntax diagram of font-synthesis.
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:
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 .
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.
font-synthesis, which includes the values of all the properties font-synthesis....font-synthesisproperty
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 propertiesfont-...allow choosing the final appearance of the characters.
Fonts can be located on the user's computer or downloaded.Regardingfont-synthesis:
First definition of thefont-synthesisproperty. It allows you to authorize or not the synthesis of bold or italic characters.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-synthesis:font-synthesisbecomes a shorthand property allowing you to authorize or not numerous alterations of characters: bold, italics, capitals and position (superscript or index).July 11, 2017Working Draft. -
CSS Fonts Module Level 5
June 29, 2021Working Draft.
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:






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.


