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.
This property can take any one of the following forms:
none
.
weight
and
style
.
weight
and
style
.
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.
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.
| 初始值 |
weight style
|
|---|---|
| 适用于 |
所有元素。它还适用于
::first-letter
and
::first-line
.
|
| 继承 | yes |
| 计算值 | 如指定 |
| 动画类型 | discrete |
none | [ weight || style ]
<em class="syn">Synthesize me! 站直。</em> <br/> <em class="no-syn">Don't synthesize me! 站直。</em>
em {
font-weight: bold;
}
.syn {
font-synthesis: style weight;
}
.no-syn {
font-synthesis: none;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Fonts Module Level 3
The definition of 'font-synthesis' in that specification. |
候选推荐 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
font-synthesis
|
Chrome 不支持 No | Edge 不支持 No |
Firefox
完整支持
34
|
IE 不支持 No | Opera 不支持 No | Safari 完整支持 9 | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 完整支持 34 | Opera Android 不支持 No | Safari iOS 完整支持 9 | Samsung Internet Android 不支持 No |
完整支持
不支持
用户必须明确启用此特征。
font
font-family
font-feature-settings
font-kerning
font-language-override
font-optical-sizing
font-size
font-size-adjust
font-smooth
font-stretch
font-style
font-synthesis
font-variant
font-variant-alternates
font-variant-caps
font-variant-east-asian
font-variant-ligatures
font-variant-numeric
font-variant-position
font-variation-settings
font-weight
line-height
line-height-step