You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-fonts-4/Overview.bs
+203Lines changed: 203 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3640,6 +3640,209 @@ including <span title="none!!font-variant-ligatures">'none'</span>
3640
3640
<h3 id="font-variant-position-prop">
3641
3641
Subscript and superscript forms: the 'font-variant-position' property</h3>
3642
3642
3643
+
3644
+
<pre class="propdef">
3645
+
Name: font-variant-position
3646
+
3647
+
Value: normal | sub | super
3648
+
Initial: normal
3649
+
Applies to: all elements
3650
+
Inherited: yes
3651
+
Percentages: n/a
3652
+
Computed value: as specified
3653
+
Animation type: discrete
3654
+
</pre>
3655
+
3656
+
<p>This property is used
3657
+
to enable typographic subscript and superscript glyphs.
3658
+
These are alternate glyphs
3659
+
designed within the same em-box as default glyphs
3660
+
and are intended to be laid out
3661
+
on the same baseline
3662
+
as the default glyphs,
3663
+
with no resizing or repositioning of the baseline.
3664
+
They are explicitly designed
3665
+
to match the surrounding text
3666
+
and to be more readable
3667
+
without affecting the line height.</p>
3668
+
3669
+
<div class="figure"><img alt="comparison between real subscript glyphs and synthesized ones" src="images/realsubscripts.png" /><p class="caption">Subscript glyphs (top) vs. typical synthesized subscripts (bottom)</p></div>
3670
+
3671
+
<p>Individual values have the following meanings:</p>
<p>Because of the semantic nature of subscripts and superscripts,
3685
+
when the value is either 'sub' or 'super'
3686
+
for a given contiguous run of text,
3687
+
if a variant glyph is not available for all the characters in the run,
3688
+
simulated glyphs <!-- must --> should be synthesized
3689
+
for all characters
3690
+
using reduced forms of the glyphs
3691
+
that would be used
3692
+
without this feature applied.
3693
+
This is done per run
3694
+
to avoid a mixture of variant glyphs and synthesized ones
3695
+
that would not align correctly.
3696
+
In the case of OpenType fonts
3697
+
that lack subscript or superscript glyphs
3698
+
for a given character,
3699
+
user agents <em>must</em> synthesize
3700
+
appropriate subscript and superscript glyphs.</p>
3701
+
3702
+
<div class="figure"><img alt="alternate superscripts vs. glyphs synthesized using superscript metrics" src="images/superscript-alt-synth.png" /><p class="caption">Superscript alternate glyph (left), synthesized superscript glyphs (middle), and incorrect mixture of the two (right)</p></div>
3703
+
3704
+
<!--
3705
+
at-risk must downgraded to should
3706
+
see https://github.com/w3c/csswg-drafts/issues/2796#issuecomment-398565265
3707
+
-->
3708
+
<p>In situations where text decorations
3709
+
are only applied to runs of text
3710
+
containing superscript or subscript glyphs,
3711
+
the synthesized glyphs may be used,
3712
+
to avoid problems with the placement of decorations.</p>
3713
+
3714
+
<p>In the past,
3715
+
user agents have used font-size
3716
+
and vertical-align
3717
+
to simulate subscripts and superscripts
3718
+
for the
3719
+
<code title="HTML sub element">sub</code>
3720
+
and <code title="HTML sup element">sup</code> elements.
3721
+
To allow a backwards compatible way
3722
+
of defining subscripts and superscripts,
3723
+
it is recommended
3724
+
that authors use conditional rules [[CSS3-CONDITIONAL]]
0 commit comments