Skip to content

Commit 683d42a

Browse files
author
John Daggett
committed
[css-fonts] remove requirement to use often inaccurate OS/2 table subscript/superscript metrics
1 parent f666e67 commit 683d42a

File tree

2 files changed

+51
-18
lines changed

2 files changed

+51
-18
lines changed

css-fonts/Fonts.html

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,8 +2459,10 @@ <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
24592459
unique font face name enclosed by "local(" and ")". The name can
24602460
optionally be enclosed in quotes. If unquoted, the unquoted font family
24612461
name processing conventions apply; the name must be a sequence of
2462-
identifiers separated by whitespace which is converted to a string by
2463-
joining the identifiers together separated by a single space.
2462+
identifiers separated by <a
2463+
href="http://www.w3.org/TR/css3-syntax/#whitespace">whitespace</a> which
2464+
is converted to a string by joining the identifiers together separated by
2465+
a single space.
24642466

24652467
<pre>
24662468
/* regular face of Gentium */
@@ -4036,12 +4038,8 @@ <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
40364038
this feature applied. This is done per run to avoid a mixture of variant
40374039
glyphs and synthesized ones that would not align correctly. In the case of
40384040
OpenType fonts that lack subscript or superscript glyphs for a given
4039-
character, user agents must use the appropriate subscript and superscript
4040-
metrics specified in the selected font's <a
4041-
href="https://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
4042-
table</a> <a href="#OPENTYPE"
4043-
rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
4044-
and offset of the synthesized substitutes.
4041+
character, user agents must synthesize appropriate subscript and
4042+
superscript glyphs.
40454043

40464044
<div class=figure><img alt="alternate superscripts vs. glyphs synthesized
40474045
using superscript metrics" src=superscript-alt-synth.png>
@@ -4063,6 +4061,23 @@ <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
40634061
older user agents will still render subscripts and superscripts via the
40644062
older mechanism.
40654063

4064+
<p>Because <code>font-size: smaller</code> is often used for these
4065+
elements, the effective scaling factor applied to subscript and
4066+
superscript text varies depending upon the size. For larger text, the font
4067+
size is often reduced by a third but for smaller text sizes, the reduction
4068+
can be much less. This allows subscripts and superscripts to remain
4069+
readable even within elements using small text sizes. User agents should
4070+
consider this when deciding how to synthesize subscript and superscript
4071+
glyphs.
4072+
4073+
<p class=note>The OpenType font format defines subscript and superscript
4074+
metrics in the <a
4075+
href="https://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
4076+
table</a> <a href="#OPENTYPE"
4077+
rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> but these are not
4078+
always accurate in practice and so cannot be relied upon when synthesizing
4079+
subscript and superscript glyphs.
4080+
40664081
<p>Authors should note that fonts typically only provide subscript and
40674082
superscript glyphs for a subset of all characters supported by the font.
40684083
For example, while subscript and superscript glyphs are often available
@@ -5576,7 +5591,7 @@ <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
55765591
system tag</a>, specifies the OpenType language system to be used instead
55775592
of the language system implied by the language of the element
55785593
</dl>
5579-
<!-- For this level, string represents a single language code, there's no concept of "fallback"
5594+
<!-- For this level, string represents a single language code, there's no concept of "fallback"
55805595
https://www.w3.org/2013/06/07-css-minutes.html#item04 -->
55815596

55825597
<p>Use of invalid OpenType language system tags must not generate a parse
@@ -6046,6 +6061,9 @@ <h3 class=no-num id=recent-changes> Changes from the <a
60466061
<li>make negative values for font-size-adjust invalid, along with negative
60476062
percentage font-size values
60486063

6064+
<li>remove the requirement that user agents use OS/2 table
6065+
subscript/superscript metrics
6066+
60496067
<li>minor editorial cleanups
60506068
</ul>
60516069

css-fonts/Fonts.src.html

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,8 +1698,9 @@ <h3 id="src-desc">Font reference: the <a href="#descdef-src">src</a> descriptor<
16981698
name enclosed by "local(" and ")". The name can optionally be
16991699
enclosed in quotes. If unquoted, the unquoted font family name
17001700
processing conventions apply; the name must be a sequence of
1701-
identifiers separated by whitespace which is converted to a string by
1702-
joining the identifiers together separated by a single space.</p>
1701+
identifiers separated by <a href="http://www.w3.org/TR/css3-syntax/#whitespace">whitespace</a>
1702+
which is converted to a string by joining the identifiers together
1703+
separated by a single space.</p>
17031704

17041705
<pre>
17051706
/* regular face of Gentium */
@@ -3039,13 +3040,10 @@ <h3 id="font-variant-position-prop">Subscript and superscript forms: the <a href
30393040
the run, simulated glyphs must be synthesized for all characters using
30403041
reduced forms of the glyphs that would be used without this feature
30413042
applied. This is done per run to avoid a mixture of variant glyphs and
3042-
synthesized ones that would not align correctly. In the case of
3043-
OpenType fonts that lack subscript or superscript glyphs for a given
3044-
character, user agents must use the appropriate subscript and
3045-
superscript metrics specified in the selected font's
3046-
<a href="https://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2 table</a>
3047-
[[!OPENTYPE]] to calculate the size and offset of the synthesized substitutes.
3048-
</p>
3043+
synthesized ones that would not align correctly. In the case of OpenType
3044+
fonts that lack subscript or superscript glyphs for a given character,
3045+
user agents must synthesize appropriate subscript and superscript
3046+
glyphs.</p>
30493047

30503048
<div class="figure"><img alt="alternate superscripts vs. glyphs synthesized using superscript metrics" src="superscript-alt-synth.png" /><p class="caption">Superscript alternate glyph (left), synthesized superscript glyphs (middle), and incorrect mixture of the two (right)</p></div>
30513049

@@ -3061,6 +3059,22 @@ <h3 id="font-variant-position-prop">Subscript and superscript forms: the <a href
30613059
older user agents will still render subscripts and superscripts via
30623060
the older mechanism.</p>
30633061

3062+
<p>Because <code>font-size: smaller</code> is often used for these
3063+
elements, the effective scaling factor applied to subscript and
3064+
superscript text varies depending upon the size. For larger text, the
3065+
font size is often reduced by a third but for smaller text sizes, the
3066+
reduction can be much less. This allows subscripts and superscripts to
3067+
remain readable even within elements using small text sizes. User agents
3068+
should consider this when deciding how to synthesize subscript and
3069+
superscript glyphs.</p>
3070+
3071+
<p class="note">The OpenType font format defines subscript and
3072+
superscript metrics in the
3073+
<a href="https://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2 table</a>
3074+
[[!OPENTYPE]] but these are not always accurate in practice and so
3075+
cannot be relied upon when synthesizing subscript and superscript
3076+
glyphs.</p>
3077+
30643078
<p>Authors should note that fonts typically only provide subscript and
30653079
superscript glyphs for a subset of all characters supported by the
30663080
font. For example, while subscript and superscript glyphs are often
@@ -4596,6 +4610,7 @@ <h3 class="no-num" id="recent-changes">
45964610
<ul>
45974611
<li>add omitted 'font-variant-position' values to <span title="font-variant!!property">'font-variant'</span> shorthand</li>
45984612
<li>make negative values for font-size-adjust invalid, along with negative percentage font-size values</li>
4613+
<li>remove the requirement that user agents use OS/2 table subscript/superscript metrics</li>
45994614
<li>minor editorial cleanups</li>
46004615
</ul>
46014616

0 commit comments

Comments
 (0)