Skip to content

Commit c656325

Browse files
author
John Daggett
committed
new font-size-adjust explanation
1 parent cb4e7e8 commit c656325

2 files changed

Lines changed: 110 additions & 66 deletions

File tree

css3-fonts/Fonts.html

Lines changed: 110 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
<h1 id=css-fonts>CSS Fonts Level 3</h1>
8181

82-
<h2 class="no-num no-toc" id=longstatus>Editor's Draft 10 June 2008</h2>
82+
<h2 class="no-num no-toc" id=longstatus>Editor's Draft 11 June 2008</h2>
8383

8484
<dl id=authors>
8585
<dt>This version:
@@ -1356,32 +1356,74 @@ <h3 id=relative><span class=secno>3.7 </span>Relative sizing: the &lsquo;<a
13561356
<td>hmmmm
13571357
</table>
13581358

1359-
<p class=issue>Isn't there a better way to specify "preserve x-heights"
1360-
instead of forcing authors to calculate relative differences between font
1361-
aspect ratios?!?
1359+
<p>For any given font size, the apparent size and legibility often varies
1360+
due to stylistic differences. For scripts such as Latin or Cyrillic that
1361+
distinguish between upper and lowercase letters, at small sizes one factor
1362+
that strongly determines legibility is the relative height of lowercase
1363+
letters compared to their uppercase counterparts. This is commonly
1364+
referred to as the <a class=index-def href="#aspect0" id=aspect
1365+
title="aspect value"><dfn id=aspect0>aspect value</dfn></a>. Precisely
1366+
defined, it is equal to the x-height of a font divided by the font size.
1367+
1368+
<p>In cases where font fallback occurs, fallback fonts may not share the
1369+
same aspect ratio as the desired font family and will thus appear less
1370+
readable. The font-size-adjust property is used to attempt to preserve the
1371+
readability of text when font fallback occurs. It does this by adjusting
1372+
the font-size so that the x-height of the fallback font matches the
1373+
x-height of the intended font.
13621374

1363-
<p>In <a name=x23><span class=index-inst id=bicameral0
1364-
title=bicameral>bicameral</span></a> scripts, the subjective apparent size
1365-
and legibility of a font are less dependent on their <a class=noxref
1366-
href="#font-size"><span class=property>&lsquo;<span
1367-
class=property>font-size</span>&rsquo;</span></a> value than on the value
1368-
of their <span class=property>&lsquo;<span
1369-
class=property>x-height</span>&rsquo;</span>, or, more usefully, on the
1370-
ratio of these two values, called the <a name=x24><span class=index-def
1371-
id=aspect title="aspect value"><dfn id=aspect0>aspect
1372-
value</dfn></span></a> (x-height divided by font-size). The higher the
1373-
aspect value, the more likely it is that a font at smaller sizes will be
1374-
legible. Inversely, faces with a lower aspect value will become illegible
1375-
more rapidly below a given threshold size than faces with a higher aspect
1376-
value. Straightforward font substitution that relies on font size alone
1377-
may lead to illegible characters.
1378-
1379-
<p>For example, the popular font Verdana has an aspect value of 0.58; when
1380-
Verdana's font size 100 units, its x-height is 58 units. For comparison,
1381-
Times New Roman has an aspect value of 0.46. Verdana will therefore tend
1382-
to remain legible at smaller sizes than Times New Roman. Conversely,
1383-
Verdana will often look &lsquo;<code class=css>too big</code>&rsquo; if
1384-
substituted for Times New Roman at a chosen size.
1375+
<div class=example>
1376+
<p>The style defined below defines Verdana as the desired font family, but
1377+
if Verdana is not available Futura or Times will be used.</p>
1378+
1379+
<pre>p {
1380+
font-family: Verdana, Futura, Times;
1381+
}
1382+
1383+
&lt;p>Lorem ipsum dolor sit amet, ...&lt;/p>
1384+
</pre>
1385+
1386+
<p>Verdana has a relatively high aspect ratio, lowercase letters are
1387+
relatively tall compared to uppercase letters, so at small sizes text
1388+
appears legible. Times has a lower aspect ratio and so if fallback
1389+
occurs, the text will be less legible at small sizes than Verdana.</p>
1390+
</div>
1391+
1392+
<p>How text rendered in each of these fonts compares is shown below, the
1393+
columns show text rendered in Verdana, Futura and Times. The same
1394+
font-size value is used across cells within each row and red lines are
1395+
included to show the differences in x-height. In the upper half each row
1396+
is rendered in the same font-size value. The same is true for the lower
1397+
half but in this half the font-size-adjust property is also set so that
1398+
the actual font size is adjusted to perserve the x-height across each row.
1399+
Note how small text remains relatively legible across each row in the
1400+
lower half.
1401+
1402+
<div class=figure><img src=fontsizeadjust.png>
1403+
<p class=caption>Small text with and without the use of font-size-adjust</p>
1404+
</div>
1405+
<!--
1406+
<p>In <a name="x23"><span class="index-inst" title="bicameral">bicameral</span></a>
1407+
scripts, the subjective apparent size and legibility of a font are
1408+
less dependent on their <a href="#font-size" class="noxref"><span
1409+
class="property">'font-size'</span></a> value than on the value
1410+
of their <span class="property">'x-height'</span>, or, more
1411+
usefully, on the ratio of these two values, called the <a name="x24"><span
1412+
class="index-def" title="aspect value"><dfn>aspect value</dfn></span></a>
1413+
(x-height divided by font-size). The higher the aspect value, the more
1414+
likely it is that a font at smaller sizes will be legible. Inversely,
1415+
faces with a lower aspect value will become illegible more rapidly
1416+
below a given threshold size than faces with a higher aspect
1417+
value. Straightforward font substitution that relies on font size
1418+
alone may lead to illegible characters.
1419+
1420+
<p>For example, the popular font Verdana has an aspect value of 0.58;
1421+
when Verdana's font size 100 units, its x-height is 58 units. For
1422+
comparison, Times New Roman has an aspect value of 0.46. Verdana will
1423+
therefore tend to remain legible at smaller sizes than Times New
1424+
Roman. Conversely, Verdana will often look 'too big' if substituted
1425+
for Times New Roman at a chosen size.
1426+
-->
13851427

13861428
<p>This property allows authors to specify an aspect value for an element
13871429
that will preserve the x-height of the first choice font, whether it is
@@ -1410,48 +1452,50 @@ <h3 id=relative><span class=secno>3.7 </span>Relative sizing: the &lsquo;<a
14101452
</pre>
14111453
</dl>
14121454

1413-
<div class=example>
1414-
<p style=display:none>Example(s):</p>
1415-
1416-
<p>For example, if 14px Verdana (with an aspect value of 0.58) was
1417-
unavailable and an available font had an aspect value of 0.46, the
1418-
font-size of the substitute would be 14 * (0.58/0.46) = 17.65px. If
1419-
Verdana is available, no adjustment occurs, as long as its actual aspect
1420-
value is the same as the hypothetical aspect value provided by the
1421-
font-size-adjust property.</p>
1422-
</div>
1455+
<p>The calculation of the aspect ratio is easily calculated with font data
1456+
available to user agents but authors can calculate this by experimenting
1457+
with large-sized text. Given two spans of text with the same font-size
1458+
value and the font-size-adjust property specified on just one, the two
1459+
spans will match when the font-size-adjust property is accurate.
14231460

1424-
<p>Font size adjustments take place when computing the actual value of <a
1425-
class=noxref href="#font-size"><span class=property>&lsquo;<span
1426-
class=property>font-size</span>&rsquo;</span></a>. Since inheritance is
1427-
based on the computed value, child elements will inherit unadjusted
1428-
values. Font size adjustments are applied to all fonts used by child
1429-
elements, substituted or not.
1430-
1431-
<p>The first image below shows several typefaces rasterized at a common
1432-
font size (11pt. at 72 ppi), together with their aspect values. Note that
1433-
faces with higher aspect values appear larger than those with lower. Faces
1434-
with very low aspect values are illegible at the size shown.
1435-
1436-
<div class=figure><img alt="Comparison of 12 point fonts" height=720
1437-
src=font-adjust-a.gif width=450>
1438-
<p class=caption>11pt text with various fonts</p>
1439-
</div>
1461+
<p>Example of experimentally determining the aspect ratio.
14401462

1441-
<p>The next image shows the results of <a class=noxref
1442-
href="#font-size-adjust"><span class=property>&lsquo;<span
1443-
class=property>font-size-adjust</span>&rsquo;</span></a> where Verdana has
1444-
been taken as the"first choice", together with the scaling factor applied.
1445-
As adjusted, the apparent sizes are nearly linear across faces, though the
1446-
actual (em) sizes vary by more than 100%. Note that <a class=noxref
1447-
href="#font-size-adjust"><span class=property>&lsquo;<span
1448-
class=property>font-size-adjust</span>&rsquo;</span></a> tends to
1449-
stabilize the horizontal metrics of lines, as well.
1463+
<p class=issue>How does inheritance work for this? This doesn't affect
1464+
computed font-size value.</p>
1465+
<!--
14501466
1451-
<div class=figure><img alt="Comparison of font-adjusted fonts" height=720
1452-
src=font-adjust-b.gif width=450>
1453-
<p class=caption>11pt text with various fonts, adjusted font size</p>
1454-
</div>
1467+
<div class="example"><P style="display:none">Example(s):</P>
1468+
<p>For example, if 14px Verdana (with an aspect value of 0.58) was
1469+
unavailable and an available font had an aspect value of 0.46, the
1470+
font-size of the substitute would be 14 * (0.58/0.46) = 17.65px. If Verdana is
1471+
available, no adjustment occurs, as long as its actual aspect value is the same
1472+
as the hypothetical aspect value provided by the font-size-adjust property.</div>
1473+
1474+
1475+
<p>Font size adjustments take place when computing the actual value of <a href="#font-size" class="noxref"><span
1476+
class="property">'font-size'</span></a>. Since inheritance is
1477+
based on the computed value,
1478+
child elements will inherit unadjusted values. Font size adjustments are applied
1479+
to all fonts used by child elements, substituted or not.<p>The first image below shows several typefaces rasterized at a
1480+
common font size (11pt. at 72 ppi), together with their aspect
1481+
values. Note that faces with higher aspect values appear larger than
1482+
those with lower. Faces with very low aspect values are illegible at
1483+
the size shown.</p>
1484+
1485+
<div class="figure"><img src="font-adjust-a.gif" alt="Comparison of 12 point fonts" width="450" height="720">
1486+
<p class="caption">11pt text with various fonts</p></div>
1487+
1488+
<p>The next image shows the results of <a href="#font-size-adjust" class="noxref"><span
1489+
class="property">'font-size-adjust'</span></a> where Verdana has
1490+
been taken as the"first choice", together with the scaling factor applied.
1491+
As adjusted, the apparent sizes are nearly linear across faces, though the
1492+
actual (em) sizes vary by more than 100%. Note that <a href="#font-size-adjust" class="noxref"><span
1493+
class="property">'font-size-adjust'</span></a>
1494+
tends to stabilize the horizontal metrics of lines, as well.
1495+
1496+
<div class="figure"><img src="font-adjust-b.gif" alt="Comparison of font-adjusted fonts" width="450" height="720">
1497+
<p class="caption">11pt text with various fonts, adjusted font size</p></div>
1498+
-->
14551499
<!-- prop: font -->
14561500

14571501
<h3 id=shorthand><span class=secno>3.8 </span>Shorthand font property: the
@@ -2623,7 +2667,7 @@ <h2 class=no-num id=index>Index</h2>
26232667

26242668
<li>at-rules, <a href="#at-rule" title=at-rules>#</a>
26252669

2626-
<li>bicameral, <a href="#bicameral0" title=bicameral>#</a>
2670+
<li>bicameral
26272671
<ul>
26282672
<li>definition of, <a href="#bicameral" title="bicameral definition
26292673
of"><strong>#</strong></a>

css3-fonts/fontsizeadjust.png

72.4 KB
Loading

0 commit comments

Comments
 (0)