CSS font-synthesis-style Property
The font-synthesis-style property controls whether a browser may generate a synthetic italic or oblique style when the selected font does not provide a suitable face.
When italic or oblique text is requested, browsers attempt to use an appropriate font face. If one is unavailable, they may approximate the appearance by slanting upright glyphs. The font-synthesis-style property allows authors to permit or prevent this behavior without changing the requested font style.
font-synthesis-style Syntax
The font-synthesis-style property accepts auto, none, or a CSS-wide keyword.
Basic Syntax
selector {
font-synthesis-style: auto;
}
Allow Synthetic Styles
selector {
font-synthesis-style: auto;
}
Disable Synthetic Styles
selector {
font-synthesis-style: none;
}
CSS-Wide Keywords
.example {
font-synthesis-style: inherit;
}
.example {
font-synthesis-style: initial;
}
.example {
font-synthesis-style: unset;
}
.example {
font-synthesis-style: revert;
}
.example {
font-synthesis-style: revert-layer;
}
The property controls whether synthetic slanting is permitted. It does not request italic or oblique text by itself.
Property Values
The property has two main values that determine whether the browser may synthesize missing italic or oblique styles.
| Value | Description |
|---|---|
auto |
Allows the browser to synthesize italic or oblique styling when a suitable font face is unavailable. |
none |
Prevents the browser from generating synthetic italic or oblique styling. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | auto |
| Inherited | Yes |
| Applies to | All elements and text |
| Computed value | As specified |
| Animation type | Discrete |
| Percentages | Not applicable |
The property is a longhand of font-synthesis. It controls synthetic font styles independently of synthetic weight, small-capital, and position settings.
How It Works
When CSS requests italic or oblique text, the browser searches for a suitable font face. If the selected family does not provide one, the browser may generate a synthetic slanted appearance.
Requesting Italic Text
.emphasis {
font-style: italic;
}
The browser attempts to select an italic face from the chosen font family.
Allowing Synthetic Italic
.emphasis {
font-style: italic;
font-synthesis-style: auto;
}
If a suitable italic or oblique face is unavailable, the browser may synthesize the requested appearance.
Preventing Synthetic Italic
.emphasis {
font-style: italic;
font-synthesis-style: none;
}
This prevents synthetic slanting. The browser may still use a suitable genuine italic or oblique face when one is available.
Font Matching
The browser follows font matching rules when choosing among available normal, italic, and oblique faces. Disabling synthesis does not disable those matching rules.
Important Consideration
The property restricts artificial styling. It does not prevent the browser from selecting an existing font face that provides the requested appearance.
The auto Value
The auto value permits the browser to synthesize italic or oblique styling when a suitable face is unavailable.
Basic Example
.emphasis {
font-synthesis-style: auto;
}
Italic Example
.emphasis {
font-style: italic;
font-synthesis-style: auto;
}
Oblique Example
.quotation {
font-style: oblique;
font-synthesis-style: auto;
}
Default Behavior
Because auto is the initial value, browsers may synthesize missing italic or oblique styles unless synthesis has been restricted.
Important Consideration
The auto value permits synthesis but does not force it. When a suitable genuine font face is available, the browser can use that face instead.
The none Value
The none value prevents the browser from generating synthetic italic or oblique styling.
Basic Example
.emphasis {
font-synthesis-style: none;
}
Prevent Synthetic Italic
.emphasis {
font-style: italic;
font-synthesis-style: none;
}
Prevent Synthetic Oblique
.quotation {
font-style: oblique;
font-synthesis-style: none;
}
Custom Font Example
.brand-text {
font-family: "Example Brand Font", sans-serif;
font-style: italic;
font-synthesis-style: none;
}
This can help prevent artificial slanting that differs from the intended design of a custom font.
Important Consideration
If the font family lacks a suitable italic or oblique face, disabling synthesis may cause the text to appear upright. Provide the necessary font faces when visible emphasis is important.
Genuine vs. Synthetic Styles
Genuine italic and oblique faces are supplied by the font. Synthetic styles are generated by the browser when suitable faces are unavailable.
Genuine Italic
A genuine italic face may contain specially designed letterforms, altered proportions, and adjusted spacing. It is not necessarily a slanted copy of the upright font.
Genuine Oblique
A genuine oblique face typically uses slanted letterforms supplied by the font designer. Some fonts provide a range of oblique angles.
Synthetic Slanting
When a suitable face is missing, the browser may approximate the requested style by slanting upright glyphs.
Comparison
| Feature | Genuine Style | Synthetic Style |
|---|---|---|
| Source | Provided by the font | Generated by the browser |
| Letterforms | May be specially designed | Usually based on upright glyphs |
| Spacing | May be adjusted by the font designer | Depends on the rendering implementation |
| Availability | Requires a suitable font face | Requires permitted synthesis |
| CSS control | Selected through font matching | Restricted by font synthesis properties |
Important Consideration
Genuine italic and oblique faces generally provide more consistent typography. Synthetic slanting can be useful as a fallback but may not match the font designer's intended appearance.
Using font-style
The font-style property requests normal, italic, or oblique text. The font-synthesis-style property controls whether missing italic or oblique styles may be synthesized.
Italic Text
.emphasis {
font-style: italic;
font-synthesis-style: auto;
}
Oblique Text
.quotation {
font-style: oblique;
font-synthesis-style: auto;
}
Oblique Angle
.quotation {
font-style: oblique 12deg;
font-synthesis-style: auto;
}
Disable Synthetic Styling
.emphasis {
font-style: italic;
font-synthesis-style: none;
}
Property Comparison
| Property | Purpose |
|---|---|
font-style |
Requests normal, italic, or oblique font styling. |
font-synthesis-style |
Controls whether missing italic or oblique styling may be synthesized. |
Important Consideration
Use font-style to select the desired appearance. Use font-synthesis-style when control over artificial slanting is needed.
The font-synthesis Shorthand
The font-synthesis shorthand controls several types of synthetic font styling, including italic and oblique synthesis.
Allow Style Synthesis
.text {
font-synthesis: style;
}
This permits synthetic style while disabling the other synthesis types controlled by the shorthand.
Allow Weight and Style
.text {
font-synthesis: weight style;
}
Disable All Synthesis
.text {
font-synthesis: none;
}
Disable Only Style Synthesis
.text {
font-synthesis-style: none;
}
The longhand disables synthetic italic and oblique styling without changing the other synthesis controls.
Shorthand Reset Behavior
.text {
font-synthesis-style: none;
font-synthesis: weight style;
}
The later shorthand permits synthetic style again because it resets the constituent longhand properties.
Important Consideration
Use the longhand when only synthetic slanting needs to change. Use the shorthand when several synthesis types should be controlled together.
Using @font-face
The @font-face rule allows authors to provide specific font resources for regular, italic, and oblique styles.
Regular Font Face
@font-face {
font-family: "Example Sans";
src: url("/fonts/example-sans-regular.woff2") format("woff2");
font-style: normal;
font-weight: 400;
}
Italic Font Face
@font-face {
font-family: "Example Sans";
src: url("/fonts/example-sans-italic.woff2") format("woff2");
font-style: italic;
font-weight: 400;
}
Using the Font
.emphasis {
font-family: "Example Sans", sans-serif;
font-style: italic;
font-synthesis-style: none;
}
When the genuine italic face loads successfully, the browser can use it without synthetic slanting.
Missing Italic Resource
If only the regular face is supplied and synthesis is disabled, the browser cannot generate an artificial italic appearance for that face.
Important Consideration
The file paths shown above are illustrative. Replace them with actual font resources and ensure that each @font-face declaration accurately describes its font file.
Variable Fonts
Variable fonts may provide italic or slant variations through registered font axes, reducing the need for synthetic styling.
Italic Axis
The registered ital axis can provide upright and italic designs when supported by the font.
.emphasis {
font-family: "Example Variable Sans", sans-serif;
font-style: italic;
font-synthesis-style: none;
}
Slant Axis
The registered slnt axis can provide a range of slanted designs when supported by the font.
.quotation {
font-family: "Example Variable Sans", sans-serif;
font-style: oblique 10deg;
font-synthesis-style: none;
}
Variable Font Face
@font-face {
font-family: "Example Variable Sans";
src: url("/fonts/example-variable.woff2") format("woff2");
font-style: oblique -10deg 20deg;
}
This descriptor illustrates how an oblique range can be declared for a variable font that actually supports the corresponding styles.
Important Consideration
Not every variable font provides italic or slant axes. Check the font's supported axes and ranges before disabling synthetic styles.
Inheritance
The font-synthesis-style property is inherited. Child elements use the parent's synthesis setting unless they specify another value.
Inherited Setting
.article {
font-synthesis-style: none;
}
<div class="article">
<p>This text contains <em>emphasized content</em>.</p>
</div>
Override a Child Element
.article {
font-synthesis-style: none;
}
.article .allow-synthesis {
font-synthesis-style: auto;
}
Explicit Inheritance
.child {
font-synthesis-style: inherit;
}
Reset to the Initial Value
.child {
font-synthesis-style: initial;
}
The initial value is auto.
Important Consideration
An inherited restriction may affect emphasized text throughout a section. Check that the fonts used by descendants provide suitable italic or oblique faces.
Accessibility Considerations
Italic and oblique text can provide visual emphasis. Disabling synthesis may reduce that distinction when the selected font lacks suitable styles.
Preserve Semantic Emphasis
<p>This is <em>emphasized text</em>.</p>
The <em> element conveys emphasis through HTML semantics, even when the text does not appear visually italic.
Provide Genuine Italic Faces
When using custom fonts, include the italic or oblique resources needed for emphasized content.
Avoid Unnecessary Restrictions
body {
font-synthesis-style: none;
}
This declaration affects descendant text through inheritance. If the chosen fonts lack italic or oblique faces, visible emphasis may be reduced.
Test Different Writing Systems
Synthetic slanting may be unsuitable for certain scripts or font designs. Test the appearance of emphasized text in the languages used by the website.
Important Consideration
Use semantic HTML for meaningful emphasis and ensure that text remains readable and visually distinguishable when synthesis is disabled.
font-synthesis-style Example
This example compares italic text with synthetic styling permitted and disabled. It uses a demonstration font family that declares only a regular upright face.
The example uses a system font as the source of the demonstration face. Its exact appearance can vary between devices, and the result depends on whether the browser supports the synthesis control.
HTML Example
<div class="font-synthesis-style-demo">
<p class="demo-label">Normal text</p>
<p class="normal-text">Creative Typography</p>
<p class="demo-label">Synthetic italic allowed</p>
<p class="synthesis-allowed">Creative Typography</p>
<p class="demo-label">Synthetic italic disabled</p>
<p class="synthesis-disabled">Creative Typography</p>
</div>
CSS Example
@font-face {
font-family: "Synthesis Style Demo";
src: local("Arial");
font-style: normal;
font-weight: 400;
}
.font-synthesis-style-demo {
font-family: "Synthesis Style Demo", Arial, sans-serif;
}
.font-synthesis-style-demo p {
margin: 0 0 16px;
}
.font-synthesis-style-demo .demo-label {
font: 600 13px/1.4 Arial, sans-serif;
}
.font-synthesis-style-demo .normal-text,
.font-synthesis-style-demo .synthesis-allowed,
.font-synthesis-style-demo .synthesis-disabled {
font-size: 28px;
line-height: 1.4;
}
.normal-text {
font-style: normal;
}
.synthesis-allowed {
font-style: italic;
font-synthesis-style: auto;
}
.synthesis-disabled {
font-style: italic;
font-synthesis-style: none;
}
Normal text
Creative Typography
Synthetic italic allowed
Creative Typography
Synthetic italic disabled
Creative Typography
The first line uses normal styling. The second permits the browser to synthesize an italic appearance when the demonstration font lacks an italic face.
The third line prevents synthetic italic styling. If the demonstration face loads and the browser supports font-synthesis-style, this line may appear upright. If the local font is unavailable, the fallback font may provide a genuine italic face, causing the lines to appear more similar.
Common Mistakes
The most common mistake is assuming that font-synthesis-style directly selects italic or oblique text.
Using italic as a Value
.emphasis {
font-synthesis-style: italic;
}
This declaration is invalid. Use font-style: italic to request italic text.
Using oblique as a Value
.quotation {
font-synthesis-style: oblique;
}
This declaration is invalid. The synthesis property accepts auto or none.
Using an Angle
.quotation {
font-synthesis-style: 12deg;
}
Angles belong to the font-style property when requesting an oblique angle.
Using a Boolean Value
.emphasis {
font-synthesis-style: false;
}
Boolean values are not supported. Use none to disable synthesis.
Expecting auto to Apply Italic
.emphasis {
font-synthesis-style: auto;
}
This declaration permits synthesis but does not request italic text. Add font-style: italic when italic styling is intended.
Assuming Genuine Italic Is Disabled
The none value prevents synthetic slanting. It does not disable genuine italic or oblique font faces.
Disabling Synthesis Without Providing Font Faces
If a custom font lacks an italic face, disabling synthesis may cause emphasized text to appear upright.
Confusing font-style with font-synthesis-style
The font-style property requests the style. The font-synthesis-style property controls whether a missing style may be synthesized.
Ignoring Shorthand Reset Behavior
A later font-synthesis declaration can reset the earlier font-synthesis-style value.
Important Considerations
Keep the following points in mind when using the font-synthesis-style property:
- Purpose: Controls synthetic italic and oblique styling.
- Property type: Longhand of
font-synthesis. - Initial value:
auto. - Inheritance: The property is inherited.
- Applies to: All elements and text.
- auto: Permits synthetic italic and oblique styles.
- none: Prevents synthetic italic and oblique styles.
- font-style: Requests normal, italic, or oblique styling.
- font-synthesis: Provides shorthand control through the
stylekeyword. - Genuine styles: Existing italic and oblique faces remain available when synthesis is disabled.
- Synthetic styles: Browsers may approximate missing styles by slanting upright glyphs.
- Font matching: Available font faces are considered before synthesis.
- Custom fonts: Provide suitable italic or oblique resources whenever possible.
- Variable fonts: The
italandslntaxes may provide genuine style variations. - Shorthand reset: Later
font-synthesisdeclarations can override the longhand. - Accessibility: Preserve semantic emphasis and ensure emphasized text remains visually distinguishable.
- Writing systems: Test the appearance of synthetic styles in the languages used by the website.
- Browser support: Check compatibility when targeting older browsers.
Use font-synthesis-style: none when artificial slanting should be prevented and suitable font faces are available. Otherwise, allowing synthesis can help preserve visible italic or oblique emphasis when a font lacks the requested style.
Browser Support
The CSS font-synthesis-style property is Widely available in modern browsers, including current versions of Chrome, Edge, Firefox, and Safari.
Older browser versions may not recognize the longhand property. Browsers that do not support it ignore the declaration and use their existing font synthesis behavior.
Basic Example
.emphasis {
font-synthesis-style: none;
}
Feature Detection
@supports (font-synthesis-style: none) {
.emphasis {
font-synthesis-style: none;
}
}
Fallback Using font-synthesis
.emphasis {
font-synthesis: none;
font-synthesis-style: none;
}
The shorthand provides a broader fallback for browsers that support font-synthesis but not the individual longhand. However, it also disables other types of font synthesis, including synthetic weight.
Important Consideration
Use the shorthand fallback only when disabling all synthesis types is acceptable. Otherwise, rely on the longhand and provide genuine italic or oblique font faces.
For current compatibility information, visit Can I Use? and search for font-synthesis-style.
Specifications
The font-synthesis-style property is defined in the CSS Fonts Module, which describes browser-generated font styles and the controls available to authors.
CSS Fonts Module Level 4: font-synthesis-style
The module also defines the font-synthesis shorthand, font matching rules, and related font style properties.
For additional explanations and examples, see MDN Web Docs.
