css3-fonts/Overview.html

Wed, 06 Feb 2013 10:00:12 -0700

author
John Daggett <jdaggett@mozilla.com>
date
Wed, 06 Feb 2013 10:00:12 -0700
changeset 7361
55bbedf65a90
parent 7357
e3ce550667e5
child 7362
a2d67885ffdd
permissions
-rw-r--r--

[css3-fonts] add animatable attribute to font properties

jdaggett@1153 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
jdaggett@1153 2 "http://www.w3.org/TR/html4/strict.dtd">
jdaggett@1153 3
jdaggett@1153 4 <html lang=en>
jdaggett@1153 5 <head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
jdaggett@1153 6
jdaggett@1153 7 <title>CSS Fonts Module Level 3</title>
jdaggett@1153 8 <!--
jdaggett@1153 9 FIXME when publishing: copy the current default.css and link to
jdaggett@1153 10 "default.css" rather than "../default.css"
jdaggett@1153 11 -->
jdaggett@1153 12 <link href="../default.css" rel=stylesheet type="text/css">
jdaggett@6453 13 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
jdaggett@6453 14 <!-- I'm just experimenting here, don't get your bee in a bonnet -->
jdaggett@7356 15 <script src="http://use.typekit.com/xon2bky.js"
jdaggett@7356 16 type="text/javascript"></script>
jdaggett@6453 17 <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
jdaggett@1153 18
jdaggett@1153 19 <style type="text/css">
jdaggett@6453 20
jdaggett@6453 21 body, th, td, h1, h2, h3, h4, h5, h6 {
jdaggett@6453 22 font-family: "myriad-pro", sans-serif !important;
jdaggett@6453 23 }
jdaggett@1153 24
jdaggett@1153 25 body {
jdaggett@1153 26 padding: 2em 70px 2em 70px;
jdaggett@1153 27 }
jdaggett@6453 28
jdaggett@1153 29 p + p, p.mtb {
jdaggett@1153 30 margin-top: 0.8em;
jdaggett@1153 31 text-indent: 0px;
jdaggett@1153 32 }
jdaggett@7099 33
jdaggett@7099 34 #bolderlighter {
jdaggett@7099 35 width: 40%;
jdaggett@7099 36 }
jdaggett@7099 37
jdaggett@7099 38 #bolderlighter th {
jdaggett@7099 39 text-align: center;
jdaggett@7099 40 }
jdaggett@1153 41
jdaggett@7100 42 #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
jdaggett@1269 43 padding-right: 2em;
jdaggett@1153 44 text-align: left;
jdaggett@1153 45 }
jdaggett@1153 46
jdaggett@1153 47 dd {
jdaggett@1153 48 margin-bottom: 1em;
jdaggett@1153 49 }
jdaggett@1153 50
jdaggett@1153 51 #authors dd {
jdaggett@1153 52 margin-bottom: 0;
jdaggett@1153 53 }
jdaggett@1153 54
jdaggett@1153 55 #fontstylematchingalg {
jdaggett@1153 56 list-style-type: lower-alpha;
jdaggett@1153 57 }
jdaggett@1153 58
jdaggett@1153 59 #fontmatchingalg ul, #fontmatchingalg ol {
jdaggett@1153 60 margin-top: 0.8em;
jdaggett@1153 61 }
jdaggett@1153 62
jdaggett@1153 63 #fontmatchingalg li + li {
jdaggett@1153 64 margin-top: 0.8em;
jdaggett@1153 65 }
jdaggett@1153 66
jdaggett@1153 67 div.example {
jdaggett@1153 68 padding: 1em;
jdaggett@1153 69 margin-top: 1em;
jdaggett@1153 70 }
jdaggett@1153 71
jdaggett@1153 72 div.example + div.example {
jdaggett@1153 73 margin-top: 2em;
jdaggett@1153 74 }
jdaggett@1153 75
jdaggett@1153 76 div.figure {
jdaggett@1153 77 page-break-inside: avoid;
jdaggett@1153 78 }
jdaggett@1269 79
jdaggett@1643 80 pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
jdaggett@1153 81
jdaggett@1654 82 div.featex {
jdaggett@1654 83 width: 700px;
jdaggett@1654 84 }
jdaggett@1654 85
jdaggett@1654 86 div.featex img {
jdaggett@1654 87 margin: auto;
jdaggett@1654 88 display: block;
jdaggett@1654 89 }
jdaggett@6453 90
jdaggett@6453 91 span.tag {
jdaggett@6453 92 font-family: monospace;
jdaggett@6453 93 font-size: 120%;
jdaggett@6453 94 }
jdaggett@7099 95
jdaggett@7099 96 ol ol {
jdaggett@7099 97 list-style-type: lower-alpha;
jdaggett@7099 98 }
jdaggett@7099 99
jdaggett@7099 100 .idl-code {
jdaggett@7099 101 font-weight: bold;
jdaggett@7099 102 color: #c50;
jdaggett@7099 103 }
jdaggett@1153 104 </style>
jdaggett@3534 105 <link href="http://www.w3.org/StyleSheets/TR/W3C-WD.css" rel=stylesheet
bert@2539 106 type="text/css">
jdaggett@1153 107
jdaggett@1153 108 <body>
jdaggett@1153 109 <div class=head> <!--begin-logo-->
jdaggett@1153 110 <p><a href="http://www.w3.org/"><img alt=W3C height=48
jdaggett@1153 111 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
jdaggett@1153 112
jdaggett@1153 113 <h1>CSS Fonts Module Level 3</h1>
jdaggett@1153 114
jdaggett@7356 115 <h2 class="no-num no-toc" id=w3c-working-draft-12-february-2013>W3C
jdaggett@7356 116 Working Draft 12 February 2013</h2>
jdaggett@1153 117
jdaggett@1153 118 <dl id=authors>
jdaggett@3534 119 <dt>This version:</dt>
jdaggett@3534 120 <!-- <dd><a href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a> -->
jdaggett@2637 121
jdaggett@2637 122 <dd><a
jdaggett@7356 123 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a>
jdaggett@2637 124
jdaggett@2637 125
jdaggett@2637 126 <dt>Latest version:
jdaggett@2637 127
jdaggett@2637 128 <dd><a
jdaggett@2637 129 href="http://www.w3.org/TR/css3-fonts/">http://www.w3.org/TR/css3-fonts/</a>
jdaggett@2637 130
jdaggett@2637 131 <dt>Latest editor's draft:
jdaggett@2637 132
jdaggett@2637 133 <dd><a
jdaggett@2637 134 href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a>
jdaggett@2637 135
jdaggett@6453 136 <dt>Previous version:
jdaggett@2554 137
jdaggett@2554 138 <dd><a
jdaggett@7356 139 href="http://www.w3.org/TR/2012/WD-css3-fonts-20121211/">http://www.w3.org/TR/2012/WD-css3-fonts-20121211/</a>
jdaggett@6453 140
jdaggett@6453 141 <dt>Issues List:
jdaggett@6453 142
jdaggett@6453 143 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
jdaggett@6453 144 issues in Tracker</a>
jdaggett@1153 145
jdaggett@1153 146 <dd><a
jdaggett@6456 147 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">CSS3
jdaggett@6453 148 Fonts issues in Bugzilla</a>
jdaggett@6453 149
jdaggett@6453 150 <dt>Discussion:
jdaggett@1661 151
jdaggett@1661 152 <dd><a
jdaggett@6453 153 href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a>
jdaggett@6453 154 with subject line “<kbd>[css3-fonts] topic</kbd>”
jdaggett@1153 155
jdaggett@1153 156 <dt>Editor:
jdaggett@1153 157
jdaggett@1153 158 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
jdaggett@1153 159 </dl>
jdaggett@1153 160 <!--begin-copyright-->
jdaggett@1153 161 <p class=copyright><a
jdaggett@1153 162 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
jdaggett@7356 163 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
jdaggett@6453 164 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
jdaggett@6453 165 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
jdaggett@6453 166 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
jdaggett@1643 167 title="European Research Consortium for Informatics and
jdaggett@7356 168 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
jdaggett@7356 169 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
jdaggett@7356 170 <a
jdaggett@1153 171 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
jdaggett@1153 172 <a
jdaggett@1153 173 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
jdaggett@1153 174 and <a
jdaggett@1153 175 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
jdaggett@1153 176 use</a> rules apply.</p>
jdaggett@1153 177 <!--end-copyright-->
jdaggett@1153 178 <hr title="Separator for header">
jdaggett@1153 179 </div>
jdaggett@1153 180
jdaggett@1153 181 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
jdaggett@1153 182
jdaggett@1153 183 <p>This CSS3 module describes how font properties are specified and how
jdaggett@1153 184 font resources are loaded dynamically. The contents of this specification
jdaggett@1153 185 are a consolidation of content previously divided into <a
jdaggett@3537 186 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
jdaggett@3537 187 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
jdaggett@3537 188 Web Fonts</a> modules.
jdaggett@1153 189
jdaggett@1153 190 <h2 class="no-num no-toc" id=status>Status of this document</h2>
jdaggett@1153 191 <!--begin-status-->
jdaggett@1153 192
jdaggett@3534 193 <p><em>This section describes the status of this document at the time of
jdaggett@3534 194 its publication. Other documents may supersede this document. A list of
jdaggett@3534 195 current W3C publications and the latest revision of this technical report
jdaggett@3534 196 can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
jdaggett@3534 197 index at http://www.w3.org/TR/.</a></em>
jdaggett@3534 198
jdaggett@3534 199 <p>Publication as a Working Draft does not imply endorsement by the W3C
jdaggett@3534 200 Membership. This is a draft document and may be updated, replaced or
jdaggett@3534 201 obsoleted by other documents at any time. It is inappropriate to cite this
jdaggett@3534 202 document as other than work in progress.
jdaggett@1153 203
jdaggett@1153 204 <p>The (<a
jdaggett@1153 205 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
jdaggett@3534 206 mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a> (see
jdaggett@3534 207 <a href="http://www.w3.org/Mail/Request">instructions</a>) is preferred
jdaggett@3534 208 for discussion of this specification. When sending e-mail, please put the
jdaggett@3534 209 text “css3-fonts” in the subject, preferably like this:
jdaggett@1153 210 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
jdaggett@1153 211
jdaggett@3534 212 <p>This document was produced by the <a
jdaggett@3534 213 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
jdaggett@3534 214 the <a href="http://www.w3.org/Style/">Style Activity</a>).
jdaggett@1153 215
jdaggett@1153 216 <p>This document was produced by a group operating under the <a
jdaggett@3534 217 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
jdaggett@3534 218 2004 W3C Patent Policy</a>. W3C maintains a <a
jdaggett@3534 219 href="http://www.w3.org/2004/01/pp-impl/32061/status"
jdaggett@1153 220 rel=disclosure>public list of any patent disclosures</a> made in
jdaggett@1153 221 connection with the deliverables of the group; that page also includes
jdaggett@1153 222 instructions for disclosing a patent. An individual who has actual
jdaggett@1153 223 knowledge of a patent which the individual believes contains <a
jdaggett@3534 224 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
jdaggett@1153 225 Claim(s)</a> must disclose the information in accordance with <a
jdaggett@3534 226 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
jdaggett@3534 227 6 of the W3C Patent Policy</a>.</p>
jdaggett@1153 228 <!--end-status-->
jdaggett@6453 229 <!--
jdaggett@6453 230 <h3 class="no-num no-toc" id="atrisk">Features at risk</h3>
jdaggett@6453 231
jdaggett@6453 232 <p>The following features are at risk and may be removed when exiting CR:</p>
jdaggett@6453 233
jdaggett@6453 234 <ul>
jdaggett@6453 235 </ul>
jdaggett@6453 236 -->
jdaggett@2528 237
jdaggett@1153 238 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
jdaggett@1153 239 <!--begin-toc-->
jdaggett@1153 240
jdaggett@1153 241 <ul class=toc>
jdaggett@1153 242 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
jdaggett@1153 243
jdaggett@1650 244 <li><a href="#typography-background"><span class=secno>2 </span>Typography
jdaggett@1153 245 Background</a>
jdaggett@1153 246
jdaggett@7099 247 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
jdaggett@7099 248 Properties</a>
jdaggett@1153 249 <ul class=toc>
jdaggett@1661 250 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
jdaggett@1661 251 family: the font-family property</a>
jdaggett@1650 252 <ul class=toc>
jdaggett@1650 253 <li><a href="#generic-font-families"><span class=secno>3.1.1
jdaggett@1650 254 </span>Generic font families</a>
jdaggett@1650 255 </ul>
jdaggett@1650 256
jdaggett@1661 257 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
jdaggett@1661 258 weight: the font-weight property</a>
jdaggett@1661 259
jdaggett@1661 260 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
jdaggett@1661 261 width: the font-stretch property</a>
jdaggett@1661 262
jdaggett@1661 263 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
jdaggett@1661 264 the font-style property</a>
jdaggett@1661 265
jdaggett@1661 266 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
jdaggett@1661 267 the font-size property</a>
jdaggett@1661 268
jdaggett@1661 269 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
jdaggett@1661 270 </span>Relative sizing: the font-size-adjust property</a>
jdaggett@1661 271
jdaggett@1661 272 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
jdaggett@1661 273 property: the font property</a>
jdaggett@2528 274
jdaggett@2528 275 <li><a href="#font-synthesis-prop"><span class=secno>3.8
jdaggett@2528 276 </span>Controlling synthetic faces: the font-synthesis property</a>
jdaggett@1650 277 </ul>
jdaggett@1650 278
jdaggett@1661 279 <li><a href="#font-resources"><span class=secno>4 </span>Font
jdaggett@7099 280 Resources</a>
jdaggett@1153 281 <ul class=toc>
jdaggett@1661 282 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
jdaggett@7099 283 <code>@font-face</code> rule</a>
jdaggett@1650 284
jdaggett@1661 285 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
jdaggett@1661 286 family: the font-family descriptor</a>
jdaggett@1661 287
jdaggett@1661 288 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
jdaggett@1661 289 src descriptor</a>
jdaggett@1661 290
jdaggett@1661 291 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
jdaggett@1661 292 descriptors: the font-style, font-weight, font-stretch descriptors</a>
jdaggett@1661 293
jdaggett@1661 294 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
jdaggett@1661 295 range: the unicode-range descriptor</a>
jdaggett@1661 296
jdaggett@1661 297 <li><a href="#font-rend-desc"><span class=secno>4.6 </span>Font
jdaggett@2528 298 features: the font-variant and font-feature-settings descriptors</a>
jdaggett@2637 299
jdaggett@2637 300 <li><a href="#font-face-loading"><span class=secno>4.7 </span>Font
jdaggett@2637 301 loading guidelines</a>
jdaggett@2637 302
jdaggett@2637 303 <li><a href="#same-origin-restriction"><span class=secno>4.8
jdaggett@2637 304 </span>Same-origin restriction for fonts</a>
jdaggett@2740 305 <ul class=toc>
jdaggett@2740 306 <li><a href="#default-same-origin-restriction"><span class=secno>4.8.1
jdaggett@2740 307 </span>Default same-origin restriction</a>
jdaggett@2740 308
jdaggett@2740 309 <li><a href="#allowing-cross-origin-font-loading"><span
jdaggett@2740 310 class=secno>4.8.2 </span>Allowing cross-origin font loading</a>
jdaggett@2740 311 </ul>
jdaggett@1153 312 </ul>
jdaggett@1153 313
jdaggett@1661 314 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
jdaggett@7099 315 Matching Algorithm</a>
jdaggett@2528 316 <ul class=toc>
jdaggett@7356 317 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
jdaggett@7356 318 sensitivity of font family names</a>
jdaggett@7356 319
jdaggett@7356 320 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
jdaggett@2528 321 font styles</a>
jdaggett@2528 322
jdaggett@7356 323 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
jdaggett@7099 324 matching</a>
jdaggett@7099 325
jdaggett@7356 326 <li><a href="#char-handling-issues"><span class=secno>5.4
jdaggett@2528 327 </span>Character handling issues</a>
jdaggett@2528 328
jdaggett@7356 329 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
jdaggett@2528 330 matching changes since CSS 2.1</a>
jdaggett@7099 331
jdaggett@7356 332 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
jdaggett@7099 333 matching examples</a>
jdaggett@2528 334 </ul>
jdaggett@2528 335
jdaggett@7099 336 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
jdaggett@7099 337 Properties</a>
jdaggett@1661 338 <ul class=toc>
jdaggett@2528 339 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
jdaggett@2528 340 </span>Glyph selection and positioning</a>
jdaggett@2528 341
jdaggett@2528 342 <li><a href="#language-specific-support"><span class=secno>6.2
jdaggett@2528 343 </span>Language-specific display</a>
jdaggett@2528 344
jdaggett@2528 345 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
jdaggett@1661 346 the font-kerning property</a>
jdaggett@1661 347
jdaggett@6453 348 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
jdaggett@1661 349 </span>Ligatures: the font-variant-ligatures property</a>
jdaggett@1661 350
jdaggett@6453 351 <li><a href="#font-variant-position-prop"><span class=secno>6.5
jdaggett@6453 352 </span>Subscript and superscript forms: the font-variant-position
jdaggett@6453 353 property</a>
jdaggett@6453 354
jdaggett@2528 355 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
jdaggett@2528 356 </span>Capitalization: the font-variant-caps property</a>
jdaggett@2528 357
jdaggett@2528 358 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
jdaggett@2528 359 </span>Numerical formatting: the font-variant-numeric property</a>
jdaggett@2528 360
jdaggett@2528 361 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
jdaggett@1661 362 </span>Alternates and swashes: the font-variant-alternates property</a>
jdaggett@1661 363
jdaggett@1661 364
jdaggett@2528 365 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
jdaggett@7099 366 font specific alternates: the <code>@font-feature-values</code>
jdaggett@7099 367 rule</a>
jdaggett@2528 368
jdaggett@2528 369 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
jdaggett@1661 370 </span>East Asian text rendering: the font-variant-east-asian
jdaggett@1661 371 property</a>
jdaggett@1661 372
jdaggett@2528 373 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
jdaggett@1661 374 shorthand for font rendering: the font-variant property</a>
jdaggett@1661 375
jdaggett@2528 376 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
jdaggett@2528 377 </span>Low-level font feature settings control: the
jdaggett@2528 378 font-feature-settings property</a>
jdaggett@2528 379
jdaggett@2528 380 <li><a href="#font-language-override-prop"><span class=secno>6.13
jdaggett@2528 381 </span>Font language override: the font-language-override property</a>
jdaggett@1661 382 </ul>
jdaggett@1661 383
jdaggett@6453 384 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
jdaggett@7099 385 Feature Resolution </a>
jdaggett@7099 386 <ul class=toc>
jdaggett@7099 387 <li><a href="#default-features"><span class=secno>7.1 </span>Default
jdaggett@7099 388 features</a>
jdaggett@7099 389
jdaggett@7099 390 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
jdaggett@7099 391 precedence</a>
jdaggett@7099 392
jdaggett@7099 393 <li><a href="#feature-precedence-examples"><span class=secno>7.3
jdaggett@7099 394 </span>Feature precedence examples</a>
jdaggett@7099 395 </ul>
jdaggett@7099 396
jdaggett@7099 397 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
jdaggett@7099 398 <ul class=toc>
jdaggett@7099 399 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
jdaggett@7099 400 <code>CSSFontFaceRule</code> interface</a>
jdaggett@7099 401
jdaggett@7099 402 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
jdaggett@7099 403 <code>CSSFontFeatureValuesRule</code> interface</a>
jdaggett@7099 404 </ul>
jdaggett@7099 405
jdaggett@7099 406 <li><a href="#font-load-events"><span class=secno>9 </span>Font Load
jdaggett@7099 407 Events</a>
jdaggett@7099 408 <ul class=toc>
jdaggett@7099 409 <li><a href="#document-fontloader"><span class=secno>9.1
jdaggett@7099 410 </span>Extension to the <code>document</code> interface</a>
jdaggett@7099 411
jdaggett@7099 412 <li><a href="#fontloader-interface"><span class=secno>9.2 </span>The
jdaggett@7099 413 <code>FontLoader</code> Interface</a>
jdaggett@7099 414 <ul class=toc>
jdaggett@7099 415 <li><a href="#events"><span class=secno>9.2.1 </span>Events</a>
jdaggett@7099 416
jdaggett@7099 417 <li><a href="#methods"><span class=secno>9.2.2 </span>Methods</a>
jdaggett@7099 418 </ul>
jdaggett@7099 419
jdaggett@7099 420 <li><a href="#font-load-event-examples"><span class=secno>9.3
jdaggett@7099 421 </span>Font load event examples</a>
jdaggett@7099 422 </ul>
jdaggett@1661 423
jdaggett@2637 424 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
jdaggett@1650 425 platform font properties to CSS properties</a>
jdaggett@1650 426
jdaggett@2528 427 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
jdaggett@2528 428 <ul class=toc>
jdaggett@7356 429 <li class=no-num><a href="#recent-changes"> Changes from the December
jdaggett@7356 430 2012 CSS3 Fonts Working Draft</a>
jdaggett@2528 431 </ul>
jdaggett@2528 432
jdaggett@1153 433 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
jdaggett@1153 434
jdaggett@7356 435 <li class=no-num><a href="#conformance"> Conformance</a>
jdaggett@7356 436 <ul class=toc>
jdaggett@7356 437 <li class=no-num><a href="#conventions"> Document Conventions</a>
jdaggett@7356 438
jdaggett@7356 439 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
jdaggett@7356 440
jdaggett@7356 441
jdaggett@7356 442 <li class=no-num><a href="#partial"> Partial Implementations</a>
jdaggett@7356 443
jdaggett@7356 444 <li class=no-num><a href="#experimental"> Experimental
jdaggett@7356 445 Implementations</a>
jdaggett@7356 446
jdaggett@7356 447 <li class=no-num><a href="#testing"> Non-Experimental
jdaggett@7356 448 Implementations</a>
jdaggett@7356 449 </ul>
jdaggett@7356 450
jdaggett@1153 451 <li class=no-num><a href="#references">References</a>
jdaggett@1153 452 <ul class=toc>
jdaggett@1661 453 <li class=no-num><a href="#normative-references">Normative
jdaggett@1661 454 References</a>
jdaggett@1661 455
jdaggett@1661 456 <li class=no-num><a href="#other-references">Other References</a>
jdaggett@1153 457 </ul>
jdaggett@1153 458
jdaggett@1153 459 <li class=no-num><a href="#index">Index</a>
jdaggett@1153 460
jdaggett@1153 461 <li class=no-num><a href="#property-index">Property index</a>
jdaggett@1153 462 </ul>
jdaggett@1153 463 <!--end-toc-->
jdaggett@1153 464
jdaggett@1153 465 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
jdaggett@1153 466
jdaggett@1153 467 <p>A font provides a resource containing the visual representation of
jdaggett@1661 468 characters. At the simplest level it contains information that maps
jdaggett@1661 469 character codes to shapes (called glyphs) that represent these characters.
jdaggett@1661 470 Fonts sharing a common design style are commonly grouped into font
jdaggett@1661 471 families classified by a set of standard font properties. Within a family,
jdaggett@1661 472 the shape displayed for a given character can vary by stroke weight, slant
jdaggett@7356 473 or relative width, among others. An individual font face is described by a
jdaggett@1661 474 unique combination of these properties. For a given range of text, CSS
jdaggett@1661 475 font properties are used to select a font family and a specific font face
jdaggett@1661 476 within that family to be used when rendering that text. As a simple
jdaggett@1661 477 example, to use the bold form of Helvetica one could use:
jdaggett@1153 478
jdaggett@1153 479 <pre>body {
jdaggett@1153 480 font-family: Helvetica;
jdaggett@1153 481 font-weight: bold;
jdaggett@1153 482 }</pre>
jdaggett@1153 483
jdaggett@7356 484 <p>Font resources may be installed locally on the system on which a user
jdaggett@7356 485 agent is running or downloadable. For local font resources descriptive
jdaggett@1153 486 information can be obtained directly from the font resource. For
jdaggett@1153 487 downloadable font resources (sometimes referred to as web fonts), the
jdaggett@1153 488 descriptive information is included with the reference to the font
jdaggett@1153 489 resource.
jdaggett@1153 490
jdaggett@1153 491 <p>Families of fonts typically don't contain a single face for each
jdaggett@1153 492 possible variation of font properties. The CSS font selection mechanism
jdaggett@7356 493 describes how to match a given set of CSS font properties to a single font
jdaggett@1153 494 face.
jdaggett@1153 495
jdaggett@1650 496 <h2 id=typography-background><span class=secno>2 </span>Typography
jdaggett@1650 497 Background</h2>
jdaggett@1153 498
jdaggett@7356 499 <p><em>This section is non-normative.</em>
jdaggett@7356 500
jdaggett@7356 501 <p> Typographic traditions vary across the globe, so there is no unique way
jdaggett@1153 502 to classify all fonts across languages and cultures. For even common Latin
jdaggett@1153 503 letters, wide variations are possible:
jdaggett@1153 504
jdaggett@1153 505 <div class=figure><img alt="variations in glyphs for a single character"
jdaggett@1153 506 src=aaaaaa.png>
jdaggett@1153 507 <p class=caption>One character, many glyph variations
jdaggett@1153 508 </div>
jdaggett@1153 509
jdaggett@1153 510 <p>Differences in the anatomy of letterforms is one way to distinguish
jdaggett@1153 511 fonts. For Latin fonts, flourishes at the ends of a character's main
jdaggett@1153 512 strokes, or serifs, can distinguish a font from those without. Similar
jdaggett@1153 513 comparisons exist in non-Latin fonts between fonts with tapered strokes
jdaggett@1153 514 and those using primarily uniform strokes:
jdaggett@1153 515
jdaggett@1153 516 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
jdaggett@1153 517 <p class=caption>Letterforms with and without serifs
jdaggett@1153 518 </div>
jdaggett@1153 519
jdaggett@1153 520 <div class=figure><img alt="serif vs. non-serifs for japanese"
jdaggett@1153 521 src=minchovsgothic.png>
jdaggett@1153 522 <p class=caption>Similar groupings for Japanese typefaces
jdaggett@1153 523 </div>
jdaggett@1153 524
jdaggett@1153 525 <p>Fonts contain letterforms and the data needed to map characters to these
jdaggett@7356 526 letterforms. Often this may be a simple one-to-one mapping, but more
jdaggett@1153 527 complex mappings are also possible. The use of combining diacritic marks
jdaggett@1153 528 creates many variations for an underlying letterform:
jdaggett@1153 529
jdaggett@1153 530 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
jdaggett@1153 531 <p class=caption>Variations with diacritic marks
jdaggett@1153 532 </div>
jdaggett@1153 533
jdaggett@1153 534 <p>A sequence of characters can be represented by a single glyph known as a
jdaggett@1153 535 ligature:
jdaggett@1153 536
jdaggett@1153 537 <div class=figure><img alt="example of a fi ligature"
jdaggett@1153 538 src=final-ligature.png>
jdaggett@1153 539 <p class=caption>Ligature example
jdaggett@1153 540 </div>
jdaggett@1153 541
jdaggett@7356 542 <p>Visual transformations based on textual context are often stylistic
jdaggett@7356 543 option in European languages. They are required to correctly render
jdaggett@7356 544 languages like Arabic, the lam and alef characters below <em>must</em> be
jdaggett@7356 545 combined when they exist in sequence:
jdaggett@1153 546
jdaggett@1153 547 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
jdaggett@1153 548 <p class=caption>Required Arabic ligature
jdaggett@1153 549 </div>
jdaggett@1153 550
jdaggett@1153 551 <p>The relative complexity of these shaping transformations requires
jdaggett@1153 552 additional data within the font.
jdaggett@1153 553
jdaggett@1153 554 <p>Sets of font faces with various stylistic variations are often grouped
jdaggett@1153 555 together into font families. In the simplest case a regular face is
jdaggett@7356 556 supplemented with bold and italic faces, but much more extensive groupings
jdaggett@7356 557 are possible. Variations in the thickness of letterform strokes, the <dfn
jdaggett@7356 558 id=weight>weight</dfn>, and the overall proportions of the letterform, the
jdaggett@7356 559 <dfn id=width>width</dfn>, are most common. In the example below, each
jdaggett@7356 560 letter uses a different font face within the Univers font family. The
jdaggett@7356 561 width used increases from top to bottom and the weight increases from left
jdaggett@7356 562 to right:
jdaggett@1153 563
jdaggett@1153 564 <div class=figure><img alt="various width and weight variations within a
jdaggett@1153 565 single family" src=weightwidthvariations.png>
jdaggett@1153 566 <p class=caption>Weight and width variations within a single font family
jdaggett@1153 567 </div>
jdaggett@1153 568
jdaggett@1153 569 <p>Creating fonts that support multiple scripts is a difficult task;
jdaggett@1153 570 designers need to understand the cultural traditions surrounding the use
jdaggett@1153 571 of type in different scripts and come up with letterforms that somehow
jdaggett@1153 572 share a common theme. Many languages often share a common script and each
jdaggett@7356 573 of these languages may have noticeable stylistic differences. For example,
jdaggett@7356 574 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
jdaggett@7356 575 many languages, not just Russian.
jdaggett@1153 576
jdaggett@2528 577 <p>The character map of a font defines the mapping of characters to glyphs
jdaggett@2528 578 for that font. If a document contains characters not supported by the
jdaggett@7356 579 character maps of the fonts contained in a font family list, a user agent
jdaggett@7356 580 may use a system font fallback procedure to locate an appropriate font
jdaggett@7356 581 that does. If no appropriate font can be found, some form of "missing
jdaggett@7356 582 glyph" character will be rendered by the user agent. Fallback can occur
jdaggett@7356 583 when the list of font families does not include a font that supports a
jdaggett@7356 584 given character.
jdaggett@2528 585
jdaggett@2528 586 <p>Although the character map of a font maps a given character to a glyph
jdaggett@2528 587 for that character, modern font technologies such as OpenType and AAT
jdaggett@7356 588 (Apple Advanced Typography) provide ways of mapping a character to
jdaggett@7356 589 different glyphs based upon feature settings. Fonts in these formats allow
jdaggett@7356 590 these features to be embedded in the font itself and controlled by
jdaggett@7356 591 applications. Common typographic features which can be specified this way
jdaggett@7356 592 include ligatures, swashes, contextual alternates, proportional and
jdaggett@7356 593 tabular figures, and automatic fractions, to list just a few. For a visual
jdaggett@7356 594 overview of OpenType features, see the <a href="#OPENTYPE-FONT-GUIDE"
jdaggett@7099 595 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
jdaggett@7099 596
jdaggett@7099 597 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
jdaggett@1153 598
jdaggett@1153 599 <p>The particular font face used to render a character is determined by the
jdaggett@1153 600 font family and other font properties that apply to a given element. This
jdaggett@1153 601 structure allows settings to be varied independent of each other.</p>
jdaggett@1153 602 <!-- prop: font-family -->
jdaggett@1153 603
jdaggett@1661 604 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
jdaggett@1661 605 href="#propdef-font-family">font-family</a> property</h3>
jdaggett@1661 606
jdaggett@6453 607 <table class=propdef id=namefont-familyvalue-ltfamily-name-ltgen>
jdaggett@1153 608 <tbody>
jdaggett@1153 609 <tr>
jdaggett@1153 610 <td>Name:
jdaggett@1153 611
jdaggett@1661 612 <td><dfn id=propdef-font-family>font-family</dfn>
jdaggett@1153 613
jdaggett@1153 614 <tr>
jdaggett@1153 615 <td>Value:
jdaggett@1153 616
jdaggett@6453 617 <td>[ &lt;family-name> | &lt;generic-family> ]#
jdaggett@1153 618
jdaggett@1153 619 <tr>
jdaggett@1153 620 <td>Initial:
jdaggett@1153 621
jdaggett@1153 622 <td>depends on user agent
jdaggett@1153 623
jdaggett@1153 624 <tr>
jdaggett@1153 625 <td>Applies to:
jdaggett@1153 626
jdaggett@1153 627 <td>all elements
jdaggett@1153 628
jdaggett@1153 629 <tr>
jdaggett@1153 630 <td>Inherited:
jdaggett@1153 631
jdaggett@1153 632 <td>yes
jdaggett@1153 633
jdaggett@1153 634 <tr>
jdaggett@1153 635 <td>Percentages:
jdaggett@1153 636
jdaggett@1153 637 <td>N/A
jdaggett@1153 638
jdaggett@1153 639 <tr>
jdaggett@1153 640 <td>Media:
jdaggett@1153 641
jdaggett@1153 642 <td>visual
jdaggett@1153 643
jdaggett@1153 644 <tr>
jdaggett@1153 645 <td>Computed value:
jdaggett@1153 646
jdaggett@1153 647 <td>as specified
jdaggett@7361 648
jdaggett@7361 649 <tr>
jdaggett@7361 650 <td>Animatable:
jdaggett@7361 651
jdaggett@7361 652 <td>no
jdaggett@1153 653 </table>
jdaggett@1153 654
jdaggett@1153 655 <p>This property specifies a prioritized list of font family names or
jdaggett@7099 656 generic family names. A font family defines a set of faces that vary in
jdaggett@7099 657 weight, width or slope. CSS uses the combination of a family name with
jdaggett@7099 658 other style attributes to select an individual face. Using this selection
jdaggett@7099 659 mechanism, rather than selecting a face via the style name as is often
jdaggett@7099 660 done in design applications, allows some degree of regularity in textual
jdaggett@7099 661 display when fallback occurs.
jdaggett@7099 662
jdaggett@7099 663 <p class=note>Designers should note that the CSS definition of font
jdaggett@7099 664 attributes used for selection are explicitly not intended to define a font
jdaggett@7099 665 taxonomy. A type designer's idea of a family may often extend to a set of
jdaggett@7099 666 faces that vary along axes other than just the standard axes of weight,
jdaggett@7099 667 width and slope. A family may extend to include both a set of serif faces
jdaggett@7099 668 and a set of sans-serif faces or vary along axes that are unique to that
jdaggett@7099 669 family. The CSS font selection mechanism merely provides a way to
jdaggett@7099 670 determine the “closest” substitute when substitution is necessary.
jdaggett@7099 671
jdaggett@7099 672 <p>Unlike other CSS properties, component values are a comma-separated list
jdaggett@7099 673 indicating alternatives. A user agent iterates through the list of family
jdaggett@7099 674 names until it matches an available font that contains a glyph for the
jdaggett@7099 675 character to be rendered. This allows for differences in available fonts
jdaggett@7099 676 across platforms and for differences in the range of characters supported
jdaggett@7099 677 by individual fonts.
jdaggett@1153 678
jdaggett@1153 679 <p>A font family name only specifies a name given to a set of font faces,
jdaggett@1153 680 it does not specify an individual face. Given the availability of the
jdaggett@1153 681 fonts below, Futura would match but Futura Medium would not:
jdaggett@1153 682
jdaggett@1153 683 <div class=figure><img alt="family and face names"
jdaggett@1153 684 src=familyvsfacename.png>
jdaggett@1153 685 <p class=caption>Family and individual face names
jdaggett@1153 686 </div>
jdaggett@1153 687
jdaggett@2528 688 <p>Consider the example below:
jdaggett@2528 689
jdaggett@2528 690 <div class=example>
jdaggett@2528 691 <pre>body {
jdaggett@2528 692 font-family: Helvetica, Verdana, sans-serif;
jdaggett@2528 693 }</pre>
jdaggett@2528 694
jdaggett@2528 695 <p>If Helvetica is available it will be used when rendering. If neither
jdaggett@2528 696 Helvetica nor Verdana is present, then the user-agent-defined sans serif
jdaggett@2528 697 font will be used.</p>
jdaggett@2528 698 </div>
jdaggett@2528 699
jdaggett@2528 700 <p>There are two types of font family names:
jdaggett@2528 701
jdaggett@2528 702 <dl>
jdaggett@2528 703 <dt>&lt;family-name&gt;
jdaggett@2528 704
jdaggett@2528 705 <dd>The name of a font family of choice such as Helvetica or Verdana in
jdaggett@2528 706 the previous example.
jdaggett@2528 707
jdaggett@2528 708 <dt>&lt;generic-family&gt;
jdaggett@2528 709
jdaggett@6453 710 <dd> The following generic family keywords are defined: ‘<a
jdaggett@6453 711 href="#serif"><code class=property>serif</code></a>’, ‘<a
jdaggett@6453 712 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
jdaggett@6453 713 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
jdaggett@6453 714 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
jdaggett@6453 715 href="#monospace"><code class=property>monospace</code></a>’. These
jdaggett@2528 716 keywords can be used as a general fallback mechanism when an author's
jdaggett@2528 717 desired font choices are not available. As keywords, they must not be
jdaggett@2528 718 quoted. Authors are encouraged to append a generic font family as a last
jdaggett@2528 719 alternative for improved robustness.
jdaggett@2528 720 </dl>
jdaggett@2528 721
jdaggett@2528 722 <p>Font family names must either be given quoted as <a
jdaggett@2528 723 href="//www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or unquoted
jdaggett@2528 724 as a sequence of one or more <a
jdaggett@2528 725 href="//www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
jdaggett@2528 726 This means most punctuation characters and digits at the start of each
jdaggett@2528 727 token must be escaped in unquoted font family names.
jdaggett@2528 728
jdaggett@7356 729 <p>To illustrate this, the following declarations are invalid:
jdaggett@2528 730
jdaggett@2528 731 <pre>
jdaggett@2528 732 font-family: Red/Black, sans-serif;
jdaggett@2528 733 font-family: "Lucida" Grande, sans-serif;
jdaggett@2528 734 font-family: Ahem!, sans-serif;
jdaggett@2528 735 font-family: test@foo, sans-serif;
jdaggett@2528 736 font-family: #POUND, sans-serif;
jdaggett@2528 737 font-family: Hawaii 5-0, sans-serif;
jdaggett@2528 738 </pre>
jdaggett@2528 739
jdaggett@2528 740 <p>If a sequence of identifiers is given as a font family name, the
jdaggett@2528 741 computed value is the name converted to a string by joining all the
jdaggett@2528 742 identifiers in the sequence by single spaces.
jdaggett@2528 743
jdaggett@2528 744 <p>To avoid mistakes in escaping, it is recommended to quote font family
jdaggett@2528 745 names that contain white space, digits, or punctuation characters other
jdaggett@2528 746 than hyphens:
jdaggett@2528 747
jdaggett@2528 748 <pre>
jdaggett@2528 749 body { font-family: "New Century Schoolbook", serif }
jdaggett@2528 750
jdaggett@2528 751 &lt;BODY STYLE="font-family: '21st Century', fantasy">
jdaggett@2528 752 </pre>
jdaggett@2528 753
jdaggett@2528 754 <p>Font family <em>names</em> that happen to be the same as a keyword value
jdaggett@6453 755 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
jdaggett@6453 756 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
jdaggett@6453 757 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
jdaggett@6453 758 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
jdaggett@6453 759 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
jdaggett@6453 760 class=property>cursive</code></a>’) must be quoted to prevent confusion
jdaggett@2528 761 with the keywords with the same names. The keywords ‘<code
jdaggett@2528 762 class=property>initial</code>’ and ‘<code
jdaggett@2528 763 class=property>default</code>’ are reserved for future use and must also
jdaggett@2528 764 be quoted when used as font names. UAs must not consider these keywords as
jdaggett@2528 765 matching the ‘<code class=css>&lt;family-name&gt;</code>’ type.
jdaggett@2528 766
jdaggett@7099 767 <p>The precise way a set of fonts are grouped into font families varies
jdaggett@7099 768 depending upon the platform font management API's. The Windows GDI API
jdaggett@7099 769 only allows four faces to be grouped into a family while the DirectWrite
jdaggett@7099 770 API and API's on OSX and other platforms support font families with a
jdaggett@7099 771 variety of weights, widths and slopes (see <a
jdaggett@7099 772 href="#platform-props-to-css">Appendix A</a> for more details).
jdaggett@7099 773
jdaggett@2528 774 <p>Some font formats allow fonts to carry multiple localizations of the
jdaggett@2528 775 family name. User agents must recognize and correctly match all of these
jdaggett@2528 776 names independent of the underlying platform localization, system API used
jdaggett@2528 777 or document encoding:
jdaggett@1153 778
jdaggett@1153 779 <div class=figure><img alt="examples of localized family names"
jdaggett@1153 780 src=localizedfamilynames.png>
jdaggett@1153 781 <p class=caption>Localized family names
jdaggett@1153 782 </div>
jdaggett@1153 783
jdaggett@1650 784 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
jdaggett@1650 785 families</h4>
jdaggett@1153 786
jdaggett@1153 787 <p>All five generic font families are defined to exist in all CSS
jdaggett@1153 788 implementations (they need not necessarily map to five distinct actual
jdaggett@1153 789 fonts). User agents should provide reasonable default choices for the
jdaggett@1153 790 generic font families, which express the characteristics of each family as
jdaggett@1153 791 well as possible within the limits allowed by the underlying technology.
jdaggett@1153 792 User agents are encouraged to allow users to select alternative choices
jdaggett@1153 793 for the generic fonts.
jdaggett@1153 794
jdaggett@1153 795 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
jdaggett@1153 796 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
jdaggett@1153 797
jdaggett@1153 798 <p>Glyphs of serif fonts, as the term is used in CSS, have finishing
jdaggett@1153 799 strokes, flared or tapering ends, or have actual serifed endings
jdaggett@1153 800 (including slab serifs). Serif fonts are typically proportionately-spaced.
jdaggett@1153 801 They often display a greater variation between thick and thin strokes than
jdaggett@6453 802 fonts from the ‘<a href="#sans-serif"><code
jdaggett@6453 803 class=property>sans-serif</code></a>’ generic font family. CSS uses the
jdaggett@6453 804 term ‘<a href="#serif"><code class=property>serif</code></a>’ to apply
jdaggett@6453 805 to a font for any script, although other names may be more familiar for
jdaggett@6453 806 particular scripts, such as Mincho (Japanese), Sung, Song or Kai
jdaggett@3534 807 (Chinese), Batang (Korean). Any font that is so described may be used to
jdaggett@6453 808 represent the generic ‘<a href="#serif"><code
jdaggett@6453 809 class=property>serif</code></a>’ family.
jdaggett@1153 810
jdaggett@1153 811 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
jdaggett@1153 812 <p class=caption>Sample serif fonts
jdaggett@1153 813 </div>
jdaggett@1153 814
jdaggett@1153 815 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
jdaggett@1153 816 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
jdaggett@1153 817 id=sans-serif>sans-serif</dfn></a></span></h5>
jdaggett@1153 818
jdaggett@1153 819 <p>Glyphs in sans-serif fonts, as the term is used in CSS, have stroke
jdaggett@1153 820 endings that are plain -- without any flaring, cross stroke, or other
jdaggett@1153 821 ornamentation. Sans-serif fonts are typically proportionately-spaced. They
jdaggett@1153 822 often have little variation between thick and thin strokes, compared to
jdaggett@6453 823 fonts from the ‘<a href="#serif"><code
jdaggett@6453 824 class=property>serif</code></a>’ family. CSS uses the term ‘<a
jdaggett@6453 825 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
jdaggett@6453 826 to a font for any script, although other names may be more familiar for
jdaggett@3534 827 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
jdaggett@1153 828 (Korean). Any font that is so described may be used to represent the
jdaggett@6453 829 generic ‘<a href="#sans-serif"><code
jdaggett@6453 830 class=property>sans-serif</code></a>’ family.
jdaggett@1153 831
jdaggett@1153 832 <div class=figure><img alt="sample sans-serif fonts"
jdaggett@1153 833 src=sansserifexamples.png>
jdaggett@1153 834 <p class=caption>Sample sans-serif fonts
jdaggett@1153 835 </div>
jdaggett@1153 836
jdaggett@1153 837 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
jdaggett@1153 838 title="cursive, definition of"> <a name=cursive-def><dfn
jdaggett@1153 839 id=cursive>cursive</dfn></a></span></h5>
jdaggett@1153 840
jdaggett@1153 841 <p>Glyphs in cursive fonts generally have either joining strokes or other
jdaggett@1153 842 cursive characteristics beyond those of italic typefaces. The glyphs are
jdaggett@1153 843 partially or completely connected, and the result looks more like
jdaggett@1153 844 handwritten pen or brush writing than printed letterwork. Some scripts,
jdaggett@6453 845 such as Arabic, are almost always cursive. CSS uses the term ‘<a
jdaggett@6453 846 href="#cursive"><code class=property>cursive</code></a>’ to apply to a
jdaggett@6453 847 font for any script, although other names such as Chancery, Brush, Swing
jdaggett@6453 848 and Script are also used in font names.
jdaggett@1153 849
jdaggett@1153 850 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
jdaggett@1153 851 <p class=caption>Sample cursive fonts
jdaggett@1153 852 </div>
jdaggett@1153 853
jdaggett@1153 854 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
jdaggett@1153 855 title="fantasy, definition of"> <a name=fantasy-def><dfn
jdaggett@1153 856 id=fantasy>fantasy</dfn></a></span></h5>
jdaggett@1153 857
jdaggett@1153 858 <p>Fantasy fonts are primarily decorative fonts that contain playful
jdaggett@1153 859 representations of characters. These do not include Pi or Picture fonts
jdaggett@1153 860 which do not represent actual characters.
jdaggett@1153 861
jdaggett@1153 862 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
jdaggett@1153 863 <p class=caption>Sample fantasy fonts
jdaggett@1153 864 </div>
jdaggett@1153 865
jdaggett@1153 866 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
jdaggett@1153 867 title="monospace, definition of"> <a name=monospace-def><dfn
jdaggett@1153 868 id=monospace>monospace</dfn></a></span></h5>
jdaggett@1153 869
jdaggett@1153 870 <p>The sole criterion of a monospace font is that all glyphs have the same
jdaggett@1153 871 fixed width. This is often used to render samples of computer code.
jdaggett@1153 872
jdaggett@1153 873 <div class=figure><img alt="sample monospace fonts"
jdaggett@1153 874 src=monospaceexamples.png>
jdaggett@1153 875 <p class=caption>Sample monospace fonts
jdaggett@1153 876 </div>
jdaggett@1153 877 <!-- prop: font-weight -->
jdaggett@1153 878
jdaggett@1661 879 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
jdaggett@1661 880 href="#propdef-font-weight">font-weight</a> property</h3>
jdaggett@1661 881
jdaggett@6453 882 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
jdaggett@1153 883 <tbody>
jdaggett@1153 884 <tr>
jdaggett@1153 885 <td>Name:
jdaggett@1153 886
jdaggett@1661 887 <td><dfn id=propdef-font-weight>font-weight</dfn>
jdaggett@1153 888
jdaggett@1153 889 <tr>
jdaggett@1153 890 <td>Value:
jdaggett@1153 891
jdaggett@1153 892 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
jdaggett@6453 893 | 700 | 800 | 900
jdaggett@1153 894
jdaggett@1153 895 <tr>
jdaggett@1153 896 <td>Initial:
jdaggett@1153 897
jdaggett@1153 898 <td>normal
jdaggett@1153 899
jdaggett@1153 900 <tr>
jdaggett@1153 901 <td>Applies to:
jdaggett@1153 902
jdaggett@1153 903 <td>all elements
jdaggett@1153 904
jdaggett@1153 905 <tr>
jdaggett@1153 906 <td>Inherited:
jdaggett@1153 907
jdaggett@1153 908 <td>yes
jdaggett@1153 909
jdaggett@1153 910 <tr>
jdaggett@1153 911 <td>Percentages:
jdaggett@1153 912
jdaggett@1153 913 <td>N/A
jdaggett@1153 914
jdaggett@1153 915 <tr>
jdaggett@1153 916 <td>Media:
jdaggett@1153 917
jdaggett@1153 918 <td>visual
jdaggett@1153 919
jdaggett@1153 920 <tr>
jdaggett@1153 921 <td>Computed value:
jdaggett@1153 922
jdaggett@1153 923 <td>see description
jdaggett@7361 924
jdaggett@7361 925 <tr>
jdaggett@7361 926 <td>Animatable:
jdaggett@7361 927
jdaggett@7361 928 <td>as <a
jdaggett@7361 929 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
jdaggett@7361 930 weight</a>
jdaggett@1153 931 </table>
jdaggett@1153 932
jdaggett@2554 933 <p>The <a class=noxref href="#font-weight-prop"><span
jdaggett@2554 934 class=property>‘<code class=property>font-weight</code>’</span></a>
jdaggett@2554 935 property specifies weight of glyphs in the font, their degree of blackness
jdaggett@2554 936 or stroke thickness.
jdaggett@1153 937
jdaggett@1153 938 <p>Values have the following meanings:
jdaggett@1153 939
jdaggett@1153 940 <dl>
jdaggett@1153 941 <dt>100 to 900
jdaggett@1153 942
jdaggett@1153 943 <dd>These values form an ordered sequence, where each number indicates a
jdaggett@1153 944 weight that is at least as dark as its predecessor. These roughly
jdaggett@1153 945 correspond to the commonly used weight names below:
jdaggett@1153 946 </dl>
jdaggett@1153 947
jdaggett@1153 948 <ul>
jdaggett@1153 949 <li>100 - Thin
jdaggett@1153 950
jdaggett@1153 951 <li>200 - Extra Light (Ultra Light)
jdaggett@1153 952
jdaggett@1153 953 <li>300 - Light
jdaggett@1153 954
jdaggett@1153 955 <li>400 - Normal
jdaggett@1153 956
jdaggett@1153 957 <li>500 - Medium
jdaggett@1153 958
jdaggett@1153 959 <li>600 - Semi Bold (Demi Bold)
jdaggett@1153 960
jdaggett@1153 961 <li>700 - Bold
jdaggett@1153 962
jdaggett@1153 963 <li>800 - Extra Bold (Ultra Bold)
jdaggett@1153 964
jdaggett@1153 965 <li>900 - Black (Heavy)
jdaggett@1153 966 </ul>
jdaggett@1153 967
jdaggett@1153 968 <dl>
jdaggett@6453 969 <dt><a href="#normal2"><strong>normal</strong></a>
jdaggett@1153 970
jdaggett@1153 971 <dd>Same as ‘<code class=css>400</code>’.
jdaggett@1153 972
jdaggett@1153 973 <dt><strong>bold</strong>
jdaggett@1153 974
jdaggett@1153 975 <dd>Same as ‘<code class=css>700</code>’.
jdaggett@1153 976
jdaggett@1153 977 <dt><strong>bolder</strong>
jdaggett@1153 978
jdaggett@1153 979 <dd>Specifies the weight of the face bolder than the inherited value.
jdaggett@1153 980
jdaggett@1153 981 <dt><strong>lighter</strong>
jdaggett@1153 982
jdaggett@1153 983 <dd>Specifies the weight of the face lighter than the inherited value.
jdaggett@1153 984 </dl>
jdaggett@1153 985
jdaggett@1153 986 <p>Font formats that use a scale other than a nine step scale should map
jdaggett@1153 987 their scale onto the CSS scale so that 400 roughly corresponds with a face
jdaggett@1153 988 that would be labeled as Regular, Book, Roman and 700 roughly matches a
jdaggett@1153 989 face that would be labeled as Bold. Or weights may be inferred from the
jdaggett@1153 990 style names, ones that correspond roughly with the scale above. The scale
jdaggett@1653 991 is relative, so a face with a larger weight value must never appear
jdaggett@1153 992 lighter. If style names are used to infer weights, care should be taken to
jdaggett@1153 993 handle variations in style names across locales.
jdaggett@1153 994
jdaggett@1153 995 <p>Quite often there are only a few weights available for a particular font
jdaggett@1153 996 family. When a weight is specified for which no face exists, a face with a
jdaggett@1153 997 nearby weight is used. In general, bold weights map to faces with heavier
jdaggett@1269 998 weights and light weights map to faces with lighter weights (see the <a
jdaggett@1269 999 href="#font-matching-algorithm">font matching section below</a> for a
jdaggett@1269 1000 precise definition). The examples here illustrate which face is used for
jdaggett@1269 1001 different weights, grey indicates a face for that weight does not exist so
jdaggett@1269 1002 a face with a nearby weight is used:
jdaggett@1153 1003
jdaggett@1153 1004 <div class=figure><img alt="weight mappings for a family with 400, 700 and
jdaggett@1153 1005 900 weights" src=optimaweights.png>
jdaggett@1153 1006 <p class=caption>Weight mappings for a font family with 400, 700 and 900
jdaggett@1153 1007 weight faces
jdaggett@1153 1008 </div>
jdaggett@1153 1009
jdaggett@1153 1010 <div class=figure><img alt="weight mappings for a family with 300, 600
jdaggett@1153 1011 weights" src=hiraginoweights.png>
jdaggett@1153 1012 <p class=caption>Weight mappings for a font family with 300 and 600 weight
jdaggett@1153 1013 faces
jdaggett@1153 1014 </div>
jdaggett@1153 1015
jdaggett@2528 1016 <p>Although the practice is not well-loved by typographers, bold faces are
jdaggett@2528 1017 often synthesized by user agents for faces that lack actual bold faces.
jdaggett@2528 1018 For the purposes of style matching, these faces must be treated as if they
jdaggett@2528 1019 exist within the family.
jdaggett@1153 1020
jdaggett@1153 1021 <p>Values of ‘<code class=property>bolder</code>’ and ‘<code
jdaggett@1153 1022 class=property>lighter</code>’ indicate values relative to the weight of
jdaggett@1153 1023 the parent element. Based on the inherited weight value, the weight used
jdaggett@1153 1024 is calculated using the chart below. Child elements inherit the calculated
jdaggett@1153 1025 weight, not a value of ‘<code class=property>bolder</code>’ or
jdaggett@1153 1026 ‘<code class=property>lighter</code>’.
jdaggett@1153 1027
jdaggett@7099 1028 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
jdaggett@1153 1029 <thead>
jdaggett@1153 1030 <tr>
jdaggett@7099 1031 <th>Inherited value
jdaggett@7099 1032
jdaggett@7099 1033 <th>bolder
jdaggett@7099 1034
jdaggett@7099 1035 <th>lighter
jdaggett@1153 1036
jdaggett@1153 1037 <tbody>
jdaggett@1153 1038 <tr>
jdaggett@1269 1039 <th>100
jdaggett@1153 1040
jdaggett@1153 1041 <td>400
jdaggett@1153 1042
jdaggett@1153 1043 <td>100
jdaggett@1153 1044
jdaggett@1153 1045 <tr>
jdaggett@1269 1046 <th>200
jdaggett@1153 1047
jdaggett@1153 1048 <td>400
jdaggett@1153 1049
jdaggett@1153 1050 <td>100
jdaggett@1153 1051
jdaggett@1153 1052 <tr>
jdaggett@1269 1053 <th>300
jdaggett@1153 1054
jdaggett@1153 1055 <td>400
jdaggett@1153 1056
jdaggett@1153 1057 <td>100
jdaggett@1153 1058
jdaggett@1153 1059 <tr>
jdaggett@1269 1060 <th>400
jdaggett@1153 1061
jdaggett@1153 1062 <td>700
jdaggett@1153 1063
jdaggett@1153 1064 <td>100
jdaggett@1153 1065
jdaggett@1153 1066 <tr>
jdaggett@1269 1067 <th>500
jdaggett@1153 1068
jdaggett@1153 1069 <td>700
jdaggett@1153 1070
jdaggett@1153 1071 <td>100
jdaggett@1153 1072
jdaggett@1153 1073 <tr>
jdaggett@1269 1074 <th>600
jdaggett@1153 1075
jdaggett@1153 1076 <td>900
jdaggett@1153 1077
jdaggett@1153 1078 <td>400
jdaggett@1153 1079
jdaggett@1153 1080 <tr>
jdaggett@1269 1081 <th>700
jdaggett@1153 1082
jdaggett@1153 1083 <td>900
jdaggett@1153 1084
jdaggett@1153 1085 <td>400
jdaggett@1153 1086
jdaggett@1153 1087 <tr>
jdaggett@1269 1088 <th>800
jdaggett@1153 1089
jdaggett@1153 1090 <td>900
jdaggett@1153 1091
jdaggett@1153 1092 <td>700
jdaggett@1153 1093
jdaggett@1153 1094 <tr>
jdaggett@1269 1095 <th>900
jdaggett@1153 1096
jdaggett@1153 1097 <td>900
jdaggett@1153 1098
jdaggett@1153 1099 <td>700
jdaggett@1153 1100 </table>
jdaggett@1153 1101
jdaggett@1153 1102 <p>The table above is equivalent to selecting the next relative bolder or
jdaggett@1153 1103 lighter face, given a font family containing normal and bold faces along
jdaggett@1153 1104 with a thin and a heavy face. Authors who desire finer control over the
jdaggett@1153 1105 exact weight values used for a given element should use numerical values
jdaggett@1153 1106 instead of relative weights.</p>
jdaggett@1153 1107 <!-- prop: font-stretch -->
jdaggett@1153 1108
jdaggett@1661 1109 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
jdaggett@1661 1110 href="#propdef-font-stretch">font-stretch</a> property</h3>
jdaggett@1661 1111
jdaggett@6453 1112 <table class=propdef id=namefont-stretchvaluenormal-ultra-conden>
jdaggett@1153 1113 <tbody>
jdaggett@1153 1114 <tr>
jdaggett@1153 1115 <td>Name:
jdaggett@1153 1116
jdaggett@1661 1117 <td><dfn id=propdef-font-stretch>font-stretch</dfn>
jdaggett@1153 1118
jdaggett@1153 1119 <tr>
jdaggett@1153 1120 <td>Value:
jdaggett@1153 1121
jdaggett@1661 1122 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@1661 1123 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@6453 1124 ultra-expanded
jdaggett@1153 1125
jdaggett@1153 1126 <tr>
jdaggett@1153 1127 <td>Initial:
jdaggett@1153 1128
jdaggett@1153 1129 <td>normal
jdaggett@1153 1130
jdaggett@1153 1131 <tr>
jdaggett@1153 1132 <td>Applies to:
jdaggett@1153 1133
jdaggett@1153 1134 <td>all elements
jdaggett@1153 1135
jdaggett@1153 1136 <tr>
jdaggett@1153 1137 <td>Inherited:
jdaggett@1153 1138
jdaggett@1153 1139 <td>yes
jdaggett@1153 1140
jdaggett@1153 1141 <tr>
jdaggett@1153 1142 <td>Percentages:
jdaggett@1153 1143
jdaggett@1153 1144 <td>N/A
jdaggett@1153 1145
jdaggett@1153 1146 <tr>
jdaggett@1153 1147 <td>Media:
jdaggett@1153 1148
jdaggett@1153 1149 <td>visual
jdaggett@1153 1150
jdaggett@1153 1151 <tr>
jdaggett@1153 1152 <td>Computed value:
jdaggett@1153 1153
jdaggett@1153 1154 <td>as specified
jdaggett@7361 1155
jdaggett@7361 1156 <tr>
jdaggett@7361 1157 <td>Animatable:
jdaggett@7361 1158
jdaggett@7361 1159 <td>as <a href="#font-stretch-animation">font stretch</a>
jdaggett@1153 1160 </table>
jdaggett@1153 1161
jdaggett@2554 1162 <p>The <a class=noxref href="#font-stretch-prop"><span
jdaggett@2554 1163 class=property>‘<code class=property>font-stretch</code>’</span></a>
jdaggett@2554 1164 property selects a normal, condensed, or expanded face from a font family.
jdaggett@2554 1165 Absolute keyword values have the following ordering, from narrowest to
jdaggett@2554 1166 widest:
jdaggett@1153 1167
jdaggett@1153 1168 <ul>
jdaggett@1153 1169 <li>Ultra Condensed
jdaggett@1153 1170
jdaggett@1153 1171 <li>Extra Condensed
jdaggett@1153 1172
jdaggett@1153 1173 <li>Condensed
jdaggett@1153 1174
jdaggett@1153 1175 <li>Semi Condensed
jdaggett@1153 1176
jdaggett@1153 1177 <li>Normal
jdaggett@1153 1178
jdaggett@1153 1179 <li>Semi Expanded
jdaggett@1153 1180
jdaggett@1153 1181 <li>Expanded
jdaggett@1153 1182
jdaggett@1153 1183 <li>Extra Expanded
jdaggett@1153 1184
jdaggett@1153 1185 <li>Ultra Expanded
jdaggett@1153 1186 </ul>
jdaggett@1153 1187
jdaggett@1153 1188 <p>The scale is relative, so a face with a font-stretch value higher in the
jdaggett@1153 1189 list above should never appear wider. When a face does not exist for a
jdaggett@1153 1190 given width, normal or condensed values map to a narrower face, otherwise
jdaggett@1153 1191 a wider face. Conversely, expanded values map to a wider face, otherwise a
jdaggett@1153 1192 narrower face. The figure below shows how the nine font-stretch property
jdaggett@1153 1193 settings affect font selection for font family containing a variety of
jdaggett@1153 1194 widths, grey indicates a width for which no face exists and a different
jdaggett@1153 1195 width is substituted:
jdaggett@1153 1196
jdaggett@1153 1197 <div class=figure><img alt="width mappings for a family with condensed,
jdaggett@1153 1198 normal and expanded faces" src=universwidths.png>
jdaggett@1153 1199 <p class=caption>Width mappings for a font family with condensed, normal
jdaggett@1153 1200 and expanded width faces
jdaggett@1153 1201 </div>
jdaggett@7361 1202
jdaggett@7361 1203 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
jdaggett@7361 1204 interpolated in discrete steps. The interpolation happens as though the
jdaggett@7361 1205 ordered values are equally spaced real numbers. The interpolation result
jdaggett@7361 1206 is rounded to the nearest value, with values exactly halfway between two
jdaggett@7361 1207 values rounded towards the later value in the list above.</p>
jdaggett@1153 1208 <!-- prop: font-style -->
jdaggett@1153 1209
jdaggett@1661 1210 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
jdaggett@1661 1211 href="#propdef-font-style">font-style</a> property</h3>
jdaggett@1661 1212
jdaggett@6453 1213 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
jdaggett@1153 1214 <tbody>
jdaggett@1153 1215 <tr>
jdaggett@1153 1216 <td>Name:
jdaggett@1153 1217
jdaggett@1661 1218 <td><dfn id=propdef-font-style>font-style</dfn>
jdaggett@1153 1219
jdaggett@1153 1220 <tr>
jdaggett@1153 1221 <td>Value:
jdaggett@1153 1222
jdaggett@6453 1223 <td>normal | italic | oblique
jdaggett@1153 1224
jdaggett@1153 1225 <tr>
jdaggett@1153 1226 <td>Initial:
jdaggett@1153 1227
jdaggett@1153 1228 <td>normal
jdaggett@1153 1229
jdaggett@1153 1230 <tr>
jdaggett@1153 1231 <td>Applies to:
jdaggett@1153 1232
jdaggett@1153 1233 <td>all elements
jdaggett@1153 1234
jdaggett@1153 1235 <tr>
jdaggett@1153 1236 <td>Inherited:
jdaggett@1153 1237
jdaggett@1153 1238 <td>yes
jdaggett@1153 1239
jdaggett@1153 1240 <tr>
jdaggett@1153 1241 <td>Percentages:
jdaggett@1153 1242
jdaggett@1153 1243 <td>N/A
jdaggett@1153 1244
jdaggett@1153 1245 <tr>
jdaggett@1153 1246 <td>Media:
jdaggett@1153 1247
jdaggett@1153 1248 <td>visual
jdaggett@1153 1249
jdaggett@1153 1250 <tr>
jdaggett@1153 1251 <td>Computed value:
jdaggett@1153 1252
jdaggett@1153 1253 <td>as specified
jdaggett@7361 1254
jdaggett@7361 1255 <tr>
jdaggett@7361 1256 <td>Animatable:
jdaggett@7361 1257
jdaggett@7361 1258 <td>no
jdaggett@1153 1259 </table>
jdaggett@1153 1260
jdaggett@2554 1261 <p>The <a class=noxref href="#font-style-prop"><span
jdaggett@2554 1262 class=property>‘<code class=property>font-style</code>’</span></a>
jdaggett@2554 1263 property allows italic or oblique faces to be selected. Italic forms are
jdaggett@2554 1264 generally cursive in nature while oblique faces are typically sloped
jdaggett@2554 1265 versions of the regular face. Oblique faces can be simulated by
jdaggett@2554 1266 artificially sloping the glyphs of the regular face. Compare the
jdaggett@2554 1267 artificially sloped renderings of Palatino ‘<code
jdaggett@2554 1268 class=property>a</code>’ and Baskerville ‘<code
jdaggett@1153 1269 class=property>N</code>’ in grey with the actual italic versions:
jdaggett@1153 1270
jdaggett@1153 1271 <div class=figure><img alt="artificial sloping vs. real italics"
jdaggett@1153 1272 src=realvsfakeitalics.png>
jdaggett@1153 1273 <p class=caption>Artificial sloping versus real italics
jdaggett@1153 1274 </div>
jdaggett@1153 1275
jdaggett@6453 1276 <p>A value of ‘<a href="#normal2"><code
jdaggett@6453 1277 class=property>normal</code></a>’ selects a face that is classified as
jdaggett@6453 1278 ‘<a href="#normal2"><code class=property>normal</code></a>’, while
jdaggett@6453 1279 ‘<code class=property>oblique</code>’ selects a font that is labeled
jdaggett@6453 1280 ‘<code class=property>oblique</code>’. A value of ‘<code
jdaggett@1153 1281 class=property>italic</code>’ selects a font that is labeled ‘<code
jdaggett@1153 1282 class=property>italic</code>’, or, if that is not available, one labeled
jdaggett@1153 1283 ‘<code class=property>oblique</code>’. If no italic or oblique faces
jdaggett@1153 1284 is available, an oblique face can by synthesized by rendering the normal
jdaggett@1153 1285 face with a sloping transformation applied.
jdaggett@1153 1286
jdaggett@1153 1287 <p>Many scripts lack the tradition of mixing a cursive form within text
jdaggett@1153 1288 rendered with a normal face. Chinese, Japanese and Korean fonts almost
jdaggett@1153 1289 always lack italic or oblique faces. Fonts that support a mixture of
jdaggett@1153 1290 scripts will sometimes omit specific scripts such as Arabic from the set
jdaggett@1153 1291 of glyphs supported in the italic face. User agents should be careful
jdaggett@7356 1292 about making character map assumptions across faces.
jdaggett@7356 1293
jdaggett@7356 1294 <p class=issue>For synthetic italics in vertical runs of Chinese, Japanese,
jdaggett@7356 1295 or Korean text, is there a need to define explicitly the direction of the
jdaggett@7356 1296 faux oblique for runs that include a mixture of ideographic and Latin
jdaggett@7356 1297 text?</p>
jdaggett@1643 1298 <!-- prop: font-size -->
jdaggett@1643 1299
jdaggett@1661 1300 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
jdaggett@1661 1301 href="#propdef-font-size">font-size</a> property</h3>
jdaggett@1661 1302
jdaggett@6453 1303 <table class=propdef id=namefont-sizevalueltabsolute-size-ltrela>
jdaggett@1153 1304 <tbody>
jdaggett@1153 1305 <tr>
jdaggett@1153 1306 <td>Name:
jdaggett@1153 1307
jdaggett@1661 1308 <td><dfn id=propdef-font-size>font-size</dfn>
jdaggett@1153 1309
jdaggett@1153 1310 <tr>
jdaggett@1153 1311 <td>Value:
jdaggett@1153 1312
jdaggett@1153 1313 <td>&lt;absolute-size> | &lt;relative-size> | &lt;length> |
jdaggett@6453 1314 &lt;percentage>
jdaggett@1153 1315
jdaggett@1153 1316 <tr>
jdaggett@1153 1317 <td>Initial:
jdaggett@1153 1318
jdaggett@1153 1319 <td>medium
jdaggett@1153 1320
jdaggett@1153 1321 <tr>
jdaggett@1153 1322 <td>Applies to:
jdaggett@1153 1323
jdaggett@1153 1324 <td>all elements
jdaggett@1153 1325
jdaggett@1153 1326 <tr>
jdaggett@1153 1327 <td>Inherited:
jdaggett@1153 1328
jdaggett@1153 1329 <td>yes
jdaggett@1153 1330
jdaggett@1153 1331 <tr>
jdaggett@1153 1332 <td>Percentages:
jdaggett@1153 1333
jdaggett@1153 1334 <td>refer to parent element's font size
jdaggett@1153 1335
jdaggett@1153 1336 <tr>
jdaggett@1153 1337 <td>Media:
jdaggett@1153 1338
jdaggett@1153 1339 <td>visual
jdaggett@1153 1340
jdaggett@1153 1341 <tr>
jdaggett@1153 1342 <td>Computed value:
jdaggett@1153 1343
jdaggett@1153 1344 <td>absolute length
jdaggett@7361 1345
jdaggett@7361 1346 <tr>
jdaggett@7361 1347 <td>Animatable:
jdaggett@7361 1348
jdaggett@7361 1349 <td>as <a
jdaggett@7361 1350 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
jdaggett@1153 1351 </table>
jdaggett@1153 1352
jdaggett@1153 1353 <p>This property indicates the desired height of glyphs from the font. For
jdaggett@1153 1354 scalable fonts, the font-size is a scale factor applied to the EM unit of
jdaggett@1153 1355 the font. (Note that certain glyphs may bleed outside their EM box.) For
jdaggett@1153 1356 non-scalable fonts, the font-size is converted into absolute units and
jdaggett@1153 1357 matched against the declared font-size of the font, using the same
jdaggett@1153 1358 absolute coordinate space for both of the matched values. Values have the
jdaggett@1153 1359 following meanings:
jdaggett@1153 1360
jdaggett@1153 1361 <dl>
jdaggett@1153 1362 <dt><a name=x18><span class=index-def id=ltabsolute-sizegt
jdaggett@7099 1363 title="&lt;absolute-size&gt;">
jdaggett@1153 1364 <strong>&lt;absolute-size&gt;</strong></span></a>
jdaggett@1153 1365
jdaggett@1153 1366 <dd> An <a class=value-def
jdaggett@1153 1367 name=value-def-absolute-size>&lt;absolute-size&gt;</a> keyword refers to
jdaggett@1153 1368 an entry in a table of font sizes computed and kept by the user agent.
jdaggett@1153 1369 Possible values are:
jdaggett@1153 1370 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
jdaggett@1153 1371
jdaggett@1153 1372 <dt><a name=x19><span class=index-def id=ltrelative-sizegt
jdaggett@7099 1373 title="&lt;relative-size&gt;">
jdaggett@7099 1374 <strong>&lt;relative-size&gt;</strong></span></a>
jdaggett@1153 1375
jdaggett@1153 1376 <dd> A <a class=value-def
jdaggett@1153 1377 name=value-def-relative-size>&lt;relative-size&gt;</a> keyword is
jdaggett@1153 1378 interpreted relative to the table of font sizes and the font size of the
jdaggett@1153 1379 parent element. Possible values are:
jdaggett@1153 1380 <p> [ larger | smaller ]
jdaggett@1153 1381
jdaggett@1153 1382 <p> For example, if the parent element has a font size of ‘<code
jdaggett@1153 1383 class=property>medium</code>’, a value of ‘<code
jdaggett@1153 1384 class=property>larger</code>’ will make the font size of the current
jdaggett@1153 1385 element be ‘<code class=property>large</code>’. If the parent
jdaggett@1153 1386 element's size is not close to a table entry, the user agent is free to
jdaggett@1153 1387 interpolate between table entries or round off to the closest one. The
jdaggett@1153 1388 user agent may have to extrapolate table values if the numerical value
jdaggett@1153 1389 goes beyond the keywords.
jdaggett@1153 1390
jdaggett@1153 1391 <dt><span class=index-inst id=ltlengthgt
jdaggett@1153 1392 title="&lt;length&gt;">&lt;length&gt;</span>
jdaggett@1153 1393
jdaggett@1153 1394 <dd>A length value specifies an absolute font size (that is independent of
jdaggett@1153 1395 the user agent's font table). Negative lengths are illegal.
jdaggett@1153 1396
jdaggett@6453 1397 <dt><span class=index-inst id=ltpercentagegt-
jdaggett@1153 1398 title="&lt;percentage&gt;">&lt;percentage&gt; </span>
jdaggett@1153 1399
jdaggett@1153 1400 <dd>A percentage value specifies an absolute font size relative to the
jdaggett@1153 1401 parent element's font size. Use of percentage values, or values in
jdaggett@1153 1402 ‘<code class=property>em</code>’s, leads to more robust and
jdaggett@1153 1403 cascadable style sheets.
jdaggett@1153 1404 </dl>
jdaggett@1153 1405
jdaggett@1153 1406 <p>The following table provides user agent's guideline for the
jdaggett@1153 1407 absolute-size scaling factor and their mapping to XHTML heading and
jdaggett@1153 1408 absolute font-sizes. The ‘<code class=property>medium</code>’ value is
jdaggett@2528 1409 used as the reference middle value. The user agent may fine-tune these
jdaggett@1269 1410 values for different fonts or different types of display devices.
jdaggett@1269 1411
jdaggett@1269 1412 <table class=data>
jdaggett@1153 1413 <thead>
jdaggett@1153 1414 <tr>
jdaggett@1153 1415 <th>CSS absolute-size values
jdaggett@1153 1416
jdaggett@1153 1417 <th>xx-small
jdaggett@1153 1418
jdaggett@1153 1419 <th>x-small
jdaggett@1153 1420
jdaggett@1153 1421 <th>small
jdaggett@1153 1422
jdaggett@1153 1423 <th>medium
jdaggett@1153 1424
jdaggett@1153 1425 <th>large
jdaggett@1153 1426
jdaggett@1153 1427 <th>x-large
jdaggett@1153 1428
jdaggett@1153 1429 <th>xx-large
jdaggett@1153 1430
jdaggett@1153 1431 <th> 
jdaggett@1153 1432
jdaggett@1153 1433 <tbody>
jdaggett@1153 1434 <tr>
jdaggett@1153 1435 <th>scaling factor
jdaggett@1153 1436
jdaggett@1153 1437 <td>3/5
jdaggett@1153 1438
jdaggett@1153 1439 <td>3/4
jdaggett@1153 1440
jdaggett@1153 1441 <td>8/9
jdaggett@1153 1442
jdaggett@1153 1443 <td>1
jdaggett@1153 1444
jdaggett@1153 1445 <td>6/5
jdaggett@1153 1446
jdaggett@1153 1447 <td>3/2
jdaggett@1153 1448
jdaggett@1153 1449 <td>2/1
jdaggett@1153 1450
jdaggett@1153 1451 <td>3/1
jdaggett@1153 1452
jdaggett@1153 1453 <tr>
jdaggett@1153 1454 <th>XHTML headings
jdaggett@1153 1455
jdaggett@1153 1456 <td>h6
jdaggett@1153 1457
jdaggett@1153 1458 <td> 
jdaggett@1153 1459
jdaggett@1153 1460 <td>h5
jdaggett@1153 1461
jdaggett@1153 1462 <td>h4
jdaggett@1153 1463
jdaggett@1153 1464 <td>h3
jdaggett@1153 1465
jdaggett@1153 1466 <td>h2
jdaggett@1153 1467
jdaggett@1153 1468 <td>h1
jdaggett@1153 1469
jdaggett@1153 1470 <td> 
jdaggett@1153 1471
jdaggett@1153 1472 <tr>
jdaggett@1153 1473 <th>XHTML font sizes
jdaggett@1153 1474
jdaggett@1153 1475 <td>1
jdaggett@1153 1476
jdaggett@1153 1477 <td> 
jdaggett@1153 1478
jdaggett@1153 1479 <td>2
jdaggett@1153 1480
jdaggett@1153 1481 <td>3
jdaggett@1153 1482
jdaggett@1153 1483 <td>4
jdaggett@1153 1484
jdaggett@1153 1485 <td>5
jdaggett@1153 1486
jdaggett@1153 1487 <td>6
jdaggett@1153 1488
jdaggett@1153 1489 <td>7
jdaggett@1153 1490 </table>
jdaggett@1153 1491
jdaggett@1153 1492 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
jdaggett@1153 1493 applying these guidelines should nevertheless avoid creating font-size
jdaggett@1153 1494 resulting in less than 9 pixels per EM unit on a computer display .</em>
jdaggett@1153 1495
jdaggett@1153 1496 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
jdaggett@1153 1497 factor between adjacent indexes was 1.5 which user experience proved to be
jdaggett@1153 1498 too large. In CSS2, the suggested scaling factor for computer screen
jdaggett@1153 1499 between adjacent indexes was 1.2 which still created issues for the small
jdaggett@1153 1500 sizes. The new scaling factor varies between each index to provide a
jdaggett@1153 1501 better readability.</em>
jdaggett@1153 1502
jdaggett@7099 1503 <p>The actual value of this property may differ from the computed value due
jdaggett@7099 1504 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
jdaggett@6453 1505 class=property>font-size-adjust</code></a>’ and the unavailability of
jdaggett@6453 1506 certain font sizes.
jdaggett@1153 1507
jdaggett@1153 1508 <p>Child elements inherit the computed <a class=noxref
jdaggett@7099 1509 href="#font-size-prop"> <span class=property>‘<code
jdaggett@1153 1510 class=property>font-size</code>’</span></a> value (otherwise, the effect
jdaggett@2554 1511 of <a class=noxref href="#font-size-adjust-prop"><span
jdaggett@2554 1512 class=property>‘<code
jdaggett@1153 1513 class=property>font-size-adjust</code>’</span></a> would compound).
jdaggett@1153 1514
jdaggett@1153 1515 <div class=example>
jdaggett@6453 1516 <p style="display:none">Example(s):
jdaggett@1153 1517
jdaggett@1153 1518 <p>
jdaggett@1153 1519
jdaggett@1153 1520 <pre>p { font-size: 12pt; }
jdaggett@1153 1521 blockquote { font-size: larger }
jdaggett@1153 1522 em { font-size: 150% }
jdaggett@1153 1523 em { font-size: 1.5em }
jdaggett@1153 1524 </pre>
jdaggett@1153 1525 </div>
jdaggett@1153 1526 <!-- prop: font-size-adjust -->
jdaggett@1153 1527
jdaggett@1661 1528 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
jdaggett@1661 1529 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
jdaggett@1661 1530
jdaggett@7099 1531 <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
jdaggett@1153 1532 <tbody>
jdaggett@1153 1533 <tr>
jdaggett@1153 1534 <td>Name:
jdaggett@1153 1535
jdaggett@1661 1536 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
jdaggett@1153 1537
jdaggett@1153 1538 <tr>
jdaggett@1153 1539 <td>Value:
jdaggett@1153 1540
jdaggett@7099 1541 <td>none | auto | &lt;number>
jdaggett@1153 1542
jdaggett@1153 1543 <tr>
jdaggett@1153 1544 <td>Initial:
jdaggett@1153 1545
jdaggett@1153 1546 <td>none
jdaggett@1153 1547
jdaggett@1153 1548 <tr>
jdaggett@1153 1549 <td>Applies to:
jdaggett@1153 1550
jdaggett@1153 1551 <td>all elements
jdaggett@1153 1552
jdaggett@1153 1553 <tr>
jdaggett@1153 1554 <td>Inherited:
jdaggett@1153 1555
jdaggett@1153 1556 <td>yes
jdaggett@1153 1557
jdaggett@1153 1558 <tr>
jdaggett@1153 1559 <td>Percentages:
jdaggett@1153 1560
jdaggett@1153 1561 <td>N/A
jdaggett@1153 1562
jdaggett@1153 1563 <tr>
jdaggett@1153 1564 <td>Media:
jdaggett@1153 1565
jdaggett@1153 1566 <td>visual
jdaggett@1153 1567
jdaggett@1153 1568 <tr>
jdaggett@1153 1569 <td>Computed value:
jdaggett@1153 1570
jdaggett@1153 1571 <td>as specified
jdaggett@7361 1572
jdaggett@7361 1573 <tr>
jdaggett@7361 1574 <td>Animatable:
jdaggett@7361 1575
jdaggett@7361 1576 <td>as <a
jdaggett@7361 1577 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
jdaggett@1153 1578 </table>
jdaggett@1153 1579
jdaggett@1153 1580 <p>For any given font size, the apparent size and legibility of text varies
jdaggett@1153 1581 across fonts. For scripts such as Latin or Cyrillic that distinguish
jdaggett@1153 1582 between upper and lowercase letters, the relative height of lowercase
jdaggett@1153 1583 letters compared to their uppercase counterparts is a determining factor
jdaggett@1153 1584 of legibility. This is commonly referred to as the <a class=index-def
jdaggett@6453 1585 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
jdaggett@6453 1586 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
jdaggett@6453 1587 the x-height of a font divided by the font size.
jdaggett@1153 1588
jdaggett@1153 1589 <p>In situations where font fallback occurs, fallback fonts may not share
jdaggett@1153 1590 the same aspect ratio as the desired font family and will thus appear less
jdaggett@1153 1591 readable. The font-size-adjust property is a way to preserve the
jdaggett@1153 1592 readability of text when font fallback occurs. It does this by adjusting
jdaggett@1643 1593 the font-size so that the x-height is the same regardless of the font
jdaggett@1153 1594 used.
jdaggett@1153 1595
jdaggett@1153 1596 <div class=example>
jdaggett@1153 1597 <p>The style defined below defines Verdana as the desired font family, but
jdaggett@1153 1598 if Verdana is not available Futura or Times will be used.</p>
jdaggett@1153 1599
jdaggett@1153 1600 <pre>p {
jdaggett@1153 1601 font-family: Verdana, Futura, Times;
jdaggett@1153 1602 }
jdaggett@1153 1603
jdaggett@1153 1604 &lt;p>Lorem ipsum dolor sit amet, ...&lt;/p>
jdaggett@1153 1605 </pre>
jdaggett@1153 1606
jdaggett@1153 1607 <p>Verdana has a relatively high aspect ratio, lowercase letters are
jdaggett@1153 1608 relatively tall compared to uppercase letters, so at small sizes text
jdaggett@1153 1609 appears legible. Times has a lower aspect ratio and so if fallback
jdaggett@1153 1610 occurs, the text will be less legible at small sizes than Verdana.</p>
jdaggett@1153 1611 </div>
jdaggett@1153 1612
jdaggett@1153 1613 <p>How text rendered in each of these fonts compares is shown below, the
jdaggett@1153 1614 columns show text rendered in Verdana, Futura and Times. The same
jdaggett@1153 1615 font-size value is used across cells within each row and red lines are
jdaggett@1153 1616 included to show the differences in x-height. In the upper half each row
jdaggett@1153 1617 is rendered in the same font-size value. The same is true for the lower
jdaggett@1153 1618 half but in this half the font-size-adjust property is also set so that
jdaggett@2528 1619 the actual font size is adjusted to preserve the x-height across each row.
jdaggett@1153 1620 Note how small text remains relatively legible across each row in the
jdaggett@1153 1621 lower half.
jdaggett@1153 1622
jdaggett@1153 1623 <div class=figure><img alt="text with and without font-size-adjust"
jdaggett@1153 1624 src=fontsizeadjust.png>
jdaggett@1153 1625 <p class=caption>Text with and without the use of font-size-adjust
jdaggett@1153 1626 </div>
jdaggett@1153 1627
jdaggett@1153 1628 <p>This property allows authors to specify an aspect value for an element
jdaggett@1153 1629 that will effectively preserve the x-height of the first choice font,
jdaggett@1153 1630 whether it is substituted or not. Values have the following meanings:
jdaggett@1153 1631
jdaggett@1153 1632 <dl>
jdaggett@1153 1633 <dt><strong>none</strong>
jdaggett@1153 1634
jdaggett@1153 1635 <dd>Do not preserve the font's x-height.
jdaggett@1153 1636
jdaggett@7099 1637 <dt><strong>auto</strong>
jdaggett@7099 1638
jdaggett@7099 1639 <dd>Behaves just like &lt;number>, except the number used is the aspect
jdaggett@7099 1640 value calculated by user agents for the first font in the list of fonts
jdaggett@7099 1641 defined for the initial value of the ‘<a
jdaggett@7099 1642 href="#descdef-font-family"><code
jdaggett@7099 1643 class=property>font-family</code></a>’ property. Effectively this is
jdaggett@7099 1644 the default font used when ‘<a href="#descdef-font-family"><code
jdaggett@7099 1645 class=property>font-family</code></a>’ is not otherwise specified.
jdaggett@7099 1646 <p>Authors can use this value to specify that font size should be
jdaggett@7099 1647 normalized across fonts based on the x-height without the need to
jdaggett@7099 1648 specify the aspect ratio explicitly.</p>
jdaggett@7099 1649
jdaggett@1153 1650 <dt><span class=index-inst id=ltnumbergt
jdaggett@1153 1651 title="&lt;number&gt;">&lt;number&gt;</span>
jdaggett@1153 1652
jdaggett@1153 1653 <dd>Specifies the aspect value used in the calculation below to calculate
jdaggett@1153 1654 the adjusted font size:
jdaggett@1153 1655 <pre>c = ( a / a' ) s
jdaggett@1153 1656 </pre>
jdaggett@1153 1657
jdaggett@1153 1658 <p>where:</p>
jdaggett@1153 1659
jdaggett@1153 1660 <pre>s = font-size value
jdaggett@1153 1661 a = aspect value as specified by the font-size-adjust property
jdaggett@1153 1662 a' = aspect value of actual font
jdaggett@1153 1663 c = adjusted font-size to use
jdaggett@1153 1664 </pre>
jdaggett@1153 1665
jdaggett@1153 1666 <p>This value applies to any font that is selected but in typical usage
jdaggett@1153 1667 it should be based on the aspect value of the first font in the
jdaggett@1153 1668 font-family list. If this is specified accurately, the <tt>(a/a')</tt>
jdaggett@1153 1669 term in the formula above is effectively 1 for the first font and no
jdaggett@1153 1670 adjustment occurs. If the value is specified inaccurately, text rendered
jdaggett@1153 1671 using the first font in the family list will display differently in
jdaggett@1153 1672 older user agents that don't support font-size-adjust.</p>
jdaggett@1153 1673 </dl>
jdaggett@1153 1674
jdaggett@1153 1675 <p>Authors can calculate the aspect value for a given font by comparing
jdaggett@1153 1676 spans with the same content but different font-size-adjust properties. If
jdaggett@1153 1677 the same font-size is used, the spans will match when the font-size-adjust
jdaggett@1153 1678 value is accurate for the given font.
jdaggett@1153 1679
jdaggett@1153 1680 <div class=example>
jdaggett@1153 1681 <p>Two spans with borders are used to determine the aspect value of a
jdaggett@1153 1682 font. The font-size is the same for both spans but the font-size-adjust
jdaggett@1153 1683 property is specified only for the right span. Starting with a value of
jdaggett@1153 1684 0.5, the aspect value can be adjusted until the borders around the two
jdaggett@1153 1685 letters line up.</p>
jdaggett@1153 1686
jdaggett@1153 1687 <pre>p {
jdaggett@1153 1688 font-family: Futura;
jdaggett@1153 1689 font-size: 500px;
jdaggett@1153 1690 }
jdaggett@1153 1691
jdaggett@1153 1692 span {
jdaggett@1153 1693 border: solid 1px red;
jdaggett@1153 1694 }
jdaggett@1153 1695
jdaggett@1153 1696 .adjust {
jdaggett@1153 1697 font-size-adjust: 0.5;
jdaggett@1153 1698 }
jdaggett@1153 1699
jdaggett@1153 1700 &lt;p>&lt;span>b&lt;/span>&lt;span class="adjust">b&lt;/span>&lt;/p>
jdaggett@1153 1701 </pre>
jdaggett@1153 1702
jdaggett@1153 1703 <div class=figure><img alt="Futura with an aspect value of 0.5"
jdaggett@1153 1704 src=beforefontsizeadjust.png>
jdaggett@1153 1705 <p class=caption>Futura with an aspect value of 0.5
jdaggett@1153 1706 </div>
jdaggett@1153 1707
jdaggett@1153 1708 <p>The box on the right is a bit bigger than the one on the left, so the
jdaggett@1153 1709 aspect value of this font is something less than 0.5. Adjust the value
jdaggett@1153 1710 until the boxes align.</p>
jdaggett@1153 1711 </div>
jdaggett@1661 1712 <!-- prop: font -->
jdaggett@3534 1713 <!-- jtdfix, crap, preprocessor is inserting links to descriptors rather than properties. bert, make it stop... -->
jdaggett@7099 1714 <!-- <a href="#font-stretch-prop" class="noxref"><span class="property">'font-stretch'</span></a> -->
jdaggett@1661 1715
jdaggett@1661 1716 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
jdaggett@1661 1717 <a href="#propdef-font">font</a> property</h3>
jdaggett@1661 1718
jdaggett@6453 1719 <table class=propdef id=namefontvalue-ltlsquofont-stylersquo-ltf>
jdaggett@1649 1720 <tbody>
jdaggett@1649 1721 <tr>
jdaggett@1649 1722 <td>Name:
jdaggett@1649 1723
jdaggett@1661 1724 <td><dfn id=propdef-font>font</dfn>
jdaggett@1649 1725
jdaggett@1649 1726 <tr>
jdaggett@1649 1727 <td>Value:
jdaggett@1649 1728
jdaggett@7099 1729 <td>[ [ &lt;‘<a href="#propdef-font-style"><code
jdaggett@6453 1730 class=property>font-style</code></a>’> || &lt;font-variant-css21> ||
jdaggett@7099 1731 &lt;‘<a href="#propdef-font-weight"><code
jdaggett@7099 1732 class=property>font-weight</code></a>’> || &lt;‘<a
jdaggett@7099 1733 href="#propdef-font-stretch"><code
jdaggett@7099 1734 class=property>font-stretch</code></a>’> ]? &lt;‘<a
jdaggett@6453 1735 href="#propdef-font-size"><code class=property>font-size</code></a>’>
jdaggett@6453 1736 [ / &lt;‘<code class=property>line-height</code>’> ]? &lt;‘<a
jdaggett@6453 1737 href="#descdef-font-family"><code
jdaggett@6453 1738 class=property>font-family</code></a>’> ] | caption | icon | menu |
jdaggett@6453 1739 message-box | small-caption | status-bar
jdaggett@1153 1740
jdaggett@1153 1741 <tr>
jdaggett@1153 1742 <td>Initial:
jdaggett@1153 1743
jdaggett@1153 1744 <td>see individual properties
jdaggett@1153 1745
jdaggett@1153 1746 <tr>
jdaggett@1153 1747 <td>Applies to:
jdaggett@1153 1748
jdaggett@1153 1749 <td>all elements
jdaggett@1153 1750
jdaggett@1153 1751 <tr>
jdaggett@1153 1752 <td>Inherited:
jdaggett@1153 1753
jdaggett@1153 1754 <td>yes
jdaggett@1153 1755
jdaggett@1153 1756 <tr>
jdaggett@1153 1757 <td>Percentages:
jdaggett@1153 1758
jdaggett@1153 1759 <td>see individual properties
jdaggett@1153 1760
jdaggett@1153 1761 <tr>
jdaggett@1153 1762 <td>Media:
jdaggett@1153 1763
jdaggett@1153 1764 <td>visual
jdaggett@1153 1765
jdaggett@1153 1766 <tr>
jdaggett@1153 1767 <td>Computed value:
jdaggett@1153 1768
jdaggett@1153 1769 <td>see individual properties
jdaggett@7361 1770
jdaggett@7361 1771 <tr>
jdaggett@7361 1772 <td>Animatable:
jdaggett@7361 1773
jdaggett@7361 1774 <td>see individual properties
jdaggett@1153 1775 </table>
jdaggett@2528 1776
jdaggett@6453 1777 <p>The <span class=property>‘<a href="#propdef-font"><code
jdaggett@6453 1778 class=property>font</code></a>’</span> property is, except as described
jdaggett@6453 1779 below, a shorthand property for setting ‘<a
jdaggett@7099 1780 href="#propdef-font-style"><code class=property>font-style</code></a>’,
jdaggett@6453 1781 <span class=property>‘<a href="#propdef-font-variant"><code
jdaggett@6453 1782 class=property>font-variant</code></a>’</span>, <span
jdaggett@7099 1783 class=property>‘<a href="#propdef-font-weight"><code
jdaggett@6453 1784 class=property>font-weight</code></a>’</span>, <span
jdaggett@7099 1785 class=property>‘<a href="#propdef-font-stretch"><code
jdaggett@7099 1786 class=property>font-stretch</code></a>’</span>, <span
jdaggett@6453 1787 class=property>‘<a href="#propdef-font-size"><code
jdaggett@6453 1788 class=property>font-size</code></a>’</span>, ‘<code
jdaggett@6453 1789 class=property>line-height</code>’, <span class=property>‘<a
jdaggett@6453 1790 href="#descdef-font-family"><code
jdaggett@6453 1791 class=property>font-family</code></a>’</span> at the same place in the
jdaggett@6453 1792 stylesheet. Values for the <span class=property>‘<a
jdaggett@6453 1793 href="#propdef-font-variant"><code
jdaggett@6453 1794 class=property>font-variant</code></a>’</span> property may also be
jdaggett@6453 1795 included but only those supported in CSS 2.1, none of the font-variant
jdaggett@6453 1796 values added in this specification can be used in the <span
jdaggett@6453 1797 class=property>‘<a href="#propdef-font"><code
jdaggett@6453 1798 class=property>font</code></a>’</span> shorthand:
jdaggett@2528 1799
jdaggett@2528 1800 <pre
jdaggett@3534 1801 class=prod><dfn id=ltfont-variant-css21gt><var>&lt;font-variant-css21&gt;</var></dfn> = [normal | small-caps]</pre>
jdaggett@2528 1802
jdaggett@2528 1803 <p>The syntax of this property is based on a traditional typographical
jdaggett@2528 1804 shorthand notation to set multiple properties related to fonts.
jdaggett@1153 1805
jdaggett@1153 1806 <p>All font-related properties are first reset to their initial values,
jdaggett@1661 1807 including those listed in the preceding paragraph plus <span
jdaggett@6453 1808 class=property>‘<a href="#propdef-font-size-adjust"><code
jdaggett@6453 1809 class=property>font-size-adjust</code></a>’</span>, <span
jdaggett@6453 1810 class=property>‘<a href="#propdef-font-kerning"><code
jdaggett@6453 1811 class=property>font-kerning</code></a>’</span> and all font feature
jdaggett@6453 1812 properties. Then, those properties that are given explicit values in the
jdaggett@6453 1813 <span class=property>‘<a href="#propdef-font"><code
jdaggett@6453 1814 class=property>font</code></a>’</span> shorthand are set to those
jdaggett@1153 1815 values. For a definition of allowed and initial values, see the previously
jdaggett@1153 1816 defined properties. For reasons of backwards compatibility, it is not
jdaggett@6453 1817 possible to set <span class=property>‘<a
jdaggett@7099 1818 href="#propdef-font-size-adjust"><code
jdaggett@7099 1819 class=property>font-size-adjust</code></a>’</span> to anything other
jdaggett@7099 1820 than its initial value using the <span class=property>‘<a
jdaggett@6453 1821 href="#propdef-font"><code class=property>font</code></a>’</span>
jdaggett@7099 1822 shorthand property; instead, use the individual property.
jdaggett@1153 1823
jdaggett@1153 1824 <div class=example>
jdaggett@6453 1825 <p style="display:none">Example(s):
jdaggett@1153 1826
jdaggett@1153 1827 <p>
jdaggett@1153 1828
jdaggett@1153 1829 <pre>p { font: 12pt/14pt sans-serif }
jdaggett@1153 1830 p { font: 80% sans-serif }
jdaggett@1153 1831 p { font: x-large/110% &quot;new century schoolbook&quot;, serif }
jdaggett@1153 1832 p { font: bold italic large Palatino, serif }
jdaggett@1153 1833 p { font: normal small-caps 120%/120% fantasy }
jdaggett@7099 1834 p { font: condensed oblique 12pt &quot;Helvetica Neue&quot;, serif; }
jdaggett@1153 1835 </pre>
jdaggett@1153 1836
jdaggett@1153 1837 <p> In the second rule, the font size percentage value (‘<code
jdaggett@1153 1838 class=css>80%</code>’) refers to the font size of the parent element.
jdaggett@1153 1839 In the third rule, the line height percentage (‘<code
jdaggett@1153 1840 class=css>110%</code>’) refers to the font size of the element itself.
jdaggett@1153 1841
jdaggett@6453 1842 <p>The first three rules do not specify the <span class=property>‘<a
jdaggett@6453 1843 href="#propdef-font-variant"><code
jdaggett@6453 1844 class=property>font-variant</code></a>’</span> and <span
jdaggett@7099 1845 class=property>‘<a href="#propdef-font-weight"><code
jdaggett@6453 1846 class=property>font-weight</code></a>’</span> explicitly, so these
jdaggett@6453 1847 properties receive their initial values (‘<a href="#normal2"><code
jdaggett@6453 1848 class=property>normal</code></a>’). Notice that the font family name
jdaggett@6453 1849 "new century schoolbook", which contains spaces, is enclosed in quotes.
jdaggett@6453 1850 The fourth rule sets the <span class=property>‘<a
jdaggett@7099 1851 href="#propdef-font-weight"><code
jdaggett@6453 1852 class=property>font-weight</code></a>’</span> to ‘<code
jdaggett@6453 1853 class=property>bold</code>’, the <span class=property>‘<a
jdaggett@7099 1854 href="#propdef-font-style"><code
jdaggett@6453 1855 class=property>font-style</code></a>’</span> to ‘<code
jdaggett@1661 1856 class=property>italic</code>’, and implicitly sets <span
jdaggett@6453 1857 class=property>‘<a href="#propdef-font-variant"><code
jdaggett@6453 1858 class=property>font-variant</code></a>’</span> to ‘<a
jdaggett@6453 1859 href="#normal2"><code class=property>normal</code></a>’.
jdaggett@6453 1860
jdaggett@6453 1861 <p> The fifth rule sets the <span class=property>‘<a
jdaggett@6453 1862 href="#propdef-font-variant"><code
jdaggett@6453 1863 class=property>font-variant</code></a>’</span> (‘<a
jdaggett@6453 1864 href="#small-caps"><code class=property>small-caps</code></a>’), the
jdaggett@6453 1865 <span class=property>‘<a href="#propdef-font-size"><code
jdaggett@6453 1866 class=property>font-size</code></a>’</span> (120% of the parent's font
jdaggett@6453 1867 size), the <span class=property>‘<code
jdaggett@1153 1868 class=property>line-height</code>’</span> (120% of the font size) and
jdaggett@6453 1869 the <span class=property>‘<a href="#descdef-font-family"><code
jdaggett@6453 1870 class=property>font-family</code></a>’</span> (‘<a
jdaggett@6453 1871 href="#fantasy"><code class=property>fantasy</code></a>’). It follows
jdaggett@6453 1872 that the keyword ‘<a href="#normal2"><code
jdaggett@6453 1873 class=property>normal</code></a>’ applies to the two remaining
jdaggett@7099 1874 properties: <span class=property>‘<a href="#propdef-font-style"><code
jdaggett@6453 1875 class=property>font-style</code></a>’</span> and <span
jdaggett@7099 1876 class=property>‘<a href="#propdef-font-weight"><code
jdaggett@6453 1877 class=property>font-weight</code></a>’</span>.
jdaggett@6453 1878
jdaggett@7356 1879 <p>The sixth rule sets the <span class=property>‘<a
jdaggett@7099 1880 href="#propdef-font-style"><code
jdaggett@6453 1881 class=property>font-style</code></a>’</span>, <span
jdaggett@7099 1882 class=property>‘<a href="#propdef-font-stretch"><code
jdaggett@7099 1883 class=property>font-stretch</code></a>’</span>, <span
jdaggett@6453 1884 class=property>‘<a href="#propdef-font-size"><code
jdaggett@6453 1885 class=property>font-size</code></a>’</span>, and <span
jdaggett@6453 1886 class=property>‘<a href="#descdef-font-family"><code
jdaggett@6453 1887 class=property>font-family</code></a>’</span>, the other font
jdaggett@7099 1888 properties being set to their initial values.
jdaggett@1153 1889 </div>
jdaggett@1153 1890
jdaggett@7099 1891 <p>Since the ‘<a href="#propdef-font-stretch"><code
jdaggett@7099 1892 class=property>font-stretch</code></a>’ property was not defined in CSS
jdaggett@7099 1893 2.1, when using ‘<a href="#propdef-font-stretch"><code
jdaggett@7099 1894 class=property>font-stretch</code></a>’ values within ‘<a
jdaggett@7099 1895 href="#propdef-font"><code class=property>font</code></a>’ rules,
jdaggett@7099 1896 authors should include a extra version compatible with older user agents:
jdaggett@7099 1897
jdaggett@7099 1898 <pre>p {
jdaggett@7099 1899 font: 80% sans-serif; /* for older user agents */
jdaggett@7099 1900 font: condensed 80% sans-serif;
jdaggett@7099 1901 }</pre>
jdaggett@7099 1902
jdaggett@1661 1903 <p>The following values refer to system fonts:
jdaggett@1153 1904
jdaggett@1153 1905 <dl>
jdaggett@1153 1906 <dt><strong>caption</strong>
jdaggett@1153 1907
jdaggett@1153 1908 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
jdaggett@1153 1909 etc.).
jdaggett@1153 1910
jdaggett@1153 1911 <dt><strong>icon</strong>
jdaggett@1153 1912
jdaggett@1153 1913 <dd>The font used to label icons.
jdaggett@1153 1914
jdaggett@1153 1915 <dt><strong>menu</strong>
jdaggett@1153 1916
jdaggett@1153 1917 <dd>The font used in menus (e.g., dropdown menus and menu lists).
jdaggett@1153 1918
jdaggett@1153 1919 <dt><strong>message-box</strong>
jdaggett@1153 1920
jdaggett@1153 1921 <dd>The font used in dialog boxes.
jdaggett@1153 1922
jdaggett@1153 1923 <dt><strong>small-caption</strong>
jdaggett@1153 1924
jdaggett@1153 1925 <dd>The font used for labeling small controls.
jdaggett@1153 1926
jdaggett@1153 1927 <dt><strong>status-bar</strong>
jdaggett@1153 1928
jdaggett@1153 1929 <dd>The font used in window status bars.
jdaggett@1153 1930 </dl>
jdaggett@1153 1931
jdaggett@1153 1932 <p>System fonts may only be set as a whole; that is, the font family, size,
jdaggett@1653 1933 weight, style, etc. are all set at the same time. These values may then be
jdaggett@1153 1934 altered individually if desired. If no font with the indicated
jdaggett@1153 1935 characteristics exists on a given platform, the user agent should either
jdaggett@1153 1936 intelligently substitute (e.g., a smaller version of the ‘<code
jdaggett@1153 1937 class=property>caption</code>’ font might be used for the ‘<code
jdaggett@7356 1938 class=property>small-caption</code>’ font), or substitute a user agent
jdaggett@1153 1939 default font. As for regular fonts, if, for a system font, any of the
jdaggett@1153 1940 individual properties are not part of the operating system's available
jdaggett@1153 1941 user preferences, those properties should be set to their initial values.
jdaggett@1153 1942
jdaggett@1661 1943 <p>That is why this property is "almost" a shorthand property: system fonts
jdaggett@1661 1944 can only be specified with this property, not with <span
jdaggett@6453 1945 class=property>‘<a href="#descdef-font-family"><code
jdaggett@6453 1946 class=property>font-family</code></a>’</span> itself, so <span
jdaggett@6453 1947 class=property>‘<a href="#propdef-font"><code
jdaggett@6453 1948 class=property>font</code></a>’</span> allows authors to do more than
jdaggett@6453 1949 the sum of its subproperties. However, the individual properties such as
jdaggett@7099 1950 <span class=property>‘<a href="#propdef-font-weight"><code
jdaggett@6453 1951 class=property>font-weight</code></a>’</span> are still given values
jdaggett@6453 1952 taken from the system font, which can be independently varied.
jdaggett@1153 1953
jdaggett@7356 1954 <p>Note that the keywords used for the system fonts listed above are only
jdaggett@7356 1955 treated as keywords when they occur in the initial position, in other
jdaggett@7356 1956 positions the same string is treated as part of the font family name:
jdaggett@7356 1957
jdaggett@7356 1958 <pre> font: menu; /* use the font settings for system menus */
jdaggett@7356 1959 font: large menu; /* use a font family named "menu" */</pre>
jdaggett@7356 1960
jdaggett@1153 1961 <div class=example>
jdaggett@6453 1962 <p style="display:none">Example(s):
jdaggett@1153 1963
jdaggett@1153 1964 <p>
jdaggett@1153 1965
jdaggett@1153 1966 <pre>button { font: 300 italic 1.3em/1.7em &quot;FB Armada&quot;, sans-serif }
jdaggett@1153 1967 button p { font: menu }
jdaggett@1153 1968 button p em { font-weight: bolder }
jdaggett@1153 1969 </pre>
jdaggett@1153 1970
jdaggett@1153 1971 <p>If the font used for dropdown menus on a particular system happened to
jdaggett@1153 1972 be, for example, 9-point Charcoal, with a weight of 600, then P elements
jdaggett@1153 1973 that were descendants of BUTTON would be displayed as if this rule were
jdaggett@1153 1974 in effect:
jdaggett@1153 1975
jdaggett@1153 1976 <pre>button p { font: 600 9pt Charcoal }
jdaggett@1153 1977 </pre>
jdaggett@1153 1978
jdaggett@6453 1979 <p>Because the <span class=property>‘<a href="#propdef-font"><code
jdaggett@6453 1980 class=property>font</code></a>’</span> shorthand resets to its initial
jdaggett@6453 1981 value any property not explicitly given a value, this has the same effect
jdaggett@6453 1982 as this declaration:
jdaggett@1153 1983
jdaggett@1153 1984 <pre>button p {
jdaggett@1153 1985 font-style: normal;
jdaggett@1153 1986 font-variant: normal;
jdaggett@1153 1987 font-weight: 600;
jdaggett@1153 1988 font-size: 9pt;
jdaggett@1153 1989 line-height: normal;
jdaggett@1153 1990 font-family: Charcoal
jdaggett@1153 1991 }
jdaggett@1153 1992 </pre>
jdaggett@1153 1993 </div>
jdaggett@2528 1994 <!-- prop: font-synthesis -->
jdaggett@2528 1995
jdaggett@2528 1996 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
jdaggett@2528 1997 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
jdaggett@2528 1998 property</h3>
jdaggett@2528 1999
jdaggett@6453 2000 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
jdaggett@2528 2001 <tbody>
jdaggett@2528 2002 <tr>
jdaggett@2528 2003 <td>Name:
jdaggett@2528 2004
jdaggett@2528 2005 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
jdaggett@2528 2006
jdaggett@2528 2007 <tr>
jdaggett@2528 2008 <td>Value:
jdaggett@2528 2009
jdaggett@2528 2010 <td>none | [ weight || style ]
jdaggett@2528 2011
jdaggett@2528 2012 <tr>
jdaggett@2528 2013 <td>Initial:
jdaggett@2528 2014
jdaggett@2528 2015 <td>weight style
jdaggett@2528 2016
jdaggett@2528 2017 <tr>
jdaggett@2528 2018 <td>Applies to:
jdaggett@2528 2019
jdaggett@2528 2020 <td>all elements
jdaggett@2528 2021
jdaggett@2528 2022 <tr>
jdaggett@2528 2023 <td>Inherited:
jdaggett@2528 2024
jdaggett@2528 2025 <td>yes
jdaggett@2528 2026
jdaggett@2528 2027 <tr>
jdaggett@2528 2028 <td>Percentages:
jdaggett@2528 2029
jdaggett@2528 2030 <td>N/A
jdaggett@2528 2031
jdaggett@2528 2032 <tr>
jdaggett@2528 2033 <td>Media:
jdaggett@2528 2034
jdaggett@2528 2035 <td>visual
jdaggett@2528 2036
jdaggett@2528 2037 <tr>
jdaggett@2528 2038 <td>Computed value:
jdaggett@2528 2039
jdaggett@2528 2040 <td>as specified
jdaggett@7361 2041
jdaggett@7361 2042 <tr>
jdaggett@7361 2043 <td>Animatable:
jdaggett@7361 2044
jdaggett@7361 2045 <td>no
jdaggett@2528 2046 </table>
jdaggett@2528 2047
jdaggett@2528 2048 <p>This property controls whether user agents are allowed to synthesize
jdaggett@2528 2049 bold or oblique font faces when a font family lacks bold or italic faces.
jdaggett@7356 2050 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
jdaggett@7356 2051 specified, user agents must not synthesize bold faces and if ‘<code
jdaggett@2528 2052 class=property>style</code>’ is not specified user agents must not
jdaggett@2528 2053 synthesize italic faces. A value of ‘<code class=property>none</code>’
jdaggett@2528 2054 disallows all synthetic faces.
jdaggett@2528 2055
jdaggett@2528 2056 <div class=example>
jdaggett@2528 2057 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
jdaggett@2528 2058
jdaggett@2528 2059 <pre>*:lang(ar) { font-synthesis: none; }
jdaggett@2528 2060 </pre>
jdaggett@2528 2061 </div>
jdaggett@1153 2062
jdaggett@7099 2063 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
jdaggett@7099 2064
jdaggett@7099 2065 <h3 id=font-face-rule><span class=secno>4.1 </span>The
jdaggett@7099 2066 <code>@font-face</code> rule</h3>
jdaggett@7099 2067
jdaggett@7099 2068 <p>The <code>@font-face</code> rule allows for linking to fonts that are
jdaggett@7099 2069 automatically activated when needed. This allows authors to select a font
jdaggett@7099 2070 that closely matches the design goals for a given page rather than
jdaggett@7099 2071 limiting the font choice to a set of fonts available on all platforms. A
jdaggett@7099 2072 set of font descriptors define the location of a font resource, either
jdaggett@7099 2073 locally or externally, along with the style characteristics of an
jdaggett@7099 2074 individual face. Multiple <code>@font-face</code> rules can be used to
jdaggett@7099 2075 construct font families with a variety of faces. Using CSS font matching
jdaggett@7099 2076 rules, a user agent can selectively download only those faces that are
jdaggett@7099 2077 needed for a given piece of text.
jdaggett@1153 2078
jdaggett@1269 2079 <p>The general form of an <span class=index-def id=font-face
jdaggett@7099 2080 title="@font-face"><code>@font-face</code></span> <span class=index-inst
jdaggett@1153 2081 id=at-rule title=at-rules>at-rule</span> is:
jdaggett@1153 2082
jdaggett@1153 2083 <pre>
jdaggett@1153 2084 @font-face { <span class=value-inst-font-description>&lt;font-description&gt;</span> }
jdaggett@1153 2085 </pre>
jdaggett@1153 2086
jdaggett@1269 2087 <p>where <span class=index-def id=ltfont-descriptiongt
jdaggett@7099 2088 title="&lt;font-description&gt;"><a
jdaggett@1153 2089 name=value-def-font-description>&lt;font-description&gt;</a></span> has
jdaggett@1153 2090 the form:
jdaggett@1153 2091
jdaggett@1153 2092 <pre>
jdaggett@1153 2093 descriptor: value;
jdaggett@1153 2094 descriptor: value;
jdaggett@1153 2095 [...]
jdaggett@1153 2096 descriptor: value;
jdaggett@1153 2097 </pre>
jdaggett@1153 2098
jdaggett@1153 2099 <p>Each <span class=index-inst id=font-face0
jdaggett@7099 2100 title="@font-face"><code>@font-face</code></span> rule specifies a value
jdaggett@7099 2101 for every font descriptor, either implicitly or explicitly. Those not
jdaggett@7099 2102 given explicit values in the rule take the initial value listed with each
jdaggett@7099 2103 descriptor in this specification. These descriptors apply solely within
jdaggett@7099 2104 the context of the <code>@font-face</code> rule in which they are defined,
jdaggett@7099 2105 and do not apply to document language elements. There is no notion of
jdaggett@7099 2106 which elements the descriptors apply to or whether the values are
jdaggett@7099 2107 inherited by child elements. When a given descriptor occurs multiple times
jdaggett@7099 2108 in a given <code>@font-face</code> rule, only the last specified value is
jdaggett@7099 2109 used, all prior values for that descriptor are ignored.
jdaggett@1153 2110
jdaggett@1153 2111 <div class=example>
jdaggett@1153 2112 <p>To use a downloadable font called Gentium:</p>
jdaggett@1153 2113
jdaggett@1153 2114 <pre>
jdaggett@1153 2115 @font-face {
jdaggett@1153 2116 font-family: Gentium;
jdaggett@2555 2117 src: url(http://example.com/fonts/Gentium.ttf);
jdaggett@1153 2118 }
jdaggett@1153 2119
jdaggett@1153 2120 p { font-family: Gentium, serif; }
jdaggett@1153 2121 </pre>
jdaggett@1153 2122
jdaggett@1153 2123 <p>The user agent will download Gentium and use it when rendering text
jdaggett@1153 2124 within paragraph elements. If for some reason the site serving the font
jdaggett@1153 2125 is unavailable, the default serif font will be used.</p>
jdaggett@1153 2126 </div>
jdaggett@1153 2127
jdaggett@7099 2128 <p>A given set of <code>@font-face</code> rules define a set of fonts
jdaggett@7099 2129 available to containing documents. Multiple rules can be used to define a
jdaggett@7099 2130 family with a large set of faces. When font matching is done fonts defined
jdaggett@7099 2131 using these rules are considered before other available fonts on a system.
jdaggett@7099 2132
jdaggett@1153 2133
jdaggett@1153 2134 <p>Downloaded fonts are only available to documents that reference them,
jdaggett@2528 2135 the process of activating these fonts should not make them available to
jdaggett@2528 2136 other applications or to documents that don't directly link to the same
jdaggett@2535 2137 font. User agent implementers might consider it convenient to use
jdaggett@2528 2138 downloaded fonts when rendering characters in other documents for which no
jdaggett@2528 2139 other available font exists as part of the system font fallback procedure.
jdaggett@2528 2140 This would cause a security leak since the contents of one page would be
jdaggett@2528 2141 able to affect other pages, something an attacker could use as an attack
jdaggett@2528 2142 vector. These restrictions do not affect caching behavior, fonts are
jdaggett@2528 2143 cached the same way other web resources are cached.
jdaggett@1153 2144
jdaggett@7099 2145 <p>User agents which do not understand the <code>@font-face</code> rule
jdaggett@7099 2146 encounter the opening curly bracket and ignore forward until the closing
jdaggett@7099 2147 curly bracket. This at-rule conforms with the forward-compatible parsing
jdaggett@7099 2148 requirement of CSS, parsers may ignore these rules without error. Any
jdaggett@7099 2149 descriptors that are not recognized or implemented by a given user agent
jdaggett@7099 2150 must be ignored. <code>@font-face</code> rules require a font-family and
jdaggett@7099 2151 src descriptor, if either of these are missing the <code>@font-face</code>
jdaggett@7099 2152 must be ignored.
jdaggett@1269 2153
jdaggett@1269 2154 <p>In cases where user agents have limited platform resources or implement
jdaggett@7099 2155 the ability to disable downloadable font resources,
jdaggett@7099 2156 <code>@font-face</code> rules must simply be ignored; the behavior of
jdaggett@7099 2157 individual descriptors as defined in this specification should not be
jdaggett@7099 2158 altered.
jdaggett@1269 2159
jdaggett@1661 2160 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
jdaggett@1661 2161 href="#descdef-font-family">font-family</a> descriptor</h3>
jdaggett@1153 2162
jdaggett@1153 2163 <table class=descdef>
jdaggett@1153 2164 <tbody>
jdaggett@1153 2165 <tr>
jdaggett@1153 2166 <td>Name:
jdaggett@1153 2167
jdaggett@1661 2168 <td><dfn id=descdef-font-family>font-family</dfn>
jdaggett@1153 2169
jdaggett@1153 2170 <tr>
jdaggett@1153 2171 <td>Value:
jdaggett@1153 2172
jdaggett@1153 2173 <td>&lt;family-name>
jdaggett@1153 2174
jdaggett@1153 2175 <tr>
jdaggett@1153 2176 <td><em>Initial:</em>
jdaggett@1153 2177
jdaggett@1153 2178 <td>N/A
jdaggett@1153 2179 </table>
jdaggett@1153 2180
jdaggett@1153 2181 <p>This descriptor defines the font family name that will be used in all
jdaggett@1269 2182 CSS font family name matching, overriding font family names contained in
jdaggett@1269 2183 the underlying font data. If the font family name is the same as a font
jdaggett@1269 2184 family available in a given user's environment, it effectively hides the
jdaggett@1269 2185 underlying font for documents that use the stylesheet. This permits a web
jdaggett@1269 2186 author to freely choose font-family names without worrying about conflicts
jdaggett@1269 2187 with font family names present in a given user's environment. Errors
jdaggett@1269 2188 loading font data do not affect font name matching behavior. User agents
jdaggett@1269 2189 that apply platform font aliasing rules to font family names defined via
jdaggett@7099 2190 <code>@font-face</code> rules are considered non-conformant.
jdaggett@1269 2191
jdaggett@1661 2192 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
jdaggett@1661 2193 href="#descdef-src">src</a> descriptor</h3>
jdaggett@1153 2194
jdaggett@1153 2195 <table class=descdef>
jdaggett@1153 2196 <tbody>
jdaggett@1153 2197 <tr>
jdaggett@1153 2198 <td>Name:
jdaggett@1153 2199
jdaggett@1661 2200 <td><dfn id=descdef-src>src</dfn>
jdaggett@1153 2201
jdaggett@1153 2202 <tr>
jdaggett@1153 2203 <td>Value:
jdaggett@1153 2204
jdaggett@6453 2205 <td>[ &lt;uri> [format(&lt;string>#)]? | &lt;font-face-name> ]#
jdaggett@1153 2206
jdaggett@1153 2207 <tr>
jdaggett@1153 2208 <td><em>Initial:</em>
jdaggett@1153 2209
jdaggett@1153 2210 <td>N/A
jdaggett@1153 2211 </table>
jdaggett@1153 2212
jdaggett@1153 2213 <p>This descriptor specifies the resource containing font data. It is
jdaggett@2528 2214 required, whether the font is downloadable or locally installed. Its value
jdaggett@2528 2215 is a prioritized, comma-separated list of external references or locally
jdaggett@2528 2216 installed font face names. When a font is needed the user agent iterates
jdaggett@2528 2217 over the set of references listed, using the first one it can successfully
jdaggett@2528 2218 activate. Fonts containing invalid data or local font faces that are not
jdaggett@2528 2219 found are ignored and the user agent loads the next font in the list
jdaggett@2528 2220 (platform substitutions for a given font must not be used).
jdaggett@1153 2221
jdaggett@1269 2222 <p>As with other URIs in CSS, the URI may be partial, in which case it is
jdaggett@1269 2223 resolved relative to the location of the style sheet containing the <span
jdaggett@7099 2224 class=index-inst id=font-face1
jdaggett@7099 2225 title="@font-face"><code>@font-face</code></span> rule. In the case of SVG
jdaggett@7099 2226 fonts, the URL points to an element within a document containing SVG font
jdaggett@7099 2227 definitions. If the element reference is omitted, a reference to the first
jdaggett@7099 2228 defined font is implied. Similarly, font container formats that can
jdaggett@7099 2229 contain more than one font must load one and only one of the fonts for a
jdaggett@7099 2230 given <code>@font-face</code> rule. Fragment identifiers are used to
jdaggett@6453 2231 indicate which font to load. If a container format lacks a defined
jdaggett@6453 2232 fragment identifier scheme, implementations should use a simple 1-based
jdaggett@6453 2233 indexing scheme (e.g. "font-collection#1" for the first font,
jdaggett@6453 2234 "font-collection#2" for the second font).
jdaggett@1269 2235
jdaggett@2528 2236 <pre>
jdaggett@2528 2237 src: url(fonts/simple.ttf); /* load simple.ttf relative to stylesheet location */
jdaggett@2528 2238 src: url(/fonts/simple.ttf); /* load simple.ttf from absolute location */
jdaggett@2528 2239 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
jdaggett@2528 2240 </pre>
jdaggett@2528 2241
jdaggett@2528 2242 <p>External references consist of a URI, followed by an optional hint
jdaggett@2528 2243 describing the format of the font resource referenced by that URI. The
jdaggett@2528 2244 format hint contains a comma-separated list of format strings that denote
jdaggett@2528 2245 well-known font formats. Conformant user agents must skip downloading a
jdaggett@2528 2246 font resource if the format hints indicate only unsupported or unknown
jdaggett@2528 2247 font formats. If no format hints are supplied, the user agent should
jdaggett@2528 2248 download the font resource.
jdaggett@2528 2249
jdaggett@2528 2250 <pre>
jdaggett@2528 2251 /* load WOFF font if possible, otherwise use OpenType font */
jdaggett@2528 2252 @font-face {
jdaggett@2528 2253 font-family: bodytext;
jdaggett@2528 2254 src: url(ideal-sans-serif.woff) format("woff"),
jdaggett@2528 2255 url(basic-sans-serif.ttf) format("opentype");
jdaggett@2528 2256 }
jdaggett@2528 2257 </pre>
jdaggett@2528 2258
jdaggett@2528 2259 <p>Format strings defined by this specification:
jdaggett@2528 2260
jdaggett@2528 2261 <table class=data id=fontformats>
jdaggett@2528 2262 <thead>
jdaggett@2528 2263 <tr>
jdaggett@2528 2264 <th>String
jdaggett@2528 2265
jdaggett@2528 2266 <th>Font Format
jdaggett@2528 2267
jdaggett@2528 2268 <th>Common extensions
jdaggett@2528 2269
jdaggett@2528 2270 <tbody>
jdaggett@2528 2271 <tr>
jdaggett@2528 2272 <th>"woff"
jdaggett@2528 2273
jdaggett@6453 2274 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
jdaggett@2528 2275
jdaggett@2528 2276 <td>.woff
jdaggett@2528 2277
jdaggett@2528 2278 <tr>
jdaggett@2528 2279 <th>"truetype"
jdaggett@2528 2280
jdaggett@6453 2281 <td><a
jdaggett@6453 2282 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
jdaggett@2528 2283
jdaggett@2528 2284 <td>.ttf
jdaggett@2528 2285
jdaggett@2528 2286 <tr>
jdaggett@2528 2287 <th>"opentype"
jdaggett@2528 2288
jdaggett@6453 2289 <td><a
jdaggett@6453 2290 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
jdaggett@2528 2291
jdaggett@2528 2292 <td>.ttf, .otf
jdaggett@2528 2293
jdaggett@2528 2294 <tr>
jdaggett@2528 2295 <th>"embedded-opentype"
jdaggett@2528 2296
jdaggett@6453 2297 <td><a
jdaggett@6453 2298 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
jdaggett@6453 2299 OpenType</a>
jdaggett@2528 2300
jdaggett@2528 2301 <td>.eot
jdaggett@2528 2302
jdaggett@2528 2303 <tr>
jdaggett@2528 2304 <th>"svg"
jdaggett@2528 2305
jdaggett@6453 2306 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
jdaggett@2528 2307
jdaggett@2528 2308 <td>.svg, .svgz
jdaggett@2528 2309 </table>
jdaggett@2528 2310
jdaggett@2528 2311 <p>Given the overlap in common usage between TrueType and OpenType, the
jdaggett@2528 2312 format hints "truetype" and "opentype" must be considered as synonymous; a
jdaggett@2528 2313 format hint of "opentype" does not imply that the font contains Postscript
jdaggett@2528 2314 CFF style glyph data or that it contains OpenType layout information (see
jdaggett@7361 2315 <a href="#platform-props-to-css">Appendix A</a> for more background on
jdaggett@7361 2316 this).
jdaggett@2528 2317
jdaggett@2528 2318 <p>When authors would prefer to use a locally available copy of a given
jdaggett@2528 2319 font and download it if it's not, local() can be used. The locally
jdaggett@2528 2320 installed <span class=index-def id=ltfont-face-namegt
jdaggett@7099 2321 title="&lt;font-face-name&gt;"><a
jdaggett@1153 2322 name=value-def-font-face-name>&lt;font-face-name&gt;</a></span> is a
jdaggett@1153 2323 format-specific string that uniquely identifies a single font face within
jdaggett@2528 2324 a larger family. The syntax for a &lt;font-face-name&gt; is a unique font
jdaggett@2528 2325 face name enclosed by "local(" and ")".
jdaggett@2528 2326
jdaggett@2528 2327 <pre>
jdaggett@2528 2328 /* regular face of Gentium */
jdaggett@1153 2329 @font-face {
jdaggett@2528 2330 font-family: MyGentium;
jdaggett@2528 2331 src: local(Gentium), /* use locally available Gentium */
jdaggett@2528 2332 url(Gentium.ttf); /* otherwise, download it */
jdaggett@1153 2333 }
jdaggett@1153 2334 </pre>
jdaggett@1153 2335
jdaggett@2528 2336 <p>The name can optionally be enclosed in quotes. For OpenType and TrueType
jdaggett@2528 2337 fonts, this string is used to match only the Postscript name or the full
jdaggett@2528 2338 font name in the name table of locally available fonts. Which is used
jdaggett@2528 2339 varies by platform and font, so authors should include both of these names
jdaggett@2528 2340 to assure proper matching across platforms.
jdaggett@2528 2341
jdaggett@2528 2342 <pre>
jdaggett@2528 2343 /* bold face of Gentium */
jdaggett@2528 2344 @font-face {
jdaggett@2528 2345 font-family: MyGentium;
jdaggett@2528 2346 src: local(Gentium Bold), /* full font name */
jdaggett@2528 2347 local(Gentium-Bold), /* Postscript name */
jdaggett@2528 2348 url(GentiumBold.ttf); /* otherwise, download it */
jdaggett@2528 2349 font-weight: bold;
jdaggett@2528 2350 }
jdaggett@2528 2351 </pre>
jdaggett@2528 2352
jdaggett@7099 2353 <p>Just as a <code>@font-face</code> rule specifies the characteristics of
jdaggett@7099 2354 a single font within a family, the unique name used with local() specifies
jdaggett@7099 2355 a single font, not an entire font family. Defined in terms of OpenType
jdaggett@7099 2356 font data, the Postscript name is found in the font's <a
jdaggett@2528 2357 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
jdaggett@2528 2358 in the name record with nameID = 6 (see <a href="#OPENTYPE"
jdaggett@2529 2359 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
jdaggett@2528 2360 Postscript name is the commonly used key for all fonts on OSX and for
jdaggett@2528 2361 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
jdaggett@2528 2362 used as a unique key for fonts with TrueType glyphs on Windows.
jdaggett@2528 2363
jdaggett@2528 2364 <p>For OpenType fonts with multiple localizations of the full font name,
jdaggett@2528 2365 the US English version is used (language ID = 0x409 for Windows and
jdaggett@2528 2366 language ID = 0 for Macintosh) or the first localization when a US English
jdaggett@2528 2367 full font name is not available (the OpenType specification recommends
jdaggett@2528 2368 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
jdaggett@2528 2369 fonts minimally include US English names</a>). User agents that also match
jdaggett@2528 2370 other full font names, e.g. matching the Dutch name when the current
jdaggett@2528 2371 system locale is set to Dutch, are considered non-conformant. This is done
jdaggett@2528 2372 not to prefer English but to avoid matching inconsistencies across font
jdaggett@2528 2373 versions and OS localizations, since font style names (e.g. "Bold") are
jdaggett@2528 2374 frequently localized into many languages and the set of localizations
jdaggett@2528 2375 available varies widely across platform and font version. User agents that
jdaggett@2528 2376 match a concatenation of family name (nameID = 1) with style name (nameID
jdaggett@2528 2377 = 2) are considered non-conformant.
jdaggett@2528 2378
jdaggett@2528 2379 <p>This also allows for referencing faces that belong to larger families
jdaggett@2528 2380 that cannot otherwise be referenced.
jdaggett@2528 2381
jdaggett@2528 2382 <div class=example>
jdaggett@1153 2383 <p>Use a local font or reference an SVG font in another document:</p>
jdaggett@1153 2384
jdaggett@1153 2385 <pre>
jdaggett@1153 2386 @font-face {
jdaggett@1153 2387 font-family: Headline;
jdaggett@1153 2388 src: local(Futura-Medium),
jdaggett@1153 2389 url(fonts.svg#MyGeometricModern) format("svg");
jdaggett@1153 2390 }
jdaggett@1153 2391 </pre>
jdaggett@1153 2392
jdaggett@1153 2393 <p>Create an alias for local Japanese fonts on different platforms:</p>
jdaggett@1153 2394
jdaggett@1153 2395 <pre>
jdaggett@1153 2396 @font-face {
jdaggett@2528 2397 font-family: jpgothic;
jdaggett@1153 2398 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
jdaggett@1153 2399 }
jdaggett@1153 2400 </pre>
jdaggett@1153 2401
jdaggett@1153 2402 <p>Reference a font face that cannot be matched within a larger family:</p>
jdaggett@1153 2403
jdaggett@1153 2404 <pre>
jdaggett@1153 2405 @font-face {
jdaggett@1153 2406 font-family: Hoefler Text Ornaments;
jdaggett@1153 2407 /* has the same font properties as Hoefler Text Regular */
jdaggett@1153 2408 src: local(HoeflerText-Ornaments);
jdaggett@1153 2409 }
jdaggett@1153 2410 </pre>
jdaggett@2528 2411
jdaggett@1661 2412 <p>Since localized fullnames should never match, a document with the
jdaggett@1661 2413 header style rules below would always render using the default serif
jdaggett@1661 2414 font, regardless whether a particular system locale parameter is set to
jdaggett@1661 2415 Finnish or not:</p>
jdaggett@1661 2416
jdaggett@1661 2417 <pre>
jdaggett@1661 2418 @font-face {
jdaggett@1661 2419 font-family: SectionHeader;
jdaggett@7099 2420 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
jdaggett@1661 2421 font-weight: bold;
jdaggett@1661 2422 }
jdaggett@1661 2423
jdaggett@1661 2424 h2 { font-family: SectionHeader, serif; }
jdaggett@1661 2425 </pre>
jdaggett@1661 2426
jdaggett@1661 2427 <p>A conformant user agent should never load the font ‘<code
jdaggett@1661 2428 class=css>gentium.eot</code>’ in the example below, since it is
jdaggett@6453 2429 included in the first definition of the ‘<a href="#descdef-src"><code
jdaggett@6453 2430 class=property>src</code></a>’ descriptor which is overridden by the
jdaggett@7099 2431 second definition in the same <code>@font-face</code> rule:</p>
jdaggett@1661 2432
jdaggett@1661 2433 <pre>
jdaggett@1661 2434 @font-face {
jdaggett@1661 2435 font-family: MainText;
jdaggett@7099 2436 src: url(gentium.eot); /* for use with older non-conformant user agents */
jdaggett@1661 2437 src: local("Gentium"), url(gentium.ttf); /* Overrides src definition */
jdaggett@1661 2438 }
jdaggett@1661 2439 </pre>
jdaggett@1661 2440 </div>
jdaggett@1661 2441
jdaggett@1661 2442 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
jdaggett@1661 2443 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
jdaggett@1661 2444 href="#descdef-font-weight">font-weight</a>, <a
jdaggett@1661 2445 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
jdaggett@1153 2446
jdaggett@1153 2447 <table class=descdef>
jdaggett@1153 2448 <tbody>
jdaggett@1153 2449 <tr>
jdaggett@1153 2450 <td>Name:
jdaggett@1153 2451
jdaggett@7099 2452 <td><dfn id=descdef-font-style title="font-style
jdaggett@7099 2453 (descriptor)">font-style</dfn>
jdaggett@1153 2454
jdaggett@1153 2455 <tr>
jdaggett@1153 2456 <td>Value:
jdaggett@1153 2457
jdaggett@1153 2458 <td>normal | italic | oblique
jdaggett@1153 2459
jdaggett@1153 2460 <tr>
jdaggett@1153 2461 <td><em>Initial:</em>
jdaggett@1153 2462
jdaggett@1153 2463 <td>normal
jdaggett@1153 2464 </table>
jdaggett@1153 2465
jdaggett@1153 2466 <table class=descdef>
jdaggett@1153 2467 <tbody>
jdaggett@1153 2468 <tr>
jdaggett@1153 2469 <td>Name:
jdaggett@1153 2470
jdaggett@7099 2471 <td><dfn id=descdef-font-weight title="font-weight
jdaggett@7099 2472 (descriptor)">font-weight</dfn>
jdaggett@1153 2473
jdaggett@1153 2474 <tr>
jdaggett@1153 2475 <td>Value:
jdaggett@1153 2476
jdaggett@1153 2477 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
jdaggett@1153 2478
jdaggett@1153 2479 <tr>
jdaggett@1153 2480 <td><em>Initial:</em>
jdaggett@1153 2481
jdaggett@1153 2482 <td>normal
jdaggett@1153 2483 </table>
jdaggett@1153 2484
jdaggett@1153 2485 <table class=descdef>
jdaggett@1153 2486 <tbody>
jdaggett@1153 2487 <tr>
jdaggett@1153 2488 <td>Name:
jdaggett@1153 2489
jdaggett@7099 2490 <td><dfn id=descdef-font-stretch title="font-stretch
jdaggett@7099 2491 (descriptor)">font-stretch</dfn>
jdaggett@1153 2492
jdaggett@1153 2493 <tr>
jdaggett@1153 2494 <td>Value:
jdaggett@1153 2495
jdaggett@1153 2496 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@1153 2497 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@1153 2498 ultra-expanded
jdaggett@1153 2499
jdaggett@1153 2500 <tr>
jdaggett@1153 2501 <td><em>Initial:</em>
jdaggett@1153 2502
jdaggett@1153 2503 <td>normal
jdaggett@1153 2504 </table>
jdaggett@1153 2505
jdaggett@1153 2506 <p>These descriptors define the characteristics of a font face and are used
jdaggett@1153 2507 in the process of matching styles to specific faces. For a font family
jdaggett@7099 2508 defined with several <code>@font-face</code> rules, user agents can either
jdaggett@7099 2509 download all faces in the family or use these descriptors to selectively
jdaggett@7099 2510 download font faces that match actual styles used in document. The values
jdaggett@7099 2511 for these descriptors are the same as those for the corresponding font
jdaggett@7099 2512 properties except that relative keywords are not allowed, ‘<code
jdaggett@2528 2513 class=property>bolder</code>’ and ‘<code
jdaggett@2528 2514 class=property>lighter</code>’. If these descriptors are omitted,
jdaggett@2528 2515 default values are assumed.
jdaggett@1153 2516
jdaggett@1153 2517 <p>The value for these font face style attributes is used in place of the
jdaggett@1153 2518 style implied by the underlying font data. This allows authors to combine
jdaggett@1153 2519 faces in flexible combinations, even in situations where the original font
jdaggett@1153 2520 data was arranged differently. User agents that implement synthetic
jdaggett@1653 2521 bolding and obliqueing must only apply synthetic styling in cases where
jdaggett@1153 2522 the font descriptors imply this is needed, rather than based on the style
jdaggett@1153 2523 attributes implied by the font data.
jdaggett@1153 2524
jdaggett@1661 2525 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
jdaggett@1661 2526 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
jdaggett@1153 2527
jdaggett@1153 2528 <table class=descdef>
jdaggett@1153 2529 <tbody>
jdaggett@1153 2530 <tr>
jdaggett@1153 2531 <td>Name:
jdaggett@1153 2532
jdaggett@1661 2533 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
jdaggett@1153 2534
jdaggett@1153 2535 <tr>
jdaggett@1153 2536 <td>Value:
jdaggett@1153 2537
jdaggett@6453 2538 <td>&lt;urange>#
jdaggett@1153 2539
jdaggett@1153 2540 <tr>
jdaggett@1153 2541 <td><em>Initial:</em>
jdaggett@1153 2542
jdaggett@1153 2543 <td>U+0-10FFFF
jdaggett@1153 2544 </table>
jdaggett@1153 2545
jdaggett@1153 2546 <p>This descriptor defines the range of Unicode characters supported by a
jdaggett@1153 2547 given font. The values of <span class=index-def id=lturangegt
jdaggett@7099 2548 title="&lt;urange&gt;"><a name=value-def-urange>&lt;urange&gt;</a></span>
jdaggett@7356 2549 are expressed using hexadecimal numbers prefixed by "U+" or "u+",
jdaggett@7356 2550 corresponding to <a href="http://www.unicode.org/charts/">Unicode
jdaggett@7356 2551 character code points</a>. The unicode-range descriptor serves as a hint
jdaggett@7356 2552 for user agents when deciding whether or not to download a font resource.
jdaggett@7356 2553
jdaggett@7356 2554 <p>Unicode range values are written using hexadecimal values and are ASCII
jdaggett@7356 2555 case-insensitive. Each is prefixed by "U+" or "u+" and multiple,
jdaggett@7356 2556 discontinuous ranges are separated by commas. Whitespace before or after
jdaggett@7356 2557 commas is ignored. Valid character code values vary between 0 and 10FFFF
jdaggett@7356 2558 inclusive. A single range has three basic forms:
jdaggett@1153 2559
jdaggett@1153 2560 <ul>
jdaggett@1153 2561 <li>a single code point (e.g. U+416)
jdaggett@1153 2562
jdaggett@1153 2563 <li>an interval value range (e.g. U+400-4ff)
jdaggett@1153 2564
jdaggett@1153 2565 <li>a range where trailing ‘<code class=css>?</code>’ characters imply
jdaggett@1153 2566 ‘<code class=css>any digit value</code>’ (e.g. U+4??)
jdaggett@1153 2567 </ul>
jdaggett@1153 2568
jdaggett@1153 2569 <p>Ranges that do not fit any of the above three forms are considered to be
jdaggett@1153 2570 parse errors and the descriptor is omitted. Interval ranges consisting of
jdaggett@1153 2571 a single code point are valid. Ranges specified with ‘?’ that lack an
jdaggett@1153 2572 initial digit (e.g. "U+???") are also valid, and are treated as if there
jdaggett@1153 2573 was a single 0 before the question marks (thus, "U+???" = "U+0???" =
jdaggett@1153 2574 "U+0000-0FFF"). "U+??????" is not a syntax error, even though "U+0??????"
jdaggett@1153 2575 would be. Ranges can overlap but interval ranges that descend (e.g.
jdaggett@1153 2576 U+400-32f) are invalid and omitted rather than treated as parse errors;
jdaggett@1153 2577 they have no effect on other ranges in a list of ranges. Ranges are
jdaggett@6453 2578 clipped to the domain of Unicode code points (currently 0 – 10FFFF
jdaggett@1153 2579 inclusive); a range entirely outside the domain is omitted. Without any
jdaggett@1153 2580 valid ranges, the descriptor is omitted. User agents may normalize the
jdaggett@2528 2581 list of ranges into a list that is different but represents the same set
jdaggett@2528 2582 of character code points.
jdaggett@1153 2583
jdaggett@7356 2584 <p>The character range can be a subset of the full <a
jdaggett@7356 2585 href="#character-map"><em>character map</em></a> of the underlying font.
jdaggett@7356 2586 The effective unicode-range used when mapping characters to fonts is the
jdaggett@7356 2587 intersection of the unicode range specified and the underlying <a
jdaggett@7356 2588 href="#character-map"><em>character map</em></a> of the font. This means
jdaggett@7356 2589 that authors do not need to define the unicode-range of a font precisely,
jdaggett@7356 2590 broad ranges for which a sparse set of code points are defined in the font
jdaggett@7356 2591 can be used. Code points outside of the defined unicode-range are ignored,
jdaggett@7356 2592 regardless of whether the font contains a glyph for that code point or
jdaggett@7356 2593 not. User agents that download fonts for characters outside the defined
jdaggett@7356 2594 unicode-range are considered non-conformant. Likewise, user agents that
jdaggett@7356 2595 render a character using a font resource for which the defined
jdaggett@7356 2596 unicode-range does not include that character are also considered
jdaggett@7356 2597 non-conformant.
jdaggett@1153 2598
jdaggett@1153 2599 <p>Example ranges for specific languages or characters:
jdaggett@1153 2600
jdaggett@1153 2601 <dl>
jdaggett@1153 2602 <dt>unicode-range: U+A5;
jdaggett@1153 2603
jdaggett@1153 2604 <dd>a single code point, the yen/yuan symbol
jdaggett@1153 2605
jdaggett@1153 2606 <dt>unicode-range: U+0-7F;
jdaggett@1153 2607
jdaggett@1153 2608 <dd>code range for basic ASCII characters
jdaggett@1153 2609
jdaggett@1153 2610 <dt>unicode-range: U+590-5ff;
jdaggett@1153 2611
jdaggett@1153 2612 <dd>code range for Hebrew characters
jdaggett@1153 2613
jdaggett@1153 2614 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
jdaggett@1153 2615
jdaggett@1153 2616 <dd>code range for Japanese kanji, hiragana and katakana characters plus
jdaggett@1153 2617 yen/yuan symbol
jdaggett@1153 2618 </dl>
jdaggett@1153 2619
jdaggett@1153 2620 <div class=example>
jdaggett@1153 2621 <p>The BBC provides news services in a wide variety of languages, many
jdaggett@7099 2622 that are not well supported across all platforms. Using an
jdaggett@7099 2623 <code>@font-face</code> rule, the BBC could provide a font for any of
jdaggett@7099 2624 these languages, as it already does via a manual font download.</p>
jdaggett@1153 2625
jdaggett@1153 2626 <pre>
jdaggett@1153 2627 @font-face {
jdaggett@1153 2628 font-family: BBCBengali;
jdaggett@1153 2629 src: url(fonts/BBCBengali.ttf) format("opentype");
jdaggett@1153 2630 unicode-range: U+00-FF, U+980-9FF;
jdaggett@1153 2631 }
jdaggett@1153 2632 </pre>
jdaggett@1153 2633 </div>
jdaggett@1153 2634
jdaggett@1153 2635 <div class=example>
jdaggett@1153 2636 <p>Technical documents often require a wide range of symbols. The STIX
jdaggett@1153 2637 Fonts project is one project aimed at providing fonts to support a wide
jdaggett@1153 2638 range of technical typesetting in a standardized way. The example below
jdaggett@1153 2639 shows the use of a font that provides glyphs for many of the mathematical
jdaggett@1153 2640 and technical symbol ranges within Unicode:</p>
jdaggett@1153 2641
jdaggett@1153 2642 <pre>
jdaggett@1153 2643 @font-face {
jdaggett@1153 2644 font-family: STIXGeneral;
jdaggett@1153 2645 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
jdaggett@1153 2646 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
jdaggett@1153 2647 }
jdaggett@1153 2648 </pre>
jdaggett@1153 2649 </div>
jdaggett@1153 2650
jdaggett@7099 2651 <p>Multiple <code>@font-face</code> rules with different unicode ranges for
jdaggett@7099 2652 the same family and style descriptor values can be used to create
jdaggett@7099 2653 composite fonts that mix the glyphs from different fonts for different
jdaggett@7099 2654 scripts. This can be used to combine fonts that only contain glyphs for a
jdaggett@7099 2655 single script (e.g. Latin, Greek, Cyrillic) or it can be used by authors
jdaggett@7099 2656 as a way of segmenting a font into fonts for commonly used characters and
jdaggett@7099 2657 less frequently used characters. Since the user agent will only pull down
jdaggett@7099 2658 the fonts it needs this helps reduce page bandwidth.
jdaggett@7099 2659
jdaggett@7099 2660 <p>If the unicode ranges overlap for a set of <code>@font-face</code> rules
jdaggett@7099 2661 with the same family and style descriptor values, the rules are ordered in
jdaggett@7099 2662 the reverse order they were defined; the last rule defined is the first to
jdaggett@7099 2663 be checked for a given character.
jdaggett@1153 2664
jdaggett@1153 2665 <div class=example>
jdaggett@1153 2666 <p>This example shows how an author can override the glyphs used for Latin
jdaggett@1153 2667 characters in a Japanese font with glyphs from a different font. The
jdaggett@1153 2668 first rule specifies no range so it defaults to the entire range. The
jdaggett@1153 2669 range specified in the second rule overlaps but takes precedence because
jdaggett@1153 2670 it is defined later.</p>
jdaggett@1153 2671
jdaggett@1153 2672 <pre>
jdaggett@1153 2673 @font-face {
jdaggett@1153 2674 font-family: JapaneseWithGentium;
jdaggett@1153 2675 src: local(MSMincho);
jdaggett@1153 2676 /* no range specified, defaults to entire range */
jdaggett@1153 2677 }
jdaggett@1153 2678
jdaggett@1153 2679 @font-face {
jdaggett@1153 2680 font-family: JapaneseWithGentium;
jdaggett@1153 2681 src: url(../fonts/Gentium.ttf);
jdaggett@1153 2682 unicode-range: U+0-2FF;
jdaggett@1153 2683 }
jdaggett@1153 2684 </pre>
jdaggett@1153 2685 </div>
jdaggett@1153 2686
jdaggett@1153 2687 <div class=example>
jdaggett@1153 2688 <p>Consider a family constructed to optimize bandwidth by separating out
jdaggett@1153 2689 Latin, Japanese and other characters into different font files:</p>
jdaggett@1153 2690
jdaggett@1153 2691 <pre>
jdaggett@1153 2692 /* fallback font - size: 4.5MB */
jdaggett@1153 2693 @font-face {
jdaggett@1153 2694 font-family: DroidSans;
jdaggett@1153 2695 src: url(DroidSansFallback.ttf);
jdaggett@1153 2696 /* no range specified, defaults to entire range */
jdaggett@1153 2697 }
jdaggett@1153 2698
jdaggett@1153 2699 /* Japanese glyphs - size: 1.2MB */
jdaggett@1153 2700 @font-face {
jdaggett@1153 2701 font-family: DroidSans;
jdaggett@1153 2702 src: url(DroidSansJapanese.ttf);
jdaggett@1153 2703 unicode-range: U+3000-9FFF, U+ff??;
jdaggett@1153 2704 }
jdaggett@1153 2705
jdaggett@1153 2706 /* Latin, Greek, Cyrillic along with some
jdaggett@1153 2707 punctuation and symbols - size: 190KB */
jdaggett@1153 2708 @font-face {
jdaggett@1153 2709 font-family: DroidSans;
jdaggett@1153 2710 src: url(DroidSans.ttf);
jdaggett@1153 2711 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
jdaggett@1153 2712 }
jdaggett@1153 2713 </pre>
jdaggett@1153 2714
jdaggett@1153 2715 <p>For simple Latin text, only the font for Latin characters is
jdaggett@1153 2716 downloaded:</p>
jdaggett@1153 2717
jdaggett@1153 2718 <pre>
jdaggett@1153 2719 body { font-family: DroidSans; }
jdaggett@1153 2720
jdaggett@1153 2721 &lt;p>This is that&lt;/p>
jdaggett@1153 2722 </pre>
jdaggett@1153 2723
jdaggett@1153 2724 <p>In this case the user agent first checks the unicode-range for the font
jdaggett@1153 2725 containing Latin characters (DroidSans.ttf). Since all the characters
jdaggett@1153 2726 above are in the range U+0-5FF, the user agent downloads the font and
jdaggett@1153 2727 renders the text with that font.</p>
jdaggett@1153 2728
jdaggett@1153 2729 <p>Next, consider text that makes use of an arrow character (⇨):</p>
jdaggett@1153 2730
jdaggett@1153 2731 <pre>
jdaggett@1153 2732 &lt;p>This &amp;#x21e8; that&lt;p>
jdaggett@1153 2733 </pre>
jdaggett@1153 2734
jdaggett@1153 2735 <p>The user agent again first checks the unicode-range of the font
jdaggett@1153 2736 containing Latin characters. Since U+2000-2300 includes the arrow code
jdaggett@1153 2737 point (U+21E8), the user agent downloads the font. For this character
jdaggett@1153 2738 however the Latin font does not have a matching glyph, so the effective
jdaggett@1153 2739 unicode-range used for font matching excludes this code point. Next, the
jdaggett@1153 2740 user agent evaluates the Japanese font. The unicode-range for the
jdaggett@1153 2741 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
jdaggett@1649 2742 user agent does not download the Japanese font. Next the fallback font is
jdaggett@7099 2743 considered. The <code>@font-face</code> rule for the fallback font does
jdaggett@7099 2744 not define unicode-range so its value defaults to the range of all
jdaggett@7099 2745 Unicode code points. The fallback font is downloaded and used to render
jdaggett@7099 2746 the arrow character.</p>
jdaggett@1153 2747 </div>
jdaggett@2528 2748
jdaggett@2528 2749 <h3 id=font-rend-desc><span class=secno>4.6 </span>Font features: the <a
jdaggett@1661 2750 href="#descdef-font-variant">font-variant</a> and <a
jdaggett@1661 2751 href="#descdef-font-feature-settings">font-feature-settings</a>
jdaggett@1649 2752 descriptors</h3>
jdaggett@1643 2753
jdaggett@1643 2754 <table class=descdef>
jdaggett@1643 2755 <tbody>
jdaggett@1643 2756 <tr>
jdaggett@1643 2757 <td>Name:
jdaggett@1643 2758
jdaggett@7099 2759 <td><dfn id=descdef-font-variant title="font-variant
jdaggett@7099 2760 (descriptor)">font-variant</dfn>
jdaggett@1643 2761
jdaggett@1643 2762 <tr>
jdaggett@1643 2763 <td>Value:
jdaggett@1643 2764
jdaggett@3534 2765 <td>normal | [ &lt;common-lig-values&gt; ||
jdaggett@3534 2766 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@3534 2767 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@6453 2768 || historical-forms || styleset(&lt;feature-value-name&gt;#) ||
jdaggett@6453 2769 character-variant(&lt;feature-value-name&gt;#) ||
jdaggett@6453 2770 swash(&lt;feature-value-name&gt;) ||
jdaggett@3534 2771 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@6453 2772 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@7099 2773 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@3534 2774 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@6453 2775 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@6453 2776 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@6453 2777 ruby ]
jdaggett@1643 2778
jdaggett@1643 2779 <tr>
jdaggett@1643 2780 <td><em>Initial:</em>
jdaggett@1643 2781
jdaggett@1643 2782 <td>normal
jdaggett@1643 2783 </table>
jdaggett@1643 2784
jdaggett@1643 2785 <table class=descdef>
jdaggett@1643 2786 <tbody>
jdaggett@1643 2787 <tr>
jdaggett@1643 2788 <td>Name:
jdaggett@1643 2789
jdaggett@7099 2790 <td><dfn id=descdef-font-feature-settings title="font-feature-settings
jdaggett@7099 2791 (descriptor)">font-feature-settings</dfn>
jdaggett@1643 2792
jdaggett@1643 2793 <tr>
jdaggett@1643 2794 <td>Value:
jdaggett@1643 2795
jdaggett@6453 2796 <td>normal | &lt;feature-tag-value&gt;#
jdaggett@1643 2797
jdaggett@1643 2798 <tr>
jdaggett@1643 2799 <td><em>Initial:</em>
jdaggett@1643 2800
jdaggett@1643 2801 <td>normal
jdaggett@1643 2802 </table>
jdaggett@1643 2803
jdaggett@1649 2804 <p>These descriptors define settings that apply when the font defined by an
jdaggett@7099 2805 <code>@font-face</code> rule is rendered. They do not affect font
jdaggett@7099 2806 selection. Values are identical to those defined for the corresponding
jdaggett@7099 2807 ‘<a href="#propdef-font-variant"><code
jdaggett@6453 2808 class=property>font-variant</code></a>’ and ‘<a
jdaggett@6453 2809 href="#propdef-font-feature-settings"><code
jdaggett@6453 2810 class=property>font-feature-settings</code></a>’ properties defined
jdaggett@6453 2811 below except that the value ‘<code class=property>inherit</code>’ is
jdaggett@6453 2812 omitted. When multiple font feature descriptors or properties are used,
jdaggett@6453 2813 the cumulative effect on text rendering is described below.
jdaggett@1649 2814
jdaggett@2637 2815 <h3 id=font-face-loading><span class=secno>4.7 </span>Font loading
jdaggett@2637 2816 guidelines</h3>
jdaggett@2637 2817
jdaggett@7099 2818 <p>The <code>@font-face</code> rule is designed to allow lazy loading of
jdaggett@7099 2819 fonts, fonts are only downloaded when needed for use within a document. A
jdaggett@7099 2820 stylesheet can include <code>@font-face</code> rules for a library of
jdaggett@7099 2821 fonts of which only a select set are used; user agents must only download
jdaggett@7099 2822 those fonts that are referred to within the style rules applicable to a
jdaggett@7099 2823 given page. User agents that download all fonts defined in
jdaggett@7099 2824 <code>@font-face</code> rules without considering whether those fonts are
jdaggett@7099 2825 in fact used within a page are considered non-conformant. In cases where a
jdaggett@7099 2826 font might be downloaded in character fallback cases, user agents may
jdaggett@7099 2827 download a font if it's listed in a font list but is not actually used for
jdaggett@7099 2828 a given text run.
jdaggett@2637 2829
jdaggett@2637 2830 <pre>
jdaggett@2637 2831 @font-face {
jdaggett@2637 2832 font-family: GeometricModern;
jdaggett@2637 2833 src: url(font.ttf);
jdaggett@2637 2834 }
jdaggett@2637 2835
jdaggett@2637 2836 p {
jdaggett@2637 2837 /* font will be downloaded for pages with p elements */
jdaggett@2637 2838 font-family: GeometricModern, sans-serif;
jdaggett@2637 2839 }
jdaggett@2637 2840
jdaggett@2637 2841 h2 {
jdaggett@2637 2842 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
jdaggett@2637 2843 font-family: Futura, GeometricModern, sans-serif;
jdaggett@2637 2844 }
jdaggett@2637 2845 </pre>
jdaggett@2637 2846
jdaggett@2637 2847 <p>In cases where textual content is loaded before downloadable fonts are
jdaggett@2637 2848 available, user agents may render text as it would be rendered if
jdaggett@2637 2849 downloadable font resources are not available or they may render text
jdaggett@2637 2850 transparently with fallback fonts to avoid a flash of text using a
jdaggett@2637 2851 fallback font. In cases where the font download fails user agents must
jdaggett@2637 2852 display text, simply leaving transparent text is considered non-conformant
jdaggett@2637 2853 behavior. Authors are advised to use fallback fonts in their font lists
jdaggett@2637 2854 that closely match the vertical metrics of the downloadable fonts to avoid
jdaggett@2637 2855 large page reflows where possible.
jdaggett@2637 2856
jdaggett@2637 2857 <h3 id=same-origin-restriction><span class=secno>4.8 </span>Same-origin
jdaggett@2637 2858 restriction for fonts</h3>
jdaggett@2637 2859
jdaggett@2740 2860 <h4 id=default-same-origin-restriction><span class=secno>4.8.1
jdaggett@2740 2861 </span>Default same-origin restriction</h4>
jdaggett@7356 2862 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
jdaggett@7356 2863 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
jdaggett@7356 2864 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
jdaggett@7356 2865 -->
jdaggett@2740 2866
jdaggett@2637 2867 <p>User agents must implement a same-origin restriction when loading fonts
jdaggett@7099 2868 via the <code>@font-face</code> mechanism. This restriction limits the
jdaggett@7099 2869 loading of fonts for a given document to fonts loaded from the same
jdaggett@7099 2870 origin. Fonts can only be loaded via the same host, port, and method
jdaggett@7099 2871 combination as the containing document, using the <a
jdaggett@7356 2872 href="http://www.w3.org/TR/html5/browsers.html#origin">origin matching
jdaggett@2637 2873 algorithm</a> described in the <a href="#HTML5"
jdaggett@2637 2874 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification. The origin of
jdaggett@7099 2875 the stylesheet containing <code>@font-face</code> rules is not used when
jdaggett@7099 2876 deciding whether a font is same origin or not, only the origin of the
jdaggett@7099 2877 containing document is used. The restriction applies to all font types.
jdaggett@2637 2878
jdaggett@2637 2879 <p>Given a document located at http://example.com/page.html, fonts defined
jdaggett@6453 2880 with ‘<a href="#descdef-src"><code class=property>src</code></a>’
jdaggett@2637 2881 definitions considered cross origin must not be loaded:
jdaggett@2637 2882
jdaggett@2637 2883 <pre>
jdaggett@2637 2884 /* same origin (i.e. domain, protocol, port match document) */
jdaggett@2637 2885 src: url(fonts/simple.ttf);
jdaggett@2637 2886 src: url(//fonts/simple.ttf);
jdaggett@2637 2887
jdaggett@2637 2888 /* cross origin, different protocol */
jdaggett@2637 2889 src: url(https://example.com/fonts/simple.ttf);
jdaggett@2637 2890
jdaggett@2637 2891 /* cross origin, different domain */
jdaggett@2637 2892 src: url(http://another.example.com/fonts/simple.ttf);
jdaggett@2637 2893 </pre>
jdaggett@2637 2894
jdaggett@2740 2895 <h4 id=allowing-cross-origin-font-loading><span class=secno>4.8.2
jdaggett@2740 2896 </span>Allowing cross-origin font loading</h4>
jdaggett@2740 2897
jdaggett@2637 2898 <p>User agents must also implement the ability to relax this restriction
jdaggett@2637 2899 using cross-site origin controls <a href="#CORS"
jdaggett@7356 2900 rel=biblioentry>[CORS]<!--{{!CORS}}--></a> for fonts loaded via HTTP.
jdaggett@7356 2901 Sites can explicitly allow cross-site downloading of font data using the
jdaggett@7356 2902 <code>Access-Control-Allow-Origin</code> HTTP header. For other protocols,
jdaggett@7356 2903 no explicit relaxation mechanism is defined or required.
jdaggett@7356 2904
jdaggett@7356 2905 <p>For font loads over HTTP, cross-origin requests must be made with the
jdaggett@7356 2906 following parameter settings which are used in conjunction with the <a
jdaggett@7356 2907 href="http://www.w3.org/TR/cors/#cross-origin-request-0"> <em>cross-origin
jdaggett@7356 2908 request algorithm</em></a> <a href="#CORS"
jdaggett@7356 2909 rel=biblioentry>[CORS]<!--{{!CORS}}--></a>:
jdaggett@7356 2910
jdaggett@7356 2911 <ul>
jdaggett@7356 2912 <li><em>request URL</em> — the URL of the font resource in the <a
jdaggett@7356 2913 href="#descdef-src"><code>src</code></a> descriptor
jdaggett@7356 2914
jdaggett@7356 2915 <li><em>request method</em> — GET
jdaggett@7356 2916
jdaggett@7356 2917 <li><em>author request headers</em> — none
jdaggett@7356 2918
jdaggett@7356 2919 <li><em>request entity body</em> — empty
jdaggett@7356 2920
jdaggett@7356 2921 <li><em>source origin</em> — the origin of the page which linked to the
jdaggett@7356 2922 stylesheet
jdaggett@7356 2923
jdaggett@7356 2924 <li><em>manual redirect flag</em> — false
jdaggett@7356 2925
jdaggett@7356 2926 <li><em>omit credentials flag</em> — true
jdaggett@7356 2927
jdaggett@7356 2928 <li><em>force preflight flag</em> — false
jdaggett@7356 2929 </ul>
jdaggett@2637 2930
jdaggett@7099 2931 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
jdaggett@7099 2932 Algorithm</h2>
jdaggett@1153 2933
jdaggett@2528 2934 <p>The algorithm below describes how fonts are associated with individual
jdaggett@2528 2935 runs of text. For each character in the run a font family is chosen and a
jdaggett@2528 2936 particular font face is selected containing a glyph for that character.
jdaggett@2528 2937
jdaggett@7356 2938 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
jdaggett@7356 2939 font family names</h3>
jdaggett@7356 2940
jdaggett@7356 2941 <p>As part of the font matching algorithm outlined below, user agents must
jdaggett@7356 2942 match font family names used in style rules with actual font family names
jdaggett@7356 2943 contained in fonts available in a given environment or defined via
jdaggett@7356 2944 <code>@font-face</code> rules. User agents must match these names case
jdaggett@7356 2945 insensitively, using the "Default Caseless Matching" algorithm outlined in
jdaggett@7356 2946 the Unicode specification <a href="#UNICODE6"
jdaggett@7356 2947 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
jdaggett@7356 2948 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
jdaggett@7356 2949 the algorithm must be applied without normalizing the strings involved and
jdaggett@7356 2950 without applying any language-specific tailorings. The case folding method
jdaggett@7356 2951 specified by this algorithm uses the case mappings with status field
jdaggett@7356 2952 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
jdaggett@7356 2953 in the CaseFolding.txt file of the Unicode Character Database.
jdaggett@7356 2954
jdaggett@7356 2955 <p class=note> Implementors should take care to verify that a given
jdaggett@7356 2956 caseless string comparison implementation uses this precise algorithm and
jdaggett@7356 2957 not assume that a given platform string matching routine follows it, as
jdaggett@7356 2958 many of these have locale-specific behavior or use some level of string
jdaggett@7356 2959 normalization.
jdaggett@7356 2960
jdaggett@7356 2961 <p class=note> For authors this means that font family names are matched
jdaggett@7356 2962 case insensitively, whether or not those names exist in a platform font or
jdaggett@7356 2963 in the <code>@font-face</code> rules contained in a stylesheet. Authors
jdaggett@7361 2964 should take care to ensure that names use a character sequence consistent
jdaggett@7361 2965 with the actual font family name, particularly when using combining
jdaggett@7361 2966 characters such as diacritical marks. For example, a family name that
jdaggett@7361 2967 contains an uppercase A (U+0041) followed by a combining ring (U+030A)
jdaggett@7361 2968 will <strong>not</strong> match a name that looks identical but which uses
jdaggett@7361 2969 the precomposed lowercase a-ring character (U+00E5) instead of the
jdaggett@7361 2970 combining sequence.
jdaggett@7356 2971
jdaggett@7356 2972 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
jdaggett@2528 2973 styles</h3>
jdaggett@2528 2974
jdaggett@7099 2975 <p>The procedure for choosing fonts consists of iterating over the font
jdaggett@1153 2976 families determined by the font-family property, selecting a font face
jdaggett@1153 2977 with the appropriate style based on other font properties and then
jdaggett@7356 2978 determining whether a glyph exists for a given character. This is done
jdaggett@7356 2979 using the <dfn id=character-map>character map</dfn> of the font, data
jdaggett@7356 2980 which maps characters to the default glyph for that character. Codepoint
jdaggett@7099 2981 sequences consisting of a base character followed by a sequence of
jdaggett@7099 2982 combining characters are treated slightly differently, see the section on
jdaggett@7099 2983 <a href="#cluster-matching">cluster matching</a> below.
jdaggett@1153 2984
jdaggett@7356 2985 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
jdaggett@7356 2986 given font family is defined to be the face that would be selected if all
jdaggett@7356 2987 font style properties were set to their initial value.
jdaggett@7356 2988
jdaggett@1153 2989 <ol id=fontmatchingalg>
jdaggett@2528 2990 <li>Using the computed font property values for a given element, the user
jdaggett@2528 2991 agent starts with the first family name in the fontlist specified by the
jdaggett@6453 2992 <span class=property>‘<a href="#descdef-font-family"><code
jdaggett@6453 2993 class=property>font-family</code></a>’</span> property.
jdaggett@2528 2994
jdaggett@2528 2995 <li>If the family name is unquoted and is a generic family name, the user
jdaggett@2528 2996 agent looks up the appropriate font family name to be used. User agents
jdaggett@2528 2997 may choose the generic font family to use based on the language of the
jdaggett@2528 2998 containing element or the Unicode range of the character.
jdaggett@2528 2999
jdaggett@2528 3000 <li>For other family names, the user agent attempts to find the family
jdaggett@7099 3001 name among fonts defined via <code>@font-face</code> rules and then among
jdaggett@7356 3002 available system fonts, matching names with a case-insensitive comparison
jdaggett@7356 3003 as outlined <a href="#font-family-casing">in the section above</a>. On
jdaggett@7356 3004 systems containing fonts with multiple localized font family names, user
jdaggett@7356 3005 agents must match any of these names independent of the underlying system
jdaggett@7356 3006 locale or platform API used. If a font family defined via
jdaggett@7356 3007 <code>@font-face</code> rules contains only invalid font data, it should
jdaggett@7356 3008 be considered as if a font was present but contained an empty <a
jdaggett@7356 3009 href="#character-map"><em>character map</em></a>; matching a platform
jdaggett@7356 3010 font with the same name must not occur in this case.
jdaggett@2528 3011
jdaggett@2528 3012 <li>If a font family match occurs, the user agent assembles the set of
jdaggett@7099 3013 font faces in that family and then narrows the set to a single face using
jdaggett@7099 3014 other font properties in the order given below:
jdaggett@2528 3015 <ol id=fontstylematchingalg>
jdaggett@7099 3016 <li><span class=property>‘<a href="#propdef-font-stretch"><code
jdaggett@6453 3017 class=property>font-stretch</code></a>’</span> is tried first. If the
jdaggett@6453 3018 matching set contains faces with width values matching the ‘<a
jdaggett@7099 3019 href="#propdef-font-stretch"><code
jdaggett@6453 3020 class=property>font-stretch</code></a>’ value, faces with other width
jdaggett@6453 3021 values are removed from the matching set. If there is no face that
jdaggett@6453 3022 exactly matches the width value the nearest width is used instead. If
jdaggett@7099 3023 the value of ‘<a href="#propdef-font-stretch"><code
jdaggett@6453 3024 class=property>font-stretch</code></a>’ is ‘<a
jdaggett@6453 3025 href="#normal2"><code class=property>normal</code></a>’ or one of the
jdaggett@6453 3026 condensed values, narrower width values are checked first, then wider
jdaggett@7099 3027 values. If the value of ‘<a href="#propdef-font-stretch"><code
jdaggett@6453 3028 class=property>font-stretch</code></a>’ is one of the expanded
jdaggett@6453 3029 values, wider values are checked first, followed by narrower values.
jdaggett@6453 3030 Once the closest matching width has been determined by this process,
jdaggett@6453 3031 faces with other widths are removed from the matching set.
jdaggett@6453 3032
jdaggett@7099 3033 <li><span class=property>‘<a href="#propdef-font-style"><code
jdaggett@6453 3034 class=property>font-style</code></a>’</span> is tried next. If the
jdaggett@7099 3035 value of ‘<a href="#propdef-font-style"><code
jdaggett@6453 3036 class=property>font-style</code></a>’ is ‘<code
jdaggett@2528 3037 class=property>italic</code>’, italic faces are checked first, then
jdaggett@2528 3038 oblique, then normal faces. If the value is ‘<code
jdaggett@2528 3039 class=property>oblique</code>’, oblique faces are checked first, then
jdaggett@6453 3040 italic faces and then normal faces. If the value is ‘<a
jdaggett@6453 3041 href="#normal2"><code class=property>normal</code></a>’, normal faces
jdaggett@6453 3042 are checked first, then oblique faces, then italic faces. Faces with
jdaggett@6453 3043 other style values are excluded from the matching set. User agents are
jdaggett@6453 3044 permitted to distinguish between italic and oblique faces within
jdaggett@6453 3045 platform font families but this is not required, they may treat all
jdaggett@6453 3046 italic or oblique faces as italic faces. However, within font families
jdaggett@7099 3047 defined via <code>@font-face</code> rules, italic and oblique faces
jdaggett@7099 3048 must be distinguished using the value of the ‘<a
jdaggett@7099 3049 href="#propdef-font-style"><code
jdaggett@6453 3050 class=property>font-style</code></a>’ descriptor.
jdaggett@6453 3051
jdaggett@7099 3052 <li><span class=property>‘<a href="#propdef-font-weight"><code
jdaggett@6453 3053 class=property>font-weight</code></a>’</span> is matched next, it
jdaggett@6453 3054 will always reduce the matching set to a single font face. If
jdaggett@2528 3055 bolder/lighter relative weights are used, the effective weight is
jdaggett@2528 3056 calculated based on the inherited weight value, as described in the
jdaggett@7099 3057 definition of the ‘<a href="#propdef-font-weight"><code
jdaggett@6453 3058 class=property>font-weight</code></a>’ property. Given the desired
jdaggett@6453 3059 weight and the weights of faces in the matching set after the steps
jdaggett@6453 3060 above, if the desired weight is available that face matches. Otherwise,
jdaggett@6453 3061 a weight is chosen using the rules below:
jdaggett@1153 3062 <ul>
jdaggett@1153 3063 <li>If the desired weight is less than 400, weights below the desired
jdaggett@1153 3064 weight are checked in descending order followed by weights above the
jdaggett@1153 3065 desired weight in ascending order until a match is found.
jdaggett@1153 3066
jdaggett@1153 3067 <li>If the desired weight is greater than 500, weights above the
jdaggett@1153 3068 desired weight are checked in ascending order followed by weights
jdaggett@1153 3069 below the desired weight in descending order until a match is found.
jdaggett@1153 3070
jdaggett@1153 3071 <li>If the desired weight is 400, 500 is checked first and then the
jdaggett@1153 3072 rule for desired weights less than 400 is used.
jdaggett@1153 3073
jdaggett@1153 3074 <li>If the desired weight is 500, 400 is checked first and then the
jdaggett@1153 3075 rule for desired weights less than 400 is used.
jdaggett@1153 3076 </ul>
jdaggett@1153 3077
jdaggett@6453 3078 <li><span class=property>‘<a href="#propdef-font-size"><code
jdaggett@6453 3079 class=property>font-size</code></a>’</span> must be matched within a
jdaggett@6453 3080 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
jdaggett@6453 3081 are rounded to the nearest whole pixel, while the tolerance for
jdaggett@6453 3082 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
jdaggett@6453 3083 by ‘<code class=property>em</code>’ values in other properties, are
jdaggett@6453 3084 based on the <span class=property>‘<a href="#propdef-font-size"><code
jdaggett@6453 3085 class=property>font-size</code></a>’</span> value that is used, not
jdaggett@6453 3086 the one that is specified.
jdaggett@1153 3087 </ol>
jdaggett@1153 3088
jdaggett@7356 3089 <li>
jdaggett@7356 3090 <p>If no matching face exists or the matched face does not contain a
jdaggett@7356 3091 glyph for the character to be rendered, the next family name is selected
jdaggett@7356 3092 and the previous two steps repeated. Glyphs from other faces in the
jdaggett@7356 3093 family are not considered. The only exception is that user agents may
jdaggett@7356 3094 optionally substitute a synthetic version of the <a
jdaggett@7356 3095 href="#default-face"><em>default face</em></a> if that face supports a
jdaggett@7356 3096 given glyph (e.g. a synthetic italic version of the regular face may be
jdaggett@7356 3097 used if the italic face doesn't support glyphs for Arabic).</p>
jdaggett@7356 3098 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
jdaggett@7356 3099
jdaggett@7356 3100 <p>If the matched font is defined via an <code>@font-face</code> rule and
jdaggett@7356 3101 needs to be downloaded, the font resource is downloaded. While the
jdaggett@7356 3102 download occurs, the user agent can either wait until the font is
jdaggett@7356 3103 downloaded or render once with substituted font metrics and render again
jdaggett@7356 3104 once the font is downloaded.</p>
jdaggett@1153 3105
jdaggett@1153 3106 <li>If there are no more font families to be evaluated and no matching
jdaggett@2528 3107 face has been found, then the user agent performs a <em>system font
jdaggett@2528 3108 fallback</em> procedure to find the best match for the character to be
jdaggett@2528 3109 rendered. The result of this procedure may vary across user agents.
jdaggett@1153 3110
jdaggett@1153 3111 <li>If a particular character cannot be displayed using any font, the user
jdaggett@1153 3112 agent should indicate by some means that a character is not being
jdaggett@2528 3113 displayed, displaying either a symbolic representation of the missing
jdaggett@2528 3114 glyph (e.g. using a <a
jdaggett@2528 3115 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
jdaggett@2528 3116 Font</a>) or using the missing character glyph from a default font.
jdaggett@1153 3117 </ol>
jdaggett@2528 3118
jdaggett@7356 3119 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
jdaggett@7099 3120
jdaggett@7099 3121 <p>When text contains characters such as combining diacritics, ideally the
jdaggett@7099 3122 base character should be rendered using the same font as the diacritic,
jdaggett@7099 3123 this assures proper placement of the diacritic. For this reason, the font
jdaggett@7099 3124 matching algorithm for clusters is more specialized than the general case
jdaggett@7099 3125 of matching a single character by itself. For sequences containing
jdaggett@7099 3126 variation selectors, which indicate the precise glyph to be used for a
jdaggett@7099 3127 given character, user agents always attempt system font fallback to find
jdaggett@7099 3128 the appropriate glyph before using the default glyph of the base
jdaggett@7099 3129 character.
jdaggett@7099 3130
jdaggett@7099 3131 <p>A font is considered to <em>support</em> a given character if (1) the
jdaggett@7356 3132 character is contained in the font's <a
jdaggett@7356 3133 href="#character-map"><em>character map</em></a> and (2) if required by
jdaggett@7099 3134 the containing script, shaping information is available for that
jdaggett@7356 3135 character. Some legacy fonts may include a given character in the <a
jdaggett@7356 3136 href="#character-map"><em>character map</em></a> but lack the shaping
jdaggett@7356 3137 information (e.g. <a
jdaggett@7099 3138 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
jdaggett@7099 3139 layout tables</a> or <a
jdaggett@7100 3140 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&amp;item_id=graphite_techAbout">Graphite
jdaggett@7099 3141 tables</a>) necessary for correctly rendering text runs containing that
jdaggett@7099 3142 character.
jdaggett@7099 3143
jdaggett@7099 3144 <p>A sequence of codepoints containing combining diacritics or other
jdaggett@7099 3145 modifiers is termed a grapheme cluster (see <a href="#CSS3TEXT"
jdaggett@7099 3146 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
jdaggett@7099 3147 description). For a given cluster containing a base character, <em>b</em>
jdaggett@7099 3148 and a sequence of combining characters <em>c1, c2…</em>, the entire
jdaggett@7099 3149 cluster is matched using these steps:
jdaggett@7099 3150
jdaggett@7099 3151 <ol>
jdaggett@7099 3152 <li>For each family in the font list, a face is chosen using the style
jdaggett@7099 3153 selection rules defined in the previous section.
jdaggett@7099 3154 <ol>
jdaggett@7099 3155 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
jdaggett@7099 3156 completely supported by the font, select this font for the sequence.
jdaggett@7099 3157
jdaggett@7099 3158 <li>If a sequence of multiple codepoints is canonically equivalent to a
jdaggett@7099 3159 single character and the font supports that character, select this font
jdaggett@7099 3160 for the sequence.
jdaggett@7099 3161 </ol>
jdaggett@7099 3162
jdaggett@7099 3163 <li>If no font was found in the font list in step 1:
jdaggett@7099 3164 <ol>
jdaggett@7099 3165 <li>If <em>c1</em> is a variation selector, system fallback must be used
jdaggett@7099 3166 to find a font that supports the full sequence of <em>b + c1</em>. If
jdaggett@7099 3167 no font on the system supports the full sequence, match the single
jdaggett@7099 3168 character <em>b</em> using the normal procedure for matching single
jdaggett@7099 3169 characters and ignore the variation selector. Note: a sequence with
jdaggett@7099 3170 more than one variation selector is treated as an encoding error and
jdaggett@7099 3171 the trailing selectors are ignored.
jdaggett@7099 3172
jdaggett@7099 3173 <li>Otherwise, the user agent may optionally use system font fallback to
jdaggett@7099 3174 match a font that supports the entire cluster.
jdaggett@7099 3175 </ol>
jdaggett@7099 3176
jdaggett@7099 3177 <li>If no font is found in step 2, use the matching sequence from step 1
jdaggett@7099 3178 to determine the longest sequence that is completely matched by a font in
jdaggett@7099 3179 the font list and attempt to match the remaining combining characters
jdaggett@7099 3180 separately using the rules for single characters.
jdaggett@7099 3181 </ol>
jdaggett@7099 3182
jdaggett@7356 3183 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
jdaggett@2528 3184 issues</h3>
jdaggett@2528 3185
jdaggett@2528 3186 <p>The procedure above is always performed on text runs containing Unicode
jdaggett@2528 3187 characters, documents using legacy encodings are assumed to have been
jdaggett@7356 3188 transcoded before matching fonts. For fonts containing <a
jdaggett@7356 3189 href="#character-map"><em title="character map">character maps</em></a>
jdaggett@7356 3190 for both legacy encodings and Unicode, the contents of the legacy encoding
jdaggett@7356 3191 <a href="#character-map"><em>character map</em></a> must have no effect on
jdaggett@7356 3192 the results of the font matching process.
jdaggett@2528 3193
jdaggett@2528 3194 <p>The font matching process does not assume that text runs are in either
jdaggett@2528 3195 normalized or denormalized form (see <a href="#CHARMOD-NORM"
jdaggett@3534 3196 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
jdaggett@2528 3197 details). Layout engines often convert base character plus combining
jdaggett@7099 3198 character sequences into precomposed characters if they exist. The font
jdaggett@7099 3199 matching algorithm outlined here supports both ways and fonts can
jdaggett@7099 3200 generally support either but variations can occur. Authors should always
jdaggett@7099 3201 tailor their choice of fonts to their content, including whether that
jdaggett@7099 3202 content contains normalized or denormalized character streams.
jdaggett@2528 3203
jdaggett@2528 3204 <p>If a given character is a Private-Use Area Unicode codepoint and none of
jdaggett@2528 3205 the fonts in the fontlist contain a glyph for that codepoint, user agents
jdaggett@2528 3206 must display some form of missing glyph symbol for that character rather
jdaggett@2528 3207 than attempting system font fallback for that codepoint. When matching the
jdaggett@2528 3208 replacement character U+FFFD, user agents may skip the font matching
jdaggett@2528 3209 process and immediately display some form of missing glyph symbol, they
jdaggett@2528 3210 are not required to display the glyph from the font that would be selected
jdaggett@2528 3211 by the font matching process.
jdaggett@2528 3212
jdaggett@2528 3213 <p>In general, the fonts for a given family will all have the same or
jdaggett@7356 3214 similar <a href="#character-map"><em title="character map">character
jdaggett@7356 3215 maps</em></a>. The process outlined here is designed to handle even font
jdaggett@7356 3216 families containing faces with widely variant <a href="#character-map"><em
jdaggett@7356 3217 title="character map">character maps</em></a>. However, authors are
jdaggett@7356 3218 cautioned that the use of such families can lead to unexpected results.
jdaggett@2528 3219
jdaggett@2528 3220 <p>Optimizations of this process are allowed provided that an
jdaggett@2528 3221 implementation behaves as if the algorithm had been followed exactly.
jdaggett@2528 3222 Matching occurs in a well-defined order to insure that the results are as
jdaggett@2528 3223 consistent as possible across user agents, given an identical set of
jdaggett@2528 3224 available fonts and rendering technology.
jdaggett@2528 3225
jdaggett@7356 3226 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
jdaggett@2528 3227 changes since CSS 2.1</h3>
jdaggett@2528 3228
jdaggett@2528 3229 <p>The algorithm above is different from CSS 2.1 in a number of key places.
jdaggett@2528 3230 These changes were made to better reflect actual font matching behavior
jdaggett@2528 3231 across user agent implementations.
jdaggett@2528 3232
jdaggett@2528 3233 <p>Differences compared to the font matching algorithm in CSS 2.1:
jdaggett@2528 3234
jdaggett@2528 3235 <ul>
jdaggett@2528 3236 <li>The algorithm includes font-stretch matching.
jdaggett@2528 3237
jdaggett@2528 3238 <li>All possible font-style matching scenarios are delineated.
jdaggett@2528 3239
jdaggett@2528 3240 <li>Small-caps fonts are not matched as part of the font matching process,
jdaggett@2528 3241 they are now handled via font features.
jdaggett@2528 3242
jdaggett@2528 3243 <li>Unicode variation selector matching is required.
jdaggett@7099 3244
jdaggett@7099 3245 <li>Cluster sequences are matched as a unit.
jdaggett@2528 3246 </ul>
jdaggett@7099 3247
jdaggett@7356 3248 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
jdaggett@7099 3249 examples</h3>
jdaggett@1153 3250
jdaggett@1153 3251 <div class=example>
jdaggett@1153 3252 <p>It's useful to note that the CSS selector syntax may be used to create
jdaggett@1153 3253 language-sensitive typography. For example, some Chinese and Japanese
jdaggett@1153 3254 characters are unified to have the same Unicode code point, although the
jdaggett@1153 3255 abstract glyphs are not the same in the two languages.
jdaggett@1153 3256
jdaggett@1153 3257 <pre>*:lang(ja-jp) { font: 900 14pt/16pt &quot;Heisei Mincho W9&quot;, serif; }
jdaggett@1153 3258 *:lang(zh-tw) { font: 800 14pt/16.5pt &quot;Li Sung&quot;, serif; }
jdaggett@1153 3259 </pre>
jdaggett@1153 3260
jdaggett@1153 3261 <p>This selects any element that has the given language - Japanese or
jdaggett@1153 3262 Traditional Chinese - and uses the appropriate font.
jdaggett@1153 3263 </div>
jdaggett@1661 3264
jdaggett@7099 3265 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
jdaggett@2528 3266
jdaggett@2528 3267 <p>Modern font technologies support a variety of advanced typographic and
jdaggett@2528 3268 language-specific font features. Using these features, a single font can
jdaggett@2528 3269 provide glyphs for a wide range of ligatures, contextual and stylistic
jdaggett@2528 3270 alternates, tabular and old-style figures, small capitals, automatic
jdaggett@2528 3271 fractions, swashes, and alternates specific to a given language. To allow
jdaggett@2528 3272 authors control over these font capabilities, the font-variant property
jdaggett@2528 3273 has been expanded for CSS3, it now functions as a shorthand for a set of
jdaggett@2528 3274 properties that provide control over stylistic font features.
jdaggett@2528 3275
jdaggett@2528 3276 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
jdaggett@2528 3277 selection and positioning</h3>
jdaggett@2528 3278
jdaggett@2528 3279 <p>Simple fonts used for displaying Latin text use a very basic processing
jdaggett@7356 3280 model, fonts contain a <a href="#character-map"><em>character map</em></a>
jdaggett@7356 3281 which maps a given character to a glyph for that character. Glyphs for
jdaggett@7356 3282 subsequent characters are simply placed next in line along a run of text.
jdaggett@7356 3283 Font formats such as OpenType and AAT (Apple Advanced Typography) use a
jdaggett@7356 3284 richer processing model, the glyph for a given character can be chosen and
jdaggett@7356 3285 positioned not just based on a single character, but also based on
jdaggett@7356 3286 surrounding characters along with the language, script, and features
jdaggett@7356 3287 enabled for the text. Font features may be required for specific scripts,
jdaggett@7356 3288 or recommended as enabled by default or they may be stylistic features
jdaggett@7356 3289 meant to be used under author control.
jdaggett@2528 3290
jdaggett@2528 3291 <p>For a good visual overview of these features, see the <a
jdaggett@2528 3292 href="#OPENTYPE-FONT-GUIDE"
jdaggett@2528 3293 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
jdaggett@2528 3294 For a detailed description of glyph processing for OpenType fonts, see <a
jdaggett@2528 3295 href="#WINDOWS-GLYPH-PROC"
jdaggett@2528 3296 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
jdaggett@2528 3297
jdaggett@6453 3298 <p>Stylistic font features can be classified into two broad categories,
jdaggett@6453 3299 ones that affect the harmonization of glyph shapes with the surrounding
jdaggett@6453 3300 context, such as kerning and ligature features, and those such as the
jdaggett@6453 3301 small-caps, subscript/superscript and alternate features that affect shape
jdaggett@6453 3302 selection.
jdaggett@6453 3303
jdaggett@2528 3304 <p>The subproperties of font-variant listed below are used to control these
jdaggett@2528 3305 stylistic font features; they do not control features that are required
jdaggett@2528 3306 for displaying certain scripts, such as the OpenType features used when
jdaggett@2528 3307 displaying Arabic or Indic language text. They affect glyph selection and
jdaggett@2528 3308 positioning, they do not affect font selection as described in the font
jdaggett@2528 3309 matching section (except in cases required for compatibility with CSS
jdaggett@2528 3310 2.1).
jdaggett@2528 3311
jdaggett@2528 3312 <p>To assure consistent behavior across user agents, the equivalent
jdaggett@1661 3313 OpenType property settings are listed for individual properties and must
jdaggett@2528 3314 be considered normative. When using other font formats these should be
jdaggett@2528 3315 used as a guideline to map CSS font feature property values to specific
jdaggett@2528 3316 font features.
jdaggett@2528 3317
jdaggett@2528 3318 <h3 id=language-specific-support><span class=secno>6.2
jdaggett@2528 3319 </span>Language-specific display</h3>
jdaggett@2528 3320
jdaggett@2528 3321 <p>OpenType also supports language-specific glyph selection and
jdaggett@2528 3322 positioning, so that text can be displayed correctly in cases where the
jdaggett@2528 3323 language dictates a specific display behavior. Languages often share a
jdaggett@2528 3324 common script but the shape of certain letters may vary across those
jdaggett@2528 3325 languages, such as the variations in certain Cyrillic letters used in
jdaggett@2528 3326 Russian and Bulgarian text. In Latin text, it's common to render "fi" with
jdaggett@2528 3327 an explicit fi-ligature that lacks a dot on the "i". However, in languages
jdaggett@2528 3328 such as Turkish which uses both a dotted-i and a dotless-i, it's important
jdaggett@2528 3329 to not use this ligature or use a specialized version that contains a dot
jdaggett@2528 3330 over the "i". The example below shows language-specific variations based
jdaggett@2528 3331 on stylistic traditions found in Spanish, Italian and French orthography:
jdaggett@2528 3332
jdaggett@2528 3333 <div class=featex><img alt="language specific forms, spanish"
jdaggett@2528 3334 src=locl-1.png></div>
jdaggett@2528 3335
jdaggett@2528 3336 <div class=featex><img alt="language specific forms, italian"
jdaggett@2528 3337 src=locl-2.png></div>
jdaggett@2528 3338
jdaggett@2528 3339 <div class=featex><img alt="language specific forms, french"
jdaggett@2528 3340 src=locl-3.png></div>
jdaggett@2528 3341
jdaggett@7356 3342 <p>If the content language of the element is known, according to the rules
jdaggett@7356 3343 of the <a
jdaggett@7356 3344 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
jdaggett@7356 3345 language</a>, user agents are required to infer the OpenType language
jdaggett@7356 3346 system from the content language and use that when selecting and
jdaggett@7356 3347 positioning glyphs using an OpenType font.
jdaggett@7356 3348
jdaggett@7356 3349 <p>For OpenType fonts, in some cases it may be necessary to explicitly
jdaggett@7356 3350 declare the OpenType language to be used, for example when displaying text
jdaggett@7356 3351 in a given language that uses the typographic conventions of another
jdaggett@7356 3352 language or when the font does not explicitly support a given language but
jdaggett@7356 3353 supports a language that shares common typographic conventions. The ‘<a
jdaggett@6453 3354 href="#propdef-font-language-override"><code
jdaggett@6453 3355 class=property>font-language-override</code></a>’ property is used for
jdaggett@6453 3356 this purpose.
jdaggett@2528 3357
jdaggett@7356 3358 <p class=issue>Should user agents be allowed to infer the OpenType language
jdaggett@7356 3359 or simply use only the default language system? Do we also need a
jdaggett@7356 3360 normative definition of how the script system is inferred?</p>
jdaggett@1661 3361 <!-- prop: font-kerning -->
jdaggett@1661 3362
jdaggett@2528 3363 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
jdaggett@1661 3364 href="#propdef-font-kerning">font-kerning</a> property</h3>
jdaggett@1661 3365
jdaggett@6453 3366 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
jdaggett@1661 3367 <tbody>
jdaggett@1661 3368 <tr>
jdaggett@1661 3369 <td>Name:
jdaggett@1661 3370
jdaggett@1661 3371 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
jdaggett@1661 3372
jdaggett@1661 3373 <tr>
jdaggett@1661 3374 <td>Value:
jdaggett@1661 3375
jdaggett@2528 3376 <td>auto | normal | none
jdaggett@1661 3377
jdaggett@1661 3378 <tr>
jdaggett@1661 3379 <td>Initial:
jdaggett@1661 3380
jdaggett@2528 3381 <td>auto
jdaggett@1661 3382
jdaggett@1661 3383 <tr>
jdaggett@1661 3384 <td>Applies to:
jdaggett@1661 3385
jdaggett@1661 3386 <td>all elements
jdaggett@1661 3387
jdaggett@1661 3388 <tr>
jdaggett@1661 3389 <td>Inherited:
jdaggett@1661 3390
jdaggett@1661 3391 <td>yes
jdaggett@1661 3392
jdaggett@1661 3393 <tr>
jdaggett@1661 3394 <td>Percentages:
jdaggett@1661 3395
jdaggett@1661 3396 <td>N/A
jdaggett@1661 3397
jdaggett@1661 3398 <tr>
jdaggett@1661 3399 <td>Media:
jdaggett@1661 3400
jdaggett@1661 3401 <td>visual
jdaggett@1661 3402
jdaggett@1661 3403 <tr>
jdaggett@1661 3404 <td>Computed value:
jdaggett@1661 3405
jdaggett@1661 3406 <td>as specified
jdaggett@7361 3407
jdaggett@7361 3408 <tr>
jdaggett@7361 3409 <td>Animatable:
jdaggett@7361 3410
jdaggett@7361 3411 <td>no
jdaggett@1661 3412 </table>
jdaggett@1661 3413
jdaggett@2528 3414 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
jdaggett@2528 3415 property controls metric kerning, kerning that utilizes adjustment data
jdaggett@6453 3416 contained in the font. The value ‘<a href="#normal2"><code
jdaggett@6453 3417 class=property>normal</code></a>’ implies that kerning is applied while
jdaggett@6453 3418 the value ‘<code class=property>none</code>’ implies that kerning is
jdaggett@6453 3419 not applied when rendering text. If the value is ‘<code
jdaggett@6453 3420 class=property>auto</code>’, a user agent is free to choose whether
jdaggett@6453 3421 kerning is enabled or not by default and to vary that default based on the
jdaggett@6453 3422 underlying text script.
jdaggett@1661 3423
jdaggett@1661 3424 <p>For fonts that do not include kerning data this property will have no
jdaggett@1661 3425 visible effect. When rendering with OpenType fonts, the <a
jdaggett@1661 3426 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
jdaggett@2528 3427 specification suggests that kerning be enabled by default. When kerning is
jdaggett@6453 3428 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
jdaggett@6453 3429 vertical text runs the <span class=tag>vkrn</span> feature is enabled).
jdaggett@6453 3430 User agents must also support fonts that only support kerning via data
jdaggett@6453 3431 contained in a ‘<code class=property>kern</code>’ font table, as
jdaggett@6453 3432 detailed in the OpenType specification. Authors may prefer to disable
jdaggett@6453 3433 kerning in situations where performance is more important that precise
jdaggett@6453 3434 appearance. If the ‘<code class=property>letter-spacing</code>’
jdaggett@6453 3435 property is defined, kerning adjustments are considered part of the
jdaggett@6453 3436 default spacing, letter spacing adjustments are made after kerning has
jdaggett@6453 3437 been applied.</p>
jdaggett@6453 3438 <!-- prop: font-variant-ligatures -->
jdaggett@6453 3439
jdaggett@6453 3440 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
jdaggett@6453 3441 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
jdaggett@6453 3442 property</h3>
jdaggett@6453 3443
jdaggett@6453 3444 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
jdaggett@2528 3445 <tbody>
jdaggett@2528 3446 <tr>
jdaggett@2528 3447 <td>Name:
jdaggett@2528 3448
jdaggett@6453 3449 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
jdaggett@2528 3450
jdaggett@2528 3451 <tr>
jdaggett@2528 3452 <td>Value:
jdaggett@2528 3453
jdaggett@6453 3454 <td>normal | none | [ &lt;common-lig-values> ||
jdaggett@6453 3455 &lt;discretionary-lig-values> || &lt;historical-lig-values> ||
jdaggett@6453 3456 &lt;contextual-alt-values> ]
jdaggett@2528 3457
jdaggett@2528 3458 <tr>
jdaggett@2528 3459 <td>Initial:
jdaggett@2528 3460
jdaggett@2528 3461 <td>normal
jdaggett@2528 3462
jdaggett@2528 3463 <tr>
jdaggett@2528 3464 <td>Applies to:
jdaggett@2528 3465
jdaggett@2528 3466 <td>all elements
jdaggett@2528 3467
jdaggett@2528 3468 <tr>
jdaggett@2528 3469 <td>Inherited:
jdaggett@2528 3470
jdaggett@2528 3471 <td>yes
jdaggett@2528 3472
jdaggett@2528 3473 <tr>
jdaggett@2528 3474 <td>Percentages:
jdaggett@2528 3475
jdaggett@2528 3476 <td>N/A
jdaggett@2528 3477
jdaggett@2528 3478 <tr>
jdaggett@2528 3479 <td>Media:
jdaggett@2528 3480
jdaggett@2528 3481 <td>visual
jdaggett@2528 3482
jdaggett@2528 3483 <tr>
jdaggett@2528 3484 <td>Computed value:
jdaggett@2528 3485
jdaggett@2528 3486 <td>as specified
jdaggett@7361 3487
jdaggett@7361 3488 <tr>
jdaggett@7361 3489 <td>Animatable:
jdaggett@7361 3490
jdaggett@7361 3491 <td>no
jdaggett@2528 3492 </table>
jdaggett@2528 3493
jdaggett@6453 3494 <p>Ligatures and contextual forms are ways of combining glyphs to produce
jdaggett@6453 3495 more harmonized forms. A value of ‘<a href="#normal2"><code
jdaggett@6453 3496 class=property>normal</code></a>’ implies that common default features
jdaggett@6453 3497 are enabled, <a href="#font-feature-resolution">as described in detail in
jdaggett@6453 3498 the next section</a>. For OpenType fonts, common ligatures and contextual
jdaggett@6453 3499 forms are on by default, discretionary and historical ligatures are not. A
jdaggett@6453 3500 value of ‘<code class=property>none</code>’ implies that all types of
jdaggett@6453 3501 ligatures and contextual forms covered by this property are explicitly
jdaggett@6453 3502 disabled. In situations where ligatures are not considered necessary, this
jdaggett@6453 3503 may improve the speed of text rendering.
jdaggett@6453 3504
jdaggett@6453 3505 <pre
jdaggett@6453 3506 class=prod><dfn id=ltcommon-lig-values><var>&lt;common-lig-values></var></dfn> = [ common-ligatures | no-common-ligatures ]</pre>
jdaggett@6453 3507
jdaggett@6453 3508 <pre
jdaggett@6453 3509 class=prod><dfn id=ltdiscretionary-lig-values><var>&lt;discretionary-lig-values></var></dfn> = [ discretionary-ligatures | no-discretionary-ligatures ]</pre>
jdaggett@6453 3510
jdaggett@6453 3511 <pre
jdaggett@6453 3512 class=prod><dfn id=lthistorical-lig-values><var>&lt;historical-lig-values></var></dfn> = [ historical-ligatures | no-historical-ligatures ]</pre>
jdaggett@6453 3513
jdaggett@6453 3514 <pre
jdaggett@6453 3515 class=prod><dfn id=ltcontextual-alt-valuesgt><var>&lt;contextual-alt-values&gt;</var></dfn> = [ contextual | no-contextual ]</pre>
jdaggett@6453 3516
jdaggett@6453 3517 <p>Individual values have the following meanings:
jdaggett@6453 3518
jdaggett@6453 3519 <dl>
jdaggett@6453 3520 <dt><dfn id=common-ligatures>common-ligatures</dfn>
jdaggett@6453 3521
jdaggett@6453 3522 <dd>Enables display of common ligatures (OpenType features: <span
jdaggett@6453 3523 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
jdaggett@6453 3524 enabled by default.
jdaggett@6453 3525 </dl>
jdaggett@6453 3526
jdaggett@6453 3527 <div class=featex><img alt="common ligature example" src=liga.png></div>
jdaggett@6453 3528
jdaggett@6453 3529 <dl>
jdaggett@6453 3530 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
jdaggett@6453 3531
jdaggett@6453 3532 <dd>Disables display of common ligatures (OpenType features: <span
jdaggett@6453 3533 class=tag>liga, clig</span>).
jdaggett@6453 3534
jdaggett@6453 3535 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
jdaggett@6453 3536
jdaggett@6453 3537 <dd>Enables display of discretionary ligatures (OpenType feature: <span
jdaggett@6453 3538 class=tag>dlig</span>). Which ligatures are discretionary, or optional,
jdaggett@6453 3539 is decided by the type designer so authors will need to refer to the
jdaggett@6453 3540 documentation of a given font to understand which ligatures are
jdaggett@6453 3541 considered discretionary.
jdaggett@6453 3542 </dl>
jdaggett@6453 3543
jdaggett@6453 3544 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
jdaggett@6453 3545
jdaggett@6453 3546 <dl>
jdaggett@6453 3547 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
jdaggett@6453 3548
jdaggett@6453 3549 <dd>Disables display of discretionary ligatures (OpenType feature: <span
jdaggett@6453 3550 class=tag>dlig</span>).
jdaggett@6453 3551
jdaggett@6453 3552 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
jdaggett@6453 3553
jdaggett@6453 3554 <dd>Enables display of historical ligatures (OpenType feature: <span
jdaggett@6453 3555 class=tag>hlig</span>).
jdaggett@6453 3556 </dl>
jdaggett@6453 3557
jdaggett@6453 3558 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
jdaggett@6453 3559
jdaggett@6453 3560 <dl>
jdaggett@6453 3561 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
jdaggett@6453 3562
jdaggett@6453 3563 <dd>Disables display of historical ligatures (OpenType feature: <span
jdaggett@6453 3564 class=tag>hlig</span>).
jdaggett@6453 3565
jdaggett@6453 3566 <dt><dfn id=contextual>contextual</dfn>
jdaggett@6453 3567
jdaggett@6453 3568 <dd>Enables display of contextual alternates (OpenType feature: <span
jdaggett@6453 3569 class=tag>calt</span>). Although not strictly a ligature feature, like
jdaggett@6453 3570 ligatures this feature is commonly used to harmonize the shapes of glyphs
jdaggett@6453 3571 with the surrounding context. For OpenType fonts, this feature is on by
jdaggett@6453 3572 default.
jdaggett@6453 3573 </dl>
jdaggett@6453 3574
jdaggett@6453 3575 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
jdaggett@6453 3576
jdaggett@6453 3577 <dl>
jdaggett@6453 3578 <dt><dfn id=no-contextual>no-contextual</dfn>
jdaggett@6453 3579
jdaggett@6453 3580 <dd>Disables display of contextual alternates (OpenType feature: <span
jdaggett@6453 3581 class=tag>calt</span>).
jdaggett@6453 3582 </dl>
jdaggett@6453 3583
jdaggett@6453 3584 <p>Required ligatures, needed for correctly rendering complex scripts, are
jdaggett@6453 3585 not affected by the settings above, including ‘<code
jdaggett@6453 3586 class=property>none</code>’ (OpenType feature: <span
jdaggett@6453 3587 class=tag>rlig</span>).</p>
jdaggett@6453 3588 <!-- prop: font-variant-position -->
jdaggett@6453 3589
jdaggett@6453 3590 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
jdaggett@6453 3591 and superscript forms: the <a
jdaggett@6453 3592 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
jdaggett@6453 3593
jdaggett@6453 3594 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
jdaggett@6453 3595 <tbody>
jdaggett@6453 3596 <tr>
jdaggett@6453 3597 <td>Name:
jdaggett@6453 3598
jdaggett@6453 3599 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
jdaggett@6453 3600
jdaggett@6453 3601 <tr>
jdaggett@6453 3602 <td>Value:
jdaggett@6453 3603
jdaggett@6453 3604 <td>normal | sub | super
jdaggett@6453 3605
jdaggett@6453 3606 <tr>
jdaggett@6453 3607 <td>Initial:
jdaggett@6453 3608
jdaggett@6453 3609 <td>normal
jdaggett@6453 3610
jdaggett@6453 3611 <tr>
jdaggett@6453 3612 <td>Applies to:
jdaggett@6453 3613
jdaggett@6453 3614 <td>all elements
jdaggett@6453 3615
jdaggett@6453 3616 <tr>
jdaggett@6453 3617 <td>Inherited:
jdaggett@6453 3618
jdaggett@6453 3619 <td>yes
jdaggett@6453 3620
jdaggett@6453 3621 <tr>
jdaggett@6453 3622 <td>Percentages:
jdaggett@6453 3623
jdaggett@6453 3624 <td>N/A
jdaggett@6453 3625
jdaggett@6453 3626 <tr>
jdaggett@6453 3627 <td>Media:
jdaggett@6453 3628
jdaggett@6453 3629 <td>visual
jdaggett@6453 3630
jdaggett@6453 3631 <tr>
jdaggett@6453 3632 <td>Computed value:
jdaggett@6453 3633
jdaggett@6453 3634 <td>as specified
jdaggett@7361 3635
jdaggett@7361 3636 <tr>
jdaggett@7361 3637 <td>Animatable:
jdaggett@7361 3638
jdaggett@7361 3639 <td>no
jdaggett@6453 3640 </table>
jdaggett@6453 3641
jdaggett@6453 3642 <p>This property is used to enable typographic subscript and superscript
jdaggett@6453 3643 glyphs. These are alternate glyphs designed within the same em-box as
jdaggett@6453 3644 default glyphs and are intended to be laid out on the same baseline as the
jdaggett@6453 3645 default glyphs, with no resizing or repositioning of the baseline. They
jdaggett@6453 3646 are explicitly designed to match the surrounding text and to be more
jdaggett@6453 3647 readable without affecting the line height.
jdaggett@3534 3648
jdaggett@3534 3649 <div class=figure><img alt="comparison between real subscript glyphs and
jdaggett@3534 3650 synthesized ones" src=realsubscripts.png>
jdaggett@3534 3651 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
jdaggett@3534 3652 (bottom)
jdaggett@3534 3653 </div>
jdaggett@3534 3654
jdaggett@6453 3655 <p>The values ‘<code class=property>sub</code>’ and ‘<code
jdaggett@6453 3656 class=property>super</code>’ imply the appropriate variant glyph is
jdaggett@6453 3657 displayed when available in the font (OpenType features: <span
jdaggett@6453 3658 class=tag>subs, sups</span>). A value of ‘<a href="#normal2"><code
jdaggett@6453 3659 class=property>normal</code></a>’ implies neither of these alternate
jdaggett@6453 3660 glyphs are substituted.
jdaggett@6453 3661
jdaggett@6453 3662 <p>Because of the semantic nature of subscripts and superscripts, when the
jdaggett@6453 3663 value is either ‘<code class=property>sub</code>’ or ‘<code
jdaggett@6453 3664 class=property>super</code>’ for a given run of text and a variant glyph
jdaggett@6453 3665 is not available for all the characters in the run, simulated glyphs are
jdaggett@6453 3666 synthesized for all characters using reduced forms of the default glyph.
jdaggett@6453 3667 This is done to avoid a mixture of variant glyphs and synthesized ones
jdaggett@6453 3668 within the same run of text, since there is no guarantee that two types of
jdaggett@6453 3669 glyphs would be aligned correctly.
jdaggett@3534 3670
jdaggett@3534 3671 <p>In the case of OpenType fonts that lack subscript or superscript glyphs
jdaggett@6453 3672 for a given character, user agents must use the appropriate subscript and
jdaggett@6453 3673 superscript metrics specified in the selected font's <a
jdaggett@3534 3674 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
jdaggett@3534 3675 table</a> <a href="#OPENTYPE"
jdaggett@6453 3676 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
jdaggett@6453 3677 and offset of the synthesized substitutes.
jdaggett@2528 3678
jdaggett@2528 3679 <p>In the past, user agents have used font-size and vertical-align to
jdaggett@6453 3680 simulate subscripts and superscripts for the <span class=tag>sub</span>
jdaggett@6453 3681 and <span class=tag>sup</span> elements. To allow a backwards compatible
jdaggett@6453 3682 way of defining subscripts and superscripts, it is recommended that
jdaggett@6453 3683 authors use conditional rules <a href="#CSS3-CONDITIONAL"
jdaggett@3534 3684 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
jdaggett@6453 3685 older user agents will still render subscripts and superscripts via the
jdaggett@6453 3686 older mechanism.
jdaggett@6453 3687
jdaggett@6453 3688 <p>Authors should note that fonts typically only provide subscript and
jdaggett@6453 3689 superscript glyphs for a subset of all characters supported by the font.
jdaggett@6453 3690 While subscript and superscript glyphs are often available for Latin
jdaggett@6453 3691 numbers, glyphs for punctuation and letter characters are less frequently
jdaggett@6453 3692 provided. The synthetic fallback rules defined for this property assure
jdaggett@6453 3693 that subscripts and superscripts will always appear but the appearance may
jdaggett@6453 3694 not match author expectations if the font used does not provide the
jdaggett@6453 3695 appropriate alternate glyph for all characters contained in a subscript or
jdaggett@6453 3696 superscript.
jdaggett@6453 3697
jdaggett@6453 3698 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
jdaggett@6453 3699 using superscript metrics" src=superscript-alt-synth.png>
jdaggett@6453 3700 <p class=caption>Superscript alternate glyph (left), synthesized
jdaggett@6453 3701 superscript glyphs (middle), and incorrect mixture of the two (right)
jdaggett@6453 3702 </div>
jdaggett@6453 3703
jdaggett@6453 3704 <p>This property is not cumulative, applying it to subelements within a
jdaggett@6453 3705 subscript or superscript won't nest the placement of a subscript or
jdaggett@6453 3706 superscript glyph. Images contained within text runs where the value of
jdaggett@6453 3707 this property is ‘<code class=property>sub</code>’ or ‘<code
jdaggett@6453 3708 class=property>super</code>’ will be drawn just as they would if the
jdaggett@6453 3709 value was ‘<a href="#normal2"><code class=property>normal</code></a>’.
jdaggett@6453 3710 Likewise, text decorations such as underlines or emphasis marks will
jdaggett@6453 3711 render in the same position as they would for the default glyphs, since
jdaggett@6453 3712 this property does not affect the baseline position.
jdaggett@6453 3713
jdaggett@6453 3714 <p>Because of these limitations, font-variant-position is not recommended
jdaggett@6453 3715 for use in user agent stylesheets. Authors should use it in cases where
jdaggett@6453 3716 subscripts or superscripts will only contain the narrow range of
jdaggett@6453 3717 characters supported by the fonts specified.
jdaggett@2528 3718
jdaggett@2528 3719 <div class=example>
jdaggett@6453 3720 <p>A typical user agent default style for the <span class=tag>sub</span>
jdaggett@6453 3721 element:</p>
jdaggett@2528 3722
jdaggett@2528 3723 <pre>sub {
jdaggett@2528 3724 vertical-align: sub;
jdaggett@2528 3725 font-size: smaller;
jdaggett@2528 3726 line-height: normal;
jdaggett@2528 3727 }
jdaggett@2528 3728 </pre>
jdaggett@2528 3729
jdaggett@3534 3730 <p>Using font-variant-position to specify typographic subscripts in a way
jdaggett@3534 3731 that will still show subscripts in older user agents:</p>
jdaggett@3534 3732
jdaggett@3534 3733 <pre>@supports ( font-variant-position: sub ) {
jdaggett@3534 3734
jdaggett@3534 3735 sub {
jdaggett@3534 3736 vertical-align: inherit;
jdaggett@3534 3737 font-size: 100%;
jdaggett@3534 3738 line-height: inherit;
jdaggett@3534 3739 font-variant-position: sub;
jdaggett@3534 3740 }
jdaggett@3534 3741
jdaggett@2528 3742 }
jdaggett@2528 3743 </pre>
jdaggett@2528 3744
jdaggett@6453 3745 <p>User agents that support the ‘<a
jdaggett@6453 3746 href="#propdef-font-variant-position"><code
jdaggett@6453 3747 class=property>font-variant-position</code></a>’ property will select a
jdaggett@6453 3748 subscript variant glyph and render this without adjusting the baseline or
jdaggett@6453 3749 font-size. Older user agents will ignore the ‘<a
jdaggett@6453 3750 href="#propdef-font-variant-position"><code
jdaggett@6453 3751 class=property>font-variant-position</code></a>’ property definition
jdaggett@6453 3752 and use the standard defaults for subscripts.</p>
jdaggett@2528 3753 </div>
jdaggett@6453 3754 <!-- prop: font-variant-caps -->
jdaggett@6453 3755
jdaggett@6453 3756 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
jdaggett@6453 3757 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
jdaggett@6453 3758
jdaggett@6453 3759 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
jdaggett@1661 3760 <tbody>
jdaggett@1661 3761 <tr>
jdaggett@1661 3762 <td>Name:
jdaggett@1661 3763
jdaggett@6453 3764 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
jdaggett@1661 3765
jdaggett@1661 3766 <tr>
jdaggett@1661 3767 <td>Value:
jdaggett@1661 3768
jdaggett@6453 3769 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
jdaggett@7099 3770 | unicase | titling-caps
jdaggett@1661 3771
jdaggett@1661 3772 <tr>
jdaggett@1661 3773 <td>Initial:
jdaggett@1661 3774
jdaggett@1661 3775 <td>normal
jdaggett@1661 3776
jdaggett@1661 3777 <tr>
jdaggett@1661 3778 <td>Applies to:
jdaggett@1661 3779
jdaggett@1661 3780 <td>all elements
jdaggett@1661 3781
jdaggett@1661 3782 <tr>
jdaggett@1661 3783 <td>Inherited:
jdaggett@1661 3784
jdaggett@1661 3785 <td>yes
jdaggett@1661 3786
jdaggett@1661 3787 <tr>
jdaggett@1661 3788 <td>Percentages:
jdaggett@1661 3789
jdaggett@1661 3790 <td>N/A
jdaggett@1661 3791
jdaggett@1661 3792 <tr>
jdaggett@1661 3793 <td>Media:
jdaggett@1661 3794
jdaggett@1661 3795 <td>visual
jdaggett@1661 3796
jdaggett@1661 3797 <tr>
jdaggett@1661 3798 <td>Computed value:
jdaggett@1661 3799
jdaggett@1661 3800 <td>as specified
jdaggett@7361 3801
jdaggett@7361 3802 <tr>
jdaggett@7361 3803 <td>Animatable:
jdaggett@7361 3804
jdaggett@7361 3805 <td>no
jdaggett@1661 3806 </table>
jdaggett@1661 3807
jdaggett@6453 3808 <p>Specifies control over capitalized forms.
jdaggett@2528 3809
jdaggett@2528 3810 <p>Individual values have the following meanings:
jdaggett@1661 3811
jdaggett@1661 3812 <dl>
jdaggett@6453 3813 <dt><dfn id=normal>normal</dfn>
jdaggett@6453 3814
jdaggett@6453 3815 <dd>None of the features listed below are enabled.
jdaggett@6453 3816
jdaggett@1661 3817 <dt><dfn id=small-caps>small-caps</dfn>
jdaggett@1661 3818
jdaggett@6453 3819 <dd>Enables display of small capitals (OpenType feature: <span
jdaggett@6453 3820 class=tag>smcp</span>). Small-caps glyphs typically use the form of
jdaggett@6453 3821 uppercase letters but are reduced to the size of lowercase letters.
jdaggett@1661 3822 </dl>
jdaggett@1661 3823
jdaggett@1661 3824 <div class=featex><img alt="small-caps example" src=smcp.png></div>
jdaggett@1661 3825
jdaggett@1661 3826 <dl>
jdaggett@2528 3827 <dt><dfn id=all-small-caps>all-small-caps</dfn>
jdaggett@2528 3828
jdaggett@2528 3829 <dd>Enables display of small capitals for both upper and lowercase letters
jdaggett@6453 3830 (OpenType features: <span class=tag>c2sc, smcp</span>).
jdaggett@2528 3831
jdaggett@1661 3832 <dt><dfn id=petite-caps>petite-caps</dfn>
jdaggett@1661 3833
jdaggett@6453 3834 <dd>Enables display of petite capitals (OpenType feature: <span
jdaggett@6453 3835 class=tag>pcap</span>).
jdaggett@1661 3836
jdaggett@2528 3837 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
jdaggett@2528 3838
jdaggett@2528 3839 <dd>Enables display of petite capitals for both upper and lowercase
jdaggett@6453 3840 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
jdaggett@2528 3841
jdaggett@7099 3842 <dt><dfn id=unicase>unicase</dfn>
jdaggett@7099 3843
jdaggett@7099 3844 <dd>Enables display of mixture of small capitals for uppercase letters
jdaggett@7099 3845 with normal lowercase letters (OpenType feature: <span
jdaggett@7099 3846 class=tag>unic</span>).
jdaggett@7099 3847
jdaggett@1661 3848 <dt><dfn id=titling-caps>titling-caps</dfn>
jdaggett@1661 3849
jdaggett@6453 3850 <dd>Enables display of titling capitals (OpenType feature: <span
jdaggett@6453 3851 class=tag>titl</span>). Uppercase letter glyphs are often designed for
jdaggett@6453 3852 use with lowercase letters. When used in all uppercase titling sequences
jdaggett@6453 3853 they can appear too strong. Titling capitals are designed specifically
jdaggett@6453 3854 for this situation.
jdaggett@1661 3855 </dl>
jdaggett@1661 3856
jdaggett@7099 3857 <p>This property allows the selection of alternate glyphs used for small or
jdaggett@7099 3858 petite capitals or for titling. These glyphs are specifically designed to
jdaggett@7099 3859 blend well with the surrounding normal glyphs, to maintain the weight and
jdaggett@7099 3860 readability which suffers when text is simply resized to fit this purpose.
jdaggett@7099 3861
jdaggett@7099 3862 <p>The availability of these glyphs is based on whether a given feature is
jdaggett@7099 3863 defined or not in the feature list of the font. User agents can optionally
jdaggett@7099 3864 decide this on a per-script basis but should explicitly not decide this on
jdaggett@7099 3865 a per-character basis.
jdaggett@7099 3866
jdaggett@7099 3867 <p>Some fonts may only support a subset or none of the features described
jdaggett@7099 3868 for this property. For backwards compatibility with CSS 2.1, if ‘<a
jdaggett@6453 3869 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
jdaggett@6453 3870 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
jdaggett@6453 3871 is specified but small-caps glyphs are not available for a given font,
jdaggett@6453 3872 user agents should simulate a small-caps font, for example by taking a
jdaggett@7099 3873 normal font and replacing the glyphs for lowercase letters with scaled
jdaggett@7099 3874 versions of the glyphs for uppercase characters (replacing the glyphs for
jdaggett@7099 3875 both upper and lowercase letters in the case of ‘<a
jdaggett@6453 3876 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
jdaggett@7099 3877
jdaggett@7099 3878 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
jdaggett@7099 3879 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
jdaggett@7099 3880 width=512px>
jdaggett@7099 3881 <p class=caption>Synthetic vs. real small-caps
jdaggett@7099 3882 </div>
jdaggett@7099 3883
jdaggett@7099 3884 <p>To match the surrounding text, a font may provide alternate glyphs for
jdaggett@7099 3885 caseless characters when these features are enabled but when a user agent
jdaggett@7099 3886 simulates small capitals, it must not attempt to simulate alternates for
jdaggett@7099 3887 codepoints which are considered caseless.
jdaggett@7099 3888
jdaggett@7099 3889 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
jdaggett@7099 3890 characters with small-caps, all-small-caps enabled" class=hires
jdaggett@7099 3891 src=small-capitals-variations.png width=418px>
jdaggett@7099 3892 <p class=caption>Caseless characters with small-caps, all-small-caps
jdaggett@7099 3893 enabled
jdaggett@7099 3894 </div>
jdaggett@7099 3895
jdaggett@7099 3896 <p>If either ‘<a href="#petite-caps"><code
jdaggett@6453 3897 class=property>petite-caps</code></a>’ or ‘<a
jdaggett@6453 3898 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
jdaggett@6453 3899 is specified for a font that doesn't support these features, the property
jdaggett@6453 3900 behaves as if ‘<a href="#small-caps"><code
jdaggett@6453 3901 class=property>small-caps</code></a>’ or ‘<a
jdaggett@6453 3902 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
jdaggett@7099 3903 respectively, had been specified. If ‘<a href="#unicase"><code
jdaggett@7099 3904 class=property>unicase</code></a>’ is specified for a font that doesn't
jdaggett@7099 3905 support that feature, the property behaves as if ‘<a
jdaggett@7099 3906 href="#small-caps"><code class=property>small-caps</code></a>’ was
jdaggett@7099 3907 applied only to lowercased uppercase letters. If ‘<a
jdaggett@7099 3908 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
jdaggett@7099 3909 specified with a font that does not support this feature, this property
jdaggett@7099 3910 has no visible effect. When simulated small capital glyphs are used, for
jdaggett@6453 3911 scripts that lack uppercase and lowercase letters, ‘<a
jdaggett@6453 3912 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
jdaggett@6453 3913 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
jdaggett@6453 3914 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
jdaggett@6453 3915 ‘<a href="#all-petite-caps"><code
jdaggett@6453 3916 class=property>all-petite-caps</code></a>’ and ‘<a
jdaggett@6453 3917 href="#unicase"><code class=property>unicase</code></a>’ have no visible
jdaggett@1661 3918 effect.
jdaggett@1661 3919
jdaggett@7099 3920 <p>When casing transforms are used to simulate small capitals, the casing
jdaggett@7099 3921 transformations should match those used for the <span
jdaggett@7099 3922 class=property>‘<code class=property>text-transform</code>’</span>
jdaggett@7099 3923 property.
jdaggett@7099 3924
jdaggett@7099 3925 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
jdaggett@7099 3926 replace glyphs in a small-caps font so that the text appears in all
jdaggett@7099 3927 uppercase letters.
jdaggett@7099 3928
jdaggett@7099 3929 <div class=figure style="padding: 0; margin: auto;"><img alt="using
jdaggett@7099 3930 all-small-caps in acronym-laden text" class=hires
jdaggett@7099 3931 src=acronym-laden-text.png width=596px>
jdaggett@7099 3932 <p class=caption>Using small capitals to improve readability in
jdaggett@7099 3933 acronym-laden text
jdaggett@7099 3934 </div>
jdaggett@7099 3935
jdaggett@1661 3936 <div class=example>
jdaggett@1661 3937 <p>Quotes rendered italicised, with small-caps on the first line:</p>
jdaggett@1661 3938
jdaggett@1661 3939 <pre>blockquote { font-style: italic; }
jdaggett@1661 3940 blockquote:first-line { font-variant: small-caps; }
jdaggett@1661 3941
jdaggett@1661 3942 &lt;blockquote><a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/0036.html" style="text-decoration: none">I'll be honor-bound to slap them like a haddock.</a>&lt;/blockquote>
jdaggett@1661 3943 </pre>
jdaggett@1661 3944 </div>
jdaggett@2528 3945 <!-- prop: font-variant-numeric -->
jdaggett@2528 3946
jdaggett@2528 3947 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
jdaggett@1661 3948 formatting: the <a
jdaggett@1661 3949 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
jdaggett@1661 3950
jdaggett@6453 3951 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
jdaggett@1661 3952 <tbody>
jdaggett@1661 3953 <tr>
jdaggett@1661 3954 <td>Name:
jdaggett@1661 3955
jdaggett@1661 3956 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
jdaggett@1661 3957
jdaggett@1661 3958 <tr>
jdaggett@1661 3959 <td>Value:
jdaggett@1661 3960
jdaggett@6453 3961 <td>normal | [ &lt;numeric-figure-values&gt; ||
jdaggett@2528 3962 &lt;numeric-spacing-values&gt; || &lt;numeric-fraction-values&gt; ||
jdaggett@6453 3963 ordinal || slashed-zero ]
jdaggett@1661 3964
jdaggett@1661 3965 <tr>
jdaggett@1661 3966 <td>Initial:
jdaggett@1661 3967
jdaggett@1661 3968 <td>normal
jdaggett@1661 3969
jdaggett@1661 3970 <tr>
jdaggett@1661 3971 <td>Applies to:
jdaggett@1661 3972
jdaggett@1661 3973 <td>all elements
jdaggett@1661 3974
jdaggett@1661 3975 <tr>
jdaggett@1661 3976 <td>Inherited:
jdaggett@1661 3977
jdaggett@1661 3978 <td>yes
jdaggett@1661 3979
jdaggett@1661 3980 <tr>
jdaggett@1661 3981 <td>Percentages:
jdaggett@1661 3982
jdaggett@1661 3983 <td>N/A
jdaggett@1661 3984
jdaggett@1661 3985 <tr>
jdaggett@1661 3986 <td>Media:
jdaggett@1661 3987
jdaggett@1661 3988 <td>visual
jdaggett@1661 3989
jdaggett@1661 3990 <tr>
jdaggett@1661 3991 <td>Computed value:
jdaggett@1661 3992
jdaggett@1661 3993 <td>as specified
jdaggett@7361 3994
jdaggett@7361 3995 <tr>
jdaggett@7361 3996 <td>Animatable:
jdaggett@7361 3997
jdaggett@7361 3998 <td>no
jdaggett@1661 3999 </table>
jdaggett@1661 4000
jdaggett@1661 4001 <p>Specifies control over numerical forms.
jdaggett@1661 4002
jdaggett@1661 4003 <pre
jdaggett@2528 4004 class=prod><dfn id=ltnumeric-figure-valuesgt><var>&lt;numeric-figure-values&gt;</var></dfn> = [ lining-nums | oldstyle-nums ]</pre>
jdaggett@2528 4005
jdaggett@2528 4006 <pre
jdaggett@2528 4007 class=prod><dfn id=ltnumeric-spacing-valuesgt><var>&lt;numeric-spacing-values&gt;</var></dfn> = [ proportional-nums | tabular-nums ]</pre>
jdaggett@2528 4008
jdaggett@2528 4009 <pre
jdaggett@2528 4010 class=prod><dfn id=ltnumeric-fraction-valuesgt><var>&lt;numeric-fraction-values&gt;</var></dfn> = [ diagonal-fractions | stacked-fractions ]</pre>
jdaggett@2528 4011
jdaggett@2528 4012 <p>Individual values have the following meanings:
jdaggett@1661 4013
jdaggett@1661 4014 <dl>
jdaggett@6453 4015 <dt><dfn id=normal0>normal</dfn>
jdaggett@6453 4016
jdaggett@6453 4017 <dd>None of the features listed below are enabled.
jdaggett@6453 4018
jdaggett@1661 4019 <dt><dfn id=lining-nums>lining-nums</dfn>
jdaggett@1661 4020
jdaggett@6453 4021 <dd>Enables display of lining numerals (OpenType feature: <span
jdaggett@6453 4022 class=tag>lnum</span>).
jdaggett@1661 4023
jdaggett@1661 4024 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
jdaggett@1661 4025
jdaggett@6453 4026 <dd>Enables display of old-style numerals (OpenType feature: <span
jdaggett@6453 4027 class=tag>onum</span>).
jdaggett@1661 4028
jdaggett@1661 4029 <dt><dfn id=proportional-nums>proportional-nums</dfn>
jdaggett@1661 4030
jdaggett@6453 4031 <dd>Enables display of proportional numerals (OpenType feature: <span
jdaggett@6453 4032 class=tag>pnum</span>).
jdaggett@1661 4033
jdaggett@1661 4034 <dt><dfn id=tabular-nums>tabular-nums</dfn>
jdaggett@1661 4035
jdaggett@6453 4036 <dd>Enables display of tabular numerals (OpenType feature: <span
jdaggett@6453 4037 class=tag>tnum</span>).
jdaggett@1661 4038 </dl>
jdaggett@1661 4039
jdaggett@1661 4040 <p>The example below shows how these different properties can be combined
jdaggett@1661 4041 to influence the rendering of tabular data with fonts that support these
jdaggett@1661 4042 features. Within normal paragraph text, proportional numbers are used
jdaggett@1661 4043 while tabular numbers are used so that columns of numbers line up
jdaggett@1661 4044 properly:
jdaggett@1661 4045
jdaggett@1661 4046 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
jdaggett@1661 4047 number styles" src=numberstyles.png>
jdaggett@1661 4048 <p class=caption>Using number styles
jdaggett@1661 4049 </div>
jdaggett@1661 4050
jdaggett@1661 4051 <dl>
jdaggett@1661 4052 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
jdaggett@1661 4053
jdaggett@6453 4054 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
jdaggett@6453 4055 class=tag>frac</span>).
jdaggett@1661 4056 </dl>
jdaggett@1661 4057
jdaggett@1661 4058 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
jdaggett@1661 4059
jdaggett@1661 4060 <dl>
jdaggett@1661 4061 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
jdaggett@1661 4062
jdaggett@6453 4063 <dd>Enables display of lining stacked fractions (OpenType feature: <span
jdaggett@6453 4064 class=tag>afrc</span>).
jdaggett@1661 4065 </dl>
jdaggett@1661 4066
jdaggett@1661 4067 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
jdaggett@1661 4068
jdaggett@1661 4069 <dl>
jdaggett@6453 4070 <dt><dfn id=ordinal>ordinal</dfn>
jdaggett@6453 4071
jdaggett@6453 4072 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
jdaggett@6453 4073 <span class=tag>ordn</span>).
jdaggett@6453 4074
jdaggett@1661 4075 <dt><dfn id=slashed-zero>slashed-zero</dfn>
jdaggett@1661 4076
jdaggett@6453 4077 <dd>Enables display of slashed zeros (OpenType feature: <span
jdaggett@6453 4078 class=tag>zero</span>).
jdaggett@1661 4079 </dl>
jdaggett@1661 4080
jdaggett@1661 4081 <div class=featex><img alt="slashed zero example" src=zero.png></div>
jdaggett@1661 4082
jdaggett@1661 4083 <div class=example id=steak-marinade>
jdaggett@1661 4084 <p>A simple flank steak marinade recipe, rendered with automatic fractions
jdaggett@1661 4085 and old-style numerals:</p>
jdaggett@1661 4086
jdaggett@1661 4087 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
jdaggett@1661 4088
jdaggett@1661 4089 &lt;h4>Steak marinade:&lt;/h4>
jdaggett@1661 4090 &lt;ul>
jdaggett@1661 4091 &lt;li>&lt;span class="amount">2&lt;/span> tbsp olive oil&lt;/li>
jdaggett@1661 4092 &lt;li>&lt;span class="amount">1&lt;/span> tbsp lemon juice&lt;/li>
jdaggett@1661 4093 &lt;li>&lt;span class="amount">1&lt;/span> tbsp soy sauce&lt;/li>
jdaggett@1661 4094 &lt;li>&lt;span class="amount">1 1/2&lt;/span> tbsp dry minced onion&lt;/li>
jdaggett@1661 4095 &lt;li>&lt;span class="amount">2 1/2&lt;/span> tsp italian seasoning&lt;/li>
jdaggett@2528 4096 &lt;li>Salt &amp;amp; pepper&lt;/li>
jdaggett@1661 4097 &lt;/ul>
jdaggett@1661 4098
jdaggett@6453 4099 &lt;p>Mix the meat with the marinade and let it sit covered in the refrigerator
jdaggett@6453 4100 for a few hours or overnight.&lt;/p>
jdaggett@1661 4101 </pre>
jdaggett@1661 4102 </div>
jdaggett@2528 4103 <!-- prop: font-variant-alternates -->
jdaggett@2528 4104
jdaggett@2528 4105 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
jdaggett@2528 4106 and swashes: the <a
jdaggett@2528 4107 href="#propdef-font-variant-alternates">font-variant-alternates</a>
jdaggett@2528 4108 property</h3>
jdaggett@2528 4109
jdaggett@6453 4110 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
jdaggett@2528 4111 <tbody>
jdaggett@2528 4112 <tr>
jdaggett@2528 4113 <td>Name:
jdaggett@2528 4114
jdaggett@2528 4115 <td><dfn
jdaggett@2528 4116 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
jdaggett@2528 4117
jdaggett@2528 4118 <tr>
jdaggett@2528 4119 <td>Value:
jdaggett@2528 4120
jdaggett@6453 4121 <td>normal | [ stylistic(&lt;feature-value-name&gt;) || historical-forms
jdaggett@6453 4122 || styleset(&lt;feature-value-name&gt;#) ||
jdaggett@6453 4123 character-variant(&lt;feature-value-name&gt;#) ||
jdaggett@6453 4124 swash(&lt;feature-value-name&gt;) ||
jdaggett@3534 4125 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@6453 4126 annotation(&lt;feature-value-name&gt;) ]
jdaggett@2528 4127
jdaggett@2528 4128 <tr>
jdaggett@2528 4129 <td>Initial:
jdaggett@2528 4130
jdaggett@2528 4131 <td>normal
jdaggett@2528 4132
jdaggett@2528 4133 <tr>
jdaggett@2528 4134 <td>Applies to:
jdaggett@2528 4135
jdaggett@2528 4136 <td>all elements
jdaggett@2528 4137
jdaggett@2528 4138 <tr>
jdaggett@2528 4139 <td>Inherited:
jdaggett@2528 4140
jdaggett@2528 4141 <td>yes
jdaggett@2528 4142
jdaggett@2528 4143 <tr>
jdaggett@2528 4144 <td>Percentages:
jdaggett@2528 4145
jdaggett@2528 4146 <td>N/A
jdaggett@2528 4147
jdaggett@2528 4148 <tr>
jdaggett@2528 4149 <td>Media:
jdaggett@2528 4150
jdaggett@2528 4151 <td>visual
jdaggett@2528 4152
jdaggett@2528 4153 <tr>
jdaggett@2528 4154 <td>Computed value:
jdaggett@2528 4155
jdaggett@2528 4156 <td>as specified
jdaggett@7361 4157
jdaggett@7361 4158 <tr>
jdaggett@7361 4159 <td>Animatable:
jdaggett@7361 4160
jdaggett@7361 4161 <td>no
jdaggett@2528 4162 </table>
jdaggett@2528 4163
jdaggett@2528 4164 <p>For any given character, fonts can provide a variety of alternate glyphs
jdaggett@2528 4165 in addition to the default glyph for that character. This property
jdaggett@2528 4166 provides control over the selection of these alternate glyphs.
jdaggett@2528 4167
jdaggett@7099 4168 <p>In cases where multiple alternates are possible, authors define a
jdaggett@7099 4169 <code>&lt;feature-value-name&gt;</code> using the
jdaggett@7099 4170 <code>@font-feature-values</code> rule described below to indicate the
jdaggett@7099 4171 specific alternate to be used. The nature of these alternates is font
jdaggett@7099 4172 specific, so the rule defines values for a specific font family or set of
jdaggett@7099 4173 families. When a particular value has not been defined for a given family,
jdaggett@7099 4174 the named value is treated as if the feature had omitted from the style
jdaggett@7099 4175 rule. If a given value is outside the range supported by a given font, the
jdaggett@7099 4176 value is ignored. These values never apply to generic font families, nor
jdaggett@7099 4177 to families selected as part of system font fallback. Values that behave
jdaggett@7099 4178 this way are marked as <em>font specific</em>.
jdaggett@2535 4179
jdaggett@2528 4180 <p>Individual values have the following meanings:
jdaggett@2528 4181
jdaggett@2528 4182 <dl>
jdaggett@6453 4183 <dt><dfn id=normal1>normal</dfn>
jdaggett@6453 4184
jdaggett@6453 4185 <dd>None of the features listed below are enabled.
jdaggett@6453 4186
jdaggett@7099 4187 <dt><dfn id=stylisticltfeature-value-namegt
jdaggett@7099 4188 title=stylistic>stylistic(&lt;feature-value-name&gt;)</dfn>
jdaggett@2528 4189
jdaggett@2528 4190 <dd>Enables display of stylistic alternates (<em>font specific</em>,
jdaggett@6453 4191 OpenType feature: <span class=tag>salt
jdaggett@6453 4192 &lt;feature-value-name&gt;</span>).
jdaggett@2528 4193 </dl>
jdaggett@2528 4194
jdaggett@2528 4195 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
jdaggett@2528 4196
jdaggett@2528 4197 <dl>
jdaggett@2528 4198 <dt><dfn id=historical-forms>historical-forms</dfn>
jdaggett@2528 4199
jdaggett@6453 4200 <dd>Enables display of historical forms (OpenType feature: <span
jdaggett@6453 4201 class=tag>hist</span>).
jdaggett@2528 4202 </dl>
jdaggett@2528 4203
jdaggett@2528 4204 <div class=featex><img alt="historical form example" src=hist.png></div>
jdaggett@2528 4205
jdaggett@2528 4206 <dl>
jdaggett@7099 4207 <dt><dfn id=stylesetltfeature-value-namegt
jdaggett@7099 4208 title=styleset>styleset(&lt;feature-value-name&gt;#)</dfn>
jdaggett@2528 4209
jdaggett@2528 4210 <dd>Enables display with stylistic sets (<em>font specific</em>, OpenType
jdaggett@6453 4211 feature: <span class=tag>ss&lt;feature-index&gt;</span> OpenType
jdaggett@6453 4212 currently defines <span class=tag>ss01</span> through <span
jdaggett@6453 4213 class=tag>ss20</span>).
jdaggett@2528 4214 </dl>
jdaggett@2528 4215
jdaggett@2528 4216 <div class=featex><img alt="styleset example" src=ssnn.png></div>
jdaggett@2528 4217
jdaggett@2528 4218 <dl>
jdaggett@7099 4219 <dt><dfn id=character-variantltfeature-value-namegt
jdaggett@7099 4220 title=character-variant>character-variant(&lt;feature-value-name&gt;#)</dfn>
jdaggett@6453 4221
jdaggett@2528 4222
jdaggett@2528 4223 <dd>Enables display of specific character variants (<em>font
jdaggett@6453 4224 specific</em>, OpenType feature: <span
jdaggett@6453 4225 class=tag>cv&lt;feature-index&gt;</span> OpenType currently defines <span
jdaggett@6453 4226 class=tag>cv01</span> through <span class=tag>cv99</span>).
jdaggett@2528 4227
jdaggett@7099 4228 <dt><dfn id=swashltfeature-value-namegt
jdaggett@7099 4229 title=swash>swash(&lt;feature-value-name&gt;)</dfn>
jdaggett@2528 4230
jdaggett@2528 4231 <dd>Enables display of swash glyphs (<em>font specific</em>, OpenType
jdaggett@6453 4232 feature: <span class=tag>swsh &lt;feature-index&gt;, cswh
jdaggett@6453 4233 &lt;feature-index&gt;</span>).
jdaggett@2528 4234 </dl>
jdaggett@2528 4235
jdaggett@2528 4236 <div class=featex><img alt="swash example" src=swsh.png></div>
jdaggett@2528 4237
jdaggett@2528 4238 <dl>
jdaggett@7099 4239 <dt><dfn id=ornamentsltfeature-value-namegt
jdaggett@7099 4240 title=ornaments>ornaments(&lt;feature-value-name&gt;)</dfn>
jdaggett@2528 4241
jdaggett@2528 4242 <dd>Enables replacement of default glyphs with ornaments, if provided in
jdaggett@6453 4243 the font (<em>font specific</em>, OpenType feature: <span class=tag>ornm
jdaggett@6453 4244 &lt;feature-index&gt;</span>). Some fonts may offer ornament glyphs as
jdaggett@2528 4245 alternates for a wide collection of characters; however, displaying
jdaggett@2528 4246 arbitrary characters (e.g., alphanumerics) as ornaments is poor practice
jdaggett@2528 4247 as it distorts the semantics of the data. Font designers are encouraged
jdaggett@2528 4248 to encode all ornaments (except those explicitly encoded in the Unicode
jdaggett@2528 4249 Dingbats blocks, etc.) as alternates for the bullet character (U+2022) to
jdaggett@2528 4250 allow authors to select the desired glyph using
jdaggett@2528 4251 &lt;feature-value-name&gt;.
jdaggett@2528 4252 </dl>
jdaggett@2528 4253
jdaggett@2528 4254 <div class=featex><img alt="ornaments example" src=ornm.png></div>
jdaggett@2528 4255
jdaggett@2528 4256 <dl>
jdaggett@7099 4257 <dt><dfn id=annotationltfeature-value-namegt
jdaggett@7099 4258 title=annotation>annotation(&lt;feature-value-name&gt;)</dfn>
jdaggett@2528 4259
jdaggett@2528 4260 <dd>Enables display of alternate annotation forms (<em>font specific</em>,
jdaggett@6453 4261 OpenType feature: <span class=tag>nalt &lt;feature-index&gt;</span>).
jdaggett@2528 4262 </dl>
jdaggett@2528 4263
jdaggett@2528 4264 <div class=featex><img alt="alternate annotation form example"
jdaggett@2528 4265 src=nalt.png></div>
jdaggett@2528 4266
jdaggett@2528 4267 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
jdaggett@7099 4268 specific alternates: the <code>@font-feature-values</code> rule</h3>
jdaggett@2528 4269
jdaggett@6453 4270 <p>Several of the possible values of ‘<a
jdaggett@6453 4271 href="#propdef-font-variant-alternates"><code
jdaggett@6453 4272 class=property>font-variant-alternates</code></a>’ listed above are
jdaggett@6453 4273 labeled as "font specific". For these features fonts may define not just a
jdaggett@6453 4274 single glyph but a set of alternate glyphs with an index to select a given
jdaggett@7099 4275 alternate. Since these are font family specific, the
jdaggett@7099 4276 <code>@font-feature-values</code> rule is used to define named-values for
jdaggett@7099 4277 these indices for a given family.
jdaggett@2528 4278
jdaggett@2528 4279 <p>In the case of the swash Q in the example shown above, the swash could
jdaggett@2528 4280 be specified using these style rules:
jdaggett@2528 4281
jdaggett@2528 4282 <pre>
jdaggett@7099 4283
jdaggett@2528 4284 @font-feature-values Jupiter Sans {
jdaggett@7099 4285 @swash {
jdaggett@7099 4286 delicate: 1;
jdaggett@7099 4287 flowing: 2;
jdaggett@7099 4288 }
jdaggett@2528 4289 }
jdaggett@2528 4290
jdaggett@2528 4291 h2 { font-family: Jupiter Sans, sans-serif; }
jdaggett@2528 4292
jdaggett@2528 4293 /* show the second swash variant in h2 headings */
jdaggett@2528 4294 h2:first-letter { font-variant-alternates: swash(flowing); }
jdaggett@2528 4295
jdaggett@2528 4296 &lt;h2>Quick&lt;/h2></pre>
jdaggett@2528 4297
jdaggett@2528 4298 <p>When Jupiter Sans is present, the second alternate swash alternate will
jdaggett@2528 4299 be displayed. When not present, no swash character will be shown, since
jdaggett@2528 4300 the specific named-value "flowing" is only defined for the Jupiter Sans
jdaggett@2528 4301 family. The @-mark indicates the name of the property value for which a
jdaggett@2528 4302 named-value can be used. The name "flowing" is chosen by the author.
jdaggett@2528 4303
jdaggett@7099 4304 <p>The syntax of the <code>@font-feature-values</code> rule is defined as:
jdaggett@7099 4305
jdaggett@7099 4306 <pre>@font-feature-values &lt;font-family># {
jdaggett@7099 4307 @&lt;feature-type> {
jdaggett@7099 4308 &lt;feature-ident> : &lt;feature-index>+;
jdaggett@7099 4309 &lt;feature-ident> : &lt;feature-index>+;
jdaggett@7099 4310 ...
jdaggett@7099 4311 }
jdaggett@7099 4312 ...
jdaggett@2528 4313 }
jdaggett@2528 4314 </pre>
jdaggett@2528 4315
jdaggett@2528 4316 <p>where:
jdaggett@2528 4317
jdaggett@2528 4318 <pre
jdaggett@7099 4319 class=prod><dfn id=ltfont-familygt><var>&lt;font-family&gt;</var></dfn> = font family name, same syntax as font-family property</pre>
jdaggett@2528 4320
jdaggett@2528 4321 <pre
jdaggett@7099 4322 class=prod><dfn id=ltfeature-typegt><var>&lt;feature-type&gt;</var></dfn> = the name of one of the font specific font-variant property values
jdaggett@7099 4323 (e.g. swash, styleset, annotation)</pre>
jdaggett@2528 4324
jdaggett@2528 4325 <pre
jdaggett@7099 4326 class=prod><dfn id=ltfeature-identgt><var>&lt;feature-ident&gt;</var></dfn> = a user-defined identifier used to describe a set of indices</pre>
jdaggett@2528 4327
jdaggett@2528 4328 <pre
jdaggett@7099 4329 class=prod><dfn id=ltfeature-indexgt><var>&lt;feature-index&gt;</var></dfn> = an integer value greater than 0 specific to a given font or set of fonts</pre>
jdaggett@7099 4330
jdaggett@7099 4331 <p>These <code>@font-feature-values</code> rules can appear anywhere within
jdaggett@7099 4332 a stylesheet and are exposed bidirectionally across @import boundaries.
jdaggett@7099 4333 Within each font feature values declaration, syntax errors such as unknown
jdaggett@7099 4334 property value names, invalid identifiers or values result in the
jdaggett@7099 4335 declaration being dropped, similar to the way syntax errors in style
jdaggett@7099 4336 declarations are handled.
jdaggett@7099 4337
jdaggett@7099 4338 <p>If multiple <code>@font-feature-values</code> rules are defined for a
jdaggett@7099 4339 given family, the resulting values defined are the union of these rules.
jdaggett@7099 4340 This allows a set of named-values to be defined for a given font family
jdaggett@7099 4341 globally for a site and specific additions made per-page. If the same
jdaggett@6453 4342 &lt;feature-value-name&gt; is defined mulitple times for a given
jdaggett@6453 4343 font-variant value, the last defined value is used.
jdaggett@2528 4344
jdaggett@2528 4345 <pre>
jdaggett@2528 4346 site.css:
jdaggett@2528 4347
jdaggett@2528 4348 @font-feature-values Mercury Serif {
jdaggett@7099 4349 @styleset {
jdaggett@7099 4350 stacked-g: 3; /* "two-storey" versions of g, a */
jdaggett@7099 4351 stacked-a: 4;
jdaggett@7099 4352 }
jdaggett@2528 4353 }
jdaggett@2528 4354
jdaggett@2528 4355 page.css:
jdaggett@2528 4356
jdaggett@2528 4357 @font-feature-values Mercury Serif {
jdaggett@7099 4358 @styleset {
jdaggett@7099 4359 geometric-m: 7; /* alternate version of m */
jdaggett@7099 4360 }
jdaggett@2528 4361 }
jdaggett@2528 4362
jdaggett@2528 4363 body {
jdaggett@2528 4364 font-family: Mercury Serif, serif;
jdaggett@2528 4365
jdaggett@2528 4366 /* enable both the use of stacked g and alternate m */
jdaggett@2528 4367 font-variant-alternates: styleset(stacked-g, geometric-m);
jdaggett@2528 4368 }</pre>
jdaggett@2528 4369
jdaggett@6453 4370 <p>Only named font families are allowed for &lt;font-family&gt;, rules that
jdaggett@6453 4371 include generic or system fonts in the list of font families are
jdaggett@6453 4372 considered syntax errors and the contents of the rules are ignored.
jdaggett@6453 4373 However, if a user agent defines a generic font to be a specific named
jdaggett@6453 4374 font (e.g. Helvetica), the settings associated with that family name will
jdaggett@6453 4375 be used.
jdaggett@6453 4376
jdaggett@6453 4377 <p>For &lt;font-variant-property-value>, only font specific property value
jdaggett@6453 4378 names supported by the ‘<a href="#propdef-font-variant"><code
jdaggett@6453 4379 class=property>font-variant</code></a>’ property are recognized,
jdaggett@6453 4380 definitions for other value names cause a syntax error and are ignored.
jdaggett@6453 4381 Each property value that is font specific is clearly marked as such.
jdaggett@7356 4382 Feature value names follow the rules of CSS user identifiers and are
jdaggett@7356 4383 case-sensitive. They are unique only for a given set of font families and
jdaggett@6453 4384 font-variant property value; the same identifier used with a different
jdaggett@6453 4385 font-variant property value is treated as a separate and distinct value.
jdaggett@2528 4386
jdaggett@2528 4387 <p>Using a commonly named value allows authors to use a single style rule
jdaggett@2528 4388 to cover a set of fonts for which the underlying selector is different for
jdaggett@2528 4389 each font. If either font in the example below is found, a circled number
jdaggett@2528 4390 glyph will be used:
jdaggett@2528 4391
jdaggett@2528 4392 <pre>@font-feature-values Taisho Gothic {
jdaggett@7099 4393 @annotation { boxed: 1; circled: 4; }
jdaggett@2528 4394 }
jdaggett@2528 4395
jdaggett@2528 4396 @font-feature-values Otaru Kisa {
jdaggett@7099 4397 @annotation { circled: 1; black-boxed: 3; }
jdaggett@2528 4398 }
jdaggett@2528 4399
jdaggett@2528 4400 h3.title {
jdaggett@2528 4401 /* circled form defined for both fonts */
jdaggett@2528 4402 font-family: Taisho Gothic, Otaru Kisa;
jdaggett@2528 4403 font-variant: annotation(circled);
jdaggett@2528 4404 }</pre>
jdaggett@2528 4405
jdaggett@6453 4406 <p>Most font specific font-variant property values take a single value
jdaggett@6453 4407 (e.g. swash). The character-variant property value allows two values and
jdaggett@6453 4408 styleset allows an unlimited number. If a larger number of values are
jdaggett@6453 4409 assigned to a given name, a syntax error occurs and the entire
jdaggett@6453 4410 &lt;font-feature-values-declaration&gt; is ignored.
jdaggett@6453 4411
jdaggett@6453 4412 <p>For the styleset property value, multiple values indicate the style sets
jdaggett@7099 4413 to be enabled. Values between 1 and 99 enable OpenType features <span
jdaggett@7099 4414 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
jdaggett@7099 4415 OpenType standard only officially defines <span class=tag>ss01</span>
jdaggett@7099 4416 through <span class=tag>ss20</span>. Values greater than 99 or equal to 0
jdaggett@7099 4417 are ignored but do not generate a syntax error when parsed.
jdaggett@2528 4418
jdaggett@2528 4419 <pre>@font-feature-values Mars Serif {
jdaggett@7099 4420 @styleset {
jdaggett@7099 4421 alt-g: 1; /* implies ss01 = 1 */
jdaggett@7099 4422 curly-quotes: 3; /* implies ss03 = 1 */
jdaggett@7099 4423 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
jdaggett@7099 4424 }
jdaggett@7099 4425
jdaggett@7099 4426 @styleset {
jdaggett@7099 4427 dumb: 125; /* &gt;99, ignored */
jdaggett@7099 4428 }
jdaggett@7099 4429
jdaggett@7099 4430 @swash {
jdaggett@7099 4431 swishy: 3 5; /* more than 1 value for swash, syntax error */
jdaggett@7099 4432 }
jdaggett@2528 4433 }
jdaggett@2528 4434
jdaggett@2528 4435 p.codeblock {
jdaggett@2528 4436 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
jdaggett@2528 4437 font-variant-alternates: styleset(curly-quotes, code);
jdaggett@2528 4438 }</pre>
jdaggett@2528 4439
jdaggett@2528 4440 <p>For character-variant, a single value between 1 and 99 indicates the
jdaggett@6453 4441 enabling of OpenType feature <span class=tag>cv01</span> through <span
jdaggett@7099 4442 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
jdaggett@7099 4443 to 0 are ignored but do not generate a syntax error when parsed. When two
jdaggett@7099 4444 values are listed, the first value indicates the feature used and the
jdaggett@7099 4445 second the value passed for that feature. When two value names imply
jdaggett@7099 4446 different settings for the same underlying feature the last setting is
jdaggett@7099 4447 used.
jdaggett@2528 4448
jdaggett@2528 4449 <pre>@font-feature-values MM Greek {
jdaggett@7099 4450 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
jdaggett@7099 4451 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
jdaggett@7099 4452 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, ignored */
jdaggett@7099 4453 @character-variant { gamma: 12; } /* implies cv12 = 1 */
jdaggett@7099 4454 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
jdaggett@7099 4455 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
jdaggett@7099 4456 @character-variant { silly: 105; } /* &gt;99, ignored */
jdaggett@7099 4457 @character-variant { dumb: 323 3; } /* &gt;99, ignored */
jdaggett@2528 4458 }
jdaggett@2528 4459
jdaggett@2528 4460 #title {
jdaggett@2528 4461 /* use the third alternate beta, first alternate gamma */
jdaggett@2528 4462 font-variant-alternates: character-variant(beta-3, gamma);
jdaggett@6453 4463 }
jdaggett@6453 4464
jdaggett@6453 4465 p {
jdaggett@6453 4466 /* zeta-2 follows zeta, implies cv20 = 2 */
jdaggett@6453 4467 font-variant-alternates: character-variant(zeta, zeta-2);
jdaggett@6453 4468 }
jdaggett@6453 4469
jdaggett@6453 4470 .special {
jdaggett@6453 4471 /* zeta follows zeta-2, implies cv20 = 3 */
jdaggett@6453 4472 font-variant-alternates: character-variant(zeta-2, zeta);
jdaggett@2528 4473 }</pre>
jdaggett@2528 4474
jdaggett@7357 4475 <p>See the <a href="#om-fontfeaturevalues">object model reference
jdaggett@7357 4476 section</a> for a description of the interfaces used to modify these rules
jdaggett@7357 4477 via the CSS Object Model.
jdaggett@3534 4478
jdaggett@2528 4479 <div class=figure><img alt="Matching text on Byzantine seals using
jdaggett@2528 4480 character variants" src=byzantineseal.png>
jdaggett@2528 4481 <p class=caption>Byzantine seal text displayed with character variants
jdaggett@2528 4482 </div>
jdaggett@2528 4483
jdaggett@2528 4484 <div class=example>
jdaggett@2528 4485 <p>In the figure above, the text in red is rendered using a font
jdaggett@2528 4486 containing character variants that mimic the character forms found on a
jdaggett@2528 4487 Byzantine seal from the 8th century A.D. Two lines below is the same text
jdaggett@2528 4488 displayed in a font without variants. Note the two variants for U and N
jdaggett@2528 4489 used on the seal.</p>
jdaggett@2528 4490
jdaggett@2528 4491 <pre>@font-feature-values Athena Ruby {
jdaggett@7099 4492 @character-variant {
jdaggett@7099 4493 leo-B: 2 1;
jdaggett@7099 4494 leo-M: 13 3;
jdaggett@7099 4495 leo-alt-N: 14 1;
jdaggett@7099 4496 leo-N: 14 2;
jdaggett@7099 4497 leo-T: 20 1;
jdaggett@7099 4498 leo-U: 21 2;
jdaggett@7099 4499 leo-alt-U: 21 4;
jdaggett@7099 4500 }
jdaggett@2528 4501 }
jdaggett@2528 4502
jdaggett@2528 4503 p {
jdaggett@7099 4504 font-variant: discretionary-ligatures,
jdaggett@7099 4505 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
jdaggett@2528 4506 }
jdaggett@2528 4507
jdaggett@2528 4508 span.alt-N {
jdaggett@2528 4509 font-variant-alternates: character-variant(leo-alt-N);
jdaggett@2528 4510 }
jdaggett@2528 4511
jdaggett@2528 4512 span.alt-U {
jdaggett@2528 4513 font-variant-alternates: character-variant(leo-alt-U);
jdaggett@2528 4514 }
jdaggett@2528 4515
jdaggett@2528 4516 &lt;p>ENO....UP͞RSTU&lt;span class="alt-U">U&lt;/span>͞&lt;span class="alt-U">U&lt;/span>ΚΑΙTỤẠG̣IUPNS&lt;/p>
jdaggett@2528 4517
jdaggett@2528 4518 &lt;p>LEON|ΚΑΙCONSTA|NTI&lt;span class="alt-N">N&lt;/span>OS..|STOIBAṢ.|LIṢROM|AIO&lt;span class="alt-N">N&lt;/span>&lt;/p>
jdaggett@2528 4519 </pre>
jdaggett@2528 4520 </div>
jdaggett@2528 4521
jdaggett@2528 4522 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
jdaggett@2528 4523 Asian text rendering: the <a
jdaggett@1661 4524 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
jdaggett@1661 4525 property</h3>
jdaggett@1661 4526
jdaggett@6453 4527 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
jdaggett@1661 4528 <tbody>
jdaggett@1661 4529 <tr>
jdaggett@1661 4530 <td>Name:
jdaggett@1661 4531
jdaggett@1661 4532 <td><dfn
jdaggett@1661 4533 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
jdaggett@1661 4534
jdaggett@1661 4535 <tr>
jdaggett@1661 4536 <td>Value:
jdaggett@1661 4537
jdaggett@6453 4538 <td>normal | [ &lt;east-asian-variant-values&gt; ||
jdaggett@6453 4539 &lt;east-asian-width-values&gt; || ruby ]
jdaggett@1661 4540
jdaggett@1661 4541 <tr>
jdaggett@1661 4542 <td>Initial:
jdaggett@1661 4543
jdaggett@1661 4544 <td>normal
jdaggett@1661 4545
jdaggett@1661 4546 <tr>
jdaggett@1661 4547 <td>Applies to:
jdaggett@1661 4548
jdaggett@1661 4549 <td>all elements
jdaggett@1661 4550
jdaggett@1661 4551 <tr>
jdaggett@1661 4552 <td>Inherited:
jdaggett@1661 4553
jdaggett@1661 4554 <td>yes
jdaggett@1661 4555
jdaggett@1661 4556 <tr>
jdaggett@1661 4557 <td>Percentages:
jdaggett@1661 4558
jdaggett@1661 4559 <td>N/A
jdaggett@1661 4560
jdaggett@1661 4561 <tr>
jdaggett@1661 4562 <td>Media:
jdaggett@1661 4563
jdaggett@1661 4564 <td>visual
jdaggett@1661 4565
jdaggett@1661 4566 <tr>
jdaggett@1661 4567 <td>Computed value:
jdaggett@1661 4568
jdaggett@1661 4569 <td>as specified
jdaggett@7361 4570
jdaggett@7361 4571 <tr>
jdaggett@7361 4572 <td>Animatable:
jdaggett@7361 4573
jdaggett@7361 4574 <td>no
jdaggett@1661 4575 </table>
jdaggett@1661 4576
jdaggett@7099 4577 <p>Allows control of glyph substitution and sizing in East Asian text.
jdaggett@1661 4578
jdaggett@1661 4579 <pre
jdaggett@3534 4580 class=prod><dfn id=lteast-asian-variant-valuesgt><var>&lt;east-asian-variant-values&gt;</var></dfn> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]</pre>
jdaggett@1661 4581
jdaggett@1661 4582 <pre
jdaggett@2528 4583 class=prod><dfn id=lteast-asian-width-valuesgt><var>&lt;east-asian-width-values&gt;</var></dfn> = [ full-width | proportional-width ]</pre>
jdaggett@2528 4584
jdaggett@2528 4585 <p>Individual values have the following meanings:
jdaggett@1661 4586
jdaggett@1661 4587 <dl>
jdaggett@6453 4588 <dt><dfn id=normal2>normal</dfn>
jdaggett@6453 4589
jdaggett@6453 4590 <dd>None of the features listed below are enabled.
jdaggett@6453 4591
jdaggett@1661 4592 <dt><dfn id=jis78>jis78</dfn>
jdaggett@1661 4593
jdaggett@6453 4594 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
jdaggett@6453 4595 class=tag>jp78</span>).
jdaggett@1661 4596 </dl>
jdaggett@1661 4597
jdaggett@1661 4598 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
jdaggett@1661 4599
jdaggett@1661 4600 <dl>
jdaggett@1661 4601 <dt><dfn id=jis83>jis83</dfn>
jdaggett@1661 4602
jdaggett@6453 4603 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
jdaggett@6453 4604 class=tag>jp83</span>).
jdaggett@1661 4605
jdaggett@1661 4606 <dt><dfn id=jis90>jis90</dfn>
jdaggett@1661 4607
jdaggett@6453 4608 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
jdaggett@6453 4609 class=tag>jp90</span>).
jdaggett@1661 4610
jdaggett@1661 4611 <dt><dfn id=jis04>jis04</dfn>
jdaggett@1661 4612
jdaggett@6453 4613 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
jdaggett@6453 4614 class=tag>jp04</span>).
jdaggett@7099 4615 <p>The various JIS variants reflect the glyph forms defined in different
jdaggett@7099 4616 Japanese national standards. Fonts generally include glyphs defined by
jdaggett@7099 4617 the most recent national standard but it's sometimes necessary to use
jdaggett@7099 4618 older variants, to match signage for example.</p>
jdaggett@1661 4619
jdaggett@1661 4620 <dt><dfn id=simplified>simplified</dfn>
jdaggett@1661 4621
jdaggett@6453 4622 <dd>Enables rendering of simplified forms (OpenType feature: <span
jdaggett@6453 4623 class=tag>smpl</span>).
jdaggett@7099 4624 <p>The ‘<a href="#simplified"><code
jdaggett@7099 4625 class=property>simplified</code></a>’ and ‘<a
jdaggett@7099 4626 href="#traditional"><code class=property>traditional</code></a>’
jdaggett@7099 4627 values allow control over the glyph forms for characters which have been
jdaggett@7099 4628 simplified over time but for which the older, traditional form is still
jdaggett@7099 4629 used in some contexts. The exact set of characters and glyph forms will
jdaggett@7099 4630 vary to some degree by context for which a given font was designed.</p>
jdaggett@1661 4631
jdaggett@1661 4632 <dt><dfn id=traditional>traditional</dfn>
jdaggett@1661 4633
jdaggett@6453 4634 <dd>Enables rendering of traditional forms (OpenType feature: <span
jdaggett@6453 4635 class=tag>trad</span>).
jdaggett@1661 4636 </dl>
jdaggett@1661 4637
jdaggett@1661 4638 <div class=featex><img alt="tradtional form example" src=trad.png></div>
jdaggett@1661 4639
jdaggett@1661 4640 <dl>
jdaggett@1661 4641 <dt><dfn id=full-width>full-width</dfn>
jdaggett@1661 4642
jdaggett@6453 4643 <dd>Enables rendering of full-width variants (OpenType feature: <span
jdaggett@6453 4644 class=tag>fwid</span>).
jdaggett@1661 4645
jdaggett@1661 4646 <dt><dfn id=proportional-width>proportional-width</dfn>
jdaggett@1661 4647
jdaggett@1661 4648 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
jdaggett@6453 4649 <span class=tag>pwid</span>).
jdaggett@1661 4650 </dl>
jdaggett@1661 4651
jdaggett@1661 4652 <div class=featex><img alt="proportionally spaced Japanese example"
jdaggett@1661 4653 src=pwid.png></div>
jdaggett@1661 4654
jdaggett@6453 4655 <dl>
jdaggett@6453 4656 <dt><dfn id=ruby>ruby</dfn>
jdaggett@6453 4657
jdaggett@6453 4658 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
jdaggett@6453 4659 class=tag>ruby</span>). Since ruby text is generally smaller than the
jdaggett@6453 4660 associated body text, font designers can design special glyphs for use
jdaggett@6453 4661 with ruby that are more readable than scaled down versions of the default
jdaggett@6453 4662 glyphs. Only glyph selection is affected, there is no associated font
jdaggett@6453 4663 scaling or other change that affects line layout. The red ruby text below
jdaggett@6453 4664 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
jdaggett@6453 4665 Note the slight difference in stroke thickness.
jdaggett@6453 4666 </dl>
jdaggett@6453 4667
jdaggett@6453 4668 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
jdaggett@6453 4669
jdaggett@2528 4670 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
jdaggett@2528 4671 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
jdaggett@1661 4672 property</h3>
jdaggett@1661 4673
jdaggett@6453 4674 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
jdaggett@1661 4675 <tbody>
jdaggett@1661 4676 <tr>
jdaggett@1661 4677 <td>Name:
jdaggett@1661 4678
jdaggett@1661 4679 <td><dfn id=propdef-font-variant>font-variant</dfn>
jdaggett@1661 4680
jdaggett@1661 4681 <tr>
jdaggett@1661 4682 <td>Value:
jdaggett@1661 4683
jdaggett@6453 4684 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@3534 4685 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@3534 4686 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@6453 4687 || historical-forms || styleset(&lt;feature-value-name&gt;#) ||
jdaggett@6453 4688 character-variant(&lt;feature-value-name&gt;#) ||
jdaggett@6453 4689 swash(&lt;feature-value-name&gt;) ||
jdaggett@3534 4690 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@6453 4691 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@7099 4692 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@2528 4693 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@6453 4694 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@6453 4695 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@6453 4696 ruby ]
jdaggett@1661 4697
jdaggett@1661 4698 <tr>
jdaggett@1661 4699 <td>Initial:
jdaggett@1661 4700
jdaggett@1661 4701 <td>normal
jdaggett@1661 4702
jdaggett@1661 4703 <tr>
jdaggett@1661 4704 <td>Applies to:
jdaggett@1661 4705
jdaggett@1661 4706 <td>all elements
jdaggett@1661 4707
jdaggett@1661 4708 <tr>
jdaggett@1661 4709 <td>Inherited:
jdaggett@1661 4710
jdaggett@1661 4711 <td>yes
jdaggett@1661 4712
jdaggett@1661 4713 <tr>
jdaggett@1661 4714 <td>Percentages:
jdaggett@1661 4715
jdaggett@7361 4716 <td>see individual properties
jdaggett@1661 4717
jdaggett@1661 4718 <tr>
jdaggett@1661 4719 <td>Media:
jdaggett@1661 4720
jdaggett@1661 4721 <td>visual
jdaggett@1661 4722
jdaggett@1661 4723 <tr>
jdaggett@1661 4724 <td>Computed value:
jdaggett@1661 4725
jdaggett@7361 4726 <td>see individual properties
jdaggett@7361 4727
jdaggett@7361 4728 <tr>
jdaggett@7361 4729 <td>Animatable:
jdaggett@7361 4730
jdaggett@7361 4731 <td>see individual properties
jdaggett@1661 4732 </table>
jdaggett@1661 4733
jdaggett@6453 4734 <p>The value ‘<a href="#normal2"><code
jdaggett@6453 4735 class=property>normal</code></a>’ resets all other font feature
jdaggett@6453 4736 properties to their inital value. The ‘<code
jdaggett@6453 4737 class=property>none</code>’ value sets ‘<a
jdaggett@6453 4738 href="#propdef-font-variant-ligatures"><code
jdaggett@6453 4739 class=property>font-variant-ligatures</code></a>’ to ‘<code
jdaggett@6453 4740 class=property>none</code>’ and resets all other font feature properties
jdaggett@6453 4741 to their initial value. Like other shorthands, using ‘<a
jdaggett@6453 4742 href="#propdef-font-variant"><code
jdaggett@6453 4743 class=property>font-variant</code></a>’ resets unspecified font-variant
jdaggett@6453 4744 subproperties to their initial values. It does not reset the values of
jdaggett@6453 4745 either ‘<a href="#propdef-font-language-override"><code
jdaggett@6453 4746 class=property>font-language-override</code></a>’ or ‘<a
jdaggett@6453 4747 href="#propdef-font-feature-settings"><code
jdaggett@6453 4748 class=property>font-feature-settings</code></a>’.
jdaggett@2528 4749
jdaggett@2528 4750 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
jdaggett@2528 4751 font feature settings control: the <a
jdaggett@1661 4752 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
jdaggett@1661 4753
jdaggett@6453 4754 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
jdaggett@1661 4755 <tbody>
jdaggett@1661 4756 <tr>
jdaggett@1661 4757 <td>Name:
jdaggett@1661 4758
jdaggett@1661 4759 <td><dfn id=propdef-font-feature-settings>font-feature-settings</dfn>
jdaggett@1661 4760
jdaggett@1661 4761 <tr>
jdaggett@1661 4762 <td>Value:
jdaggett@1661 4763
jdaggett@6453 4764 <td>normal | &lt;feature-tag-value&gt;#
jdaggett@1661 4765
jdaggett@1661 4766 <tr>
jdaggett@1661 4767 <td>Initial:
jdaggett@1661 4768
jdaggett@1661 4769 <td>normal
jdaggett@1661 4770
jdaggett@1661 4771 <tr>
jdaggett@1661 4772 <td>Applies to:
jdaggett@1661 4773
jdaggett@1661 4774 <td>all elements
jdaggett@1661 4775
jdaggett@1661 4776 <tr>
jdaggett@1661 4777 <td>Inherited:
jdaggett@1661 4778
jdaggett@1661 4779 <td>yes
jdaggett@1661 4780
jdaggett@1661 4781 <tr>
jdaggett@1661 4782 <td>Percentages:
jdaggett@1661 4783
jdaggett@1661 4784 <td>N/A
jdaggett@1661 4785
jdaggett@1661 4786 <tr>
jdaggett@1661 4787 <td>Media:
jdaggett@1661 4788
jdaggett@1661 4789 <td>visual
jdaggett@1661 4790
jdaggett@1661 4791 <tr>
jdaggett@1661 4792 <td>Computed value:
jdaggett@1661 4793
jdaggett@1661 4794 <td>as specified
jdaggett@7361 4795
jdaggett@7361 4796 <tr>
jdaggett@7361 4797 <td>Animatable:
jdaggett@7361 4798
jdaggett@7361 4799 <td>no
jdaggett@1661 4800 </table>
jdaggett@2528 4801
jdaggett@2528 4802 <p>This property provides low-level control over OpenType font features. It
jdaggett@2528 4803 is intended as a way of providing access to font features that are not
jdaggett@6453 4804 widely used but are needed for a particular use case. A value of ‘<a
jdaggett@6453 4805 href="#normal2"><code class=property>normal</code></a>’ means that no
jdaggett@6453 4806 change in glyph selection or positioning occurs due to this property.
jdaggett@2528 4807
jdaggett@2528 4808 <p>
jdaggett@2528 4809
jdaggett@2528 4810 <pre>/* enable small caps and use second swash alternate */
jdaggett@2528 4811 font-feature-settings: "smcp", "swsh" 2;</pre>
jdaggett@2528 4812
jdaggett@2528 4813 <p>Feature tag values have the following syntax:
jdaggett@2528 4814
jdaggett@2528 4815 <pre
jdaggett@2528 4816 class=prod><dfn id=ltfeature-tag-valuegt><var>&lt;feature-tag-value&gt;</var></dfn> = &lt;string&gt; [ &lt;integer&gt; | on | off ]?</pre>
jdaggett@2528 4817
jdaggett@6453 4818 <p>The &lt;string&gt; is a case-sensitive OpenType feature tag. As
jdaggett@6453 4819 specified in the OpenType specification, feature tags contain four ASCII
jdaggett@6453 4820 characters. Tag strings longer or shorter than four characters, or
jdaggett@6453 4821 containing characters outside the U+20–7E codepoint range are invalid.
jdaggett@6453 4822 User agents must not use a feature tag created by truncating or padding
jdaggett@6453 4823 the string to four characters. Feature tags need only match a feature tag
jdaggett@2528 4824 defined in the font, they are not limited to explicitly registered
jdaggett@2528 4825 OpenType features. Fonts defining custom feature tags should follow the <a
jdaggett@2528 4826 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
jdaggett@2528 4827 rules</a> defined in the OpenType specification <a
jdaggett@1661 4828 href="#OPENTYPE-FEATURES"
jdaggett@2528 4829 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
jdaggett@2528 4830 Feature tags not present in the font are ignored; a user agent must not
jdaggett@2528 4831 attempt to synthesize fallback behavior based on these feature tags.
jdaggett@2528 4832
jdaggett@6453 4833 <p>This means that explicitly disabling the <span class=tag>kern</span>
jdaggett@6453 4834 feature will not affect the application of kerning data found in the
jdaggett@6453 4835 ‘<code class=property>kern</code>’ table (as opposed to kerning data
jdaggett@6453 4836 associated with the <span class=tag>kern</span> feature in the ‘<code
jdaggett@6453 4837 class=property>GPOS</code>’ table). Authors should use the ‘<a
jdaggett@6453 4838 href="#propdef-font-kerning"><code
jdaggett@6453 4839 class=property>font-kerning</code></a>’ property to explictly enable or
jdaggett@6453 4840 disable kerning since this property affects both types of kerning.
jdaggett@6453 4841
jdaggett@2528 4842 <p>If present, a value indicates an index used for glyph selection. An
jdaggett@2528 4843 &lt;integer&gt; value must be 0 or greater. A value of 0 indicates that
jdaggett@2528 4844 the feature is disabled. For boolean features, a value of 1 enables the
jdaggett@2528 4845 feature. For non-boolean features, a value of 1 or greater enables the
jdaggett@2528 4846 feature and indicates the feature selection index. A value of ‘<code
jdaggett@2528 4847 class=property>on</code>’ is synonymous with 1 and ‘<code
jdaggett@2528 4848 class=property>off</code>’ is synonymous with 0. If the value is
jdaggett@2528 4849 omitted, a value of 1 is assumed.
jdaggett@2528 4850
jdaggett@2528 4851 <pre>
jdaggett@2528 4852 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
jdaggett@2528 4853 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
jdaggett@2528 4854 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
jdaggett@2528 4855 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
jdaggett@2528 4856 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
jdaggett@6453 4857 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
jdaggett@6453 4858 font-feature-settings: "palin" off; /* good idea but invalid tagname */
jdaggett@2528 4859 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
jdaggett@6453 4860 font-feature-settings: dlig; /* invalid, tag must be a string */
jdaggett@2528 4861 </pre>
jdaggett@2528 4862
jdaggett@6453 4863 <p>Authors should generally use ‘<a href="#propdef-font-variant"><code
jdaggett@6453 4864 class=property>font-variant</code></a>’ and its related subproperties
jdaggett@6453 4865 whenever possible and only use this property for special cases where its
jdaggett@6453 4866 use is the only way of accessing a particular infrequently used font
jdaggett@6453 4867 feature.
jdaggett@2528 4868
jdaggett@2528 4869 <p>Although specifically defined for OpenType feature tags, feature tags
jdaggett@2528 4870 for other modern font formats that support font features may be added in
jdaggett@6453 4871 the future. Where possible, features defined for other font formats should
jdaggett@6453 4872 attempt to follow the pattern of registered OpenType tags.
jdaggett@1661 4873
jdaggett@1661 4874 <div class=example>
jdaggett@1661 4875 <p>The Japanese text below will be rendered with half-width kana
jdaggett@1661 4876 characters:</p>
jdaggett@1661 4877
jdaggett@1661 4878 <pre lang=ja>
jdaggett@2528 4879 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
jdaggett@1661 4880
jdaggett@1661 4881 &lt;p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない&lt;/p>
jdaggett@1661 4882 </pre>
jdaggett@1661 4883 </div>
jdaggett@1661 4884
jdaggett@2528 4885 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
jdaggett@2528 4886 language override: the <a
jdaggett@2528 4887 href="#propdef-font-language-override">font-language-override</a> property</h3>
jdaggett@2528 4888
jdaggett@6453 4889 <table class=propdef id=namefont-language-overridevaluenormal-lt>
jdaggett@1661 4890 <tbody>
jdaggett@1661 4891 <tr>
jdaggett@1661 4892 <td>Name:
jdaggett@1661 4893
jdaggett@2528 4894 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
jdaggett@1661 4895
jdaggett@1661 4896 <tr>
jdaggett@1661 4897 <td>Value:
jdaggett@1661 4898
jdaggett@6453 4899 <td>normal | &lt;string&gt;
jdaggett@1661 4900
jdaggett@1661 4901 <tr>
jdaggett@1661 4902 <td>Initial:
jdaggett@1661 4903
jdaggett@1661 4904 <td>normal
jdaggett@1661 4905
jdaggett@1661 4906 <tr>
jdaggett@1661 4907 <td>Applies to:
jdaggett@1661 4908
jdaggett@1661 4909 <td>all elements
jdaggett@1661 4910
jdaggett@1661 4911 <tr>
jdaggett@1661 4912 <td>Inherited:
jdaggett@1661 4913
jdaggett@1661 4914 <td>yes
jdaggett@1661 4915
jdaggett@1661 4916 <tr>
jdaggett@1661 4917 <td>Percentages:
jdaggett@1661 4918
jdaggett@1661 4919 <td>N/A
jdaggett@1661 4920
jdaggett@1661 4921 <tr>
jdaggett@1661 4922 <td>Media:
jdaggett@1661 4923
jdaggett@1661 4924 <td>visual
jdaggett@1661 4925
jdaggett@1661 4926 <tr>
jdaggett@1661 4927 <td>Computed value:
jdaggett@1661 4928
jdaggett@1661 4929 <td>as specified
jdaggett@7361 4930
jdaggett@7361 4931 <tr>
jdaggett@7361 4932 <td>Animatable:
jdaggett@7361 4933
jdaggett@7361 4934 <td>no
jdaggett@1661 4935 </table>
jdaggett@1661 4936
jdaggett@6453 4937 <p>The value of ‘<a href="#normal2"><code
jdaggett@6453 4938 class=property>normal</code></a>’ implies that when rendering with
jdaggett@6453 4939 OpenType fonts the language of the document is used to infer the OpenType
jdaggett@6453 4940 language system, used to select language specific features when rendering.
jdaggett@6453 4941 The value of the &lt;string&gt; is a single three-letter OpenType <a
jdaggett@1661 4942 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
jdaggett@1661 4943 system tag</a>, defined in the layout tag registry of the OpenType
jdaggett@1661 4944 specification.
jdaggett@1661 4945
jdaggett@1661 4946 <div class=example>
jdaggett@7356 4947 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
jdaggett@1661 4948 Declaration of Human Rights</a> has been translated into a wide variety
jdaggett@1661 4949 of languages. In Turkish, Article 9 of this document might be marked up
jdaggett@1661 4950 as below:</p>
jdaggett@1661 4951
jdaggett@1661 4952 <pre lang=tr>&lt;body lang="tr">
jdaggett@1661 4953
jdaggett@1661 4954 &lt;h4>Madde 9&lt;/h4>
jdaggett@1661 4955 &lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
jdaggett@1661 4956 </pre>
jdaggett@1661 4957
jdaggett@1661 4958 <p>Here the user agent uses the value of the ‘<code
jdaggett@1661 4959 class=property>lang</code>’ attribute when rendering text and
jdaggett@1661 4960 appropriately renders this text without ‘<code
jdaggett@6453 4961 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
jdaggett@6453 4962 href="#propdef-font-language-override"><code
jdaggett@6453 4963 class=property>font-language-override</code></a>’ property.</p>
jdaggett@1661 4964
jdaggett@1661 4965 <p>However, a given font may lack support for a specific language. In this
jdaggett@1661 4966 situation authors may need to use the typographic conventions of a
jdaggett@1661 4967 related language that are supported by that font:</p>
jdaggett@1661 4968
jdaggett@1661 4969 <pre lang=mk>&lt;body lang="mk"> &lt;!-- Macedonian lang code --&gt;
jdaggett@1661 4970
jdaggett@2528 4971 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
jdaggett@1661 4972
jdaggett@1661 4973 &lt;h4>Члeн 9&lt;/h4>
jdaggett@1661 4974 &lt;p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.&lt;/p>
jdaggett@1661 4975
jdaggett@1661 4976 </pre>
jdaggett@1661 4977
jdaggett@1661 4978 <p>The Macedonian text here will be rendered using Serbian typographic
jdaggett@1661 4979 conventions, with the assumption that the font specified supports
jdaggett@1661 4980 Serbian.</p>
jdaggett@1661 4981 </div>
jdaggett@1661 4982
jdaggett@6453 4983 <p><a id=rendering-considerations></a>
jdaggett@6453 4984
jdaggett@7099 4985 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
jdaggett@7099 4986 Resolution</h2>
jdaggett@6453 4987
jdaggett@6453 4988 <p>As described in the previous section, font features can be enabled in a
jdaggett@6453 4989 variety of ways, either via the use of ‘<a
jdaggett@6453 4990 href="#propdef-font-variant"><code
jdaggett@6453 4991 class=property>font-variant</code></a>’ or ‘<a
jdaggett@6453 4992 href="#propdef-font-feature-settings"><code
jdaggett@6453 4993 class=property>font-feature-settings</code></a>’ in a style rule or
jdaggett@7099 4994 within an <code>@font-face</code> rule. The resolution order for the union
jdaggett@7099 4995 of these settings is defined below. Features defined via CSS properties
jdaggett@7099 4996 are applied on top of layout engine default features.
jdaggett@7099 4997
jdaggett@7099 4998 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
jdaggett@6453 4999
jdaggett@6453 5000 <p>For OpenType fonts, user agents must enable the default features defined
jdaggett@6453 5001 in the OpenType documentation for a given script and writing mode.
jdaggett@6453 5002 Required ligatures, common ligatures and contextual forms must be enabled
jdaggett@6453 5003 by default (OpenType features: <span class=tag>rlig, liga, clig,
jdaggett@6453 5004 calt</span>), along with localized forms (OpenType feature: <span
jdaggett@6453 5005 class=tag>locl</span>), and features required for proper display of
jdaggett@6453 5006 composed characters and marks (OpenType features: <span class=tag>ccmp,
jdaggett@6453 5007 mark, mkmk</span>). These features must always be enabled, even when the
jdaggett@6453 5008 value of the ‘<a href="#propdef-font-variant"><code
jdaggett@6453 5009 class=property>font-variant</code></a>’ and ‘<a
jdaggett@6453 5010 href="#propdef-font-feature-settings"><code
jdaggett@6453 5011 class=property>font-feature-settings</code></a>’ properties is ‘<a
jdaggett@6453 5012 href="#normal2"><code class=property>normal</code></a>’. Individual
jdaggett@7356 5013 features are only disabled when explicitly overridden by the author, as
jdaggett@7356 5014 when ‘<a href="#propdef-font-variant-ligatures"><code
jdaggett@6453 5015 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
jdaggett@6453 5016 href="#no-common-ligatures"><code
jdaggett@7356 5017 class=property>no-common-ligatures</code></a>’. For handling complex
jdaggett@7356 5018 scripts such as <a
jdaggett@6453 5019 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
jdaggett@6453 5020 <a
jdaggett@6453 5021 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
jdaggett@6453 5022 or <a
jdaggett@6453 5023 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
jdaggett@6453 5024 additional features are required. For upright text within vertical text
jdaggett@6453 5025 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
jdaggett@6453 5026 must be enabled.
jdaggett@6453 5027
jdaggett@7099 5028 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
jdaggett@7099 5029
jdaggett@6453 5030 <p>General and font specific font feature property settings are resolved in
jdaggett@6453 5031 the order below, in ascending precedence order. This ordering is used to
jdaggett@3534 5032 construct a combined list of font features that affect a given text run.
jdaggett@1661 5033
jdaggett@1661 5034 <ol>
jdaggett@6453 5035 <li>Font features enabled by default, including features required for a
jdaggett@6453 5036 given script.
jdaggett@6453 5037
jdaggett@7099 5038 <li>If the font is defined via an <code>@font-face</code> rule, the font
jdaggett@7099 5039 features implied by the font-variant descriptor in the
jdaggett@7099 5040 <code>@font-face</code> rule.
jdaggett@7099 5041
jdaggett@7099 5042 <li>If the font is defined via an <code>@font-face</code> rule, the font
jdaggett@7099 5043 features implied by the font-feature-settings descriptor in the
jdaggett@7099 5044 <code>@font-face</code> rule.
jdaggett@1661 5045
jdaggett@6453 5046 <li>Feature settings determined by properties other than ‘<a
jdaggett@6453 5047 href="#propdef-font-variant"><code
jdaggett@6453 5048 class=property>font-variant</code></a>’ or ‘<a
jdaggett@6453 5049 href="#propdef-font-feature-settings"><code
jdaggett@6453 5050 class=property>font-feature-settings</code></a>’. For example, setting
jdaggett@6453 5051 a non-default value for the ‘<code
jdaggett@6453 5052 class=property>letter-spacing</code>’ property disables ligatures.
jdaggett@6453 5053
jdaggett@6453 5054 <li>Font features implied by the value of the ‘<a
jdaggett@6453 5055 href="#propdef-font-variant"><code
jdaggett@6453 5056 class=property>font-variant</code></a>’ property, the related
jdaggett@6453 5057 font-variant subproperties and any other CSS property that may use
jdaggett@6453 5058 OpenType features (e.g. the ‘<a href="#propdef-font-kerning"><code
jdaggett@6453 5059 class=property>font-kerning</code></a>’ property).
jdaggett@6453 5060
jdaggett@6453 5061 <li>Font features implied by the value of ‘<a
jdaggett@6453 5062 href="#propdef-font-feature-settings"><code
jdaggett@6453 5063 class=property>font-feature-settings</code></a>’ property.
jdaggett@1661 5064 </ol>
jdaggett@1661 5065
jdaggett@3534 5066 <p>This ordering allows authors to set up a general set of defaults for
jdaggett@7099 5067 fonts within their <code>@font-face</code> rules, then override them with
jdaggett@7099 5068 property settings for specific elements. General property settings
jdaggett@7099 5069 override the settings in <code>@font-face</code> rules and low-level font
jdaggett@7099 5070 feature settings override ‘<a href="#propdef-font-variant"><code
jdaggett@6453 5071 class=property>font-variant</code></a>’ property settings.
jdaggett@2528 5072
jdaggett@2528 5073 <p>For situations where the combined list of font feature settings contains
jdaggett@3534 5074 more than one value for the same feature, the last value is used. When a
jdaggett@3534 5075 font lacks support for a given underlying font feature, text is simply
jdaggett@3534 5076 rendered as if that font feature was not enabled; font fallback does not
jdaggett@3534 5077 occur and no attempt is made to synthesize the feature except where
jdaggett@3534 5078 explicitly noted for specific properties.
jdaggett@1661 5079
jdaggett@7099 5080 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
jdaggett@7099 5081 precedence examples</h3>
jdaggett@7099 5082
jdaggett@1661 5083 <div class=example>
jdaggett@1661 5084 <p>With the styles below, numbers are rendered proportionally when used
jdaggett@1661 5085 within a paragraph but are shown in tabular form within tables of prices:</p>
jdaggett@1661 5086
jdaggett@1661 5087 <pre>body {
jdaggett@1661 5088 font-variant-numeric: proportional-nums;
jdaggett@1661 5089 }
jdaggett@1661 5090
jdaggett@1661 5091 table.prices td {
jdaggett@1661 5092 font-variant-numeric: tabular-nums;
jdaggett@1661 5093 }
jdaggett@1661 5094 </pre>
jdaggett@1661 5095 </div>
jdaggett@1661 5096
jdaggett@1661 5097 <div class=example>
jdaggett@7099 5098 <p>When the font-variant descriptor is used within an
jdaggett@7099 5099 <code>@font-face</code> rule, it only applies to the font defined by that
jdaggett@7099 5100 rule.</p>
jdaggett@1661 5101
jdaggett@1661 5102 <pre>@font-face {
jdaggett@1661 5103 font-family: MainText;
jdaggett@2555 5104 src: url(http://example.com/font.ttf);
jdaggett@1661 5105 font-variant: oldstyle-nums proportional-nums styleset(1,3);
jdaggett@1661 5106 }
jdaggett@1661 5107
jdaggett@1661 5108 body {
jdaggett@1661 5109 font-family: MainText, Helvetica;
jdaggett@1661 5110 }
jdaggett@1661 5111
jdaggett@1661 5112 table.prices td {
jdaggett@1661 5113 font-variant-numeric: tabular-nums;
jdaggett@1661 5114 }
jdaggett@1661 5115 </pre>
jdaggett@1661 5116
jdaggett@1661 5117 <p>In this case, old-style numerals will be used throughout but only where
jdaggett@1661 5118 the font "MainText" is used. Just as in the previous example, tabular
jdaggett@6453 5119 values will be used in price tables since ‘<a
jdaggett@6453 5120 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
jdaggett@6453 5121 appears in a general style rule and its use is mutually exclusive with
jdaggett@6453 5122 ‘<a href="#proportional-nums"><code
jdaggett@6453 5123 class=property>proportional-nums</code></a>’. Stylistic alternate sets
jdaggett@6453 5124 will only be used where MainText is used.</p>
jdaggett@1661 5125 </div>
jdaggett@1661 5126
jdaggett@1661 5127 <div class=example>
jdaggett@7099 5128 <p>The <code>@font-face</code> rule can also be used to access font
jdaggett@7099 5129 features in locally available fonts via the use of local() in the ‘<a
jdaggett@6453 5130 href="#descdef-src"><code class=property>src</code></a>’ descriptor of
jdaggett@7099 5131 the <code>@font-face</code> definition:</p>
jdaggett@1661 5132
jdaggett@1661 5133 <pre>@font-face {
jdaggett@1661 5134 font-family: BodyText;
jdaggett@1661 5135 src: local("HiraMaruPro-W4");
jdaggett@1661 5136 font-variant: proportional-width;
jdaggett@2528 5137 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
jdaggett@1661 5138 }
jdaggett@1661 5139
jdaggett@1661 5140 body { font-family: BodyText, serif; }
jdaggett@1661 5141 </pre>
jdaggett@1661 5142
jdaggett@1661 5143 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
jdaggett@1661 5144 text rendering occurs, Japanese kana will be proportionally spaced and
jdaggett@1661 5145 Latin text will be italicised. Text rendered with the fallback serif font
jdaggett@1661 5146 will use default rendering properties.</p>
jdaggett@1661 5147 </div>
jdaggett@1661 5148
jdaggett@1661 5149 <div class=example>
jdaggett@3534 5150 <p>In the example below, discretionary ligatures are enabled only for a
jdaggett@1661 5151 downloadable font but are disabled within spans of class "special":</p>
jdaggett@1661 5152
jdaggett@1661 5153 <pre>@font-face {
jdaggett@1661 5154 font-family: main;
jdaggett@1661 5155 src: url(fonts/ffmeta.woff) format("woff");
jdaggett@3534 5156 font-variant: discretionary-ligatures;
jdaggett@1661 5157 }
jdaggett@1661 5158
jdaggett@1661 5159 body { font-family: main, Helvetica; }
jdaggett@3534 5160 span.special { font-variant-ligatures: no-discretionary-ligatures; }
jdaggett@1661 5161 </pre>
jdaggett@1661 5162
jdaggett@7099 5163 <p>Adding an discretionary style rule with the <code>@font-face</code>
jdaggett@7099 5164 above:</p>
jdaggett@1661 5165
jdaggett@1661 5166 <pre>body { font-family: main, Helvetica; }
jdaggett@2528 5167 span { font-feature-settings: "dlig"; }
jdaggett@3534 5168 span.special { font-variant-ligatures: no-discretionary-ligatures; }
jdaggett@1661 5169 </pre>
jdaggett@1661 5170
jdaggett@3534 5171 <p>Within spans of class "special", discretionary ligatures <em>will</em>
jdaggett@6453 5172 be rendered. This is because both the ‘<a
jdaggett@6453 5173 href="#propdef-font-feature-settings"><code
jdaggett@6453 5174 class=property>font-feature-settings</code></a>’ and ‘<a
jdaggett@6453 5175 href="#propdef-font-variant-ligatures"><code
jdaggett@6453 5176 class=property>font-variant-ligatures</code></a>’ properties apply to
jdaggett@6453 5177 these spans. Although the ‘<code class=css>no-discretionary
jdaggett@6453 5178 ligatures</code>’ setting of ‘<a
jdaggett@6453 5179 href="#propdef-font-variant-ligatures"><code
jdaggett@6453 5180 class=property>font-variant-ligatures</code></a>’ effectively disables
jdaggett@6453 5181 the OpenType <span class=tag>dlig</span> feature, because the ‘<a
jdaggett@6453 5182 href="#propdef-font-feature-settings"><code
jdaggett@6453 5183 class=property>font-feature-settings</code></a>’ is resolved after
jdaggett@6453 5184 that, the ‘<code class=property>dlig</code>’ value reenables
jdaggett@6453 5185 discretionary ligatures.</p>
jdaggett@1661 5186 </div>
jdaggett@7099 5187
jdaggett@7099 5188 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
jdaggett@7099 5189
jdaggett@7099 5190 <p>The contents of <code>@font-face</code> and
jdaggett@7099 5191 <code>@font-feature-values</code> rules can be accessed via the following
jdaggett@7099 5192 extensions to the CSS Object Model.
jdaggett@7099 5193
jdaggett@7099 5194 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
jdaggett@7099 5195 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
jdaggett@7099 5196
jdaggett@7099 5197 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
jdaggett@7099 5198 <code>@font-face</code> rule.
jdaggett@7099 5199
jdaggett@7099 5200 <pre class=idl>
jdaggett@7099 5201 interface CSSFontFaceRule : CSSRule {
jdaggett@7099 5202 attribute DOMString family;
jdaggett@7099 5203 attribute DOMString src;
jdaggett@7099 5204 attribute DOMString style;
jdaggett@7099 5205 attribute DOMString weight;
jdaggett@7099 5206 attribute DOMString stretch;
jdaggett@7099 5207 attribute DOMString unicodeRange;
jdaggett@7099 5208 attribute DOMString variant;
jdaggett@7099 5209 attribute DOMString featureSettings;
jdaggett@7099 5210 }</pre>
jdaggett@7099 5211
jdaggett@7099 5212 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
jdaggett@7099 5213 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
jdaggett@7099 5214 defined a different variant of this rule. This definition supercedes that
jdaggett@7099 5215 one.
jdaggett@7099 5216
jdaggett@7099 5217 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
jdaggett@7099 5218 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
jdaggett@7099 5219 interface</h3>
jdaggett@7099 5220
jdaggett@7099 5221 <p>The <code>CSSRule</code> interface is extended as follows:
jdaggett@7099 5222
jdaggett@7099 5223 <pre class=idl>partial interface CSSRule {
jdaggett@7099 5224 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
jdaggett@7099 5225 }</pre>
jdaggett@7099 5226
jdaggett@7099 5227 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
jdaggett@7099 5228 interface represents a <code>@font-feature-values</code> rule.
jdaggett@7099 5229
jdaggett@7099 5230 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
jdaggett@7099 5231 readonly attribute DOMString familyList;
jdaggett@7099 5232 readonly attribute DOMString valueText;
jdaggett@7099 5233 };</pre>
jdaggett@7099 5234
jdaggett@7099 5235 <dl class=idl-attributes>
jdaggett@7099 5236 <dt><var>familyList</var> of type <code>DOMString</code>, readonly
jdaggett@7099 5237
jdaggett@7099 5238 <dd>The list of one or more font families for which a given set of feature
jdaggett@7099 5239 values is defined.
jdaggett@7099 5240
jdaggett@7099 5241 <dt><var>valueText</var> of type <code>DOMString</code>, readonly
jdaggett@7099 5242
jdaggett@7099 5243 <dd>Serialized set of feature values.
jdaggett@7099 5244 </dl>
jdaggett@7099 5245
jdaggett@7099 5246 <h2 id=font-load-events><span class=secno>9 </span>Font Load Events</h2>
jdaggett@7099 5247
jdaggett@7099 5248 <p>Since fonts defined via <code>@font-face</code> rules are loaded on
jdaggett@7099 5249 demand, pages may need to know precisely when fonts have completed
jdaggett@7099 5250 downloading before measuring text elements on the page or to show some
jdaggett@7099 5251 form of interim user interface state.
jdaggett@7099 5252
jdaggett@7099 5253 <h3 id=document-fontloader><span class=secno>9.1 </span>Extension to the
jdaggett@7099 5254 <code>document</code> interface</h3>
jdaggett@7099 5255
jdaggett@7099 5256 <p>To allow font loading to be tracked explicitly within content the
jdaggett@7099 5257 following event target is added to the <code>document</code> of the page:
jdaggett@7099 5258
jdaggett@7099 5259 <pre class=idl>partial interface Document {
jdaggett@7099 5260 readonly attribute FontLoader fontloader;
jdaggett@7099 5261 };
jdaggett@7099 5262 </pre>
jdaggett@7099 5263
jdaggett@7099 5264 <h3 id=fontloader-interface><span class=secno>9.2 </span>The
jdaggett@7099 5265 <code>FontLoader</code> Interface</h3>
jdaggett@7099 5266
jdaggett@7099 5267 <pre class=idl>dictionary CSSFontFaceLoadEventInit : EventInit {
jdaggett@7099 5268 CSSFontFaceRule fontface = null;
jdaggett@7099 5269 DOMError error = null;
jdaggett@7099 5270 };
jdaggett@7099 5271
jdaggett@7356 5272 dictionary LoadFontParameters {
jdaggett@7356 5273 DOMString font;
jdaggett@7356 5274 DOMString text = " ";
jdaggett@7356 5275 FontsReadyCallback onsuccess;
jdaggett@7356 5276 FontsReadyCallback onerror;
jdaggett@7356 5277 };
jdaggett@7356 5278
jdaggett@7099 5279 [Constructor(DOMString type, optional CSSFontFaceLoadEventInit eventInitDict)]
jdaggett@7099 5280 interface CSSFontFaceLoadEvent : Event {
jdaggett@7099 5281 readonly attribute CSSFontFaceRule fontface;
jdaggett@7099 5282 readonly attribute DOMError error;
jdaggett@7099 5283 }
jdaggett@7099 5284
jdaggett@7099 5285 callback FontsReadyCallback = void ();
jdaggett@7099 5286
jdaggett@7099 5287 interface FontLoader : EventTarget {
jdaggett@7099 5288
jdaggett@7099 5289 // -- events for when loading state changes
jdaggett@7099 5290 attribute EventHandler <a href="#fontloader-loading">onloading</a>;
jdaggett@7099 5291 attribute EventHandler <a href="#fontloader-loadingdone">onloadingdone</a>;
jdaggett@7099 5292
jdaggett@7099 5293 // -- events for each individual font load
jdaggett@7099 5294 attribute EventHandler <a href="#fontloader-loadstart">onloadstart</a>;
jdaggett@7099 5295 attribute EventHandler <a href="#fontloader-load">onload</a>;
jdaggett@7099 5296 attribute EventHandler <a href="#fontloader-error">onerror</a>;
jdaggett@7099 5297
jdaggett@7099 5298 // check and start load if appropriate
jdaggett@7356 5299 // and fire callback when all loads complete
jdaggett@7356 5300 void <a href="#fontloader-loadfont">loadFont</a>(LoadFontParameters params);
jdaggett@7356 5301
jdaggett@7356 5302 // return whether all fonts in the fontlist are loaded
jdaggett@7356 5303 // (does not initiate load if not available)
jdaggett@7356 5304 boolean <a href="#fontloader-checkfont">checkFont</a>(DOMString font, optional DOMString text = " ");
jdaggett@7099 5305
jdaggett@7099 5306 // async notify upon completion, pending layout changes
jdaggett@7099 5307 void <a href="#fontloader-notifywhenfontsready">notifyWhenFontsReady</a>(FontsReadyCallback fontsReadyCallback);
jdaggett@7099 5308
jdaggett@7099 5309 // loading state, true while one or more fonts loading, false otherwise
jdaggett@7099 5310 readonly attribute boolean loading;
jdaggett@7099 5311 };</pre>
jdaggett@7099 5312
jdaggett@7099 5313 <p>Because font families defined with <code>@font-face</code> rules are
jdaggett@7099 5314 loaded only when they are used, content sometimes needs to understand when
jdaggett@7099 5315 the loading of fonts occurs. Authors can use the events and methods
jdaggett@7099 5316 defined here to allow greater control over actions that are dependent upon
jdaggett@7099 5317 the availability of specific fonts.
jdaggett@7099 5318
jdaggett@7099 5319 <p>The term <dfn id=font-load>font load</dfn> is used below to indicate
jdaggett@7099 5320 when the loading of content for a given <code>@font-face</code> rule
jdaggett@7099 5321 completes. An <code>@font-face</code> rule may list multiple alternate
jdaggett@7099 5322 resources within the ‘<a href="#descdef-src"><code
jdaggett@7099 5323 class=property>src</code></a>’ descriptor, including references to local
jdaggett@7099 5324 fonts, but the term font load only refers to the loading of the finally
jdaggett@7099 5325 selected resource for a given rule, not to the loading of each individual
jdaggett@7099 5326 resource.
jdaggett@7099 5327
jdaggett@7099 5328 <h4 id=events><span class=secno>9.2.1 </span>Events</h4>
jdaggett@7099 5329
jdaggett@7099 5330 <p>The following are the event handlers (and their corresponding event
jdaggett@7099 5331 handler event types) that must be supported by <code>FontLoader</code>
jdaggett@7099 5332 objects as IDL attributes:
jdaggett@7099 5333
jdaggett@7100 5334 <table class=data id=eventhandlers>
jdaggett@7099 5335 <thead>
jdaggett@7099 5336 <tr>
jdaggett@7099 5337 <th>Event handler
jdaggett@7099 5338
jdaggett@7099 5339 <th>Event handler event type
jdaggett@7099 5340
jdaggett@7099 5341 <tbody>
jdaggett@7099 5342 <tr>
jdaggett@7099 5343 <th><code class=idl-code>onloading</code>
jdaggett@7099 5344
jdaggett@7099 5345 <td><code class=idl-code>loading</code>
jdaggett@7099 5346
jdaggett@7099 5347 <tr>
jdaggett@7099 5348 <th><code class=idl-code>onloadingdone</code>
jdaggett@7099 5349
jdaggett@7099 5350 <td><code class=idl-code>loadingdone</code>
jdaggett@7099 5351
jdaggett@7099 5352 <tr>
jdaggett@7099 5353 <th><code class=idl-code>onloadstart</code>
jdaggett@7099 5354
jdaggett@7099 5355 <td><code class=idl-code>loadstart</code>
jdaggett@7099 5356
jdaggett@7099 5357 <tr>
jdaggett@7099 5358 <th><code class=idl-code>onload</code>
jdaggett@7099 5359
jdaggett@7099 5360 <td><code class=idl-code>load</code>
jdaggett@7099 5361
jdaggett@7099 5362 <tr>
jdaggett@7099 5363 <th><code class=idl-code>onerror</code>
jdaggett@7099 5364
jdaggett@7099 5365 <td><code class=idl-code>error</code>
jdaggett@7099 5366 </table>
jdaggett@7099 5367
jdaggett@7099 5368 <p>To <dfn id=fire-a-font-load-event>fire a font load event</dfn> named
jdaggett@7356 5369 <var>e</var> at a <code>FontLoader</code> target means to <a
jdaggett@7356 5370 href="http://www.w3.org/TR/html5/webappapis.html#event-firing">fire a
jdaggett@7356 5371 simple event</a> named <var>e</var> using the
jdaggett@7099 5372 <code>CSSFontFaceLoadEvent</code> interface that also meets these
jdaggett@7099 5373 conditions:
jdaggett@7099 5374
jdaggett@7099 5375 <ol>
jdaggett@7099 5376 <li>The <code class=idl-code>fontface</code> attribute is initialized to
jdaggett@7099 5377 the given <var>font face rule</var>.
jdaggett@7099 5378
jdaggett@7099 5379 <li>The <code class=idl-code>error</code> attribute is initialized to the
jdaggett@7099 5380 given <var>error</var>.
jdaggett@7099 5381 </ol>
jdaggett@7099 5382
jdaggett@7099 5383 <p>When the user agent determines that one or more fonts defined via
jdaggett@7099 5384 <code>@font-face</code> rules in a document <var>doc</var> need to be
jdaggett@7099 5385 loaded, it must run the following steps:
jdaggett@7099 5386
jdaggett@7099 5387 <ol>
jdaggett@7099 5388 <li>Let <var>font loader</var> be the value of the <code
jdaggett@7099 5389 class=idl-code>fontloader</code> attribute of <var>doc</var>.
jdaggett@7099 5390
jdaggett@7099 5391 <li>Set the <code class=idl-code>loading</code> attribute of <var>font
jdaggett@7099 5392 loader</var> to true.
jdaggett@7099 5393
jdaggett@7099 5394 <li><a href="#fire-a-font-load-event">Fire a font load event</a> named <a
jdaggett@7099 5395 id=fontloader-loading><code class=idl-code>"loading"</code></a> with
jdaggett@7099 5396 <var>font face rule</var> and <var>error</var> at <var>font loader</var>.
jdaggett@7099 5397
jdaggett@7099 5398 <li>When the user agent begins loading the first resource for a given
jdaggett@7099 5399 <code>@font-face</code> rule, it must <a
jdaggett@7099 5400 href="#fire-a-font-load-event">fire a font load event</a> named <a
jdaggett@7099 5401 id=fontloader-loadstart><code class=idl-code>"loadstart"</code></a> with
jdaggett@7099 5402 <var>font face</var> set to the <code>@font-face</code> rule that caused
jdaggett@7099 5403 this load to start and <var>error</var> set to <code>????</code> at
jdaggett@7099 5404 <var>font loader</var>.
jdaggett@7099 5405 </ol>
jdaggett@7099 5406
jdaggett@7099 5407 <p class=issue>What are the error types that should be used here?
jdaggett@7099 5408
jdaggett@7099 5409 <p>The term “font load” covers any of the resources listed in the
jdaggett@7099 5410 ‘src’ descriptor, including local fonts. When multiple resources are
jdaggett@7099 5411 listed, the “font load” is the first resource in the list to
jdaggett@7099 5412 successfully load or the error that occurs on the last resource for which
jdaggett@7099 5413 a load is attempted.
jdaggett@7099 5414
jdaggett@7099 5415 <p class=issue>Given that a set of <code>@font-face</code> rules might load
jdaggett@7099 5416 concurrently, does it make sense to have a non-null value for the <code
jdaggett@7099 5417 class=idl-code>"loading"</code> event?
jdaggett@7099 5418
jdaggett@7099 5419 <p>When the user agent completes each font load for a document
jdaggett@7099 5420 <var>doc</var>, it must run the following steps:
jdaggett@7099 5421
jdaggett@7099 5422 <ol>
jdaggett@7099 5423 <li>Let <var>font loader</var> be the value of the <code
jdaggett@7099 5424 class=idl-code>fontloader</code> attribute of <var>doc</var>.
jdaggett@7099 5425
jdaggett@7099 5426 <li>If none of the resources listed for the ‘<a
jdaggett@7099 5427 href="#descdef-src"><code class=property>src</code></a>’ descriptor
jdaggett@7099 5428 contain valid data, <a href="#fire-a-font-load-event">fire a font load
jdaggett@7099 5429 event</a> named <a id=fontloader-error><code
jdaggett@7099 5430 class=idl-code>"error"</code></a> with <var>font face</var> the
jdaggett@7099 5431 <code>@font-face</code> rule that caused this load to start and
jdaggett@7099 5432 <var>error</var> [something?] at <var>font loader</var>.
jdaggett@7099 5433
jdaggett@7099 5434 <li>Otherwise, <a href="#fire-a-font-load-event">fire a font load
jdaggett@7099 5435 event</a> named <a id=fontloader-load><code
jdaggett@7099 5436 class=idl-code>"load"</code></a> with <var>font face</var> the
jdaggett@7099 5437 <code>@font-face</code> rule that caused this load to start and
jdaggett@7099 5438 <var>error</var> [something?] at <var>font loader</var>.
jdaggett@7099 5439 </ol>
jdaggett@7099 5440
jdaggett@7099 5441 <p>When the user agent completes the final font load for document
jdaggett@7099 5442 <var>doc</var>, it must run the following steps:
jdaggett@7099 5443
jdaggett@7099 5444 <ol>
jdaggett@7099 5445 <li>Let <var>font loader</var> be the value of the <code
jdaggett@7099 5446 class=idl-code>fontloader</code> attribute of <var>doc</var>.
jdaggett@7099 5447
jdaggett@7099 5448 <li>Set the <code class=idl-code>loading</code> attribute of <var>font
jdaggett@7099 5449 loader</var> to false.
jdaggett@7099 5450
jdaggett@7099 5451 <li><a href="#fire-a-font-load-event">Fire a font load event</a> named <a
jdaggett@7099 5452 id=fontloader-loadingdone><code class=idl-code>"loadingdone"</code></a>
jdaggett@7099 5453 with <var>font face rule</var>, set to the last font to load, and
jdaggett@7099 5454 <var>error</var> at <var>font loader</var>.
jdaggett@7099 5455 </ol>
jdaggett@7099 5456
jdaggett@7099 5457 <p>Note: For example, if three fonts are loaded at the same time, a <code
jdaggett@7099 5458 class=idl-code>"loading"</code> event followed by three <code
jdaggett@7099 5459 class=idl-code>"loadstart"</code> events and three <code
jdaggett@7099 5460 class=idl-code>"load"</code> or <code class=idl-code>"error"</code>
jdaggett@7099 5461 events, followed by a <code class=idl-code>"loadingdone"</code> event will
jdaggett@7099 5462 occur.
jdaggett@7099 5463
jdaggett@7099 5464 <h4 id=methods><span class=secno>9.2.2 </span>Methods</h4>
jdaggett@7099 5465
jdaggett@7356 5466 <p>The methods <code class=idl-code>loadFont</code> and <code
jdaggett@7356 5467 class=idl-code>checkFont</code> must determine whether all fonts in the
jdaggett@7099 5468 given font list have been loaded and are available. If all fonts are
jdaggett@7356 5469 available, <code class=idl-code>checkFont</code> must return true, false
jdaggett@7356 5470 if one or more fonts are not available. In the case of <code
jdaggett@7099 5471 class=idl-code>loadFont</code>, if any fonts are downloadable fonts and
jdaggett@7099 5472 have not already been loaded, the user agent must initiate the load of
jdaggett@7099 5473 each of these fonts.
jdaggett@7099 5474
jdaggett@7356 5475 <p>The <a id=fontloader-loadfont><code
jdaggett@7356 5476 class=idl-code>loadFont(params)</code></a> method must use these steps:
jdaggett@7099 5477
jdaggett@7099 5478 <ol>
jdaggett@7356 5479 <li>Parse the value of the <code class=idl-code>font</code> member of
jdaggett@7356 5480 <code class=idl-code>params</code>, using the CSS value syntax of the
jdaggett@7356 5481 ‘<a href="#propdef-font"><code class=property>font</code></a>’
jdaggett@7356 5482 property.
jdaggett@7356 5483
jdaggett@7356 5484 <li>If a syntax error occurs, return.
jdaggett@7099 5485
jdaggett@7099 5486 <li>Otherwise, let <var>font family list</var> be the set of families and
jdaggett@7099 5487 <var>font style</var> be the other font style attributes.
jdaggett@7099 5488
jdaggett@7099 5489 <li>For each family in <var>font family list</var>, use the font matching
jdaggett@7099 5490 rules to select the font faces that match the <var>font style</var>. In
jdaggett@7099 5491 the case where these are font faces defined via <code>@font-face</code>
jdaggett@7099 5492 rules, the use of ‘<a href="#descdef-unicode-range"><code
jdaggett@7099 5493 class=property>unicode-range</code></a>’ means that this may be more
jdaggett@7099 5494 than just a single font face.
jdaggett@7099 5495
jdaggett@7099 5496 <li>Remove from the set of font faces all faces that have defined ‘<a
jdaggett@7099 5497 href="#descdef-unicode-range"><code
jdaggett@7099 5498 class=property>unicode-range</code></a>’ values that don't intersect
jdaggett@7099 5499 the range of character values in the <code class=idl-code>text</code>
jdaggett@7356 5500 member of <code class=idl-code>params</code> and set this to be the
jdaggett@7356 5501 <var>font load list</var>.
jdaggett@7356 5502
jdaggett@7356 5503 <li>For all of the font faces in the <var>font load list</var>, initiate
jdaggett@7356 5504 the load of any font that has not already been loaded and return.
jdaggett@7356 5505
jdaggett@7356 5506 <li>When all fonts in the <var>font load list</var> have been loaded, fire
jdaggett@7356 5507 the appropriate callback handler. If all fonts loaded successfully, call
jdaggett@7356 5508 the callback specified by the <code class=idl-code>onsuccess</code>
jdaggett@7356 5509 member of <code class=idl-code>params</code>. If an error occurred with
jdaggett@7356 5510 any one of the fonts in the <var>font load list</var> or if the list is
jdaggett@7356 5511 empty, call the callback specified by the <code
jdaggett@7356 5512 class=idl-code>onerror</code> member of <code
jdaggett@7356 5513 class=idl-code>params</code>.
jdaggett@7099 5514 </ol>
jdaggett@7099 5515
jdaggett@7356 5516 <p>Callbacks for <code class=idl-code>loadFont</code> fire in addition to
jdaggett@7356 5517 the callbacks that fire due to font event handlers.
jdaggett@7356 5518
jdaggett@7356 5519 <p>The <a id=fontloader-checkfont><code class=idl-code>checkFont(font,
jdaggett@7099 5520 text)</code></a> method must use these steps:
jdaggett@7099 5521
jdaggett@7099 5522 <ol>
jdaggett@7356 5523 <li>Parse the value of the <code class=idl-code>font</code> parameter,
jdaggett@7356 5524 using the CSS value syntax of the ‘<a href="#propdef-font"><code
jdaggett@7099 5525 class=property>font</code></a>’ property.
jdaggett@7099 5526
jdaggett@7356 5527 <li>If a syntax error occurs, return <code class=idl-code>false</code>.
jdaggett@7099 5528
jdaggett@7099 5529 <li>Otherwise, let <var>font family list</var> be the set of families and
jdaggett@7099 5530 <var>font style</var> be the other font style attributes.
jdaggett@7099 5531
jdaggett@7099 5532 <li>For each family in <var>font family list</var>, use the font matching
jdaggett@7099 5533 rules to select the font faces that match the <var>font style</var>. In
jdaggett@7099 5534 the case where these are font faces defined via <code>@font-face</code>
jdaggett@7099 5535 rules, the use of ‘<a href="#descdef-unicode-range"><code
jdaggett@7099 5536 class=property>unicode-range</code></a>’ means that this may be more
jdaggett@7099 5537 than just a single font face.
jdaggett@7099 5538
jdaggett@7099 5539 <li>Remove from the set of font faces all faces that have defined ‘<a
jdaggett@7099 5540 href="#descdef-unicode-range"><code
jdaggett@7099 5541 class=property>unicode-range</code></a>’ values that don't intersect
jdaggett@7099 5542 the range of character values in the <code class=idl-code>text</code>
jdaggett@7356 5543 parameter and set this to be the <var>font load list</var>.
jdaggett@7356 5544
jdaggett@7356 5545 <li>If the <var>font load list</var> contains no font faces, return <code
jdaggett@7356 5546 class=idl-code>false</code>.
jdaggett@7356 5547
jdaggett@7356 5548 <li>If all fonts in the <var>font load list</var> have already
jdaggett@7356 5549 successfully been loaded, return <code class=idl-code>true</code>.
jdaggett@7356 5550 Otherwise, return <code class=idl-code>false</code>.
jdaggett@7099 5551 </ol>
jdaggett@7099 5552
jdaggett@7356 5553 <p>The <code class=idl-code>font</code> parameter of <code
jdaggett@7356 5554 class=idl-code>checkFont</code> and the <code class=idl-code>font</code>
jdaggett@7356 5555 member of <code class=idl-code>params</code> parameter of <code
jdaggett@7356 5556 class=idl-code>loadFont</code> both specify the list of fonts to load.
jdaggett@7356 5557 These values must be parsed using the same syntax as values for the CSS
jdaggett@7356 5558 ‘<a href="#propdef-font"><code class=property>font</code></a>’
jdaggett@7356 5559 property, the same way the <code class=idl-code>font</code> attribute of
jdaggett@7356 5560 the <code>CanvasRenderingContext2D</code> is interpreted. <a href="#HTML5"
jdaggett@7356 5561 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> This yields a list of font
jdaggett@7356 5562 families along with font style attributes.
jdaggett@7356 5563
jdaggett@7099 5564 <p>Because the number of fonts loaded depends on the how many fonts are
jdaggett@7099 5565 used for a given piece of text, in some cases whether fonts need to be
jdaggett@7099 5566 loaded or not may not be known. The <a
jdaggett@7099 5567 id=fontloader-notifywhenfontsready><code
jdaggett@7099 5568 class=idl-code>notifyWhenFontsReady</code></a> method provides a way for
jdaggett@7099 5569 authors to avoid having to keep track of which fonts have or haven't been
jdaggett@7099 5570 loaded before examining content affected by which font is used.
jdaggett@7099 5571
jdaggett@7099 5572 <p>The <code class=idl-code>notifyWhenFontsReady(fontsReadyCallback)</code>
jdaggett@7099 5573 method must use these steps:
jdaggett@7099 5574
jdaggett@7099 5575 <ol>
jdaggett@7099 5576 <li>Let <var>font loader</var> be the value of the <code
jdaggett@7099 5577 class=idl-code>fontloader</code> attribute of <var>doc</var>.
jdaggett@7099 5578
jdaggett@7099 5579 <li>Add the value of the <code class=idl-code>fontsReadyCallback</code>
jdaggett@7099 5580 parameter to the <var>notify</var> callback list of the <var>font
jdaggett@7099 5581 loader</var> and return.
jdaggett@7099 5582
jdaggett@7099 5583 <li>Once all pending layout operations have completed, determine whether
jdaggett@7099 5584 font resources need to be loaded.
jdaggett@7099 5585
jdaggett@7099 5586 <li>If no loads are in progress, copy the contents of the
jdaggett@7099 5587 <var>notify</var> callback list to the <var>notify pending</var> list of
jdaggett@7356 5588 the <var>font loader</var> and clear out the <var>notify</var> list.
jdaggett@7356 5589 After the <code class=idl-code>"loadingdone"</code> event fires, call
jdaggett@7356 5590 each of the callbacks in the <var>notify pending</var> list and clear out
jdaggett@7356 5591 the <var>notify pending</var> list.
jdaggett@7356 5592
jdaggett@7356 5593 <li>Otherwise, after all font loads complete and subsequent layout
jdaggett@7356 5594 operations finish, again check whether loads are in progress. If no loads
jdaggett@7356 5595 are in progress, execute the previous step. If fonts are still loading,
jdaggett@7356 5596 continue waiting until those loads complete and repeat this step.
jdaggett@7099 5597 </ol>
jdaggett@7099 5598
jdaggett@7099 5599 <p>Authors should note here that the callback only fires once, the method
jdaggett@7099 5600 needs to be called again when further font loads might occur. This method
jdaggett@7099 5601 is similar to the callback function of the <code
jdaggett@7099 5602 class=idl-code>"loadingdone"</code> event handler, except that in this
jdaggett@7099 5603 case the callback will <strong>always</strong> get called, even when no
jdaggett@7099 5604 font loads occur because the fonts in question are already loaded. It's a
jdaggett@7099 5605 simple, easy way to sync code to font loads without the need to keep track
jdaggett@7099 5606 of what fonts are needed and precisely when they load.
jdaggett@7099 5607
jdaggett@7356 5608 <p>Note that the user agent may need to iterate over multiple font loads
jdaggett@7356 5609 before the notify callback is called. This can occur with font fallback
jdaggett@7356 5610 situations, where one font in the fontlist is loaded but doesn't contain a
jdaggett@7356 5611 particular glyph and other fonts in the fontlist need to be loaded. The
jdaggett@7356 5612 notify callback only fires after layout operations complete and no
jdaggett@7356 5613 additional font loads are necessary.
jdaggett@7099 5614
jdaggett@7099 5615 <h3 id=font-load-event-examples><span class=secno>9.3 </span>Font load
jdaggett@7099 5616 event examples</h3>
jdaggett@7099 5617
jdaggett@7099 5618 <div class=example>
jdaggett@7099 5619 <p>To show content only after all font loads complete:</p>
jdaggett@7099 5620
jdaggett@7099 5621 <pre> document.fontloader.onloadingdone = function() {
jdaggett@7099 5622 var content = document.getElementById("content");
jdaggett@7099 5623 content.style.visibility = "visible";
jdaggett@7099 5624 }
jdaggett@7099 5625 </pre>
jdaggett@7099 5626 </div>
jdaggett@7099 5627
jdaggett@7099 5628 <div class=example>
jdaggett@7099 5629 <p>Drawing text in a canvas with a downloadable font, explicitly
jdaggett@7099 5630 initiating the font download and drawing upon completion:</p>
jdaggett@7099 5631
jdaggett@7099 5632 <pre> function drawStuff() {
jdaggett@7099 5633 var ctx = document.getElementById("c").getContext("2d");
jdaggett@7099 5634
jdaggett@7099 5635 ctx.fillStyle = "red";
jdaggett@7099 5636 ctx.font = "50px MyDownloadableFont";
jdaggett@7099 5637 ctx.fillText("Hello!", 100, 100);
jdaggett@7099 5638 }
jdaggett@7099 5639
jdaggett@7356 5640 document.fontloader.loadFont({font: "50px MyDownloadableFont",
jdaggett@7356 5641 onsuccess: drawStuff,
jdaggett@7356 5642 onerror: handleError});</pre>
jdaggett@7099 5643 </div>
jdaggett@7099 5644
jdaggett@7099 5645 <div class=example>
jdaggett@7099 5646 <p>A rich text editing application may need to measure text elements after
jdaggett@7099 5647 editing operations have taken place. Since style changes may or may not
jdaggett@7099 5648 require additional fonts to be downloaded, or the fonts may already have
jdaggett@7099 5649 been downloaded, the measurement procedures need to occur after those
jdaggett@7099 5650 font loads complete:</p>
jdaggett@7099 5651
jdaggett@7099 5652 <pre> function measureTextElements() {
jdaggett@7099 5653 // contents can now be measured using the metrics of
jdaggett@7099 5654 // the downloadable font(s)
jdaggett@7099 5655 }
jdaggett@7099 5656
jdaggett@7099 5657 function doEditing() {
jdaggett@7099 5658
jdaggett@7099 5659 // content/layout operations that may cause additional font loads
jdaggett@7099 5660
jdaggett@7099 5661 document.fontloader.notifyWhenFontsReady(measureTextElements);
jdaggett@7099 5662 }
jdaggett@7099 5663 </pre>
jdaggett@7099 5664 </div>
jdaggett@1269 5665
jdaggett@2637 5666 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
jdaggett@1661 5667 properties to CSS properties</h2>
jdaggett@1643 5668
jdaggett@1643 5669 <p><em>This appendix is included as background for some of the problems and
jdaggett@1153 5670 situations that are described in other sections. It should be viewed as
jdaggett@1153 5671 informative only.</em>
jdaggett@1153 5672
jdaggett@1153 5673 <p>Font properties in CSS are designed to be independent of the underlying
jdaggett@1153 5674 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
jdaggett@1153 5675 SVG fonts in addition to the common TrueType and OpenType fonts. But there
jdaggett@1269 5676 are facets of the TrueType and OpenType formats that often cause confusion
jdaggett@2535 5677 for authors and present challenges to implementers on different platforms.
jdaggett@1269 5678
jdaggett@1269 5679 <p>Originally developed at Apple, TrueType was designed as an outline font
jdaggett@1269 5680 format for both screen and print. Microsoft joined Apple in developing the
jdaggett@1269 5681 TrueType format and both platforms have supported TrueType fonts since
jdaggett@1269 5682 then. Font data in the TrueType format consists of a set of tables
jdaggett@1269 5683 distinguished with common four-letter tag names, each containing a
jdaggett@1269 5684 specific type of data. For example, naming information, including
jdaggett@1269 5685 copyright and license information, is stored in the ‘<code
jdaggett@7356 5686 class=property>name</code>’ table. The <a
jdaggett@7356 5687 href="#character-map"><em>character map</em></a> (‘<code
jdaggett@1269 5688 class=property>cmap</code>’) table contains a mapping of character
jdaggett@1269 5689 encodings to glyphs. Apple later added additional tables for supporting
jdaggett@1269 5690 enhanced typographic functionality; these are now called Apple Advanced
jdaggett@1269 5691 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
jdaggett@1643 5692 tables for advanced typography and called their format OpenType <a
jdaggett@1643 5693 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
jdaggett@1153 5694
jdaggett@1153 5695 <p>In many cases the font data used under Microsoft Windows or Linux is
jdaggett@1153 5696 slightly different from the data used under Apple's Mac OS X because the
jdaggett@7099 5697 TrueType format allowed for explicit variation across platforms. This
jdaggett@7356 5698 includes font metrics, names and <a href="#character-map"><em>character
jdaggett@7356 5699 map</em></a> data.
jdaggett@7099 5700
jdaggett@7099 5701 <p>Specifically, font family name data is handled differently across
jdaggett@7099 5702 platforms. For TrueType and OpenType fonts these names are contained in
jdaggett@7099 5703 the ‘<code class=property>name</code>’ table, in name records with
jdaggett@7099 5704 name ID 1. Mulitple names can be stored for different locales but
jdaggett@7099 5705 Microsoft recommends fonts always include at least a US English version of
jdaggett@7099 5706 the name. On Windows, Microsoft made the decision for backwards
jdaggett@7099 5707 compatibility to limit this family name to a maximum of four faces; for
jdaggett@7099 5708 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
jdaggett@7099 5709 ID 21) can be used. Other platforms such as OSX don't have this
jdaggett@7099 5710 limitation, the family name is used to define all possible groupings.
jdaggett@7099 5711
jdaggett@7099 5712 <p>Other name table data provides names used to uniquely identify a
jdaggett@7099 5713 specific face within a family. The full font name (name ID 4) and the
jdaggett@1269 5714 Postscript name (name ID 6) describe a single face uniquely. The bold face
jdaggett@1269 5715 of the Gill Sans family has a fullname of "Gill Sans Bold" and a
jdaggett@1269 5716 Postscript name of "GillSans-Bold". There can be multiple localized
jdaggett@1269 5717 versions of the fullname for a given face but the Postscript name is
jdaggett@1269 5718 always a unique name made from a limited set of ASCII characters.
jdaggett@1269 5719
jdaggett@1269 5720 <p>On various platforms, different names are used to search for a font. For
jdaggett@1269 5721 example, with the Windows GDI CreateIndirectFont API, either a family or
jdaggett@1269 5722 fullname can be used to lookup a face while on Mac OS X the
jdaggett@1269 5723 ATSFontFindFromName and ATSFontFindFromPostScriptName API calls are used
jdaggett@1269 5724 to lookup a given face using the fullname and Postscript name. Under
jdaggett@1269 5725 Linux, the fontconfig API allows fonts to be searched using any of these
jdaggett@1269 5726 names. In situations where platform API's automatically substitute other
jdaggett@1269 5727 font choices, it may be necessary to verify a returned font matches a
jdaggett@1269 5728 given name.
jdaggett@1269 5729
jdaggett@1269 5730 <p>The weight of a given face can be determined via the usWeightClass field
jdaggett@1269 5731 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
jdaggett@1269 5732 the width can be determined via the usWidthClass of the OS/2 table or
jdaggett@7099 5733 inferred from the style name. For historical reasons related to synthetic
jdaggett@7099 5734 bolding at weights 200 or lower with the Windows GDI API, font designers
jdaggett@7099 5735 have sometimes skewed values in the OS/2 table to avoid these weights.
jdaggett@1269 5736
jdaggett@1269 5737 <p>Rendering complex scripts that use contextual shaping such as Thai,
jdaggett@1269 5738 Arabic and Devanagari requires features present only in OpenType or AAT
jdaggett@1269 5739 fonts. Currently, complex script rendering is supported on Windows and
jdaggett@1269 5740 Linux using OpenType font features while AAT font features are used under
jdaggett@2528 5741 Mac OS X. Apple has indicated it intends to support complex script
jdaggett@2528 5742 rendering using OpenType font features in the future.
jdaggett@1269 5743
jdaggett@2528 5744 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
jdaggett@2528 5745
jdaggett@2528 5746 <h3 class=no-num id=recent-changes> Changes from the <a
jdaggett@7356 5747 href="http://www.w3.org/TR/2012/WD-css3-fonts-20121211/">December 2012
jdaggett@7356 5748 CSS3 Fonts Working Draft</a></h3>
jdaggett@2528 5749
jdaggett@2528 5750 <p>Major changes include:
jdaggett@2528 5751
jdaggett@2528 5752 <ul>
jdaggett@7356 5753 <li><code>loadFont</code> method takes a dictionary parameter that
jdaggett@7356 5754 includes callbacks
jdaggett@7356 5755
jdaggett@7356 5756 <li>Added example of system font names used as normal font family name
jdaggett@7356 5757
jdaggett@7356 5758 <li>Added conformance section
jdaggett@7356 5759
jdaggett@7356 5760 <li>Added CORS cross-origin request algorithm parameters
jdaggett@7356 5761
jdaggett@7356 5762 <li>Added specification of Unicode caseless matching for font family names
jdaggett@7356 5763 based on WG resolution
jdaggett@7356 5764
jdaggett@7356 5765 <li>Include issue of synthetic oblique angle in CJK vertical text runs
jdaggett@7356 5766
jdaggett@7356 5767 <li>Minor editorial tweaks hither and thither
jdaggett@2528 5768 </ul>
jdaggett@2528 5769
jdaggett@1153 5770 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
jdaggett@1153 5771
jdaggett@1661 5772 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
jdaggett@1661 5773 their help and feedback. John Hudson was kind enough to take the time to
jdaggett@2528 5774 explain the subtleties of OpenType language tags and provided the example
jdaggett@2528 5775 of character variant usage for displaying text on Byzantine seals. Ken
jdaggett@2528 5776 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
jdaggett@2528 5777 and Unicode variation selectors. The idea for supporting font features by
jdaggett@2528 5778 using font-variant subproperties originated with Håkon Wium Lie, Adam
jdaggett@6453 5779 Twardoch and Tal Leming. Elika Etemad supplied some of the initial design
jdaggett@7099 5780 ideas for the <code>@font-feature-values</code> rule. Several members of
jdaggett@7356 5781 the Google Fonts team provided helpful feedback on font load events, as
jdaggett@7356 5782 did Boris Zbarsky, Jonas Sicking and ms2ger. Thanks also to House
jdaggett@7356 5783 Industries for allowing the use of Ed Interlock in the discretionary
jdaggett@7356 5784 ligatures example.
jdaggett@1661 5785
jdaggett@1153 5786 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
jdaggett@1153 5787 that is <em>The Elements of Typographic Style</em>.
jdaggett@1153 5788
jdaggett@7356 5789 <h2 class=no-num id=conformance> Conformance</h2>
jdaggett@7356 5790
jdaggett@7356 5791 <h3 class=no-num id=conventions> Document Conventions</h3>
jdaggett@7356 5792
jdaggett@7356 5793 <p>Conformance requirements are expressed with a combination of descriptive
jdaggett@7356 5794 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
jdaggett@7356 5795 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
jdaggett@7356 5796 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
jdaggett@7356 5797 normative parts of this document are to be interpreted as described in RFC
jdaggett@7356 5798 2119. However, for readability, these words do not appear in all uppercase
jdaggett@7356 5799 letters in this specification.
jdaggett@7356 5800
jdaggett@7356 5801 <p>All of the text of this specification is normative except sections
jdaggett@7356 5802 explicitly marked as non-normative, examples, and notes. <a
jdaggett@7356 5803 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
jdaggett@7356 5804
jdaggett@7356 5805 <p>Examples in this specification are introduced with the words “for
jdaggett@7356 5806 example” or are set apart from the normative text with
jdaggett@7356 5807 <code>class="example"</code>, like this:
jdaggett@7356 5808
jdaggett@7356 5809 <div class=example>
jdaggett@7356 5810 <p>This is an example of an informative example.
jdaggett@7356 5811 </div>
jdaggett@7356 5812
jdaggett@7356 5813 <p>Informative notes begin with the word “Note” and are set apart from
jdaggett@7356 5814 the normative text with <code>class="note"</code>, like this:
jdaggett@7356 5815
jdaggett@7356 5816 <p class=note>Note, this is an informative note.
jdaggett@7356 5817
jdaggett@7356 5818 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
jdaggett@7356 5819
jdaggett@7356 5820 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
jdaggett@7356 5821 classes:
jdaggett@7356 5822
jdaggett@7356 5823 <dl>
jdaggett@7356 5824 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
jdaggett@7356 5825 sheet</dfn>
jdaggett@7356 5826
jdaggett@7356 5827 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
jdaggett@7356 5828 style sheet</a>.
jdaggett@7356 5829
jdaggett@7356 5830 <dt><dfn id=renderer>renderer</dfn>
jdaggett@7356 5831
jdaggett@7356 5832 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jdaggett@7356 5833 that interprets the semantics of a style sheet and renders documents that
jdaggett@7356 5834 use them.
jdaggett@7356 5835
jdaggett@7356 5836 <dt><dfn id=authoring-tool>authoring tool</dfn>
jdaggett@7356 5837
jdaggett@7356 5838 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jdaggett@7356 5839 that writes a style sheet.
jdaggett@7356 5840 </dl>
jdaggett@7356 5841
jdaggett@7356 5842 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
jdaggett@7356 5843 declarations that use properties defined in this module have values that
jdaggett@7356 5844 are valid according to the generic CSS grammar and the individual grammars
jdaggett@7356 5845 of each property as given in this module.
jdaggett@7356 5846
jdaggett@7356 5847 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
jdaggett@7356 5848 interpreting the style sheet as defined by the appropriate specifications,
jdaggett@7356 5849 it supports all the features defined by CSS Fonts Level 3 Module by
jdaggett@7356 5850 parsing them correctly and rendering the document accordingly. However,
jdaggett@7356 5851 the inability of a UA to correctly render a document due to limitations of
jdaggett@7356 5852 the device does not make the UA non-conformant. (For example, a UA is not
jdaggett@7356 5853 required to render color on a monochrome monitor.)
jdaggett@7356 5854
jdaggett@7356 5855 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
jdaggett@7356 5856 style sheets that are syntactically correct according to the generic CSS
jdaggett@7356 5857 grammar and the individual grammars of each feature in this module, and
jdaggett@7356 5858 meet all other conformance requirements of style sheets as described in
jdaggett@7356 5859 this module.
jdaggett@7356 5860
jdaggett@7356 5861 <h3 class=no-num id=partial> Partial Implementations</h3>
jdaggett@7356 5862
jdaggett@7356 5863 <p>So that authors can exploit the forward-compatible parsing rules to
jdaggett@7356 5864 assign fallback values, CSS renderers <strong>must</strong> treat as
jdaggett@7356 5865 invalid (and <a
jdaggett@7356 5866 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
jdaggett@7356 5867 appropriate</a>) any at-rules, properties, property values, keywords, and
jdaggett@7356 5868 other syntactic constructs for which they have no usable level of support.
jdaggett@7356 5869 In particular, user agents <strong>must not</strong> selectively ignore
jdaggett@7356 5870 unsupported component values and honor supported values in a single
jdaggett@7356 5871 multi-value property declaration: if any value is considered invalid (as
jdaggett@7356 5872 unsupported values must be), CSS requires that the entire declaration be
jdaggett@7356 5873 ignored.
jdaggett@7356 5874
jdaggett@7356 5875 <h3 class=no-num id=experimental> Experimental Implementations</h3>
jdaggett@7356 5876
jdaggett@7356 5877 <p>To avoid clashes with future CSS features, the CSS2.1 specification
jdaggett@7356 5878 reserves a <a
jdaggett@7356 5879 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
jdaggett@7356 5880 syntax</a> for proprietary and experimental extensions to CSS.
jdaggett@7356 5881
jdaggett@7356 5882 <p>Prior to a specification reaching the Candidate Recommendation stage in
jdaggett@7356 5883 the W3C process, all implementations of a CSS feature are considered
jdaggett@7356 5884 experimental. The CSS Working Group recommends that implementations use a
jdaggett@7356 5885 vendor-prefixed syntax for such features, including those in W3C Working
jdaggett@7356 5886 Drafts. This avoids incompatibilities with future changes in the draft.
jdaggett@7356 5887
jdaggett@7356 5888 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
jdaggett@7356 5889
jdaggett@7356 5890 <p>Once a specification reaches the Candidate Recommendation stage,
jdaggett@7356 5891 non-experimental implementations are possible, and implementors should
jdaggett@7356 5892 release an unprefixed implementation of any CR-level feature they can
jdaggett@7356 5893 demonstrate to be correctly implemented according to spec.
jdaggett@7356 5894
jdaggett@7356 5895 <p>To establish and maintain the interoperability of CSS across
jdaggett@7356 5896 implementations, the CSS Working Group requests that non-experimental CSS
jdaggett@7356 5897 renderers submit an implementation report (and, if necessary, the
jdaggett@7356 5898 testcases used for that implementation report) to the W3C before releasing
jdaggett@7356 5899 an unprefixed implementation of any CSS features. Testcases submitted to
jdaggett@7356 5900 W3C are subject to review and correction by the CSS Working Group.
jdaggett@7356 5901
jdaggett@7356 5902 <p>Further information on submitting testcases and implementation reports
jdaggett@7356 5903 can be found from on the CSS Working Group's website at <a
jdaggett@7356 5904 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
jdaggett@7356 5905 Questions should be directed to the <a
jdaggett@7356 5906 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
jdaggett@7356 5907 mailing list.
jdaggett@7356 5908
jdaggett@1153 5909 <h2 class=no-num id=references>References</h2>
jdaggett@1153 5910
jdaggett@1661 5911 <h3 class=no-num id=normative-references>Normative References</h3>
jdaggett@1153 5912 <!--begin-normative-->
jdaggett@1153 5913 <!-- Sorted by label -->
jdaggett@1153 5914
jdaggett@1153 5915 <dl class=bibliography>
jdaggett@1153 5916 <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
jdaggett@1153 5917 <!---->
jdaggett@1153 5918
jdaggett@2528 5919 <dt id=CHARMOD>[CHARMOD]
jdaggett@2528 5920
jdaggett@2528 5921 <dd>Martin J. Dürst; et al. <a
jdaggett@2737 5922 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
jdaggett@2528 5923 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
jdaggett@2528 5924 2005. W3C Recommendation. URL: <a
jdaggett@2737 5925 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
jdaggett@1643 5926 </dd>
jdaggett@1643 5927 <!---->
jdaggett@1643 5928
jdaggett@2528 5929 <dt id=CORS>[CORS]
jdaggett@2528 5930
jdaggett@2528 5931 <dd>Anne van Kesteren. <a
jdaggett@7356 5932 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
jdaggett@7356 5933 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
jdaggett@7356 5934 Recommendation. (Work in progress.) URL: <a
jdaggett@7356 5935 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
jdaggett@2528 5936 </dd>
jdaggett@2528 5937 <!---->
jdaggett@2528 5938
jdaggett@3534 5939 <dt id=CSS21>[CSS21]
jdaggett@3534 5940
jdaggett@3534 5941 <dd>Bert Bos; et al. <a
jdaggett@7356 5942 href="http://www.w3.org/TR/2011/REC-CSS2-20110607/"><cite>Cascading Style
jdaggett@3534 5943 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
jdaggett@3534 5944 2011. W3C Recommendation. URL: <a
jdaggett@7356 5945 href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a>
jdaggett@6453 5946 </dd>
jdaggett@6453 5947 <!---->
jdaggett@6453 5948
jdaggett@6453 5949 <dt id=CSS3VAL>[CSS3VAL]
jdaggett@6453 5950
jdaggett@6453 5951 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
jdaggett@7099 5952 href="http://www.w3.org/TR/2012/CR-css3-values-20120828/"><cite>CSS
jdaggett@7099 5953 Values and Units Module Level 3.</cite></a> 28 August 2012. W3C Candidate
jdaggett@7099 5954 Recommendation. (Work in progress.) URL: <a
jdaggett@7099 5955 href="http://www.w3.org/TR/2012/CR-css3-values-20120828/">http://www.w3.org/TR/2012/CR-css3-values-20120828/</a>
jdaggett@3534 5956 </dd>
jdaggett@3534 5957 <!---->
jdaggett@3534 5958
jdaggett@1643 5959 <dt id=HTML5>[HTML5]
jdaggett@1643 5960
jdaggett@2528 5961 <dd>Ian Hickson. <a
jdaggett@7356 5962 href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
jdaggett@7356 5963 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
jdaggett@7356 5964 <a
jdaggett@7356 5965 href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
jdaggett@1643 5966 </dd>
jdaggett@1643 5967 <!---->
jdaggett@1643 5968
jdaggett@1643 5969 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
jdaggett@1643 5970
jdaggett@1643 5971 <dd><a
jdaggett@1643 5972 href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip"><cite>Information
jdaggett@1643 5973 technology — Coding of audio-visual objects — Part 22: Open Font
jdaggett@1643 5974 Format.</cite></a> International Organization for Standardization.
jdaggett@1643 5975 ISO/IEC 14496-22:2009. URL: <a
jdaggett@1643 5976 href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip</a>
jdaggett@1643 5977 </dd>
jdaggett@1643 5978 <!---->
jdaggett@1643 5979
jdaggett@1643 5980 <dt id=OPENTYPE>[OPENTYPE]
jdaggett@1643 5981
jdaggett@1643 5982 <dd><a
jdaggett@1643 5983 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
jdaggett@1643 5984 specification.</cite></a> Microsoft. URL: <a
jdaggett@1643 5985 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
jdaggett@1643 5986 </dd>
jdaggett@1643 5987 <!---->
jdaggett@1643 5988
jdaggett@1643 5989 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
jdaggett@1643 5990
jdaggett@1643 5991 <dd><a
jdaggett@1643 5992 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
jdaggett@1643 5993 feature registry.</cite></a> Microsoft. URL: <a
jdaggett@1643 5994 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
jdaggett@1643 5995 </dd>
jdaggett@1643 5996 <!---->
jdaggett@1643 5997
jdaggett@7356 5998 <dt id=RFC2119>[RFC2119]
jdaggett@7356 5999
jdaggett@7356 6000 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
jdaggett@7356 6001 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
jdaggett@7356 6002 RFC 2119. URL: <a
jdaggett@7356 6003 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
jdaggett@2528 6004 </dd>
jdaggett@2528 6005 <!---->
jdaggett@2528 6006
jdaggett@7356 6007 <dt id=UAX15>[UAX15]
jdaggett@7356 6008
jdaggett@7356 6009 <dd>Mark Davis; Ken Whistler. <a
jdaggett@7356 6010 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
jdaggett@7356 6011 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
jdaggett@7356 6012 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
jdaggett@7356 6013 </dd>
jdaggett@7356 6014 <!---->
jdaggett@7356 6015
jdaggett@2528 6016 <dt id=UAX29>[UAX29]
jdaggett@2528 6017
jdaggett@2528 6018 <dd>Mark Davis. <a
jdaggett@6453 6019 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
jdaggett@7356 6020 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
jdaggett@2528 6021 URL: <a
jdaggett@6453 6022 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
jdaggett@2528 6023 </dd>
jdaggett@2528 6024 <!---->
jdaggett@2528 6025
jdaggett@3534 6026 <dt id=UNICODE6>[UNICODE6]
jdaggett@1153 6027
jdaggett@1153 6028 <dd>The Unicode Consortium. <a
jdaggett@7356 6029 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
jdaggett@7356 6030 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
jdaggett@7356 6031 Version 6.2.0 URL: <a
jdaggett@7356 6032 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
jdaggett@1153 6033 </dd>
jdaggett@1153 6034 <!---->
jdaggett@1153 6035 </dl>
jdaggett@1153 6036 <!--end-normative-->
jdaggett@3534 6037 <!--{{!CSS21}}-->
jdaggett@6453 6038 <!--{{!CSS3VAL}}-->
jdaggett@1643 6039 <!--{{!OPENTYPE}}-->
jdaggett@1643 6040 <!--{{!OPENTYPE-FEATURES}}-->
jdaggett@1643 6041 <!--{{!OPEN-FONT-FORMAT}}-->
jdaggett@3534 6042 <!--{{!UNICODE6}}-->
jdaggett@2528 6043 <!--{{!UAX15}}-->
jdaggett@2528 6044 <!--{{!UAX29}}-->
jdaggett@2528 6045 <!--{{!CORS}}-->
jdaggett@1643 6046 <!--{{!HTML5}}-->
jdaggett@2528 6047 <!--{{!CHARMOD}}-->
jdaggett@1153 6048
jdaggett@1661 6049 <h3 class=no-num id=other-references>Other References</h3>
jdaggett@1153 6050 <!--begin-informative-->
jdaggett@1153 6051 <!-- Sorted by label -->
jdaggett@1153 6052
jdaggett@1153 6053 <dl class=bibliography>
jdaggett@1153 6054 <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
jdaggett@1153 6055 <!---->
jdaggett@1153 6056
jdaggett@3534 6057 <dt id=AAT-FEATURES>[AAT-FEATURES]
jdaggett@3534 6058
jdaggett@3534 6059 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
jdaggett@3534 6060 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
jdaggett@3534 6061 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
jdaggett@3534 6062 </dd>
jdaggett@3534 6063 <!---->
jdaggett@3534 6064
jdaggett@1153 6065 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
jdaggett@1153 6066
jdaggett@1153 6067 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
jdaggett@1153 6068 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
jdaggett@1153 6069 <!---->
jdaggett@1153 6070
jdaggett@3534 6071 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
jdaggett@3534 6072
jdaggett@3534 6073 <dd>François Yergeau; et al. <a
jdaggett@6453 6074 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
jdaggett@6453 6075 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
jdaggett@6453 6076 W3C Working Draft. (Work in progress.) URL: <a
jdaggett@6453 6077 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
jdaggett@3534 6078 </dd>
jdaggett@3534 6079 <!---->
jdaggett@3534 6080
jdaggett@2528 6081 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
jdaggett@2528 6082
jdaggett@2528 6083 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
jdaggett@2528 6084 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
jdaggett@2528 6085 <!---->
jdaggett@2528 6086
jdaggett@3534 6087 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
jdaggett@3534 6088
jdaggett@3534 6089 <dd>L. David Baron. <a
jdaggett@7356 6090 href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/"><cite>CSS
jdaggett@7356 6091 Conditional Rules Module Level 3.</cite></a> 13 December 2012. W3C
jdaggett@3534 6092 Working Draft. (Work in progress.) URL: <a
jdaggett@7356 6093 href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">http://www.w3.org/TR/2012/WD-css3-conditional-20121213/</a>
jdaggett@7099 6094 </dd>
jdaggett@7099 6095 <!---->
jdaggett@7099 6096
jdaggett@7099 6097 <dt id=CSS3TEXT>[CSS3TEXT]
jdaggett@7099 6098
jdaggett@7099 6099 <dd>Elika J. Etemad; Koji Ishii. <a
jdaggett@7099 6100 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
jdaggett@7099 6101 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
jdaggett@7099 6102 progress.) URL: <a
jdaggett@7099 6103 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
jdaggett@3534 6104 </dd>
jdaggett@3534 6105 <!---->
jdaggett@3534 6106
jdaggett@2528 6107 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
jdaggett@2528 6108
jdaggett@2528 6109 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
jdaggett@2528 6110 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
jdaggett@2528 6111 ISBN 0-201-17633-5.</dd>
jdaggett@2528 6112 <!---->
jdaggett@2528 6113
jdaggett@7099 6114 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
jdaggett@7099 6115
jdaggett@7099 6116 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
jdaggett@7356 6117 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
jdaggett@7099 6118 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
jdaggett@7099 6119 2000. W3C Recommendation. URL: <a
jdaggett@7356 6120 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/">http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/</a>
jdaggett@7099 6121 </dd>
jdaggett@7099 6122 <!---->
jdaggett@7099 6123
jdaggett@1153 6124 <dt id=ELEMTYPO>[ELEMTYPO]
jdaggett@1153 6125
jdaggett@1153 6126 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
jdaggett@1153 6127 3.1.</cite> Hartley &amp; Marks. 2005. ISBN 0-88179-206-3.</dd>
jdaggett@1153 6128 <!---->
jdaggett@1153 6129
jdaggett@1153 6130 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
jdaggett@1153 6131
jdaggett@1153 6132 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
jdaggett@1153 6133 ISBN 1-932026-01-0.</dd>
jdaggett@1153 6134 <!---->
jdaggett@1643 6135
jdaggett@1643 6136 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
jdaggett@1643 6137
jdaggett@1643 6138 <dd><a
jdaggett@3535 6139 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
jdaggett@1643 6140 User Guide.</cite></a> FontShop International. URL: <a
jdaggett@3535 6141 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
jdaggett@1643 6142 </dd>
jdaggett@1643 6143 <!---->
jdaggett@2528 6144
jdaggett@2528 6145 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
jdaggett@2528 6146
jdaggett@2528 6147 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
jdaggett@7099 6148 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
jdaggett@2528 6149 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
jdaggett@2528 6150 <!---->
jdaggett@2528 6151
jdaggett@2528 6152 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
jdaggett@2528 6153
jdaggett@2528 6154 <dd>John Hudson. <a
jdaggett@2528 6155 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
jdaggett@2528 6156 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
jdaggett@2528 6157 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
jdaggett@2528 6158 </dd>
jdaggett@2528 6159 <!---->
jdaggett@1153 6160 </dl>
jdaggett@1153 6161 <!--end-informative-->
jdaggett@1153 6162 <!--{{ARABIC-TYPO}}-->
jdaggett@2528 6163 <!--{{CJKV-INFO-PROCESSING}}-->
jdaggett@2528 6164 <!--{{DIGITAL-TYPOGRAPHY}}-->
jdaggett@7099 6165 <!--{{DOM-LEVEL-2-STYLE}}-->
jdaggett@1153 6166 <!--{{ELEMTYPO}}-->
jdaggett@2528 6167 <!--{{LANGCULTTYPE}}-->
jdaggett@1643 6168 <!--{{OPENTYPE-FONT-GUIDE}}-->
jdaggett@2528 6169 <!--{{RASTER-TRAGEDY}}-->
jdaggett@2528 6170 <!--{{WINDOWS-GLYPH-PROC}}-->
jdaggett@3534 6171 <!--{{CHARMOD-NORM}}-->
jdaggett@3534 6172 <!--{{AAT-FEATURES}}-->
jdaggett@3534 6173 <!--{{CSS3-CONDITIONAL}}-->
jdaggett@7099 6174 <!--{{CSS3TEXT}}-->
jdaggett@1153 6175
jdaggett@1153 6176 <h2 class=no-num id=index>Index</h2>
jdaggett@1153 6177 <!--begin-index-->
jdaggett@1153 6178
jdaggett@1153 6179 <ul class=indexlist>
jdaggett@7099 6180 <li>&lt;absolute-size&gt;, <a href="#ltabsolute-sizegt"
jdaggett@7099 6181 title="&lt;absolute-size&gt;"><strong>3.5</strong></a>
jdaggett@1153 6182
jdaggett@2528 6183 <li><var>&lt;common-lig-values></var>, <a href="#ltcommon-lig-values"
jdaggett@6453 6184 title="&lt;common-lig-values>"><strong>6.4</strong></a>
jdaggett@2737 6185
jdaggett@2528 6186 <li><var>&lt;contextual-alt-values&gt;</var>, <a
jdaggett@2528 6187 href="#ltcontextual-alt-valuesgt"
jdaggett@6453 6188 title="&lt;contextual-alt-values&gt;"><strong>6.4</strong></a>
jdaggett@3534 6189
jdaggett@3534 6190 <li><var>&lt;discretionary-lig-values></var>, <a
jdaggett@3534 6191 href="#ltdiscretionary-lig-values"
jdaggett@6453 6192 title="&lt;discretionary-lig-values>"><strong>6.4</strong></a>
jdaggett@3534 6193
jdaggett@2528 6194 <li><var>&lt;east-asian-variant-values&gt;</var>, <a
jdaggett@2528 6195 href="#lteast-asian-variant-valuesgt"
jdaggett@2528 6196 title="&lt;east-asian-variant-values&gt;"><strong>6.10</strong></a>
jdaggett@2528 6197
jdaggett@2528 6198 <li><var>&lt;east-asian-width-values&gt;</var>, <a
jdaggett@2528 6199 href="#lteast-asian-width-valuesgt"
jdaggett@2528 6200 title="&lt;east-asian-width-values&gt;"><strong>6.10</strong></a>
jdaggett@2528 6201
jdaggett@7099 6202 <li><var>&lt;feature-ident&gt;</var>, <a href="#ltfeature-identgt"
jdaggett@7099 6203 title="&lt;feature-ident&gt;"><strong>6.9</strong></a>
jdaggett@7099 6204
jdaggett@2528 6205 <li><var>&lt;feature-index&gt;</var>, <a href="#ltfeature-indexgt"
jdaggett@2528 6206 title="&lt;feature-index&gt;"><strong>6.9</strong></a>
jdaggett@2528 6207
jdaggett@2528 6208 <li><var>&lt;feature-tag-value&gt;</var>, <a href="#ltfeature-tag-valuegt"
jdaggett@2528 6209 title="&lt;feature-tag-value&gt;"><strong>6.12</strong></a>
jdaggett@2528 6210
jdaggett@7099 6211 <li><var>&lt;feature-type&gt;</var>, <a href="#ltfeature-typegt"
jdaggett@7099 6212 title="&lt;feature-type&gt;"><strong>6.9</strong></a>
jdaggett@7099 6213
jdaggett@7099 6214 <li>&lt;font-description&gt;, <a href="#ltfont-descriptiongt"
jdaggett@7099 6215 title="&lt;font-description&gt;"><strong>4.1</strong></a>
jdaggett@7099 6216
jdaggett@7099 6217 <li>&lt;font-face-name&gt;, <a href="#ltfont-face-namegt"
jdaggett@7099 6218 title="&lt;font-face-name&gt;"><strong>4.3</strong></a>
jdaggett@6453 6219
jdaggett@6453 6220 <li><var>&lt;font-family&gt;</var>, <a href="#ltfont-familygt"
jdaggett@6453 6221 title="&lt;font-family&gt;"><strong>6.9</strong></a>
jdaggett@6453 6222
jdaggett@6453 6223 <li><var>&lt;font-variant-css21&gt;</var>, <a
jdaggett@6453 6224 href="#ltfont-variant-css21gt"
jdaggett@6453 6225 title="&lt;font-variant-css21&gt;"><strong>3.7</strong></a>
jdaggett@6453 6226
jdaggett@6453 6227 <li><var>&lt;historical-lig-values></var>, <a
jdaggett@6453 6228 href="#lthistorical-lig-values"
jdaggett@6453 6229 title="&lt;historical-lig-values>"><strong>6.4</strong></a>
jdaggett@6453 6230
jdaggett@6453 6231 <li>&lt;length&gt;, <a href="#ltlengthgt" title="&lt;length&gt;">3.5</a>
jdaggett@6453 6232
jdaggett@6453 6233 <li>&lt;number&gt;, <a href="#ltnumbergt" title="&lt;number&gt;">3.6</a>
jdaggett@6453 6234
jdaggett@6453 6235 <li><var>&lt;numeric-figure-values&gt;</var>, <a
jdaggett@6453 6236 href="#ltnumeric-figure-valuesgt"
jdaggett@6453 6237 title="&lt;numeric-figure-values&gt;"><strong>6.7</strong></a>
jdaggett@6453 6238
jdaggett@6453 6239 <li><var>&lt;numeric-fraction-values&gt;</var>, <a
jdaggett@6453 6240 href="#ltnumeric-fraction-valuesgt"
jdaggett@6453 6241 title="&lt;numeric-fraction-values&gt;"><strong>6.7</strong></a>
jdaggett@6453 6242
jdaggett@6453 6243 <li><var>&lt;numeric-spacing-values&gt;</var>, <a
jdaggett@6453 6244 href="#ltnumeric-spacing-valuesgt"
jdaggett@6453 6245 title="&lt;numeric-spacing-values&gt;"><strong>6.7</strong></a>
jdaggett@6453 6246
jdaggett@6453 6247 <li>&lt;percentage&gt;, <a href="#ltpercentagegt-"
jdaggett@6453 6248 title="&lt;percentage&gt;">3.5</a>
jdaggett@6453 6249
jdaggett@7099 6250 <li>&lt;relative-size&gt;, <a href="#ltrelative-sizegt"
jdaggett@7099 6251 title="&lt;relative-size&gt;"><strong>3.5</strong></a>
jdaggett@7099 6252
jdaggett@7099 6253 <li>&lt;urange&gt;, <a href="#lturangegt"
jdaggett@7099 6254 title="&lt;urange&gt;"><strong>4.5</strong></a>
jdaggett@1153 6255
jdaggett@1153 6256 <li>@font-face, <a href="#font-face"
jdaggett@1661 6257 title="@font-face"><strong>4.1</strong></a>, <a href="#font-face0"
jdaggett@1661 6258 title="@font-face">4.1</a>, <a href="#font-face1"
jdaggett@1661 6259 title="@font-face">4.3</a>
jdaggett@1153 6260
jdaggett@6453 6261 <li>all-petite-caps, <a href="#all-petite-caps"
jdaggett@6453 6262 title=all-petite-caps><strong>6.6</strong></a>
jdaggett@6453 6263
jdaggett@6453 6264 <li>all-small-caps, <a href="#all-small-caps"
jdaggett@6453 6265 title=all-small-caps><strong>6.6</strong></a>
jdaggett@6453 6266
jdaggett@7099 6267 <li>annotation, <a href="#annotationltfeature-value-namegt"
jdaggett@7099 6268 title=annotation><strong>6.8</strong></a>
jdaggett@6453 6269
jdaggett@6453 6270 <li>aspect value, <a href="#aspect-value0" title="aspect
jdaggett@6453 6271 value"><strong>3.6</strong></a>
jdaggett@6453 6272
jdaggett@6453 6273 <li>at-rules, <a href="#at-rule" title=at-rules>4.1</a>
jdaggett@6453 6274
jdaggett@7356 6275 <li>authoring tool, <a href="#authoring-tool" title="authoring
jdaggett@7356 6276 tool"><strong>#</strong></a>
jdaggett@7356 6277
jdaggett@7356 6278 <li>character map, <a href="#character-map" title="character
jdaggett@7356 6279 map"><strong>5.2</strong></a>
jdaggett@7356 6280
jdaggett@7099 6281 <li>character-variant, <a href="#character-variantltfeature-value-namegt"
jdaggett@7099 6282 title=character-variant><strong>6.8</strong></a>
jdaggett@6453 6283
jdaggett@6453 6284 <li>common-ligatures, <a href="#common-ligatures"
jdaggett@6453 6285 title=common-ligatures><strong>6.4</strong></a>
jdaggett@6453 6286
jdaggett@6453 6287 <li>contextual, <a href="#contextual"
jdaggett@6453 6288 title=contextual><strong>6.4</strong></a>
jdaggett@6453 6289
jdaggett@7099 6290 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
jdaggett@7099 6291 title=CSSFontFaceRule><strong>8.1</strong></a>
jdaggett@7099 6292
jdaggett@7099 6293 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
jdaggett@7099 6294 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
jdaggett@7099 6295
jdaggett@6453 6296 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
jdaggett@6453 6297 of"><strong>#</strong></a>
jdaggett@6453 6298
jdaggett@7356 6299 <li>default face, <a href="#default-face" title="default
jdaggett@7356 6300 face"><strong>5.2</strong></a>
jdaggett@7356 6301
jdaggett@6453 6302 <li>diagonal-fractions, <a href="#diagonal-fractions"
jdaggett@6453 6303 title=diagonal-fractions><strong>6.7</strong></a>
jdaggett@6453 6304
jdaggett@6453 6305 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
jdaggett@6453 6306 title=discretionary-ligatures><strong>6.4</strong></a>
jdaggett@6453 6307
jdaggett@6453 6308 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
jdaggett@6453 6309 of"><strong>#</strong></a>
jdaggett@6453 6310
jdaggett@7099 6311 <li>fire a font load event, <a href="#fire-a-font-load-event" title="fire
jdaggett@7099 6312 a font load event"><strong>9.2.1</strong></a>
jdaggett@7099 6313
jdaggett@6453 6314 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
jdaggett@1153 6315
jdaggett@7099 6316 <li>font load, <a href="#font-load" title="font
jdaggett@7099 6317 load"><strong>9.2</strong></a>
jdaggett@7099 6318
jdaggett@1661 6319 <li>font-family, <a href="#descdef-font-family"
jdaggett@6453 6320 title=font-family><strong>4.2</strong></a>, <a
jdaggett@1661 6321 href="#propdef-font-family" title=font-family><strong>3.1</strong></a>
jdaggett@1661 6322
jdaggett@7099 6323 <li>font-feature-settings, <a href="#propdef-font-feature-settings"
jdaggett@2528 6324 title=font-feature-settings><strong>6.12</strong></a>
jdaggett@1661 6325
jdaggett@7099 6326 <li>font-feature-settings (descriptor), <a
jdaggett@7099 6327 href="#descdef-font-feature-settings" title="font-feature-settings
jdaggett@7099 6328 (descriptor)"><strong>4.6</strong></a>
jdaggett@7099 6329
jdaggett@1661 6330 <li>font-kerning, <a href="#propdef-font-kerning"
jdaggett@2528 6331 title=font-kerning><strong>6.3</strong></a>
jdaggett@2528 6332
jdaggett@2528 6333 <li>font-language-override, <a href="#propdef-font-language-override"
jdaggett@2528 6334 title=font-language-override><strong>6.13</strong></a>
jdaggett@1661 6335
jdaggett@1661 6336 <li>font-size, <a href="#propdef-font-size"
jdaggett@1643 6337 title=font-size><strong>3.5</strong></a>
jdaggett@1153 6338
jdaggett@1661 6339 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
jdaggett@1643 6340 title=font-size-adjust><strong>3.6</strong></a>
jdaggett@1153 6341
jdaggett@7099 6342 <li>font-stretch, <a href="#propdef-font-stretch"
jdaggett@7099 6343 title=font-stretch><strong>3.3</strong></a>
jdaggett@7099 6344
jdaggett@7099 6345 <li>font-stretch (descriptor), <a href="#descdef-font-stretch"
jdaggett@7099 6346 title="font-stretch (descriptor)"><strong>4.4</strong></a>
jdaggett@7099 6347
jdaggett@7099 6348 <li>font-style, <a href="#propdef-font-style"
jdaggett@1661 6349 title=font-style><strong>3.4</strong></a>
jdaggett@1661 6350
jdaggett@7099 6351 <li>font-style (descriptor), <a href="#descdef-font-style"
jdaggett@7099 6352 title="font-style (descriptor)"><strong>4.4</strong></a>
jdaggett@7099 6353
jdaggett@2528 6354 <li>font-synthesis, <a href="#propdef-font-synthesis"
jdaggett@2528 6355 title=font-synthesis><strong>3.8</strong></a>
jdaggett@2528 6356
jdaggett@7099 6357 <li>font-variant, <a href="#propdef-font-variant"
jdaggett@7099 6358 title=font-variant><strong>6.11</strong></a>
jdaggett@7099 6359
jdaggett@7099 6360 <li>font-variant (descriptor), <a href="#descdef-font-variant"
jdaggett@7099 6361 title="font-variant (descriptor)"><strong>4.6</strong></a>
jdaggett@1661 6362
jdaggett@1661 6363 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
jdaggett@2528 6364 title=font-variant-alternates><strong>6.8</strong></a>
jdaggett@1661 6365
jdaggett@1661 6366 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
jdaggett@2528 6367 title=font-variant-caps><strong>6.6</strong></a>
jdaggett@1661 6368
jdaggett@1661 6369 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
jdaggett@2528 6370 title=font-variant-east-asian><strong>6.10</strong></a>
jdaggett@1661 6371
jdaggett@1661 6372 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
jdaggett@6453 6373 title=font-variant-ligatures><strong>6.4</strong></a>
jdaggett@1661 6374
jdaggett@1661 6375 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
jdaggett@2528 6376 title=font-variant-numeric><strong>6.7</strong></a>
jdaggett@1661 6377
jdaggett@3534 6378 <li>font-variant-position, <a href="#propdef-font-variant-position"
jdaggett@6453 6379 title=font-variant-position><strong>6.5</strong></a>
jdaggett@2737 6380
jdaggett@7099 6381 <li>font-weight, <a href="#propdef-font-weight"
jdaggett@7099 6382 title=font-weight><strong>3.2</strong></a>
jdaggett@7099 6383
jdaggett@7099 6384 <li>font-weight (descriptor), <a href="#descdef-font-weight"
jdaggett@7099 6385 title="font-weight (descriptor)"><strong>4.4</strong></a>
jdaggett@1643 6386
jdaggett@1643 6387 <li>full-width, <a href="#full-width"
jdaggett@2528 6388 title=full-width><strong>6.10</strong></a>
jdaggett@1643 6389
jdaggett@1643 6390 <li>historical-forms, <a href="#historical-forms"
jdaggett@2528 6391 title=historical-forms><strong>6.8</strong></a>
jdaggett@1643 6392
jdaggett@1643 6393 <li>historical-ligatures, <a href="#historical-ligatures"
jdaggett@6453 6394 title=historical-ligatures><strong>6.4</strong></a>
jdaggett@2737 6395
jdaggett@2528 6396 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
jdaggett@2528 6397
jdaggett@2528 6398 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
jdaggett@2528 6399
jdaggett@2528 6400 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
jdaggett@2528 6401
jdaggett@2528 6402 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
jdaggett@1643 6403
jdaggett@1643 6404 <li>lining-nums, <a href="#lining-nums"
jdaggett@2528 6405 title=lining-nums><strong>6.7</strong></a>
jdaggett@1153 6406
jdaggett@1153 6407 <li>monospace, definition of, <a href="#monospace0" title="monospace,
jdaggett@1153 6408 definition of"><strong>#</strong></a>
jdaggett@1153 6409
jdaggett@1643 6410 <li>no-common-ligatures, <a href="#no-common-ligatures"
jdaggett@6453 6411 title=no-common-ligatures><strong>6.4</strong></a>
jdaggett@1643 6412
jdaggett@1643 6413 <li>no-contextual, <a href="#no-contextual"
jdaggett@6453 6414 title=no-contextual><strong>6.4</strong></a>
jdaggett@1643 6415
jdaggett@3534 6416 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
jdaggett@6453 6417 title=no-discretionary-ligatures><strong>6.4</strong></a>
jdaggett@3534 6418
jdaggett@1643 6419 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
jdaggett@6453 6420 title=no-historical-ligatures><strong>6.4</strong></a>
jdaggett@6453 6421
jdaggett@6453 6422 <li>normal, <a href="#normal" title=normal><strong>6.6</strong></a>, <a
jdaggett@6453 6423 href="#normal0" title=normal><strong>6.7</strong></a>, <a href="#normal1"
jdaggett@6453 6424 title=normal><strong>6.8</strong></a>, <a href="#normal2"
jdaggett@6453 6425 title=normal><strong>6.10</strong></a>
jdaggett@2737 6426
jdaggett@1643 6427 <li>oldstyle-nums, <a href="#oldstyle-nums"
jdaggett@2528 6428 title=oldstyle-nums><strong>6.7</strong></a>
jdaggett@2528 6429
jdaggett@6453 6430 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
jdaggett@6453 6431
jdaggett@7099 6432 <li>ornaments, <a href="#ornamentsltfeature-value-namegt"
jdaggett@7099 6433 title=ornaments><strong>6.8</strong></a>
jdaggett@1643 6434
jdaggett@1643 6435 <li>petite-caps, <a href="#petite-caps"
jdaggett@2528 6436 title=petite-caps><strong>6.6</strong></a>
jdaggett@1643 6437
jdaggett@1643 6438 <li>proportional-nums, <a href="#proportional-nums"
jdaggett@2528 6439 title=proportional-nums><strong>6.7</strong></a>
jdaggett@1643 6440
jdaggett@1643 6441 <li>proportional-width, <a href="#proportional-width"
jdaggett@2528 6442 title=proportional-width><strong>6.10</strong></a>
jdaggett@2528 6443
jdaggett@7356 6444 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
jdaggett@7356 6445
jdaggett@6453 6446 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
jdaggett@1643 6447
jdaggett@1153 6448 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
jdaggett@1153 6449 definition of"><strong>#</strong></a>
jdaggett@1153 6450
jdaggett@1153 6451 <li>serif, definition of, <a href="#serif0" title="serif, definition
jdaggett@1153 6452 of"><strong>#</strong></a>
jdaggett@1153 6453
jdaggett@1643 6454 <li>simplified, <a href="#simplified"
jdaggett@2528 6455 title=simplified><strong>6.10</strong></a>
jdaggett@1643 6456
jdaggett@1643 6457 <li>slashed-zero, <a href="#slashed-zero"
jdaggett@2528 6458 title=slashed-zero><strong>6.7</strong></a>
jdaggett@1643 6459
jdaggett@1643 6460 <li>small-caps, <a href="#small-caps"
jdaggett@2528 6461 title=small-caps><strong>6.6</strong></a>
jdaggett@1661 6462
jdaggett@1661 6463 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
jdaggett@1643 6464
jdaggett@1643 6465 <li>stacked-fractions, <a href="#stacked-fractions"
jdaggett@2528 6466 title=stacked-fractions><strong>6.7</strong></a>
jdaggett@2528 6467
jdaggett@7356 6468 <li>style sheet
jdaggett@7356 6469 <ul>
jdaggett@7356 6470 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
jdaggett@7356 6471 conformance class"><strong>#</strong></a>
jdaggett@7356 6472 </ul>
jdaggett@7356 6473
jdaggett@7099 6474 <li>styleset, <a href="#stylesetltfeature-value-namegt"
jdaggett@7099 6475 title=styleset><strong>6.8</strong></a>
jdaggett@7099 6476
jdaggett@7099 6477 <li>stylistic, <a href="#stylisticltfeature-value-namegt"
jdaggett@7099 6478 title=stylistic><strong>6.8</strong></a>
jdaggett@7099 6479
jdaggett@7099 6480 <li>swash, <a href="#swashltfeature-value-namegt"
jdaggett@7099 6481 title=swash><strong>6.8</strong></a>
jdaggett@1643 6482
jdaggett@1643 6483 <li>tabular-nums, <a href="#tabular-nums"
jdaggett@2528 6484 title=tabular-nums><strong>6.7</strong></a>
jdaggett@1643 6485
jdaggett@1643 6486 <li>titling-caps, <a href="#titling-caps"
jdaggett@2528 6487 title=titling-caps><strong>6.6</strong></a>
jdaggett@1643 6488
jdaggett@1643 6489 <li>traditional, <a href="#traditional"
jdaggett@2528 6490 title=traditional><strong>6.10</strong></a>
jdaggett@2528 6491
jdaggett@2528 6492 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
jdaggett@1661 6493
jdaggett@1661 6494 <li>unicode-range, <a href="#descdef-unicode-range"
jdaggett@1661 6495 title=unicode-range><strong>4.5</strong></a>
jdaggett@7356 6496
jdaggett@7356 6497 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
jdaggett@7356 6498
jdaggett@7356 6499 <li>width, <a href="#width" title=width><strong>2</strong></a>
jdaggett@1153 6500 </ul>
jdaggett@1153 6501 <!--end-index-->
jdaggett@1153 6502
jdaggett@1153 6503 <h2 class=no-num id=property-index>Property index</h2>
jdaggett@1153 6504 <!--begin-properties-->
jdaggett@1153 6505
jdaggett@1153 6506 <table class=proptable>
jdaggett@1153 6507 <thead>
jdaggett@1153 6508 <tr>
jdaggett@1153 6509 <th>Property
jdaggett@1153 6510
jdaggett@1153 6511 <th>Values
jdaggett@1153 6512
jdaggett@1153 6513 <th>Initial
jdaggett@1153 6514
jdaggett@1153 6515 <th>Applies to
jdaggett@1153 6516
jdaggett@1153 6517 <th>Inh.
jdaggett@1153 6518
jdaggett@1153 6519 <th>Percentages
jdaggett@1153 6520
jdaggett@1153 6521 <th>Media
jdaggett@1153 6522
jdaggett@1153 6523 <tbody>
jdaggett@3534 6524 <tr>
jdaggett@3534 6525 <th><a class=property href="#propdef-font">font</a>
jdaggett@1153 6526
jdaggett@2528 6527 <td>[ [ &lt;‘font-style’> || &lt;font-variant-css21> ||
jdaggett@7099 6528 &lt;‘font-weight’> || &lt;‘font-stretch’> ]?
jdaggett@7099 6529 &lt;‘font-size’> [ / &lt;‘line-height’> ]?
jdaggett@7099 6530 &lt;‘font-family’> ] | caption | icon | menu | message-box |
jdaggett@7099 6531 small-caption | status-bar
jdaggett@1153 6532
jdaggett@1153 6533 <td>see individual properties
jdaggett@1153 6534
jdaggett@1153 6535 <td>all elements
jdaggett@1153 6536
jdaggett@1153 6537 <td>yes
jdaggett@1153 6538
jdaggett@1153 6539 <td>see individual properties
jdaggett@1153 6540
jdaggett@1153 6541 <td>visual
jdaggett@1153 6542
jdaggett@3534 6543 <tr>
jdaggett@3534 6544 <th><a class=property href="#descdef-font-family">font-family</a>
jdaggett@1153 6545
jdaggett@6453 6546 <td>[ &lt;family-name> | &lt;generic-family> ]#
jdaggett@1153 6547
jdaggett@1153 6548 <td>depends on user agent
jdaggett@1153 6549
jdaggett@1153 6550 <td>all elements
jdaggett@1153 6551
jdaggett@1153 6552 <td>yes
jdaggett@1153 6553
jdaggett@1153 6554 <td>N/A
jdaggett@1153 6555
jdaggett@1153 6556 <td>visual
jdaggett@1153 6557
jdaggett@3534 6558 <tr>
jdaggett@3534 6559 <th><a class=property
jdaggett@1661 6560 href="#propdef-font-feature-settings">font-feature-settings</a>
jdaggett@1649 6561
jdaggett@6453 6562 <td>normal | &lt;feature-tag-value&gt;#
jdaggett@1649 6563
jdaggett@1649 6564 <td>normal
jdaggett@1649 6565
jdaggett@1649 6566 <td>all elements
jdaggett@1649 6567
jdaggett@1649 6568 <td>yes
jdaggett@1649 6569
jdaggett@1649 6570 <td>N/A
jdaggett@1649 6571
jdaggett@1649 6572 <td>visual
jdaggett@1649 6573
jdaggett@3534 6574 <tr>
jdaggett@3534 6575 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
jdaggett@1649 6576
jdaggett@2528 6577 <td>auto | normal | none
jdaggett@2528 6578
jdaggett@2528 6579 <td>auto
jdaggett@1649 6580
jdaggett@1649 6581 <td>all elements
jdaggett@1649 6582
jdaggett@1649 6583 <td>yes
jdaggett@1649 6584
jdaggett@1649 6585 <td>N/A
jdaggett@1649 6586
jdaggett@1649 6587 <td>visual
jdaggett@1649 6588
jdaggett@3534 6589 <tr>
jdaggett@3534 6590 <th><a class=property
jdaggett@2528 6591 href="#propdef-font-language-override">font-language-override</a>
jdaggett@1643 6592
jdaggett@6453 6593 <td>normal | &lt;string&gt;
jdaggett@1643 6594
jdaggett@1643 6595 <td>normal
jdaggett@1643 6596
jdaggett@1643 6597 <td>all elements
jdaggett@1643 6598
jdaggett@1643 6599 <td>yes
jdaggett@1643 6600
jdaggett@1643 6601 <td>N/A
jdaggett@1643 6602
jdaggett@1643 6603 <td>visual
jdaggett@1643 6604
jdaggett@3534 6605 <tr>
jdaggett@3534 6606 <th><a class=property href="#propdef-font-size">font-size</a>
jdaggett@1153 6607
jdaggett@1153 6608 <td>&lt;absolute-size> | &lt;relative-size> | &lt;length> |
jdaggett@6453 6609 &lt;percentage>
jdaggett@1153 6610
jdaggett@1153 6611 <td>medium
jdaggett@1153 6612
jdaggett@1153 6613 <td>all elements
jdaggett@1153 6614
jdaggett@1153 6615 <td>yes
jdaggett@1153 6616
jdaggett@1153 6617 <td>refer to parent element's font size
jdaggett@1153 6618
jdaggett@1153 6619 <td>visual
jdaggett@1153 6620
jdaggett@3534 6621 <tr>
jdaggett@3534 6622 <th><a class=property
jdaggett@1661 6623 href="#propdef-font-size-adjust">font-size-adjust</a>
jdaggett@1153 6624
jdaggett@7099 6625 <td>none | auto | &lt;number>
jdaggett@1153 6626
jdaggett@1153 6627 <td>none
jdaggett@1153 6628
jdaggett@1153 6629 <td>all elements
jdaggett@1153 6630
jdaggett@1153 6631 <td>yes
jdaggett@1153 6632
jdaggett@1153 6633 <td>N/A
jdaggett@1153 6634
jdaggett@1153 6635 <td>visual
jdaggett@1153 6636
jdaggett@3534 6637 <tr>
jdaggett@7099 6638 <th><a class=property href="#propdef-font-stretch">font-stretch</a>
jdaggett@1661 6639
jdaggett@1661 6640 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@1661 6641 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@6453 6642 ultra-expanded
jdaggett@1153 6643
jdaggett@1153 6644 <td>normal
jdaggett@1153 6645
jdaggett@1153 6646 <td>all elements
jdaggett@1153 6647
jdaggett@1153 6648 <td>yes
jdaggett@1153 6649
jdaggett@1153 6650 <td>N/A
jdaggett@1153 6651
jdaggett@1153 6652 <td>visual
jdaggett@1153 6653
jdaggett@3534 6654 <tr>
jdaggett@7099 6655 <th><a class=property href="#propdef-font-style">font-style</a>
jdaggett@1153 6656
jdaggett@6453 6657 <td>normal | italic | oblique
jdaggett@1153 6658
jdaggett@1153 6659 <td>normal
jdaggett@1153 6660
jdaggett@1153 6661 <td>all elements
jdaggett@1153 6662
jdaggett@1153 6663 <td>yes
jdaggett@1153 6664
jdaggett@1153 6665 <td>N/A
jdaggett@1153 6666
jdaggett@1153 6667 <td>visual
jdaggett@1153 6668
jdaggett@3534 6669 <tr>
jdaggett@3534 6670 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
jdaggett@2528 6671
jdaggett@2528 6672 <td>none | [ weight || style ]
jdaggett@2528 6673
jdaggett@2528 6674 <td>weight style
jdaggett@2528 6675
jdaggett@2528 6676 <td>all elements
jdaggett@2528 6677
jdaggett@2528 6678 <td>yes
jdaggett@2528 6679
jdaggett@2528 6680 <td>N/A
jdaggett@2528 6681
jdaggett@2528 6682 <td>visual
jdaggett@2528 6683
jdaggett@3534 6684 <tr>
jdaggett@3534 6685 <th><a class=property href="#propdef-font-variant">font-variant</a>
jdaggett@1643 6686
jdaggett@6453 6687 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@3534 6688 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@3534 6689 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@6453 6690 || historical-forms || styleset(&lt;feature-value-name&gt;#) ||
jdaggett@6453 6691 character-variant(&lt;feature-value-name&gt;#) ||
jdaggett@6453 6692 swash(&lt;feature-value-name&gt;) ||
jdaggett@3534 6693 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@6453 6694 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@7099 6695 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@2528 6696 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@6453 6697 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@6453 6698 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@6453 6699 ruby ]
jdaggett@1153 6700
jdaggett@1153 6701 <td>normal
jdaggett@1153 6702
jdaggett@1153 6703 <td>all elements
jdaggett@1153 6704
jdaggett@1153 6705 <td>yes
jdaggett@1153 6706
jdaggett@7361 6707 <td>see individual properties
jdaggett@1153 6708
jdaggett@1153 6709 <td>visual
jdaggett@1153 6710
jdaggett@3534 6711 <tr>
jdaggett@3534 6712 <th><a class=property
jdaggett@1661 6713 href="#propdef-font-variant-alternates">font-variant-alternates</a>
jdaggett@1643 6714
jdaggett@6453 6715 <td>normal | [ stylistic(&lt;feature-value-name&gt;) || historical-forms
jdaggett@6453 6716 || styleset(&lt;feature-value-name&gt;#) ||
jdaggett@6453 6717 character-variant(&lt;feature-value-name&gt;#) ||
jdaggett@6453 6718 swash(&lt;feature-value-name&gt;) ||
jdaggett@6453 6719 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@6453 6720 annotation(&lt;feature-value-name&gt;) ]
jdaggett@1643 6721
jdaggett@1643 6722 <td>normal
jdaggett@1643 6723
jdaggett@1643 6724 <td>all elements
jdaggett@1643 6725
jdaggett@1643 6726 <td>yes
jdaggett@1643 6727
jdaggett@1643 6728 <td>N/A
jdaggett@1643 6729
jdaggett@1643 6730 <td>visual
jdaggett@1643 6731
jdaggett@3534 6732 <tr>
jdaggett@3534 6733 <th><a class=property
jdaggett@1661 6734 href="#propdef-font-variant-caps">font-variant-caps</a>
jdaggett@1661 6735
jdaggett@6453 6736 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
jdaggett@7099 6737 | unicase | titling-caps
jdaggett@1643 6738
jdaggett@1643 6739 <td>normal
jdaggett@1643 6740
jdaggett@1643 6741 <td>all elements
jdaggett@1643 6742
jdaggett@1643 6743 <td>yes
jdaggett@1643 6744
jdaggett@1643 6745 <td>N/A
jdaggett@1643 6746
jdaggett@1643 6747 <td>visual
jdaggett@1643 6748
jdaggett@3534 6749 <tr>
jdaggett@3534 6750 <th><a class=property
jdaggett@1661 6751 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
jdaggett@1661 6752
jdaggett@6453 6753 <td>normal | [ &lt;east-asian-variant-values&gt; ||
jdaggett@6453 6754 &lt;east-asian-width-values&gt; || ruby ]
jdaggett@1643 6755
jdaggett@1643 6756 <td>normal
jdaggett@1643 6757
jdaggett@1643 6758 <td>all elements
jdaggett@1643 6759
jdaggett@1643 6760 <td>yes
jdaggett@1643 6761
jdaggett@1643 6762 <td>N/A
jdaggett@1643 6763
jdaggett@1643 6764 <td>visual
jdaggett@1643 6765
jdaggett@3534 6766 <tr>
jdaggett@3534 6767 <th><a class=property
jdaggett@1661 6768 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
jdaggett@1661 6769
jdaggett@6453 6770 <td>normal | none | [ &lt;common-lig-values> ||
jdaggett@6453 6771 &lt;discretionary-lig-values> || &lt;historical-lig-values> ||
jdaggett@6453 6772 &lt;contextual-alt-values> ]
jdaggett@1661 6773
jdaggett@1661 6774 <td>normal
jdaggett@1661 6775
jdaggett@1661 6776 <td>all elements
jdaggett@1661 6777
jdaggett@1661 6778 <td>yes
jdaggett@1661 6779
jdaggett@1661 6780 <td>N/A
jdaggett@1661 6781
jdaggett@1661 6782 <td>visual
jdaggett@1661 6783
jdaggett@3534 6784 <tr>
jdaggett@3534 6785 <th><a class=property
jdaggett@1661 6786 href="#propdef-font-variant-numeric">font-variant-numeric</a>
jdaggett@1643 6787
jdaggett@6453 6788 <td>normal | [ &lt;numeric-figure-values&gt; ||
jdaggett@2528 6789 &lt;numeric-spacing-values&gt; || &lt;numeric-fraction-values&gt; ||
jdaggett@6453 6790 ordinal || slashed-zero ]
jdaggett@1643 6791
jdaggett@1643 6792 <td>normal
jdaggett@1643 6793
jdaggett@1643 6794 <td>all elements
jdaggett@1643 6795
jdaggett@1643 6796 <td>yes
jdaggett@1643 6797
jdaggett@1643 6798 <td>N/A
jdaggett@1643 6799
jdaggett@1643 6800 <td>visual
jdaggett@1643 6801
jdaggett@3534 6802 <tr>
jdaggett@3534 6803 <th><a class=property
jdaggett@3534 6804 href="#propdef-font-variant-position">font-variant-position</a>
jdaggett@3534 6805
jdaggett@6453 6806 <td>normal | sub | super
jdaggett@3534 6807
jdaggett@3534 6808 <td>normal
jdaggett@3534 6809
jdaggett@3534 6810 <td>all elements
jdaggett@3534 6811
jdaggett@3534 6812 <td>yes
jdaggett@3534 6813
jdaggett@3534 6814 <td>N/A
jdaggett@3534 6815
jdaggett@3534 6816 <td>visual
jdaggett@3534 6817
jdaggett@3534 6818 <tr>
jdaggett@7099 6819 <th><a class=property href="#propdef-font-weight">font-weight</a>
jdaggett@1153 6820
jdaggett@1153 6821 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
jdaggett@6453 6822 | 700 | 800 | 900
jdaggett@1153 6823
jdaggett@1153 6824 <td>normal
jdaggett@1153 6825
jdaggett@1153 6826 <td>all elements
jdaggett@1153 6827
jdaggett@1153 6828 <td>yes
jdaggett@1153 6829
jdaggett@1153 6830 <td>N/A
jdaggett@1153 6831
jdaggett@1153 6832 <td>visual
jdaggett@1153 6833 </table>
jdaggett@1153 6834 <!--end-properties-->
jdaggett@6453 6835 <!--begin-descriptors-->
jdaggett@6453 6836
jdaggett@6453 6837 <table class=proptable>
jdaggett@6453 6838 <thead>
jdaggett@6453 6839 <tr>
jdaggett@6453 6840 <th>Descriptor
jdaggett@6453 6841
jdaggett@6453 6842 <th>Value
jdaggett@6453 6843
jdaggett@6453 6844 <th>Initial
jdaggett@6453 6845
jdaggett@6453 6846 <th>Percentages
jdaggett@6453 6847
jdaggett@6453 6848 <th>Media
jdaggett@6453 6849
jdaggett@6453 6850 <tbody>
jdaggett@6453 6851 <tr>
jdaggett@6453 6852 <th><a class=property href="#descdef-font-family">font-family</a>
jdaggett@6453 6853
jdaggett@6453 6854 <td>&lt;family-name>
jdaggett@6453 6855
jdaggett@6453 6856 <td>N/A
jdaggett@6453 6857
jdaggett@6453 6858 <tr>
jdaggett@6453 6859 <th><a class=property
jdaggett@6453 6860 href="#propdef-font-feature-settings">font-feature-settings</a>
jdaggett@6453 6861
jdaggett@6453 6862 <td>normal | &lt;feature-tag-value&gt;#
jdaggett@6453 6863
jdaggett@6453 6864 <td>normal
jdaggett@6453 6865
jdaggett@6453 6866 <tr>
jdaggett@7099 6867 <th><a class=property href="#propdef-font-stretch">font-stretch</a>
jdaggett@6453 6868
jdaggett@6453 6869 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@6453 6870 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@6453 6871 ultra-expanded
jdaggett@6453 6872
jdaggett@6453 6873 <td>normal
jdaggett@6453 6874
jdaggett@6453 6875 <tr>
jdaggett@7099 6876 <th><a class=property href="#propdef-font-style">font-style</a>
jdaggett@6453 6877
jdaggett@6453 6878 <td>normal | italic | oblique
jdaggett@6453 6879
jdaggett@6453 6880 <td>normal
jdaggett@6453 6881
jdaggett@6453 6882 <tr>
jdaggett@6453 6883 <th><a class=property href="#propdef-font-variant">font-variant</a>
jdaggett@6453 6884
jdaggett@6453 6885 <td>normal | [ &lt;common-lig-values&gt; ||
jdaggett@6453 6886 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@6453 6887 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@6453 6888 || historical-forms || styleset(&lt;feature-value-name&gt;#) ||
jdaggett@6453 6889 character-variant(&lt;feature-value-name&gt;#) ||
jdaggett@6453 6890 swash(&lt;feature-value-name&gt;) ||
jdaggett@6453 6891 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@6453 6892 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@7099 6893 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@6453 6894 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@6453 6895 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@6453 6896 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@6453 6897 ruby ]
jdaggett@6453 6898
jdaggett@6453 6899 <td>normal
jdaggett@6453 6900
jdaggett@6453 6901 <tr>
jdaggett@7099 6902 <th><a class=property href="#propdef-font-weight">font-weight</a>
jdaggett@6453 6903
jdaggett@6453 6904 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
jdaggett@6453 6905
jdaggett@6453 6906 <td>normal
jdaggett@6453 6907
jdaggett@6453 6908 <tr>
jdaggett@6453 6909 <th><a class=property href="#descdef-src">src</a>
jdaggett@6453 6910
jdaggett@6453 6911 <td>[ &lt;uri> [format(&lt;string>#)]? | &lt;font-face-name> ]#
jdaggett@6453 6912
jdaggett@6453 6913 <td>N/A
jdaggett@6453 6914
jdaggett@6453 6915 <tr>
jdaggett@6453 6916 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
jdaggett@6453 6917
jdaggett@6453 6918 <td>&lt;urange>#
jdaggett@6453 6919
jdaggett@6453 6920 <td>U+0-10FFFF
jdaggett@6453 6921 </table>
jdaggett@6453 6922 <!--end-descriptors-->
jdaggett@7099 6923 <script type="text/javascript">
jdaggett@7099 6924 window.onload = function () {
jdaggett@7099 6925 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
jdaggett@7099 6926 var i, hiresElements = document.getElementsByClassName("hires");
jdaggett@7099 6927 for (i = 0; i < hiresElements.length; i++) {
jdaggett@7099 6928 var h = hiresElements[i];
jdaggett@7099 6929 if (h.tagName != "IMG") continue;
jdaggett@7099 6930 var src = h.getAttribute("src");
jdaggett@7099 6931 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
jdaggett@7099 6932 h.src = src2x;
jdaggett@7099 6933 }
jdaggett@7099 6934 }
jdaggett@7099 6935 </script>
jdaggett@1153 6936 </html>
jdaggett@1153 6937 <!-- Keep this comment at the end of the file
jdaggett@1153 6938 Local variables:
jdaggett@1153 6939 mode: sgml
jdaggett@1153 6940 sgml-declaration:"~/SGML/HTML4.decl"
jdaggett@1153 6941 sgml-default-doctype-name:"html"
jdaggett@1153 6942 sgml-minimize-attributes:t
jdaggett@1153 6943 sgml-nofill-elements:("pre" "style" "br")
jdaggett@1153 6944 sgml-live-element-indicator:t
jdaggett@1153 6945 sgml-omittag:nil
jdaggett@1153 6946 sgml-shorttag:nil
jdaggett@1153 6947 sgml-namecase-general:t
jdaggett@1153 6948 sgml-general-insert-case:lower
jdaggett@1153 6949 sgml-always-quote-attributes:t
jdaggett@1153 6950 sgml-indent-step:nil
jdaggett@1153 6951 sgml-indent-data:t
jdaggett@1153 6952 sgml-parent-document:nil
jdaggett@1153 6953 sgml-exposed-tags:nil
jdaggett@1153 6954 sgml-local-catalogs:nil
jdaggett@1153 6955 sgml-local-ecat-files:nil
jdaggett@1153 6956 End:
jdaggett@1153 6957 -->
jdaggett@2528 6958 <!--
jdaggett@2528 6959
jdaggett@2528 6960 to do:
jdaggett@2528 6961
jdaggett@2528 6962 - wording of OpenType family name handling
jdaggett@2528 6963 - handling combining sequences in the font matching algorithm
jdaggett@2528 6964 - fix-up fi ligature example
jdaggett@2528 6965
jdaggett@2528 6966 -->

mercurial