--- title: font-synthesis slug: Web/CSS/font-synthesis tags: - CSS - 参考 - 字体 translation_of: Web/CSS/font-synthesis ---
font-synthesis CSS 属性控制浏览器可以合成(synthesize)哪些缺失的字体,粗体或斜体。
大多数标准西方字体包含斜体和粗体变体,但许多新颖(novelty)的字体不包括这些。用于中文、日文、韩文和其他语标文字(logographic script)的字体往往不含这些变体,同时,从默认字体中生成、合成这些变体可能会妨碍文本的易读性。在这些情况下,可能最好关闭浏览器默认的 font-synthesis 字体合成特性。
{{cssinfo}}
此属性(的值)可采用下列任意一种形式:
noneweight 或 styleweight 和 style。noneweightstyle<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;
}
{{ EmbedLiveSample('Examples', '', '50', '', 'Web/CSS/font-synthesis') }}
| 规范 | 状态 | 备注 |
|---|---|---|
| {{SpecName('CSS3 Fonts', '#propdef-font-synthesis', 'font-synthesis')}} | {{Spec2('CSS3 Fonts')}} | Initial definition |
{{Compat("css.properties.font-synthesis")}}