8000 csswg-drafts/css-fonts/Overview.html at 06350b3db6667328d46c1c249c81aa0a2e7d924e · xfq/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
3886 lines (3086 loc) · 340 KB

File metadata and controls

3886 lines (3086 loc) · 340 KB
<!DOCTYPE html><html lang=en><head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Fonts Module</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<script defer src=//test.csswg.org/harness/annotate.js#css-fonts-3_dev/css-fonts-3 type=text/javascript></script>
<script src=http://use.typekit.com/xon2bky.js type=text/javascript></script>
<script type=text/javascript>try{Typekit.load();}catch(e){}</script>
<script type=text/javascript>
window.onload = function () {
if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
var i, hiresElements = document.getElementsByClassName("hires");
for (i = 0; i < hiresElements.length; i++) {
var h = hiresElements[i];
if (h.tagName != "IMG") continue;
var src = h.getAttribute("src");
var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
h.src = src2x;
}
}
</script>
<style type=text/css>
body, th, td, h1, h2, h3, h4, h5, h6 {
font-family: "myriad-pro", sans-serif !important;
}
body {
padding: 2em 70px 2em 70px;
}
p + p, p.mtb {
margin-top: 0.8em;
text-indent: 0px;
}
#bolderlighter {
width: 40%;
}
#bolderlighter th {
text-align: center;
}
#fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
padding-right: 2em;
text-align: left;
}
dd {
margin-bottom: 1em;
}
#authors dd {
margin-bottom: 0;
}
#fontstylematchingalg {
list-style-type: lower-alpha;
}
#fontmatchingalg ul, #fontmatchingalg ol {
margin-top: 0.8em;
}
#fontmatchingalg li + li {
margin-top: 0.8em;
}
div.example {
padding: 1em;
margin-top: 1em;
}
div.example + div.example {
margin-top: 2em;
}
div.figure {
page-break-inside: avoid;
}
pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
div.featex {
width: 700px;
}
div.featex img {
margin: auto;
display: block;
}
span.tag {
font-family: monospace;
font-size: 120%;
}
ol ol {
list-style-type: lower-alpha;
}
.idl-code {
font-weight: bold;
color: #c50;
}
</style>
</head>
<body class=h-entry>
<div class=head>
<p data-fill-with=logo><a class=logo href=http://www.w3.org/>
<img alt=W3C height=48 src=https://www.w3.org/Icons/w3c_home width=72>
</a>
</p>
<h1 class="p-name no-ref" id=title>CSS Fonts Module</h1>
<h2 class="no-num no-toc no-ref heading settled" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20141020>20 October 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-fonts/>http://dev.w3.org/csswg/css-fonts/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-fonts-3/>http://www.w3.org/TR/css-fonts-3/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/ rel=previous>http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/</a><dt>Feedback:<dd><span><a href="mailto:www-style@w3.org?subject=[css-fonts] feedback">www-style@w3.org</a> with subject line “<kbd>[css-fonts] <var>… message topic …</var></kbd>” (<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)</span><dt>Test Suite:<dd><a href=http://test.csswg.org/suites/css3-fonts/nightly-unstable/>http://test.csswg.org/suites/css3-fonts/nightly-unstable/</a><dt>Editor:<dd><div class="p-author h-card vcard"><a class="p-name fn u-email email" href=mailto:jdaggett@mozilla.com>John Daggett</a> (<span class="p-org org">Mozilla Japan</span>)</div><dt>Issues List:<dd><span><a href=http://www.w3.org/Style/CSS/Tracker/products/18>Tracker</a></span><dd><span><a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Fonts&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">Bugzilla</a></span></dl></div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id=abstract><span class=content>Abstract</span></h2>
<div class=p-summary data-fill-with=abstract><p>This CSS3 module describes how font properties are specified and how font resources are loaded dynamically. The contents of this specification are a consolidation of content previously divided into <a href=http://www.w3.org/TR/2002/WD-css3-fonts-20020802/>CSS3 Fonts</a> and <a href=http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/>CSS3 Web Fonts</a> modules. The description of font load events was moved into the <a href=http://dev.w3.org/csswg/css-font-load-events/>CSS3 Font Load Events</a> module.</p>
<a href=http://www.w3.org/TR/CSS/>CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</div>
<h2 class="no-num no-toc no-ref heading settled" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<p>
The (<a href=http://lists.w3.org/Archives/Public/www-style/>archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-fonts%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href=http://www.w3.org/Mail/Request>instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-fonts” in the subject,
preferably like this:
“[css-fonts] <em>…summary of comment…</em>”
<p>
This document was produced by the <a href=http://www.w3.org/Style/CSS/members>CSS Working Group</a>
(part of the <a href=http://www.w3.org/Style/>Style Activity</a>).
<p>
This document was produced by a group operating under
the <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href=http://www.w3.org/2004/01/pp-impl/32061/status rel=disclosure>public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>
must disclose the information in accordance with <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.
<p>
This document is governed by the <a href=http://www.w3.org/2014/Process-20140801/>1 August 2014 W3C Process Document</a>.
</div>
<div data-fill-with=at-risk><p>The following features are at-risk, and may be dropped during the CR period:
<ul><li>fallback handling for text decoration in superscript/subscript variant glyphs (<a class=property data-link-type=propdesc href=#propdef-font-variant-position title=font-variant-position>font-variant-position</a>), <a class=property data-link-type=propdesc href=#propdef-font-language-override title=font-language-override>font-language-override</a> property</ul></div>
<h2 class="no-num no-toc no-ref heading settled" id=contents><span class=content>Table of Contents</span></h2>
<div data-fill-with=table-of-contents><ul class=toc><li><a href=#introduction><span class=secno>1</span> <span class=content>Introduction</span></a><li><a href=#typography-background><span class=secno>2</span> <span class=content>Typography Background</span></a><li><a href=#basic-font-props><span class=secno>3</span> <span class=content>Basic Font Properties</span></a><ul class=toc><li><a href=#font-family-prop><span class=secno>3.1</span> <span class=content>Font family: the <span class=property data-link-type=propdesc title=font-family>font-family</span> property</span></a><ul class=toc><li><a href=#generic-font-families><span class=secno>3.1.1</span> <span class=content>Generic font families</span></a></ul><li><a href=#font-weight-prop><span class=secno>3.2</span> <span class=content>Font weight: the <span class=property data-link-type=propdesc title=font-weight>font-weight</span> property</span></a><li><a href=#font-stretch-prop><span class=secno>3.3</span> <span class=content>Font width: the <span class=property data-link-type=propdesc title=font-stretch>font-stretch</span> property</span></a><li><a href=#font-style-prop><span class=secno>3.4</span> <span class=content>Font style: the <span class=property data-link-type=propdesc title=font-style>font-style</span> property</span></a><li><a href=#font-size-prop><span class=secno>3.5</span> <span class=content>Font size: the <span class=property data-link-type=propdesc title=font-size>font-size</span> property</span></a><li><a href=#font-size-adjust-prop><span class=secno>3.6</span> <span class=content>Relative sizing: the <span class=property data-link-type=propdesc title=font-size-adjust>font-size-adjust</span> property</span></a><li><a href=#font-prop><span class=secno>3.7</span> <span class=content>Shorthand font property: the <span class=property data-link-type=propdesc title=font>font</span> property</span></a><li><a href=#font-synthesis-prop><span class=secno>3.8</span> <span class=content>Controlling synthetic faces: the <span class=property data-link-type=propdesc title=font-synthesis>font-synthesis</span> property</span></a></ul><li><a href=#font-resources><span class=secno>4</span> <span class=content>Font Resources</span></a><ul class=toc><li><a href=#font-face-rule><span class=secno>4.1</span> <span class=content>The <span data-dfn-type=at-rule data-export="">@font-face</span> rule</span></a><li><a href=#font-family-desc><span class=secno>4.2</span> <span class=content>Font family: the <span class=css data-link-for=@font-face>font-family</span> descriptor</span></a><li><a href=#src-desc><span class=secno>4.3</span> <span class=content>Font reference: the <span class=css data-link-for=@font-face>src</span> descriptor</span></a><li><a href=#font-prop-desc><span class=secno>4.4</span> <span class=content>
Font property descriptors: the <span class=css data-link-for=@font-face>font-style</span>, <span class=css data-link-for=@font-face>font-weight</span>, <span class=css data-link-for=@font-face>font-stretch</span> descriptors</span></a><li><a href=#unicode-range-desc><span class=secno>4.5</span> <span class=content>Character range: the <span class=css data-link-for=@font-face>unicode-range</span> descriptor</span></a><li><a href=#composite-fonts><span class=secno>4.6</span> <span class=content>Using character ranges to define composite fonts</span></a><li><a href=#font-rend-desc><span class=secno>4.7</span> <span class=content>Font features: the <span class=css data-link-for=@font-face>font-variant</span> and <span class=css data-link-for=@font-face>font-feature-settings</span> descriptors</span></a><li><a href=#font-face-loading><span class=secno>4.8</span> <span class=content>Font loading guidelines</span></a><li><a href=#font-fetching-requirements><span class=secno>4.9</span> <span class=content>Font fetching requirements
<span></span>
<span></span>
</span></a></ul><li><a href=#font-matching-algorithm><span class=secno>5</span> <span class=content>Font Matching Algorithm</span></a><ul class=toc><li><a href=#font-family-casing><span class=secno>5.1</span> <span class=content>Case sensitivity of font family names</span></a><li><a href=#font-style-matching><span class=secno>5.2</span> <span class=content>Matching font styles</span></a><li><a href=#cluster-matching><span class=secno>5.3</span> <span class=content>Cluster matching</span></a><li><a href=#char-handling-issues><span class=secno>5.4</span> <span class=content>Character handling issues</span></a><li><a href=#font-matching-changes><span class=secno>5.5</span> <span class=content>Font matching changes since CSS 2.1</span></a><li><a href=#font-matching-examples><span class=secno>5.6</span> <span class=content>Font matching examples</span></a></ul><li><a href=#font-rend-props><span class=secno>6</span> <span class=content>Font Feature Properties</span></a><ul class=toc><li><a href=#glyph-selection-positioning><span class=secno>6.1</span> <span class=content>Glyph selection and positioning</span></a><li><a href=#language-specific-support><span class=secno>6.2</span> <span class=content>Language-specific display</span></a><li><a href=#font-kerning-prop><span class=secno>6.3</span> <span class=content>Kerning: the <span class=property data-link-type=propdesc title=font-kerning>font-kerning</span> property</span></a><li><a href=#font-variant-ligatures-prop><span class=secno>6.4</span> <span class=content>Ligatures: the <span class=property data-link-type=propdesc title=font-variant-ligatures>font-variant-ligatures</span> property</span></a><li><a href=#font-variant-position-prop><span class=secno>6.5</span> <span class=content>Subscript and superscript forms: the <sp 8E4A an class=property data-link-type=propdesc title=font-variant-position>font-variant-position</span> property</span></a><li><a href=#font-variant-caps-prop><span class=secno>6.6</span> <span class=content>Capitalization: the <span class=property data-link-type=propdesc title=font-variant-caps>font-variant-caps</span> property</span></a><li><a href=#font-variant-numeric-prop><span class=secno>6.7</span> <span class=content>Numerical formatting: the <span class=property data-link-type=propdesc title=font-variant-numeric>font-variant-numeric</span> property</span></a><li><a href=#font-variant-alternates-prop><span class=secno>6.8</span> <span class=content>Alternates and swashes: the <span class=property data-link-type=propdesc title=font-variant-alternates>font-variant-alternates</span> property</span></a><li><a href=#font-feature-values><span class=secno>6.9</span> <span class=content>Defining font specific alternates: the <span data-dfn-type=at-rule data-export="">@font-feature-values</span> rule</span></a><ul class=toc><li><a href=#basic-syntax><span class=secno>6.9.1</span> <span class=content>Basic syntax</span></a><li><a href=#multi-valued-features><span class=secno>6.9.2</span> <span class=content>Multi-valued feature value definitions</span></a></ul><li><a href=#font-variant-east-asian-prop><span class=secno>6.10</span> <span class=content>East Asian text rendering: the <span class=property data-link-type=propdesc title=font-variant-east-asian>font-variant-east-asian</span> property</span></a><li><a href=#font-variant-prop><span class=secno>6.11</span> <span class=content>Overall shorthand for font rendering: the <span class=property data-link-type=propdesc title=font-variant>font-variant</span> property</span></a><li><a href=#font-feature-settings-prop><span class=secno>6.12</span> <span class=content>Low-level font feature settings control: the <span class=property data-link-type=propdesc title=font-feature-settings>font-feature-settings</span> property</span></a><li><a href=#font-language-override-prop><span class=secno>6.13</span> <span class=content>Font language override: the <span class=property data-link-type=propdesc title=font-language-override>font-language-override</span> property</span></a></ul><li><a href=#font-feature-resolution><span class=secno>7</span> <span class=content>
Font Feature Resolution
<span></span>
</span></a><ul class=toc><li><a href=#default-features><span class=secno>7.1</span> <span class=content>Default features</span></a><li><a href=#feature-precedence><span class=secno>7.2</span> <span class=content>Feature precedence</span></a><li><a href=#feature-precedence-examples><span class=secno>7.3</span> <span class=content>Feature precedence examples</span></a></ul><li><a href=#object-model><span class=secno>8</span> <span class=content>Object Model</span></a><ul class=toc><li><a href=#om-fontface><span class=secno>8.1</span> <span class=content>The <code class=idl><span data-link-type=idl title=CSSFontFaceRule>CSSFontFaceRule</span></code> interface</span></a><li><a href=#om-fontfeaturevalues><span class=secno>8.2</span> <span class=content>The <code class=idl><span data-link-type=idl title=CSSFontFeatureValuesRule>CSSFontFeatureValuesRule</span></code> interface</span></a></ul><li><a href=#platform-props-to-css><span class=secno></span> <span class=content>Appendix A: Mapping platform font properties to CSS properties</span></a><li><a href=#ch-ch-ch-changes><span class=secno></span> <span class=content>Changes</span></a><ul class=toc><li><a href=#recent-changes><span class=secno></span> <span class=content>
Changes from the <span>July 2013 CSS3 Fonts Last Call Working Draft</span></span></a></ul><li><a href=#acknowledgments><span class=secno></span> <span class=content>Acknowledgments</span></a><li><a href=#conformance><span class=secno></span> <span class=content>
Conformance</span></a><ul class=toc><li><a href=#conventions><span class=secno></span> <span class=content>
Document conventions</span></a><li><a href=#conformance-classes><span class=secno></span> <span class=content>
Conformance classes</span></a><li><a href=#partial><span class=secno></span> <span class=content>
Partial implementations</span></a><li><a href=#experimental><span class=secno></span> <span class=content>
Experimental implementations</span></a><li><a href=#testing><span class=secno></span> <span class=content>
Non-experimental implementations</span></a></ul><li><a href=#references><span class=secno></span> <span class=content>References</span></a><ul class=toc><li><a href=#normative><span class=secno></span> <span class=content>Normative References</span></a><li><a href=#informative><span class=secno></span> <span class=content>Informative References</span></a></ul><li><a href=#index><span class=secno></span> <span class=content>Index</span></a><li><a href=#property-index><span class=secno></span> <span class=content>Property Index</span></a><ul class=toc><li><a href=#font-face-descriptor-table><span class=secno></span> <span class=content><span data-link-type=at-rule>@font-face</span> Descriptors</span></a></ul><li><a href=#idl-index><span class=secno></span> <span class=content>IDL Index</span></a></ul></div>
<h2 class="heading settled" data-level=1 id=introduction><span class=secno>1. </span><span class=content>Introduction</span><a class=self-link href=#introduction></a></h2>
<p>A font provides a resource containing the visual representation of
characters. At the simplest level it contains information that maps character
codes to shapes (called glyphs) that represent these characters. Fonts
sharing a common design style are commonly grouped into font families
classified by a set of standard font properties. Within a family, the
shape displayed for a given character can vary by stroke weight, slant
or relative width, among others. An individual font face is described by a
unique combination of these properties. For a given range of text, CSS
font properties are used to select a font family and a specific font
face within that family to be used when rendering that text. As a
simple example, to use the bold form of Helvetica one could use:</p>
<pre>body {
font-family: Helvetica;
font-weight: bold;
}
</pre>
<p>Font resources may be installed locally on the system on which a user
agent is running or downloadable. For local font resources descriptive
information can be obtained directly from the font resource. For
downloadable font resources (sometimes referred to as web fonts), the
descriptive information is included with the reference to the font
resource.</p>
<p>Families of fonts typically don’t contain a single face for each
possible variation of font properties. The CSS font selection mechanism
describes how to match a given set of CSS font properties to a single
font face.</p>
<h2 class="heading settled" data-level=2 id=typography-background><span class=secno>2. </span><span class=content>Typography Background</span><a class=self-link href=#typography-background></a></h2>
<p><em>This section is non-normative.</em></p>
<p>Typographic traditions vary across the globe, so there is no unique way
to classify all fonts across languages and cultures. For even common
Latin letters, wide variations are possible:</p>
<div class=figure><img alt="variations in glyphs for a single character" src=aaaaaa.png><p class=caption>One character, many glyph variations</div>
<p>Differences in the anatomy of letterforms is one way to distinguish
fonts. For Latin fonts, flourishes at the ends of a character’s main
strokes, or serifs, can distinguish a font from those without. Similar
comparisons exist in non-Latin fonts between fonts with tapered strokes
and those using primarily uniform strokes:</p>
<div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png><p class=caption>Letterforms with and without serifs</div>
<div class=figure><img alt="serif vs. non-serifs for japanese" src=minchovsgothic.png><p class=caption>Similar groupings for Japanese typefaces</div>
<p>Fonts contain letterforms and the data needed to map characters to
these letterforms. Often this may be a simple one-to-one mapping, but
more complex mappings are also possible. The use of combining diacritic
marks creates many variations for an underlying letterform:</p>
<div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png><p class=caption>Variations with diacritic marks</div>
<p>A sequence of characters can be represented by a single glyph known as a ligature:</p>
<div class=figure><img alt="example of a fi ligature" src=final-ligature.png><p class=caption>Ligature example</div>
<p>Visual transformations based on textual context are often
stylistic option in European languages. They are required to correctly
render languages like Arabic, the lam and alef characters below
<em>must</em> be combined when they exist in sequence:</p>
<div class=figure><img alt="lam alef ligature" src=lamaleflig.png><p class=caption>Required Arabic ligature</div>
<p>The relative complexity of these shaping transformations requires
additional data within the font.</p>
<p>Sets of font faces with various stylistic variations are often
grouped together into font families. In the simplest case a regular
face is supplemented with bold and italic faces, but much more extensive
groupings are possible. Variations in the thickness of letterform
strokes, the <dfn data-dfn-type=dfn data-noexport="" id=weight>weight<a class=self-link href=#weight></a></dfn>, and the overall proportions of the letterform,
the <dfn data-dfn-type=dfn data-noexport="" id=width>width<a class=self-link href=#width></a></dfn>, are most common. In the example below, each letter uses a
different font face within the Univers font family. The width used
increases from top to bottom and the weight increases from left to
right:</p>
<div class=figure><img alt="various width and weight variations within a single family" src=weightwidthvariations.png><p class=caption>Weight and width variations within a single font family</div>
<p>Creating fonts that support multiple scripts is a difficult task;
designers need to understand the cultural traditions surrounding the
use of type in different scripts and come up with letterforms that
somehow share a common theme. Many languages often share a common
script and each of these languages may have noticeable stylistic
differences. For example, the Arabic script, when used for Persian and
Urdu, exhibits significant and systematic differences in letterforms,
as does Cyrillic when used with languages such as Serbian and
Russian.</p>
<p>The <em>character map</em> of a font defines the mapping of characters
to glyphs for that font. If a document contains characters not
supported by the <em title="character map">character maps</em> of the fonts contained in a font
family list, a
user agent may use a <em>system font fallback</em> procedure to locate an
appropriate font that does. If no appropriate font can be found,
some form of "missing glyph" character will be rendered by the
user agent. System fallback can occur when the specified list of font families
does not include a font that supports a given character.</p>
<p>Although the <em>character map</em> of a font maps a given character to a
glyph for that character, modern font technologies such as OpenType
and AAT (Apple Advanced Typography) provide ways of mapping a
character to different glyphs based upon feature settings. Fonts in
these formats allow these features to be embedded in the font itself
and controlled by applications. Common typographic features which can
be specified this way include ligatures, swashes, contextual
alternates, proportional and tabular figures, and automatic fractions,
to list just a few. For a visual overview of OpenType features, see
the <a data-biblio-type=informative data-link-type=biblio href=#biblio-opentype-font-guide title=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]</a>.</p>
<h2 class="heading settled" data-level=3 id=basic-font-props><span class=secno>3. </span><span class=content>Basic Font Properties</span><a class=self-link href=#basic-font-props></a></h2>
<p>The particular font face used to render a character is determined by
the font family and other font properties that apply to a given element.
This structure allows settings to be varied independent of each
other.</p>
<h3 class="heading settled" data-level=3.1 id=font-family-prop><span class=secno>3.1. </span><span class=content>Font family: the <a class=property data-link-type=propdesc href=#propdef-font-family title=font-family>font-family</a> property</span><a class=self-link href=#font-family-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font-family>font-family<a class=self-link href=#propdef-font-family></a></dfn><tr><th>Value:<td class=prod>[ <a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css2/fonts.html#value-def-family-name title="<family-name>">&lt;family-name&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a class="production css" data-link-type=type href=#typedef-generic-family title="<generic-family>">&lt;generic-family&gt;</a> ]<a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#mult-comma title=#>#</a><tr><th>Initial:<td>depends on user agent<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>n/a<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>no</table>
<p>This property specifies a prioritized list of font family names or
generic family names. A font family defines a set of faces that vary
in weight, width or slope. CSS uses the combination of a family name
with other style attributes to select an individual face. Using this
selection mechanism, rather than selecting a face via the style name
as is often done in design applications, allows some degree of
regularity in textual display when fallback occurs.</p>
<p class=note>Note: Designers should note that the CSS definition of font
attributes used for selection are explicitly not intended to define a
font taxonomy. A type designer’s idea of a family may often extend to
a set of faces that vary along axes other than just the standard axes
of weight, width and slope. A family may extend to include both a set
of serif faces and a set of sans-serif faces or vary along axes that
are unique to that family. The CSS font selection mechanism merely
provides a way to determine the “closest” substitute when
substitution is necessary.</p>
<p>Unlike other CSS properties, component values are a comma-separated
list indicating alternatives. A user agent iterates through the list
of family names until it matches an available font that contains a
glyph for the character to be rendered. This allows for differences
in available fonts across platforms and for differences in the range
of characters supported by individual fonts.</p>
<p>A font family name only specifies a name given to a set of font
faces, it does not specify an individual face. For example, given the availability
of the fonts below, Futura would match but Futura Medium would not:</p>
<div class=figure><img alt="family and face names" src=familyvsfacename.png><p class=caption>Family and individual face names</div>
<p>Consider the example below:</p>
<div class=example>
<pre>body {
font-family: Helvetica, Verdana, sans-serif;
}</pre>
<p>If Helvetica is available it will be used when rendering. If
neither Helvetica nor Verdana is present, then the user-agent-defined
sans serif font will be used.</p>
</div>
<p>There are two types of font family names:</p>
<dl data-dfn-for=font-family data-dfn-type=value>
<dt><dfn class=css data-dfn-for=font-family data-dfn-type=value data-export="" id=family-name-value><a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css2/fonts.html#value-def-family-name title="<family-name>">&lt;family-name&gt;</a><a class=self-link href=#family-name-value></a></dfn>
<dd>The name of a font family of choice such as Helvetica or Verdana in the previous example.
<dt><dfn class=css data-dfn-for=font-family data-dfn-type=value data-export="" id=generic-family-value><a class="production css" data-link-type=type href=#typedef-generic-family title="<generic-family>">&lt;generic-family&gt;</a><a class=self-link href=#generic-family-value></a></dfn>
<dd>
The following generic family keywords are defined: <a class=css data-link-type=maybe href=#valdef-generic-family-serif title=serif>serif</a>, <a class=css data-link-type=maybe href=#valdef-generic-family-sans-serif title=sans-serif>sans-serif</a>, <a class=css data-link-type=maybe href=#valdef-generic-family-cursive title=cursive>cursive</a>,
<a class=css data-link-type=maybe href=#valdef-generic-family-fantasy title=fantasy>fantasy</a>, and <a class=css data-link-type=maybe href=#valdef-generic-family-monospace title=monospace>monospace</a>. These keywords can be used as a general fallback mechanism
when an author’s desired font choices are not available. As keywords, they must not
be quoted. Authors are encouraged to append a generic font family as a last alternative for
improved robustness.
</dl>
<p>Font family names other than generic families must either be given quoted as <a href=http://www.w3.org/TR/CSS21/syndata.html#strings>strings,</a>
or unquoted as a sequence of one or more
<a href=http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier>identifiers.</a>
This means most punctuation characters and digits at the start of
each token must be escaped in unquoted font family names.</p>
<p>To illustrate this, the following declarations are invalid:</p>
<pre>font-family: Red/Black, sans-serif;
font-family: "Lucida" Grande, sans-serif;
font-family: Ahem!, sans-serif;
font-family: test@foo, sans-serif;
font-family: #POUND, sans-serif;
font-family: Hawaii 5-0, sans-serif;
</pre>
<p>If a sequence of identifiers is given as a font family name,
the computed value is the name converted to a string by joining
all the identifiers in the sequence by single spaces.</p>
<p>To avoid mistakes in escaping, it is recommended to quote font
family names that contain white space, digits, or punctuation
characters other than hyphens:</p>
<pre>body { font-family: "New Century Schoolbook", serif }
&lt;BODY STYLE="font-family: '21st Century', fantasy"&gt;
</pre>
<p>Font family <em>names</em> that happen to be the same as a keyword
value (<span class=css>inherit</span>, <a class=css data-link-type=maybe href=#valdef-generic-family-serif title=serif>serif</a>, <a class=css data-link-type=maybe href=#valdef-generic-family-sans-serif title=sans-serif>sans-serif</a>, <a class=css data-link-type=maybe href=#valdef-generic-family-monospace title=monospace>monospace</a>, <a class=css data-link-type=maybe href=#valdef-generic-family-fantasy title=fantasy>fantasy</a>, and
<a class=css data-link-type=maybe href=#valdef-generic-family-cursive title=cursive>cursive</a>) must be quoted to prevent confusion with the keywords with
the same names. The keywords <span class=css>initial</span> and <span class=css>default</span> are reserved for
future use and must also be quoted when used as font names. UAs must
not consider these keywords as matching the <var>&lt;family-name&gt;</var>
type.</p>
<p>The precise way a set of fonts are grouped into font families
varies depending upon the platform font management API’s. The
Windows GDI API only allows four faces to be grouped into a family
while the DirectWrite API and API’s on OSX and other platforms support
font families with a variety of weights, widths and slopes (see <a href=#platform-props-to-css>Appendix A</a> for more details).</p>
<p>Some font formats allow fonts to carry multiple localizations
of the family name. User agents must recognize and correctly
match all of these names independent of the underlying platform
localization, system API used or document encoding:</p>
<div class=figure><img alt="examples of localized family names" src=localizedfamilynames.png><p class=caption>Localized family names</div>
<p>The details of localized font family name matching and the
corresponding issues of case sensitivity are described below in the
<a href=#font-family-casing>font matching</a> section.</p>
<h4 class="heading settled" data-level=3.1.1 id=generic-font-families><span class=secno>3.1.1. </span><span class=content>Generic font families</span><a class=self-link href=#generic-font-families></a></h4>
<p>All five generic font families are defined to exist in all CSS
implementations (they need not necessarily map to five distinct actual
fonts). User agents should provide reasonable default choices for the
generic font families, which express the characteristics of each family
as well as possible within the limits allowed by the underlying
technology. User agents are encouraged to allow users to select
alternative choices for the generic fonts.</p>
<p>The syntax of <dfn class=css data-dfn-type=type data-export="" id=typedef-generic-family>&lt;generic-family&gt;<a class=self-link href=#typedef-generic-family></a></dfn> is:</p>
<pre class=prod>&lt;generic-family&gt; = serif <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> sans-serif <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> cursive <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> fantasy <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> monospace</pre>
<h5 class="no-num no-toc heading settled" id=serif-family><span class=content><dfn class=css data-dfn-for="<generic-family>" data-dfn-type=value data-export="" id=valdef-generic-family-serif>serif<a class=self-link href=#valdef-generic-family-serif></a></dfn></span><a class=self-link href=#serif-family></a></h5>
<p>Serif fonts represent the formal text style for a script.
This often means but is not limited to glyphs that have finishing
strokes, flared or tapering ends, or have actual serifed endings
(including slab serifs). Serif fonts are typically
proportionately-spaced. They often display a greater variation between
thick and thin strokes than fonts from the <a class=css data-link-type=maybe href=#valdef-generic-family-sans-serif title=sans-serif>sans-serif</a> generic font
family. CSS uses the term <a class=css data-link-type=maybe href=#valdef-generic-family-serif title=serif>serif</a> to apply to a font for any script,
although other names may be more familiar for particular scripts, such
as Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean).
For Arabic, the Naskh style would correspond to <a class=css data-link-type=maybe href=#valdef-generic-family-serif title=serif>serif</a> more due to
its typographic role rather than its actual design style.
Any font that is so described may be used to represent the
generic <a class=css data-link-type=maybe href=#valdef-generic-family-serif title=serif>serif</a> family.</p>
<div class=figure><img alt="sample serif fonts" src=serifexamples.png><p class=caption>Sample serif fonts</div>
<h5 class="no-num no-toc heading settled" id=sans-serif-family><span class=content><dfn class=css data-dfn-for="<generic-family>" data-dfn-type=value data-export="" id=valdef-generic-family-sans-serif>sans-serif<a class=self-link href=#valdef-generic-family-sans-serif></a></dfn></span><a class=self-link href=#sans-serif-family></a></h5>
<p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
low contrast (vertical and horizontal stems have the close to the same
thickness) and have stroke
endings that are plain -- without any flaring, cross stroke, or other
ornamentation. Sans-serif fonts are typically
proportionately-spaced. They often have little variation between thick
and thin strokes, compared to fonts from the <a class=css data-link-type=maybe href=#valdef-generic-family-serif title=serif>serif</a> family. CSS uses
the term <a class=css data-link-type=maybe href=#valdef-generic-family-sans-serif title=sans-serif>sans-serif</a> to apply to a font for any script, although
other names may be more familiar for particular scripts, such as
Gothic (Japanese), Hei (Chinese), or Gulim (Korean). Any font that
is so described may be used to represent the generic <a class=css data-link-type=maybe href=#valdef-generic-family-sans-serif title=sans-serif>sans-serif</a>
family.</p>
<div class=figure><img alt="sample sans-serif fonts" src=sansserifexamples.png><p class=caption>Sample sans-serif fonts</div>
<h5 class="no-num no-toc heading settled" id=cursive-family><span class=content><dfn class=css data-dfn-for="<generic-family>" data-dfn-type=value data-export="" id=valdef-generic-family-cursive>cursive<a class=self-link href=#valdef-generic-family-cursive></a></dfn></span><a class=self-link href=#cursive-family></a></h5>
<p>Glyphs in cursive fonts generally use a more informal script style,
and the result looks more like handwritten pen or brush writing than
printed letterwork. CSS uses the term <a class=css data-link-type=maybe href=#valdef-generic-family-cursive title=cursive>cursive</a> to apply to a font for
any script, although other names such as Chancery, Brush, Swing and
Script are also used in font names.</p>
<div class=figure><img alt="sample cursive fonts&q DB3 uot; src=cursiveexamples.png><p class=caption>Sample cursive fonts</div>
<h5 class="no-num no-toc heading settled" id=fantasy-family><span class=content><dfn class=css data-dfn-for="<generic-family>" data-dfn-type=value data-export="" id=valdef-generic-family-fantasy>fantasy<a class=self-link href=#valdef-generic-family-fantasy></a></dfn></span><a class=self-link href=#fantasy-family></a></h5>
<p>Fantasy fonts are primarily decorative or expressive fonts that contain decorative or
expressive representations of characters.
These do not include Pi or Picture fonts which do not represent actual characters.</p>
<div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png><p class=caption>Sample fantasy fonts</div>
<h5 class="no-num no-toc heading settled" id=monospace-family><span class=content><dfn class=css data-dfn-for="<generic-family>" data-dfn-type=value data-export="" id=valdef-generic-family-monospace>monospace<a class=self-link href=#valdef-generic-family-monospace></a></dfn></span><a class=self-link href=#m FE0D onospace-family></a></h5>
<p>The sole criterion of a monospace font is that all glyphs have the same fixed width. This is often used
to render samples of computer code.</p>
<div class=figure><img alt="sample monospace fonts" src=monospaceexamples.png><p class=caption>Sample monospace fonts</div>
<h3 class="heading settled" data-level=3.2 id=font-weight-prop><span class=secno>3.2. </span><span class=content>Font weight: the <a class=property data-link-type=propdesc href=#propdef-font-weight title=font-weight>font-weight</a> property</span><a class=self-link href=#font-weight-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font-weight>font-weight<a class=self-link href=#propdef-font-weight></a></dfn><tr><th>Value:<td class=prod>normal <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> bold <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> bolder <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> lighter <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 100 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 200 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 300 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 400 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 500 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 600 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 700 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 800 <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> 900<tr><th>Initial:<td>normal<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>n/a<tr><th>Media:<td>visual<tr><th>Computed value:<td>numeric weight value (see description)<tr><th>Animatable:<td>as font weight</table>
<p>The <a class=property data-link-type=propdesc href=#propdef-font-weight title=font-weight>font-weight</a> property specifies the weight of glyphs in the font,
their degree of blackness or stroke thickness.</p>
<p>Values have the following meanings:</p>
<dl data-dfn-for=font-weight data-dfn-type=value>
<dt><dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-100>100<a class=self-link href=#valdef-font-weight-100></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-200>200<a class=self-link href=#valdef-font-weight-200></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-300>300<a class=self-link href=#valdef-font-weight-300></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-400>400<a class=self-link href=#valdef-font-weight-400></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-500>500<a class=self-link href=#valdef-font-weight-500></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-600>600<a class=self-link href=#valdef-font-weight-600></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-700>700<a class=self-link href=#valdef-font-weight-700></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-800>800<a class=self-link href=#valdef-font-weight-800></a></dfn>, <dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-900>900<a class=self-link href=#valdef-font-weight-900></a></dfn>
<dd>
These values form an ordered sequence,
where each number indicates a weight that is at least as dark as its predecessor.
These roughly correspond to the commonly used weight names below:
<ul><li data-md=""><p>100 - Thin</p>
<li data-md=""><p>200 - Extra Light (Ultra Light)</p>
<li data-md=""><p>300 - Light</p>
<li data-md=""><p>400 - Normal</p>
<li data-md=""><p>500 - Medium</p>
<li data-md=""><p>600 - Semi Bold (Demi Bold)</p>
<li data-md=""><p>700 - Bold</p>
<li data-md=""><p>800 - Extra Bold (Ultra Bold)</p>
<li data-md=""><p>900 - Black (Heavy)</p>
</ul>
<dt><dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-normal>normal<a class=self-link href=#valdef-font-weight-normal></a></dfn>
<dd>Same as <a class=css data-link-type=maybe href=#valdef-font-weight-400 title=400>400</a>.
<dt><dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-bold>bold<a class=self-link href=#valdef-font-weight-bold></a></dfn>
<dd>Same as <a class=css data-link-type=maybe href=#valdef-font-weight-700 title=700>700</a>.
<dt><dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-bolder>bolder<a class=self-link href=#valdef-font-weight-bolder></a></dfn>
<dd>Specifies a bolder weight than the inherited value.
<dt><dfn class=css data-dfn-for=font-weight data-dfn-type=value data-export="" id=valdef-font-weight-lighter>lighter<a class=self-link href=#valdef-font-weight-lighter></a></dfn>
<dd>Specifies a lighter weight than the inherited value.
</dl>
<p>Font formats that use a scale other than a nine-step scale should map
their scale onto the CSS scale so that <a class=css data-link-type=maybe href=#valdef-font-weight-400 title=400>400</a> roughly corresponds with a
face that would be labeled as Regular, Book, Roman and <a class=css data-link-type=maybe href=#valdef-font-weight-700 title=700>700</a> roughly
matches a face that would be labeled as Bold. Or weights may be
inferred from the style names, ones that correspond roughly with the
scale above. The scale is relative, so a face with a larger weight value
must never appear lighter. If style names are used to infer weights,
care should be taken to handle variations in style names across locales.</p>
<p>Quite often there are only a few weights available for a particular
font family. When a weight is specified for which no face exists, a
face with a nearby weight is used. In general, bold weights map to faces
with heavier weights and light weights map to faces with lighter weights
(see <a data-section="" href=#font-matching-algorithm>§5 Font Matching Algorithm</a> for a precise definition). The examples here illustrate which
face is used for different weights, grey indicates a face for that
weight does not exist so a face with a nearby weight is used:</p>
<div class=figure><img alt="weight mappings for a family with 400, 700 and 900 weights" src=optimaweights.png><p class=caption>Weight mappings for a font family with 400, 700 and 900 weight faces</div>
<div class=figure><img alt="weight mappings for a family with 300, 600 weights" src=hiraginoweights.png><p class=caption>Weight mappings for a font family with 300 and 600 weight faces</div>
<p>Although the practice is not well-loved by typographers, bold faces are often
synthesized by user agents for faces that lack actual bold faces. For
the purposes of style matching, these faces must be treated as if they
exist within the family. Authors can explicitly avoid this behavior
by using the <a class=property data-link-type=propdesc href=#propdef-font-synthesis title=font-synthesis>font-synthesis</a> property.</p>
<p>Specified values of <a class=css data-link-type=maybe href=#valdef-font-weight-bolder title=bolder>bolder</a> and <a class=css data-link-type=maybe href=#valdef-font-weight-lighter title=lighter>lighter</a> indicate weights
relative to the weight of the parent element. The computed weight is
calculated based on the inherited <a class=property data-link-type=propdesc href=#propdef-font-weight title=font-weight>font-weight</a> value using the chart
below.</p>
<table class=data id=bolderlighter summary="Bolder/lighter mappings">
<thead>
<tr>
<th>Inherited value
<th>bolder
<th>lighter
<tbody>
<tr><th>100<td>400<td>100
<tr><th>200<td>400<td>100
<tr><th>300<td>400<td>100
<tr><th>400<td>700<td>100
<tr><th>500<td>700<td>100
<tr><th>600<td>900<td>400
<tr><th>700<td>900<td>400
<tr><th>800<td>900<td>700
<tr><th>900<td>900<td>700
</table>
<p>The table above is equivalent to selecting the next relative bolder or lighter face,
given a font family containing normal and bold faces along with a thin and a heavy face.
Authors who desire finer control over the exact weight values used for a given element
may use numerical values instead of relative weights.</p>
<h3 class="heading settled" data-level=3.3 id=font-stretch-prop><span class=secno>3.3. </span><span class=content>Font width: the <a class=property data-link-type=propdesc href=#propdef-font-stretch title=font-stretch>font-stretch</a> property</span><a class=self-link href=#font-stretch-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font-stretch>font-stretch<a class=self-link href=#propdef-font-stretch></a></dfn><tr><th>Value:<td class=prod>normal <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> ultra-condensed <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> extra-condensed <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> condensed <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> semi-condensed <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> semi-expanded <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> expanded <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> extra-expanded <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> ultra-expanded<tr><th>Initial:<td>normal<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>n/a<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>as font stretch</table>
<p>The <a class=property data-link-type=propdesc href=#propdef-font-stretch title=font-stretch>font-stretch</a> property selects a normal,
condensed, or expanded face from a font family. Absolute keyword values
have the following ordering, from narrowest to widest:</p>
<ul data-dfn-for=font-stretch data-dfn-type=value>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-ultra-condensed>ultra-condensed<a class=self-link href=#valdef-font-stretch-ultra-condensed></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-extra-condensed>extra-condensed<a class=self-link href=#valdef-font-stretch-extra-condensed></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-condensed>condensed<a class=self-link href=#valdef-font-stretch-condensed></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-semi-condensed>semi-condensed <a class=self-link href=#valdef-font-stretch-semi-condensed></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-normal>normal<a class=self-link href=#valdef-font-stretch-normal></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-semi-expanded>semi-expanded<a class=self-link href=#valdef-font-stretch-semi-expanded></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-expanded>expanded<a class=self-link href=#valdef-font-stretch-expanded></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-extra-expanded>extra-expanded<a class=self-link href=#valdef-font-stretch-extra-expanded></a></dfn>
<li><dfn class=css data-dfn-for=font-stretch data-dfn-type=value data-export="" id=valdef-font-stretch-ultra-expanded>ultra-expanded<a class=self-link href=#valdef-font-stretch-ultra-expanded></a></dfn>
</ul>
<p>When a face does not exist
for a given width, normal or condensed values map to a narrower face,
otherwise a wider face. Conversely, expanded values map to a wider
face, otherwise a narrower face. The figure below shows how the nine
font-stretch property settings affect font selection for font family
containing a variety of widths, grey indicates a width for which no
face exists and a different width is substituted:</p>
<div class=figure><img alt="width mappings for a family with condensed, normal and expanded faces" src=universwidths.png><p class=caption>Width mappings for a font family with condensed, normal and expanded width faces</div>
<p id=font-stretch-animation>Animation of font stretch: Font stretch is
interpolated in discrete steps. The interpolation happens as though the
ordered values are equally spaced real numbers. The interpolation result
is rounded to the nearest value, with values exactly halfway between two
values rounded towards the later value in the list above.
<h3 class="heading settled" data-level=3.4 id=font-style-prop><span class=secno>3.4. </span><span class=content>Font style: the <a class=property data-link-type=propdesc href=#propdef-font-style title=font-style>font-style</a> property</span><a class=self-link href=#font-style-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font-style>font-style<a class=self-link href=#propdef-font-style></a></dfn><tr><th>Value:<td class=prod>normal <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> italic <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> oblique<tr><th>Initial:<td>normal<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>n/a<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specifed<tr><th>Animatable:<td>no</table>
<p>The <a class=property data-link-type=propdesc href=#propdef-font-style title=font-style>font-style</a> property allows
italic or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are
typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the
glyphs of the regular face. Compare the artificially sloped renderings of Palatino "a" and Baskerville "N"
in grey with the actual italic versions:</p>
<div class=figure><img alt="artificial sloping vs. real italics" src=realvsfakeitalics.png><p class=caption>Artificial sloping versus real italics</div>
<p>Values have the following meanings:</p>
<dl data-dfn-for=font-style data-dfn-type=value>
<dt><dfn class=css data-dfn-for=font-style data-dfn-type=value data-export="" id=valdef-font-style-normal>normal<a class=self-link href=#valdef-font-style-normal></a></dfn>
<dd>selects a face that is classified as a normal face, one that is neither italic or obliqued
<dt><dfn class=css data-dfn-for=font-style data-dfn-type=value data-export="" id=valdef-font-style-italic>italic<a class=self-link href=#valdef-font-style-italic></a></dfn>
<dd>selects a font that is labeled as an italic face, or an oblique face if one is not
<dt><dfn class=css data-dfn-for=font-style data-dfn-type=value data-export="" id=valdef-font-style-oblique>oblique<a class=self-link href=#valdef-font-style-oblique></a></dfn>
<dd>selects a font that is labeled as an oblique face, or an italic face if one is not
</dl>
<p>If no italic or oblique face is available, oblique faces can be
synthesized by rendering non-obliqued faces with an artificial
obliquing operation. The use of these artificially obliqued faces
can be disabled using the <a class=property data-link-type=propdesc href=#propdef-font-synthesis title=font-synthesis>font-synthesis</a> property. The details
of the obliquing operation are not explicitly defined.</p>
<p class=note>Note: Authors should also be aware that synthesized
approaches may not be suitable for scripts like Cyrillic, where italic
forms are very different in shape. It is always better to use an actual
italic font rather than rely on a synthetic version.</p>
<p>Many scripts lack the tradition of mixing a cursive form within
text rendered with a normal face. Chinese, Japanese and Korean fonts
almost always lack italic or oblique faces. Fonts that support a
mixture of scripts will sometimes omit specific scripts such as Arabic
from the set of glyphs supported in the italic face. User agents
should be careful about making <em>character map</em> assumptions across
faces when implementing support for <em>system font fallback</em>.</p>
<h3 class="heading settled" data-level=3.5 id=font-size-prop><span class=secno>3.5. </span><span class=content>Font size: the <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a> property</span><a class=self-link href=#font-size-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font-size> DB3 font-size<a class=self-link href=#propdef-font-size></a></dfn><tr><th>Value:<td class=prod><a class="production css" data-link-type=type href=#typedef-absolute-size title="<absolute-size>">&lt;absolute-size&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a class="production css" data-link-type=type href=#typedef-relative-size title="<relative-size>">&lt;relative-size&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#percentage-value title="<percentage>">&lt;percentage&gt;</a><tr><th>Initial:<td>medium<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>refer to parent element’s font size<tr><th>Media:<td>visual<tr><th>Computed value:<td>absolute length<tr><th>Animatable:<td>as length</table>
<p>This property indicates the desired height of glyphs from the
font. For scalable fonts, the font-size is a scale factor applied to the EM unit
of the font. (Note that certain glyphs may bleed outside their EM box.) For
non-scalable fonts, the font-size is converted into absolute units and matched
against the declared font-size of the font, using the same absolute coordinate
space for both of the matched values.
Values have the following meanings:</p>
<dl data-dfn-for=font-size data-dfn-type=value>
<dt><dfn class=css data-dfn-type=type data-export="" id=typedef-absolute-size>&lt;absolute-size&gt;<a class=self-link href=#typedef-absolute-size></a></dfn>
<dd> An <a class="production css" data-link-type=type href=#typedef-absolute-size title="<absolute-size>">&lt;absolute-size&gt;</a> keyword refers to an entry
in a table of font sizes computed and kept by the user agent. Possible values
are:
<pre class=prod data-link-for="<absolute-size>" data-link-type=value><a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-xx-small title=xx-small>xx-small</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-x-small title=x-small>x-small</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-small title=small>small</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-medium title=medium>medium</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-large title=large>large</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-x-large title=x-large>x-large</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a data-link-for="<absolute-size>" data-link-type=value href=#valdef-font-size-absolute-size-xx-large title=xx-large>xx-large</a>
</pre>
<dt><dfn class=css data-dfn-type=type data-export="" id=typedef-relative-size>&lt;relative-size&gt;<a class=self-link href=#typedef-relative-size></a></dfn>
<dd> A <a class="production css" data-link-type=type href=#typedef-relative-size title="<relative-size>">&lt;relative-size&gt;</a> keyword is interpreted
relative to the table of font sizes and the computed <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a> of the
parent element. Possible values are:
<pre class=prod data-dfn-for="<relative-size> font-size" data-dfn-type=value><dfn data-dfn-for="<relative-size> font-size" data-dfn-type=value data-export="" id=valdef-relative-size-font-size-larger>larger<a class=self-link href=#valdef-relative-size-font-size-larger></a></dfn> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <dfn data-dfn-for="<relative-size> font-size" data-dfn-type=value data-export="" id=valdef-relative-size-font-size-smaller>smaller<a class=self-link href=#valdef-relative-size-font-size-smaller></a></dfn>
</pre>
<p>For example, if the parent element has a font size of
<a class=css data-link-type=maybe href=#valdef-font-size-absolute-size-medium title=medium>medium</a>, a value of <a class=css data-link-type=maybe href=#valdef-relative-size-font-size-larger title=larger>larger</a> will make the font size of the
current element be <a class=css data-link-type=maybe href=#valdef-font-size-absolute-size-large title=large>large</a>. If the parent element’s size is not
close to a table entry, the user agent is free to interpolate
between table entries or round off to the closest one. The user
agent may have to extrapolate table values if the numerical value
goes beyond the keywords.</p>
<dt><dfn class=css data-dfn-for=font-size data-dfn-type=value data-export="" id=valdef-font-size-length><a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#length-value title="<length>">&lt;length&gt;</a><a class=self-link href=#valdef-font-size-length></a></dfn>
<dd>A length value specifies an absolute font size
(independent of the user agent’s font table).
Negative lengths are illegal.
<dt><dfn class=css data-dfn-for=font-size data-dfn-type=value data-export="" id=valdef-font-size-percentage><a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#percentage-value title="<percentage>">&lt;percentage&gt;</a><a class=self-link href=#valdef-font-size-percentage></a></dfn>
<dd>A percentage value specifies an absolute font size relative
to the parent element’s font size. Use of percentage values, or
values in <span class=css>em</span>s, leads to more robust and cascadable style sheets.
</dl>
<p>The following table provides user agent guidelines for the
absolute-size scaling factor and their mapping to HTML heading and
absolute font-sizes. The <a class=css data-link-type=maybe href=#valdef-font-size-absolute-size-medium title=medium>medium</a> value is used as the reference
middle value. The user agent may fine-tune these values for different
fonts or different types of display devices.</p>
<table class=data>
<thead data-dfn-for="font-size <absolute-size>" data-dfn-type=value>
<tr><th scope=row><a class="production css" data-link-type=type href=#typedef-absolute-size title="<absolute-size>">&lt;absolute-size&gt;</a>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-xx-small>xx-small<a class=self-link href=#valdef-font-size-absolute-size-xx-small></a></dfn>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-x-small>x-small<a class=self-link href=#valdef-font-size-absolute-size-x-small></a></dfn>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-small>small<a class=self-link href=#valdef-font-size-absolute-size-small></a></dfn>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-medium>medium<a class=self-link href=#valdef-font-size-absolute-size-medium></a></dfn>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-large>large<a class=self-link href=#valdef-font-size-absolute-size-large></a></dfn>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-x-large>x-large<a class=self-link href=#valdef-font-size-absolute-size-x-large></a></dfn>
<th scope=col><dfn class=css data-dfn-for="font-size <absolute-size>" data-dfn-type=value data-export="" id=valdef-font-size-absolute-size-xx-large>xx-large<a class=self-link href=#valdef-font-size-absolute-size-xx-large></a></dfn>
<th scope=col>
<tbody>
<tr>
<th scope=row>scaling factor
<td>3/5
<td>3/4
<td>8/9
<td>1
<td>6/5
<td>3/2
<td>2/1
<td>3/1
<tr>
<th scope=row>HTML headings
<td>h6
<td>
<td>h5
<td>h4
<td>h3
<td>h2
<td>h1
<td>
<tr>
<th scope=row>HTML font sizes
<td>1
<td>
<td>2
<td>3
<td>4
<td>5
<td>6
<td>7
</table>
<p class=note>Note: To preserve readability, an UA applying
these guidelines should nevertheless avoid creating font-size resulting
in less than 9 device pixels per EM unit on a computer display.</p>
<p class=note>Note: In CSS1, the suggested
scaling factor between adjacent indexes was 1.5 which user experience
proved to be too large. In CSS2, the suggested scaling factor for computer
screen between adjacent indexes was 1.2 which still created issues for the small
sizes. The new scaling factor varies between each index to provide a better
readability.</p>
<p>The actual value of this property may differ from the computed
value due a numerical value on <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> and the
unavailability of certain font sizes.</p>
<p>Child elements inherit the computed <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a> value (otherwise, the
effect of <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> would compound).</p>
<div class=example>
Examples:
<pre>p { font-size: 12pt; }
blockquote { font-size: larger }
em { font-size: 150% }
em { font-size: 1.5em }
</pre>
</div>
<h3 class="heading settled" data-level=3.6 id=font-size-adjust-prop><span class=secno>3.6. </span><span class=content>Relative sizing: the <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> property</span><a class=self-link href=#font-size-adjust-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font-size-adjust>font-size-adjust<a class=self-link href=#propdef-font-size-adjust></a></dfn><tr><th>Value:<td class=prod>none <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> <a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#number-value title="<number>">&lt;number&gt;</a><tr><th>Initial:<td>none<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Percentages:<td>n/a<tr><th>Media:<td>visual<tr><th>Computed value:<td>as specified<tr><th>Animatable:<td>as number</table>
<p>For any given font size, the apparent size and legibility of text
varies across fonts. For scripts such as Latin or Cyrillic that
distinguish between upper and lowercase letters, the relative height
of lowercase letters compared to their uppercase counterparts is a
determining factor of legibility. This is commonly referred to as the
<dfn data-dfn-type=dfn data-local-title="aspect value" data-noexport="" id=font-aspect-value title="font aspect value">aspect value<a class=self-link href=#font-aspect-value></a></dfn>.
Precisely defined, it is equal to the x-height of a font divided by
the font size.</p>
<p>In situations where font fallback occurs, fallback fonts may not
share the same aspect value as the desired font family and will thus
appear less readable. The <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> property is a way to
preserve the readability of text when font fallback occurs. It does
this by adjusting the font-size so that the x-height is the same
regardless of the font used.</p>
<div class=example>
The style defined below defines Verdana as the desired font family, but if Verdana is not available Futura or Times
will be used.
<pre>p {
font-family: Verdana, Futura, Times;
}
&lt;p&gt;Lorem ipsum dolor sit amet, ...&lt;/p&gt;
</pre>
<p>Verdana has a relatively high aspect value, lowercase letters are relatively tall compared to uppercase
letters, so at small sizes text appears legible. Times has a lower aspect value and so if fallback occurs,
the text will be less legible at small sizes than Verdana.</p>
</div>
<p>How text rendered in each of these fonts compares is shown below, the columns show text rendered in Verdana, Futura and Times.
The same font-size value is used across cells
within each row and red lines are included to show the differences in x-height. In the upper half each row is rendered in the same font-size value. The same is true
for the lower half but in this half the <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> property is also set so that the actual font size is adjusted
to preserve the x-height across each row. Note how small text remains relatively legible across each row in the lower half.</p>
<div class=figure><img alt="text with and without 'font-size-adjust'" src=fontsizeadjust.png><p class=caption>Text with and without the use of <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a></div>
<p>This property allows authors to specify an <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> for an element that
will effectively preserve the x-height of the first choice font, whether it is substituted
or not. Values have the following meanings:</p>
<dl data-dfn-for=font-size-adjust data-dfn-type=value>
<dt><dfn class=css data-dfn-for=font-size-adjust data-dfn-type=value data-export="" id=valdef-font-size-adjust-none>none<a class=self-link href=#valdef-font-size-adjust-none></a></dfn>
<dd>Do not preserve the font’s x-height.
<dt><dfn class=css data-dfn-for=font-size-adjust data-dfn-type=value data-export="" id=valdef-font-size-adjust-number><a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#number-value title="<number>">&lt;number&gt;</a><a class=self-link href=#valdef-font-size-adjust-number></a></dfn>
<dd>
Specifies the <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> used in the calculation below to calculate the adjusted font size:
<pre>c = ( a / a' ) s </pre>
<p>where:</p>
<pre>s = font-size value
a = <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> as specified by the 'font-size-adjust' property
a' = <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> of actual font
c = adjusted font-size to use
</pre>
<p>This value applies to any font that is selected but in typical usage it should be based
on the <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> of the first font in the font-family list. If this is specified accurately,
the <tt>(a/a')</tt> term in the formula above is effectively 1 for the first font and no adjustment occurs.
If the value is specified inaccurately, text rendered using the first font in the family
list will display differently in older user agents that don’t support <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a>.</p>
</dl>
<p>The value of <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> affects the used value of <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a> but
does not affect the computed value. It affects the size of relative units
that are based on font metrics of the <a data-link-type=dfn href=#first-available-font title="first available font">first available font</a> such
as <code>ex</code> and <code>ch</code> but does not affect the size of
<code>em</code> units. Since numeric values of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-line-height title=line-height>line-height</a>
refer to the computed size of <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a>,
<a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> does not affect the used value of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-line-height title=line-height>line-height</a>.</p>
<p class=note>Note: In CSS, authors often specify <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-line-height title=line-height>line-height</a>
as a multiple of the <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a>. Since the <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a>
property affects the used value of <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a>, authors should take
care setting the line height when <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> is used. Setting
the line height too tightly can result in overlapping lines of text
in this situation.</p>
<p>Authors can calculate the
<a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> for a given font by comparing spans with the same content but
different <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> properties. If the same font-size is used, the spans will match when the <a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a>
value is accurate for the given font.</p>
<div class=example>
Two spans with borders are used to determine the <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> of a font. The <a class=property data-link-type=propdesc href=#propdef-font-size title=font-size>font-size</a> is the same for both spans but the
<a class=property data-link-type=propdesc href=#propdef-font-size-adjust title=font-size-adjust>font-size-adjust</a> property is specified only for the right span. Starting with a value of 0.5, the aspect
value can be adjusted until the borders around the two letters line up.
<pre>p {
font-family: Futura;
font-size: 500px;
}
span {
border: solid 1px red;
}
.adjust {
font-size-adjust: 0.5;
}
&lt;p&gt;&lt;span&gt;b&lt;/span&gt;&lt;span class="adjust"&gt;b&lt;/span&gt;&lt;/p&gt;
</pre>
<div class=figure><img alt="Futura with an aspect value of 0.5" src=beforefontsizeadjust.png><p class=caption>Futura with an <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> of 0.5</div>
<p>The box on the right is a bit bigger than the one on the left, so the <a data-link-type=dfn href=#font-aspect-value title="aspect value">aspect value</a> of this font is something less than 0.5.
Adjust the value until the boxes align.</p>
</div>
<h3 class="heading settled" data-level=3.7 id=font-prop><span class=secno>3.7. </span><span class=content>Shorthand font property: the <a class=property data-link-type=propdesc href=#propdef-font title=font>font</a> property</span><a class=self-link href=#font-prop></a></h3>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-font>font<a class=self-link href=#propdef-font></a></dfn><tr><th>Value:<td class=prod>[ [ <a class=production data-link-type=propdesc href=#propdef-font-style title=font-style>&lt;‘font-style’&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-any title=||>||</a> <a class="production css" data-link-type=type href=#typedef-font-variant-css21 title="<font-variant-css21>">&lt;font-variant-css21&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-any title=||>||</a> <a class=production data-link-type=propdesc href=#propdef-font-weight title=font-weight>&lt;‘font-weight’&gt;</a> <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-any title=||>||</a> <a class=production data-link-type=propdesc href=#propdef-font-stretch title=font-stretch>&lt;‘font-stretch’&gt;</a> ]<a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#mult-opt title=?>?</a> <a class=production data-link-type=propdesc href=#propdef-font-size title=font-size>&lt;‘font-size’&gt;</a> [ / <a class=production data-link-type=propdesc href=http://dev.w3.org/csswg/css2/visudet.html#propdef-line-height title=line-height>&lt;‘line-height’&gt;</a> ]<a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#mult-opt title=?>?</a> <a class=production data-link-type=propdesc href=#propdef-font-family title=font-family>&lt;‘font-family’&gt;</a> ] <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> caption <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> icon <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> menu <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> message-box <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> small-caption <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one title=|>|</a> status-bar<tr><th>Initial:<td>see individual properties<tr><th>Applies to:<td>see individual properties<tr><th>Inherited:<td>see individual properties<tr><th>Percentages:<td>see individual properties<tr><th>Media:<td>see individual properties<tr><th>Computed value:<td>see individual properties<tr><th>Animatable:<td>see individual properties</table>
<p>The <a class=property data-link-type=propdesc href=#propdef-font title=font>font</a> property is, except as
described below, a shorthand property for setting
<a class=property data-link-type=propdesc href=#propdef-font-style title=font-style>font-style</a>,