font-synthesis-position

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.

Die font-synthesis-position CSS Eigenschaft ermöglicht es Ihnen zu spezifizieren, ob ein Browser fehlende "Position"-Schriftschnitte wie Tief- und Hochstellung innerhalb einer Schriftfamilie synthetisieren darf, während font-variant-position verwendet wird, um die Positionen festzulegen.

Die font-synthesis-position-Eigenschaft hat keine Auswirkung, wenn die <sup> und <sub> Elemente verwendet werden.

Es ist oft praktisch, die Kurzschreibweise font-synthesis zu verwenden, um alle Schriftschnitt-Synthese-Werte zu steuern.

Syntax

css
/* Keyword values */
font-synthesis-position: auto;
font-synthesis-position: none;

/* Global values */
font-synthesis-position: inherit;
font-synthesis-position: initial;
font-synthesis-position: revert;
font-synthesis-position: revert-layer;
font-synthesis-position: unset;

Werte

auto

Gibt an, dass ein fehlender Positions-Schriftschnitt bei Bedarf vom Browser synthetisiert werden darf.

none

Gibt an, dass die Synthese eines fehlenden Positions-Schriftschnitts durch den Browser nicht erlaubt ist.

Formale Definition

Anfangswertnone
Anwendbar aufall elements and text. Auch anwendbar auf ::first-letter und ::first-line.
VererbtJa
Berechneter Wertwie angegeben
Animationstypdiskret

Formale Syntax

font-synthesis-position = 
auto |
none

Beispiele

Deaktivierung der Synthese von Positions-Schriftarten

Dieses Beispiel zeigt, wie die Synthese der hochgestellten und tiefgestellten Schriftschnitte durch den Browser in der Montserrat-Schriftart ausgeschaltet wird.

HTML

html
<p>
  These are the default position <span class="super">superscript</span>,
  position <span class="sub">subscript</span>, <strong>bold</strong> and
  <em>oblique</em> typefaces.
</p>

<p class="no-syn">
  The positions <span class="super">superscript</span> and
  <span class="sub">subscript</span> typeface is turned off here but not the
  <strong>bold</strong> and <em>oblique</em> typefaces (on browsers that support
  <code>font-synthesis-position</code>).
</p>

CSS

css
@import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");

* {
  font-family: "Montserrat", sans-serif;
}
.super {
  font-variant-position: super;
}
.sub {
  font-variant-position: sub;
}
.no-syn {
  font-synthesis-position: none;
}

Ergebnis

Spezifikationen

Specification
CSS Fonts Module Level 4
# font-synthesis-position

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
font-synthesis-position
Experimental
auto
Experimental
none
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

Siehe auch