Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

font-synthesis — controlling synthetic font variants

font-synthesis controls replacement font variants when suitable faces or glyphs are missing. It does not disable genuine bold or italic faces.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

font-synthesis: none | [ weight || style || small-caps || position ];

font-synthesis controls synthesis of missing font variants, such as artificial bolding or slanting. It does not select a variant: properties such as font-weight and font-style request one. The value none prohibits synthesis but does not prevent an available genuine face from being used.

In CSS Fonts Level 4, it is shorthand for font-synthesis-weight, font-synthesis-style, font-synthesis-small-caps, and font-synthesis-position. The keywords weight, style, small-caps, and position enable synthesis of weight, slant, small capitals, and superscripts/subscripts, respectively. Listed components receive auto; omitted components receive none.

The || notation means one or more keywords, each at most once, in any order; none stands alone. The property is inherited. Its Level 4 initial value is weight style small-caps position. Specification syntax does not establish support in the target browser; position especially needs separate verification.

Examples

<!doctype html>
<meta charset="utf-8">
<style>
  #sample {
    font-family: serif;
    font-weight: bold;
    font-style: italic;
    font-synthesis: none;
  }
</style>
<p id="sample">Font synthesis sample</p>
<pre id="result"></pre>
<script>
  const sample = document.getElementById('sample');
  const result = document.getElementById('result');
  result.textContent = getComputedStyle(sample).getPropertyValue('font-synthesis');
</script>

Result

none

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources