The font-synthesis
CSS property controls which missing typefaces, bold, italic, or small-caps, may be synthesized by the browser.
The font-synthesis
CSS property controls which missing typefaces, bold, italic, or small-caps, may be synthesized by the browser.
font-synthesis: none; font-synthesis: weight; font-synthesis: style; font-synthesis: small-caps; font-synthesis: weight style small-caps; /* Global values */ font-synthesis: inherit; font-synthesis: initial; font-synthesis: revert; font-synthesis: revert-layer; font-synthesis: unset;
none
Indicates that no bold, italic, nor small-caps 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.
small-caps
Indicates that a small-caps typeface may be synthesized if needed.
Most standard Western fonts include italic and bold variants, and some fonts include a small-caps variant. However, many 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.
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 |
<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 small-caps; } .no-syn { font-synthesis: none; }
Specification |
---|
CSS Fonts Module Level 4 # font-synthesis |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
font-synthesis |
97 | 97 | 34 | No | 83 | 9 | 97 | 97 | 34 | No | 9 | 18.0 |
small-caps |
97 | 97 | 93 | No | 83 | 10.1 | 97 | 97 | 93 | No | 10.3 | 18.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/font-synthesis