font-synthesis
The font-synthesis
CSS property controls which missing typefaces, bold or italic, may be synthesized by the browser.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Syntax
This property can take any one of the following forms:
- The keyword value
none
. - Either of the keyword values
weight
andstyle
. - Both the keyword values
weight
andstyle
.
Values
none
- Indicates that neither bold nor italic typeface may be synthesized.
weight
- Indicates that a bold typeface may be synthesized if needed.
style
- Indicates that an italic typeface may be synthesized if needed.
Description
Most standard Western fonts include italic and bold variants, but many novelty fonts do not. Fonts used for Chinese, Japanese, Korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text. In these cases, it may be desirable to switch off the browser's default font-synthesis.
Formal definition
Initial value | weight style |
---|---|
Applies to | all elements. It also applies to ::first-letter and ::first-line . |
Inherited | yes |
Computed value | as specified |
Animation type | discrete |
Formal syntax
Examples
Disabling font synthesis
HTML
<em class="syn">Synthesize me! 站直。</em>
<br/>
<em class="no-syn">Don't synthesize me! 站直。</em>
CSS
em {
font-weight: bold;
}
.syn {
font-synthesis: style weight;
}
.no-syn {
font-synthesis: none;
}
Result
Specifications
Specification | Status | Comment |
---|---|---|
CSS Fonts Module Level 3 The definition of 'font-synthesis' in that specification. |
Recommendation | Initial definition |
Browser compatibility
BCD tables only load in the browser