css-fonts/Fonts.html

Fri, 30 Aug 2013 13:11:26 +0900

author
John Daggett <jdaggett@mozilla.com>
date
Fri, 30 Aug 2013 13:11:26 +0900
changeset 8984
b0cb9e6a8be9
parent 8983
2569e20405e3
child 8985
9d3b548685a9
permissions
-rw-r--r--

[css3-fonts] add ordinals example

jdaggett@484 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
jdaggett@484 2 "http://www.w3.org/TR/html4/strict.dtd">
jdaggett@484 3
jdaggett@484 4 <html lang=en>
jdaggett@484 5 <head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
jdaggett@484 6
jdaggett@1244 7 <title>CSS Fonts Module Level 3</title>
jdaggett@484 8 <!--
jdaggett@484 9 FIXME when publishing: copy the current default.css and link to
jdaggett@484 10 "default.css" rather than "../default.css"
jdaggett@484 11 -->
jdaggett@484 12 <link href="../default.css" rel=stylesheet type="text/css">
jdaggett@8699 13 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
jdaggett@4546 14 <!-- I'm just experimenting here, don't get your bee in a bonnet -->
jdaggett@4546 15 <script src="http://use.typekit.com/xon2bky.js"
jdaggett@4546 16 type="text/javascript"></script>
jdaggett@4546 17 <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
jdaggett@484 18
jdaggett@497 19 <style type="text/css">
jdaggett@4546 20
jdaggett@4547 21 body, th, td, h1, h2, h3, h4, h5, h6 {
jdaggett@4547 22 font-family: "myriad-pro", sans-serif !important;
jdaggett@4547 23 }
jdaggett@8277 24
jdaggett@524 25 body {
jdaggett@524 26 padding: 2em 70px 2em 70px;
jdaggett@524 27 }
jdaggett@4546 28
jdaggett@497 29 p + p, p.mtb {
jdaggett@497 30 margin-top: 0.8em;
jdaggett@497 31 text-indent: 0px;
jdaggett@497 32 }
jdaggett@6651 33
jdaggett@6651 34 #bolderlighter {
jdaggett@6651 35 width: 40%;
jdaggett@6651 36 }
jdaggett@6651 37
jdaggett@6651 38 #bolderlighter th {
jdaggett@6651 39 text-align: center;
jdaggett@6651 40 }
jdaggett@8277 41
jdaggett@7103 42 #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
jdaggett@1244 43 padding-right: 2em;
jdaggett@512 44 text-align: left;
jdaggett@512 45 }
jdaggett@8277 46
jdaggett@518 47 dd {
jdaggett@518 48 margin-bottom: 1em;
jdaggett@514 49 }
jdaggett@8277 50
jdaggett@516 51 #authors dd {
jdaggett@516 52 margin-bottom: 0;
jdaggett@516 53 }
jdaggett@8277 54
jdaggett@531 55 #fontstylematchingalg {
jdaggett@531 56 list-style-type: lower-alpha;
jdaggett@531 57 }
jdaggett@8277 58
jdaggett@531 59 #fontmatchingalg ul, #fontmatchingalg ol {
jdaggett@531 60 margin-top: 0.8em;
jdaggett@531 61 }
jdaggett@8277 62
jdaggett@531 63 #fontmatchingalg li + li {
jdaggett@531 64 margin-top: 0.8em;
jdaggett@531 65 }
jdaggett@8277 66
jdaggett@531 67 div.example {
jdaggett@531 68 padding: 1em;
jdaggett@531 69 margin-top: 1em;
jdaggett@531 70 }
jdaggett@531 71
jdaggett@531 72 div.example + div.example {
jdaggett@531 73 margin-top: 2em;
jdaggett@531 74 }
jdaggett@8277 75
jdaggett@531 76 div.figure {
jdaggett@531 77 page-break-inside: avoid;
jdaggett@531 78 }
jdaggett@1244 79
jdaggett@1662 80 pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
jdaggett@8277 81
jdaggett@8277 82 div.featex {
jdaggett@1662 83 width: 700px;
jdaggett@1662 84 }
jdaggett@8277 85
jdaggett@1662 86 div.featex img {
jdaggett@1662 87 margin: auto;
jdaggett@1662 88 display: block;
jdaggett@1662 89 }
jdaggett@6436 90
jdaggett@6436 91 span.tag {
jdaggett@6436 92 font-family: monospace;
jdaggett@6436 93 font-size: 120%;
jdaggett@6436 94 }
jdaggett@6648 95
jdaggett@6701 96 ol ol {
jdaggett@6701 97 list-style-type: lower-alpha;
jdaggett@6701 98 }
jdaggett@7060 99
jdaggett@7060 100 .idl-code {
jdaggett@7060 101 font-weight: bold;
jdaggett@7060 102 color: #c50;
jdaggett@7060 103 }
jdaggett@497 104 </style>
jdaggett@2556 105 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
jdaggett@2556 106 type="text/css">
peter@8369 107 <script defer=defer
jdaggett@8385 108 src="http://test.csswg.org/harness/annotate.js#CSS3-FONTS_DEV"
jdaggett@8385 109 type="text/javascript"></script>
jdaggett@497 110
jdaggett@484 111 <body>
jdaggett@484 112 <div class=head> <!--begin-logo-->
jdaggett@484 113 <p><a href="http://www.w3.org/"><img alt=W3C height=48
jdaggett@890 114 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
jdaggett@890 115
jdaggett@901 116 <h1>CSS Fonts Module Level 3</h1>
jdaggett@901 117
jdaggett@8983 118 <h2 class="no-num no-toc" id=editors-draft-30-august-2013>Editor's Draft
jdaggett@8983 119 30 August 2013</h2>
jdaggett@484 120
jdaggett@516 121 <dl id=authors>
jdaggett@484 122 <dt>This version:
jdaggett@484 123
jdaggett@484 124 <dd><a
jdaggett@8699 125 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
jdaggett@8983 126 <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css-fonts-3-20130830/">http://www.w3.org/TR/2013/ED-css-fonts-3-20130830/</a> -->
jdaggett@8699 127
jdaggett@484 128
jdaggett@484 129 <dt>Latest version:
jdaggett@484 130
jdaggett@484 131 <dd><a
jdaggett@8699 132 href="http://www.w3.org/TR/css-fonts-3/">http://www.w3.org/TR/css-fonts-3/</a>
jdaggett@484 133
jdaggett@890 134 <dt>Latest editor's draft:
jdaggett@890 135
jdaggett@890 136 <dd><a
jdaggett@8031 137 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
jdaggett@7488 138 (<a
jdaggett@8031 139 href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
jdaggett@7488 140 log</a>)
jdaggett@890 141
jdaggett@4624 142 <dt>Previous version:
jdaggett@890 143
jdaggett@890 144 <dd><a
jdaggett@8699 145 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/</a>
jdaggett@4624 146
jdaggett@4624 147 <dt>Issues List:
jdaggett@4624 148
jdaggett@4624 149 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
jdaggett@4624 150 issues in Tracker</a>
jdaggett@2556 151
jdaggett@2556 152 <dd><a
jdaggett@6648 153 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@4624 154 Fonts issues in Bugzilla</a>
jdaggett@4624 155
jdaggett@8031 156 <dt>Discussion:
jdaggett@8031 157
jdaggett@8031 158 <dd><a
jdaggett@8031 159 href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
jdaggett@8031 160 with subject line “<kbd>[css-fonts] <var>… message topic
jdaggett@8031 161 …</var></kbd>” (<a
jdaggett@8031 162 href="http://lists.w3.org/Archives/Public/www-style/"
jdaggett@8031 163 rel=discussion>archives</a>)
jdaggett@890 164
jdaggett@8969 165 <dt>Test Suite:
jdaggett@8969 166
jdaggett@8969 167 <dd><a
jdaggett@8969 168 href="http://test.csswg.org/suites/css3-fonts/nightly-unstable/">http://test.csswg.org/suites/css3-fonts/nightly-unstable/</a>
jdaggett@8969 169
jdaggett@8969 170
jdaggett@890 171 <dt>Editor:
jdaggett@484 172
jdaggett@497 173 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
jdaggett@484 174 </dl>
jdaggett@484 175 <!--begin-copyright-->
jdaggett@484 176 <p class=copyright><a
jdaggett@484 177 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
jdaggett@7179 178 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
jdaggett@5530 179 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
jdaggett@5530 180 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
jdaggett@5530 181 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
jdaggett@1662 182 title="European Research Consortium for Informatics and
jdaggett@7244 183 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
jdaggett@7244 184 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
jdaggett@7244 185 <a
jdaggett@484 186 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
jdaggett@484 187 <a
jdaggett@484 188 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
jdaggett@484 189 and <a
jdaggett@484 190 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
jdaggett@484 191 use</a> rules apply.</p>
jdaggett@484 192 <!--end-copyright-->
jdaggett@484 193 <hr title="Separator for header">
jdaggett@484 194 </div>
jdaggett@525 195
jdaggett@484 196 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
jdaggett@484 197
jdaggett@890 198 <p>This CSS3 module describes how font properties are specified and how
jdaggett@890 199 font resources are loaded dynamically. The contents of this specification
jdaggett@1244 200 are a consolidation of content previously divided into <a
jdaggett@3538 201 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
jdaggett@3538 202 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
jdaggett@7521 203 Web Fonts</a> modules. The description of font load events was moved into
jdaggett@8646 204 the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
jdaggett@8646 205 Events</a> module.
jdaggett@484 206
jdaggett@484 207 <h2 class="no-num no-toc" id=status>Status of this document</h2>
jdaggett@484 208 <!--begin-status-->
jdaggett@484 209
jdaggett@484 210 <p>This is a public copy of the editors' draft. It is provided for
jdaggett@484 211 discussion only and may change at any moment. Its publication here does
jdaggett@484 212 not imply endorsement of its contents by W3C. Don't cite this document
jdaggett@484 213 other than as work in progress.
jdaggett@484 214
jdaggett@484 215 <p>The (<a
jdaggett@484 216 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
jdaggett@1662 217 mailing list <a
jdaggett@1662 218 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
jdaggett@1662 219 www-style@w3.org</a> (see <a
jdaggett@1662 220 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
jdaggett@1662 221 discussion of this specification. When sending e-mail, please put the text
jdaggett@1662 222 “css3-fonts” in the subject, preferably like this:
jdaggett@1148 223 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
jdaggett@484 224
jdaggett@8031 225 <p>This document was produced by the <a
jdaggett@8031 226 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
jdaggett@8031 227 the <a href="http://www.w3.org/Style/">Style Activity</a>).
jdaggett@484 228
jdaggett@484 229 <p>This document was produced by a group operating under the <a
jdaggett@8031 230 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
jdaggett@8031 231 2004 W3C Patent Policy</a>. W3C maintains a <a
jdaggett@8031 232 href="http://www.w3.org/2004/01/pp-impl/32061/status"
jdaggett@484 233 rel=disclosure>public list of any patent disclosures</a> made in
jdaggett@484 234 connection with the deliverables of the group; that page also includes
jdaggett@484 235 instructions for disclosing a patent. An individual who has actual
jdaggett@484 236 knowledge of a patent which the individual believes contains <a
jdaggett@8031 237 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
jdaggett@484 238 Claim(s)</a> must disclose the information in accordance with <a
jdaggett@8031 239 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
jdaggett@8031 240 6 of the W3C Patent Policy</a>.</p>
jdaggett@484 241 <!--end-status-->
jdaggett@8385 242
jdaggett@8385 243 <h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
jdaggett@8385 244
jdaggett@8385 245 <p>The following features are at risk and may be removed when exiting CR:
jdaggett@8385 246
jdaggett@8385 247 <ul>
jdaggett@8386 248 <li>fallback handling for text decoration in superscript/subscript variant
jdaggett@8385 249 glyphs (‘<a href="#propdef-font-variant-position"><code
jdaggett@8385 250 class=property>font-variant-position</code></a>’)
jdaggett@8385 251
jdaggett@8385 252 <li>‘<a href="#propdef-font-language-override"><code
jdaggett@8385 253 class=property>font-language-override</code></a>’ property
jdaggett@8385 254 </ul>
jdaggett@8699 255 <!--
jdaggett@8699 256 <p>This draft is a <strong>Last Call Working Draft</strong>.
jdaggett@8699 257 Please send comments to the
jdaggett@8699 258 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style mailing list</a>
jdaggett@8699 259 as described above. The <strong>deadline for comments</strong>
jdaggett@8699 260 is six weeks after the date of publication in the header, 22 August 2013.</p>
jdaggett@8699 261 -->
jdaggett@2472 262
jdaggett@484 263 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
jdaggett@484 264 <!--begin-toc-->
jdaggett@484 265
jdaggett@484 266 <ul class=toc>
jdaggett@890 267 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
jdaggett@890 268
jdaggett@1244 269 <li><a href="#typography-background"><span class=secno>2 </span>Typography
jdaggett@545 270 Background</a>
jdaggett@545 271
jdaggett@6699 272 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
jdaggett@6699 273 Properties</a>
jdaggett@484 274 <ul class=toc>
jdaggett@1662 275 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
jdaggett@1662 276 family: the font-family property</a>
jdaggett@514 277 <ul class=toc>
jdaggett@1244 278 <li><a href="#generic-font-families"><span class=secno>3.1.1
jdaggett@1244 279 </span>Generic font families</a>
jdaggett@514 280 </ul>
jdaggett@484 281
jdaggett@1662 282 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
jdaggett@1662 283 weight: the font-weight property</a>
jdaggett@1662 284
jdaggett@1662 285 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
jdaggett@1662 286 width: the font-stretch property</a>
jdaggett@1662 287
jdaggett@1662 288 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
jdaggett@1662 289 the font-style property</a>
jdaggett@1662 290
jdaggett@1662 291 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
jdaggett@1662 292 the font-size property</a>
jdaggett@1662 293
jdaggett@1662 294 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
jdaggett@1662 295 </span>Relative sizing: the font-size-adjust property</a>
jdaggett@1662 296
jdaggett@1662 297 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
jdaggett@1662 298 property: the font property</a>
jdaggett@2457 299
jdaggett@2487 300 <li><a href="#font-synthesis-prop"><span class=secno>3.8
jdaggett@2487 301 </span>Controlling synthetic faces: the font-synthesis property</a>
jdaggett@484 302 </ul>
jdaggett@484 303
jdaggett@890 304 <li><a href="#font-resources"><span class=secno>4 </span>Font
jdaggett@6699 305 Resources</a>
jdaggett@512 306 <ul class=toc>
jdaggett@1662 307 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
jdaggett@7096 308 <code>@font-face</code> rule</a>
jdaggett@1244 309
jdaggett@1662 310 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
jdaggett@1662 311 family: the font-family descriptor</a>
jdaggett@1662 312
jdaggett@1662 313 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
jdaggett@1662 314 src descriptor</a>
jdaggett@1662 315
jdaggett@1662 316 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
jdaggett@1662 317 descriptors: the font-style, font-weight, font-stretch descriptors</a>
jdaggett@1662 318
jdaggett@1662 319 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
jdaggett@1662 320 range: the unicode-range descriptor</a>
jdaggett@1662 321
jdaggett@8225 322 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
jdaggett@8225 323 character ranges to define composite fonts</a>
jdaggett@8225 324
jdaggett@8225 325 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
jdaggett@1732 326 features: the font-variant and font-feature-settings descriptors</a>
jdaggett@2563 327
jdaggett@8225 328 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
jdaggett@2563 329 loading guidelines</a>
jdaggett@2737 330
jdaggett@8863 331 <li><a href="#font-fetching-requirements"><span class=secno>4.9
jdaggett@8863 332 </span>Font fetching requirements</a>
jdaggett@512 333 </ul>
jdaggett@484 334
jdaggett@1244 335 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
jdaggett@6699 336 Matching Algorithm</a>
jdaggett@2457 337 <ul class=toc>
jdaggett@7309 338 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
jdaggett@7309 339 sensitivity of font family names</a>
jdaggett@7309 340
jdaggett@7309 341 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
jdaggett@2457 342 font styles</a>
jdaggett@2457 343
jdaggett@7309 344 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
jdaggett@6701 345 matching</a>
jdaggett@6701 346
jdaggett@7309 347 <li><a href="#char-handling-issues"><span class=secno>5.4
jdaggett@2457 348 </span>Character handling issues</a>
jdaggett@2509 349
jdaggett@7309 350 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
jdaggett@2509 351 matching changes since CSS 2.1</a>
jdaggett@6701 352
jdaggett@7309 353 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
jdaggett@6701 354 matching examples</a>
jdaggett@2457 355 </ul>
jdaggett@1244 356
jdaggett@6699 357 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
jdaggett@6699 358 Properties</a>
jdaggett@1662 359 <ul class=toc>
jdaggett@1856 360 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
jdaggett@1856 361 </span>Glyph selection and positioning</a>
jdaggett@1856 362
jdaggett@1856 363 <li><a href="#language-specific-support"><span class=secno>6.2
jdaggett@1856 364 </span>Language-specific display</a>
jdaggett@1856 365
jdaggett@1856 366 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
jdaggett@1662 367 the font-kerning property</a>
jdaggett@1662 368
jdaggett@6176 369 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
jdaggett@6176 370 </span>Ligatures: the font-variant-ligatures property</a>
jdaggett@6176 371
jdaggett@6176 372 <li><a href="#font-variant-position-prop"><span class=secno>6.5
jdaggett@3638 373 </span>Subscript and superscript forms: the font-variant-position
jdaggett@3638 374 property</a>
jdaggett@1856 375
jdaggett@2118 376 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
jdaggett@2118 377 </span>Capitalization: the font-variant-caps property</a>
jdaggett@2118 378
jdaggett@2118 379 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
jdaggett@2118 380 </span>Numerical formatting: the font-variant-numeric property</a>
jdaggett@2118 381
jdaggett@2118 382 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
jdaggett@1662 383 </span>Alternates and swashes: the font-variant-alternates property</a>
jdaggett@1662 384
jdaggett@1662 385
jdaggett@2472 386 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
jdaggett@7096 387 font specific alternates: the <code>@font-feature-values</code>
jdaggett@7096 388 rule</a>
jdaggett@8356 389 <ul class=toc>
jdaggett@8356 390 <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
jdaggett@8356 391 syntax</a>
jdaggett@8356 392
jdaggett@8356 393 <li><a href="#multi-valued-feature-value-definitions"><span
jdaggett@8356 394 class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
jdaggett@8356 395 </ul>
jdaggett@2118 396
jdaggett@2118 397 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
jdaggett@1662 398 </span>East Asian text rendering: the font-variant-east-asian
jdaggett@1662 399 property</a>
jdaggett@1662 400
jdaggett@2118 401 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
jdaggett@1662 402 shorthand for font rendering: the font-variant property</a>
jdaggett@1662 403
jdaggett@2118 404 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
jdaggett@2509 405 </span>Low-level font feature settings control: the
jdaggett@2509 406 font-feature-settings property</a>
jdaggett@1662 407
jdaggett@2118 408 <li><a href="#font-language-override-prop"><span class=secno>6.13
jdaggett@1732 409 </span>Font language override: the font-language-override property</a>
jdaggett@1662 410 </ul>
jdaggett@1662 411
jdaggett@6176 412 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
jdaggett@6699 413 Feature Resolution </a>
jdaggett@6699 414 <ul class=toc>
jdaggett@6699 415 <li><a href="#default-features"><span class=secno>7.1 </span>Default
jdaggett@6699 416 features</a>
jdaggett@6699 417
jdaggett@6699 418 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
jdaggett@6699 419 precedence</a>
jdaggett@6699 420
jdaggett@6699 421 <li><a href="#feature-precedence-examples"><span class=secno>7.3
jdaggett@6699 422 </span>Feature precedence examples</a>
jdaggett@6699 423 </ul>
jdaggett@6699 424
jdaggett@7021 425 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
jdaggett@7021 426 <ul class=toc>
jdaggett@7021 427 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
jdaggett@7021 428 <code>CSSFontFaceRule</code> interface</a>
jdaggett@7021 429
jdaggett@7021 430 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
jdaggett@7021 431 <code>CSSFontFeatureValuesRule</code> interface</a>
jdaggett@7021 432 </ul>
jdaggett@7021 433
jdaggett@2737 434 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
jdaggett@1662 435 platform font properties to CSS properties</a>
jdaggett@1662 436
jdaggett@2472 437 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
jdaggett@2472 438 <ul class=toc>
jdaggett@8699 439 <li class=no-num><a href="#recent-changes"> Changes from the July 2013
jdaggett@8699 440 CSS3 Fonts Last Call Working Draft</a>
jdaggett@2472 441 </ul>
jdaggett@2472 442
jdaggett@529 443 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
jdaggett@529 444
jdaggett@7242 445 <li class=no-num><a href="#conformance"> Conformance</a>
jdaggett@7242 446 <ul class=toc>
jdaggett@7242 447 <li class=no-num><a href="#conventions"> Document Conventions</a>
jdaggett@7242 448
jdaggett@7242 449 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
jdaggett@7242 450
jdaggett@7242 451
jdaggett@7242 452 <li class=no-num><a href="#partial"> Partial Implementations</a>
jdaggett@7242 453
jdaggett@7242 454 <li class=no-num><a href="#experimental"> Experimental
jdaggett@7242 455 Implementations</a>
jdaggett@7242 456
jdaggett@7242 457 <li class=no-num><a href="#testing"> Non-Experimental
jdaggett@7242 458 Implementations</a>
jdaggett@7242 459 </ul>
jdaggett@7242 460
jdaggett@484 461 <li class=no-num><a href="#references">References</a>
jdaggett@484 462 <ul class=toc>
jdaggett@1662 463 <li class=no-num><a href="#normative-references">Normative
jdaggett@1662 464 References</a>
jdaggett@1662 465
jdaggett@1662 466 <li class=no-num><a href="#other-references">Other References</a>
jdaggett@484 467 </ul>
jdaggett@484 468
jdaggett@484 469 <li class=no-num><a href="#index">Index</a>
jdaggett@484 470
jdaggett@484 471 <li class=no-num><a href="#property-index">Property index</a>
jdaggett@484 472 </ul>
jdaggett@484 473 <!--end-toc-->
jdaggett@484 474
jdaggett@890 475 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
jdaggett@545 476
jdaggett@1148 477 <p>A font provides a resource containing the visual representation of
jdaggett@1662 478 characters. At the simplest level it contains information that maps
jdaggett@1662 479 character codes to shapes (called glyphs) that represent these characters.
jdaggett@1662 480 Fonts sharing a common design style are commonly grouped into font
jdaggett@1662 481 families classified by a set of standard font properties. Within a family,
jdaggett@1662 482 the shape displayed for a given character can vary by stroke weight, slant
jdaggett@7311 483 or relative width, among others. An individual font face is described by a
jdaggett@1662 484 unique combination of these properties. For a given range of text, CSS
jdaggett@1662 485 font properties are used to select a font family and a specific font face
jdaggett@1662 486 within that family to be used when rendering that text. As a simple
jdaggett@1662 487 example, to use the bold form of Helvetica one could use:
jdaggett@1148 488
jdaggett@8277 489 <pre>body {
jdaggett@8277 490 font-family: Helvetica;
jdaggett@8277 491 font-weight: bold;
jdaggett@1148 492 }</pre>
jdaggett@1148 493
jdaggett@7311 494 <p>Font resources may be installed locally on the system on which a user
jdaggett@7311 495 agent is running or downloadable. For local font resources descriptive
jdaggett@1148 496 information can be obtained directly from the font resource. For
jdaggett@1148 497 downloadable font resources (sometimes referred to as web fonts), the
jdaggett@1148 498 descriptive information is included with the reference to the font
jdaggett@1148 499 resource.
jdaggett@1148 500
jdaggett@1148 501 <p>Families of fonts typically don't contain a single face for each
jdaggett@1148 502 possible variation of font properties. The CSS font selection mechanism
jdaggett@7311 503 describes how to match a given set of CSS font properties to a single font
jdaggett@1148 504 face.
jdaggett@890 505
jdaggett@1244 506 <h2 id=typography-background><span class=secno>2 </span>Typography
jdaggett@1244 507 Background</h2>
jdaggett@890 508
jdaggett@7311 509 <p><em>This section is non-normative.</em>
jdaggett@7311 510
jdaggett@7311 511 <p> Typographic traditions vary across the globe, so there is no unique way
jdaggett@890 512 to classify all fonts across languages and cultures. For even common Latin
jdaggett@890 513 letters, wide variations are possible:
jdaggett@497 514
jdaggett@1150 515 <div class=figure><img alt="variations in glyphs for a single character"
jdaggett@1150 516 src=aaaaaa.png>
jdaggett@890 517 <p class=caption>One character, many glyph variations
jdaggett@498 518 </div>
jdaggett@497 519
jdaggett@497 520 <p>Differences in the anatomy of letterforms is one way to distinguish
jdaggett@497 521 fonts. For Latin fonts, flourishes at the ends of a character's main
jdaggett@497 522 strokes, or serifs, can distinguish a font from those without. Similar
jdaggett@534 523 comparisons exist in non-Latin fonts between fonts with tapered strokes
jdaggett@534 524 and those using primarily uniform strokes:
jdaggett@497 525
jdaggett@1150 526 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
jdaggett@890 527 <p class=caption>Letterforms with and without serifs
jdaggett@534 528 </div>
jdaggett@534 529
jdaggett@1150 530 <div class=figure><img alt="serif vs. non-serifs for japanese"
jdaggett@1150 531 src=minchovsgothic.png>
jdaggett@890 532 <p class=caption>Similar groupings for Japanese typefaces
jdaggett@498 533 </div>
jdaggett@497 534
jdaggett@497 535 <p>Fonts contain letterforms and the data needed to map characters to these
jdaggett@7311 536 letterforms. Often this may be a simple one-to-one mapping, but more
jdaggett@497 537 complex mappings are also possible. The use of combining diacritic marks
jdaggett@497 538 creates many variations for an underlying letterform:
jdaggett@497 539
jdaggett@1150 540 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
jdaggett@890 541 <p class=caption>Variations with diacritic marks
jdaggett@498 542 </div>
jdaggett@525 543
jdaggett@497 544 <p>A sequence of characters can be represented by a single glyph known as a
jdaggett@497 545 ligature:
jdaggett@497 546
jdaggett@1150 547 <div class=figure><img alt="example of a fi ligature"
jdaggett@1150 548 src=final-ligature.png>
jdaggett@890 549 <p class=caption>Ligature example
jdaggett@498 550 </div>
jdaggett@497 551
jdaggett@7311 552 <p>Visual transformations based on textual context are often stylistic
jdaggett@7311 553 option in European languages. They are required to correctly render
jdaggett@7311 554 languages like Arabic, the lam and alef characters below <em>must</em> be
jdaggett@7311 555 combined when they exist in sequence:
jdaggett@497 556
jdaggett@1150 557 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
jdaggett@890 558 <p class=caption>Required Arabic ligature
jdaggett@498 559 </div>
jdaggett@497 560
jdaggett@498 561 <p>The relative complexity of these shaping transformations requires
jdaggett@498 562 additional data within the font.
jdaggett@497 563
jdaggett@497 564 <p>Sets of font faces with various stylistic variations are often grouped
jdaggett@512 565 together into font families. In the simplest case a regular face is
jdaggett@7311 566 supplemented with bold and italic faces, but much more extensive groupings
jdaggett@7311 567 are possible. Variations in the thickness of letterform strokes, the <dfn
jdaggett@7311 568 id=weight>weight</dfn>, and the overall proportions of the letterform, the
jdaggett@7311 569 <dfn id=width>width</dfn>, are most common. In the example below, each
jdaggett@7311 570 letter uses a different font face within the Univers font family. The
jdaggett@7311 571 width used increases from top to bottom and the weight increases from left
jdaggett@7311 572 to right:
jdaggett@497 573
jdaggett@1150 574 <div class=figure><img alt="various width and weight variations within a
jdaggett@1150 575 single family" src=weightwidthvariations.png>
jdaggett@890 576 <p class=caption>Weight and width variations within a single font family
jdaggett@498 577 </div>
jdaggett@497 578
jdaggett@545 579 <p>Creating fonts that support multiple scripts is a difficult task;
jdaggett@1148 580 designers need to understand the cultural traditions surrounding the use
jdaggett@1148 581 of type in different scripts and come up with letterforms that somehow
jdaggett@1148 582 share a common theme. Many languages often share a common script and each
jdaggett@7311 583 of these languages may have noticeable stylistic differences. For example,
jdaggett@7311 584 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
jdaggett@7311 585 many languages, not just Russian.
jdaggett@518 586
jdaggett@8225 587 <p>The <a href="#character-map"><em>character map</em></a> of a font
jdaggett@8225 588 defines the mapping of characters to glyphs for that font. If a document
jdaggett@8225 589 contains characters not supported by the <a href="#character-map"><em
jdaggett@8225 590 title="character map">character maps</em></a> of the fonts contained in a
jdaggett@8363 591 font family list, a user agent may use a <a
jdaggett@8363 592 href="#system-font-fallback"><em>system font fallback</em></a> procedure
jdaggett@8363 593 to locate an appropriate font that does. If no appropriate font can be
jdaggett@8363 594 found, some form of "missing glyph" character will be rendered by the user
jdaggett@8363 595 agent. System fallback can occur when the specified list of font families
jdaggett@8363 596 does not include a font that supports a given character.
jdaggett@8225 597
jdaggett@8225 598 <p>Although the <a href="#character-map"><em>character map</em></a> of a
jdaggett@8225 599 font maps a given character to a glyph for that character, modern font
jdaggett@8225 600 technologies such as OpenType and AAT (Apple Advanced Typography) provide
jdaggett@8225 601 ways of mapping a character to different glyphs based upon feature
jdaggett@8225 602 settings. Fonts in these formats allow these features to be embedded in
jdaggett@8225 603 the font itself and controlled by applications. Common typographic
jdaggett@8225 604 features which can be specified this way include ligatures, swashes,
jdaggett@8225 605 contextual alternates, proportional and tabular figures, and automatic
jdaggett@8225 606 fractions, to list just a few. For a visual overview of OpenType features,
jdaggett@8225 607 see the <a href="#OPENTYPE-FONT-GUIDE"
jdaggett@6659 608 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
jdaggett@1662 609
jdaggett@6699 610 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
jdaggett@512 611
jdaggett@512 612 <p>The particular font face used to render a character is determined by the
jdaggett@515 613 font family and other font properties that apply to a given element. This
jdaggett@515 614 structure allows settings to be varied independent of each other.</p>
jdaggett@512 615 <!-- prop: font-family -->
jdaggett@484 616
jdaggett@1662 617 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
jdaggett@1662 618 href="#propdef-font-family">font-family</a> property</h3>
jdaggett@1662 619
jdaggett@8225 620 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
jdaggett@484 621 <tbody>
jdaggett@484 622 <tr>
jdaggett@484 623 <td>Name:
jdaggett@484 624
jdaggett@8278 625 <td><dfn id=propdef-font-family
jdaggett@8278 626 title="font-family!!property">font-family</dfn>
jdaggett@484 627
jdaggett@484 628 <tr>
jdaggett@484 629 <td>Value:
jdaggett@484 630
jdaggett@8225 631 <td>[ <a href="#family-name-value"><var>&lt;family-name&gt;</var></a> |
jdaggett@8225 632 <a href="#generic-family-value"><var>&lt;generic-family&gt;</var></a> ]
jdaggett@8225 633 #
jdaggett@484 634
jdaggett@484 635 <tr>
jdaggett@484 636 <td>Initial:
jdaggett@484 637
jdaggett@484 638 <td>depends on user agent
jdaggett@484 639
jdaggett@484 640 <tr>
jdaggett@484 641 <td>Applies to:
jdaggett@484 642
jdaggett@484 643 <td>all elements
jdaggett@484 644
jdaggett@484 645 <tr>
jdaggett@484 646 <td>Inherited:
jdaggett@484 647
jdaggett@484 648 <td>yes
jdaggett@484 649
jdaggett@484 650 <tr>
jdaggett@484 651 <td>Percentages:
jdaggett@484 652
jdaggett@484 653 <td>N/A
jdaggett@484 654
jdaggett@484 655 <tr>
jdaggett@484 656 <td>Media:
jdaggett@484 657
jdaggett@484 658 <td>visual
jdaggett@484 659
jdaggett@484 660 <tr>
jdaggett@1148 661 <td>Computed value:
jdaggett@484 662
jdaggett@484 663 <td>as specified
jdaggett@7377 664
jdaggett@7377 665 <tr>
jdaggett@7377 666 <td>Animatable:
jdaggett@7377 667
jdaggett@7377 668 <td>no
jdaggett@484 669 </table>
jdaggett@484 670
jdaggett@514 671 <p>This property specifies a prioritized list of font family names or
jdaggett@6694 672 generic family names. A font family defines a set of faces that vary in
jdaggett@6694 673 weight, width or slope. CSS uses the combination of a family name with
jdaggett@6694 674 other style attributes to select an individual face. Using this selection
jdaggett@6694 675 mechanism, rather than selecting a face via the style name as is often
jdaggett@6694 676 done in design applications, allows some degree of regularity in textual
jdaggett@6694 677 display when fallback occurs.
jdaggett@6694 678
jdaggett@6694 679 <p class=note>Designers should note that the CSS definition of font
jdaggett@6694 680 attributes used for selection are explicitly not intended to define a font
jdaggett@6694 681 taxonomy. A type designer's idea of a family may often extend to a set of
jdaggett@6694 682 faces that vary along axes other than just the standard axes of weight,
jdaggett@6694 683 width and slope. A family may extend to include both a set of serif faces
jdaggett@6694 684 and a set of sans-serif faces or vary along axes that are unique to that
jdaggett@6694 685 family. The CSS font selection mechanism merely provides a way to
jdaggett@6694 686 determine the “closest” substitute when substitution is necessary.
jdaggett@6694 687
jdaggett@6694 688 <p>Unlike other CSS properties, component values are a comma-separated list
jdaggett@6694 689 indicating alternatives. A user agent iterates through the list of family
jdaggett@6694 690 names until it matches an available font that contains a glyph for the
jdaggett@6694 691 character to be rendered. This allows for differences in available fonts
jdaggett@6694 692 across platforms and for differences in the range of characters supported
jdaggett@6694 693 by individual fonts.
jdaggett@514 694
jdaggett@514 695 <p>A font family name only specifies a name given to a set of font faces,
jdaggett@8177 696 it does not specify an individual face. For example, given the
jdaggett@8177 697 availability of the fonts below, Futura would match but Futura Medium
jdaggett@8177 698 would not:
jdaggett@514 699
jdaggett@1150 700 <div class=figure><img alt="family and face names"
jdaggett@1150 701 src=familyvsfacename.png>
jdaggett@890 702 <p class=caption>Family and individual face names
jdaggett@514 703 </div>
jdaggett@514 704
jdaggett@514 705 <p>Consider the example below:
jdaggett@512 706
jdaggett@512 707 <div class=example>
jdaggett@8277 708 <pre>body {
jdaggett@8277 709 font-family: Helvetica, Verdana, sans-serif;
jdaggett@514 710 }</pre>
jdaggett@1758 711
jdaggett@1758 712 <p>If Helvetica is available it will be used when rendering. If neither
jdaggett@1758 713 Helvetica nor Verdana is present, then the user-agent-defined sans serif
jdaggett@1758 714 font will be used.</p>
jdaggett@512 715 </div>
jdaggett@512 716
jdaggett@514 717 <p>There are two types of font family names:
jdaggett@512 718
jdaggett@512 719 <dl>
jdaggett@8225 720 <dt><dfn id=family-name-value><var>&lt;family-name&gt;</var></dfn>
jdaggett@514 721
jdaggett@514 722 <dd>The name of a font family of choice such as Helvetica or Verdana in
jdaggett@2457 723 the previous example.
jdaggett@514 724
jdaggett@8225 725 <dt><dfn id=generic-family-value><var>&lt;generic-family&gt;</var></dfn>
jdaggett@514 726
jdaggett@4624 727 <dd> The following generic family keywords are defined: ‘<a
jdaggett@4624 728 href="#serif"><code class=property>serif</code></a>’, ‘<a
jdaggett@4624 729 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
jdaggett@4624 730 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
jdaggett@4624 731 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
jdaggett@4624 732 href="#monospace"><code class=property>monospace</code></a>’. These
jdaggett@1148 733 keywords can be used as a general fallback mechanism when an author's
jdaggett@1758 734 desired font choices are not available. As keywords, they must not be
jdaggett@1148 735 quoted. Authors are encouraged to append a generic font family as a last
jdaggett@1148 736 alternative for improved robustness.
jdaggett@512 737 </dl>
jdaggett@512 738
jdaggett@8272 739 <p>Font family names other than generic families must either be given
jdaggett@8272 740 quoted as <a
jdaggett@8699 741 href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or
jdaggett@8699 742 unquoted as a sequence of one or more <a
bert@8683 743 href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
jdaggett@2457 744 This means most punctuation characters and digits at the start of each
jdaggett@2457 745 token must be escaped in unquoted font family names.
jdaggett@2457 746
jdaggett@7377 747 <p>To illustrate this, the following declarations are invalid:
jdaggett@2457 748
jdaggett@2457 749 <pre>
jdaggett@2457 750 font-family: Red/Black, sans-serif;
jdaggett@2457 751 font-family: "Lucida" Grande, sans-serif;
jdaggett@2457 752 font-family: Ahem!, sans-serif;
jdaggett@2457 753 font-family: test@foo, sans-serif;
jdaggett@2457 754 font-family: #POUND, sans-serif;
jdaggett@2457 755 font-family: Hawaii 5-0, sans-serif;
jdaggett@2457 756 </pre>
jdaggett@2457 757
jdaggett@2457 758 <p>If a sequence of identifiers is given as a font family name, the
jdaggett@2457 759 computed value is the name converted to a string by joining all the
jdaggett@2457 760 identifiers in the sequence by single spaces.
jdaggett@2457 761
jdaggett@2457 762 <p>To avoid mistakes in escaping, it is recommended to quote font family
jdaggett@2457 763 names that contain white space, digits, or punctuation characters other
jdaggett@2457 764 than hyphens:
jdaggett@2457 765
jdaggett@2457 766 <pre>
jdaggett@2457 767 body { font-family: "New Century Schoolbook", serif }
jdaggett@2457 768
jdaggett@2457 769 &lt;BODY STYLE="font-family: '21st Century', fantasy">
jdaggett@2457 770 </pre>
jdaggett@2457 771
jdaggett@2457 772 <p>Font family <em>names</em> that happen to be the same as a keyword value
jdaggett@4624 773 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
jdaggett@4624 774 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
jdaggett@4624 775 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
jdaggett@4624 776 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
jdaggett@4624 777 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
jdaggett@4624 778 class=property>cursive</code></a>’) must be quoted to prevent confusion
jdaggett@2457 779 with the keywords with the same names. The keywords ‘<code
jdaggett@2457 780 class=property>initial</code>’ and ‘<code
jdaggett@2457 781 class=property>default</code>’ are reserved for future use and must also
jdaggett@2457 782 be quoted when used as font names. UAs must not consider these keywords as
jdaggett@8225 783 matching the <a
jdaggett@8225 784 href="#family-name-value"><var>&lt;family-name&gt;</var></a> type.
jdaggett@2457 785
jdaggett@6694 786 <p>The precise way a set of fonts are grouped into font families varies
jdaggett@6694 787 depending upon the platform font management API's. The Windows GDI API
jdaggett@6694 788 only allows four faces to be grouped into a family while the DirectWrite
jdaggett@6694 789 API and API's on OSX and other platforms support font families with a
jdaggett@6695 790 variety of weights, widths and slopes (see <a
jdaggett@6694 791 href="#platform-props-to-css">Appendix A</a> for more details).
jdaggett@6694 792
jdaggett@2457 793 <p>Some font formats allow fonts to carry multiple localizations of the
jdaggett@2457 794 family name. User agents must recognize and correctly match all of these
jdaggett@2457 795 names independent of the underlying platform localization, system API used
jdaggett@2457 796 or document encoding:
jdaggett@2457 797
jdaggett@2457 798 <div class=figure><img alt="examples of localized family names"
jdaggett@2457 799 src=localizedfamilynames.png>
jdaggett@2457 800 <p class=caption>Localized family names
jdaggett@2457 801 </div>
jdaggett@2457 802
jdaggett@1244 803 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
jdaggett@1244 804 families</h4>
jdaggett@514 805
jdaggett@518 806 <p>All five generic font families are defined to exist in all CSS
jdaggett@518 807 implementations (they need not necessarily map to five distinct actual
jdaggett@518 808 fonts). User agents should provide reasonable default choices for the
jdaggett@518 809 generic font families, which express the characteristics of each family as
jdaggett@518 810 well as possible within the limits allowed by the underlying technology.
jdaggett@518 811 User agents are encouraged to allow users to select alternative choices
jdaggett@514 812 for the generic fonts.
jdaggett@514 813
jdaggett@890 814 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
jdaggett@890 815 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
jdaggett@514 816
jdaggett@8178 817 <p>Serif fonts represent the formal text style for a script. This often
jdaggett@8178 818 means but is not limited to glyphs that have finishing strokes, flared or
jdaggett@8178 819 tapering ends, or have actual serifed endings (including slab serifs).
jdaggett@8178 820 Serif fonts are typically proportionately-spaced. They often display a
jdaggett@8178 821 greater variation between thick and thin strokes than fonts from the ‘<a
jdaggett@8178 822 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
jdaggett@8178 823 font family. CSS uses the term ‘<a href="#serif"><code
jdaggett@8178 824 class=property>serif</code></a>’ to apply to a font for any script,
jdaggett@8178 825 although other names may be more familiar for particular scripts, such as
jdaggett@8178 826 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
jdaggett@8178 827 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
jdaggett@8178 828 class=property>serif</code></a>’ more due to its typographic role rather
jdaggett@8178 829 than its actual design style. Any font that is so described may be used to
jdaggett@4624 830 represent the generic ‘<a href="#serif"><code
jdaggett@4624 831 class=property>serif</code></a>’ family.
jdaggett@514 832
jdaggett@1150 833 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
jdaggett@890 834 <p class=caption>Sample serif fonts
jdaggett@514 835 </div>
jdaggett@514 836
jdaggett@890 837 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
jdaggett@890 838 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
jdaggett@890 839 id=sans-serif>sans-serif</dfn></a></span></h5>
jdaggett@514 840
jdaggett@8178 841 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
jdaggett@8178 842 low contrast (vertical and horizontal stems have the close to the same
jdaggett@8178 843 thickness) and have stroke endings that are plain -- without any flaring,
jdaggett@8178 844 cross stroke, or other ornamentation. Sans-serif fonts are typically
jdaggett@8178 845 proportionately-spaced. They often have little variation between thick and
jdaggett@8178 846 thin strokes, compared to fonts from the ‘<a href="#serif"><code
jdaggett@4624 847 class=property>serif</code></a>’ family. CSS uses the term ‘<a
jdaggett@4624 848 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
jdaggett@4624 849 to a font for any script, although other names may be more familiar for
jdaggett@3041 850 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
jdaggett@1148 851 (Korean). Any font that is so described may be used to represent the
jdaggett@4624 852 generic ‘<a href="#sans-serif"><code
jdaggett@4624 853 class=property>sans-serif</code></a>’ family.
jdaggett@518 854
jdaggett@1150 855 <div class=figure><img alt="sample sans-serif fonts"
jdaggett@1150 856 src=sansserifexamples.png>
jdaggett@890 857 <p class=caption>Sample sans-serif fonts
jdaggett@514 858 </div>
jdaggett@514 859
jdaggett@890 860 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
jdaggett@545 861 title="cursive, definition of"> <a name=cursive-def><dfn
jdaggett@890 862 id=cursive>cursive</dfn></a></span></h5>
jdaggett@545 863
jdaggett@8178 864 <p>Glyphs in cursive fonts generally use a more informal script style, and
jdaggett@8178 865 the result looks more like handwritten pen or brush writing than printed
jdaggett@8178 866 letterwork. CSS uses the term ‘<a href="#cursive"><code
jdaggett@8178 867 class=property>cursive</code></a>’ to apply to a font for any script,
jdaggett@8178 868 although other names such as Chancery, Brush, Swing and Script are also
jdaggett@8178 869 used in font names.
jdaggett@514 870
jdaggett@1150 871 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
jdaggett@890 872 <p class=caption>Sample cursive fonts
jdaggett@514 873 </div>
jdaggett@514 874
jdaggett@890 875 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
jdaggett@545 876 title="fantasy, definition of"> <a name=fantasy-def><dfn
jdaggett@890 877 id=fantasy>fantasy</dfn></a></span></h5>
jdaggett@514 878
jdaggett@8178 879 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
jdaggett@8178 880 playful representations of characters. These do not include Pi or Picture
jdaggett@8178 881 fonts which do not represent actual characters.
jdaggett@514 882
jdaggett@1150 883 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
jdaggett@890 884 <p class=caption>Sample fantasy fonts
jdaggett@514 885 </div>
jdaggett@514 886
jdaggett@890 887 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
jdaggett@545 888 title="monospace, definition of"> <a name=monospace-def><dfn
jdaggett@890 889 id=monospace>monospace</dfn></a></span></h5>
jdaggett@514 890
jdaggett@514 891 <p>The sole criterion of a monospace font is that all glyphs have the same
jdaggett@518 892 fixed width. This is often used to render samples of computer code.
jdaggett@514 893
jdaggett@1150 894 <div class=figure><img alt="sample monospace fonts"
jdaggett@1150 895 src=monospaceexamples.png>
jdaggett@890 896 <p class=caption>Sample monospace fonts
jdaggett@514 897 </div>
jdaggett@512 898 <!-- prop: font-weight -->
jdaggett@512 899
jdaggett@1662 900 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
jdaggett@1662 901 href="#propdef-font-weight">font-weight</a> property</h3>
jdaggett@1662 902
jdaggett@4624 903 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
jdaggett@484 904 <tbody>
jdaggett@484 905 <tr>
jdaggett@484 906 <td>Name:
jdaggett@484 907
jdaggett@8278 908 <td><dfn id=propdef-font-weight
jdaggett@8278 909 title="font-weight!!property">font-weight</dfn>
jdaggett@484 910
jdaggett@484 911 <tr>
jdaggett@484 912 <td>Value:
jdaggett@484 913
jdaggett@8278 914 <td><a href="#font-weight-normal-value"
jdaggett@8278 915 title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
jdaggett@8278 916 href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
jdaggett@8278 917 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 918 values">100</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 919 title="100...900 weight values">200</a> | <a
jdaggett@8278 920 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 921 values">300</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 922 title="100...900 weight values">400</a> | <a
jdaggett@8278 923 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 924 values">500</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 925 title="100...900 weight values">600</a> | <a
jdaggett@8278 926 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 927 values">700</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 928 title="100...900 weight values">800</a> | <a
jdaggett@8278 929 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 930 values">900</a>
jdaggett@484 931
jdaggett@484 932 <tr>
jdaggett@484 933 <td>Initial:
jdaggett@484 934
jdaggett@484 935 <td>normal
jdaggett@484 936
jdaggett@484 937 <tr>
jdaggett@484 938 <td>Applies to:
jdaggett@484 939
jdaggett@484 940 <td>all elements
jdaggett@484 941
jdaggett@484 942 <tr>
jdaggett@484 943 <td>Inherited:
jdaggett@484 944
jdaggett@484 945 <td>yes
jdaggett@484 946
jdaggett@484 947 <tr>
jdaggett@484 948 <td>Percentages:
jdaggett@484 949
jdaggett@484 950 <td>N/A
jdaggett@484 951
jdaggett@484 952 <tr>
jdaggett@484 953 <td>Media:
jdaggett@484 954
jdaggett@484 955 <td>visual
jdaggett@484 956
jdaggett@484 957 <tr>
jdaggett@1148 958 <td>Computed value:
jdaggett@484 959
jdaggett@8177 960 <td>numeric weight value (see description)
jdaggett@7377 961
jdaggett@7377 962 <tr>
jdaggett@7377 963 <td>Animatable:
jdaggett@7377 964
jdaggett@7377 965 <td>as <a
jdaggett@7377 966 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
jdaggett@7377 967 weight</a>
jdaggett@484 968 </table>
jdaggett@484 969
jdaggett@8278 970 <p>The <a href="#propdef-font-weight"
jdaggett@8278 971 title="font-weight!!property">‘<code
jdaggett@8278 972 class=property>font-weight</code>’</a> property specifies the weight of
jdaggett@8278 973 glyphs in the font, their degree of blackness or stroke thickness.
jdaggett@531 974
jdaggett@531 975 <p>Values have the following meanings:
jdaggett@512 976
jdaggett@512 977 <dl>
jdaggett@8278 978 <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
jdaggett@8278 979 to 900</dfn>
jdaggett@512 980
jdaggett@512 981 <dd>These values form an ordered sequence, where each number indicates a
jdaggett@514 982 weight that is at least as dark as its predecessor. These roughly
jdaggett@514 983 correspond to the commonly used weight names below:
jdaggett@512 984 </dl>
jdaggett@512 985
jdaggett@512 986 <ul>
jdaggett@512 987 <li>100 - Thin
jdaggett@512 988
jdaggett@518 989 <li>200 - Extra Light (Ultra Light)
jdaggett@512 990
jdaggett@512 991 <li>300 - Light
jdaggett@512 992
jdaggett@512 993 <li>400 - Normal
jdaggett@512 994
jdaggett@512 995 <li>500 - Medium
jdaggett@512 996
jdaggett@518 997 <li>600 - Semi Bold (Demi Bold)
jdaggett@512 998
jdaggett@512 999 <li>700 - Bold
jdaggett@512 1000
jdaggett@518 1001 <li>800 - Extra Bold (Ultra Bold)
jdaggett@512 1002
jdaggett@512 1003 <li>900 - Black (Heavy)
jdaggett@512 1004 </ul>
jdaggett@512 1005
jdaggett@512 1006 <dl>
jdaggett@8278 1007 <dt><dfn id=font-weight-normal-value
jdaggett@8278 1008 title="normal!!font-weight">normal</dfn>
jdaggett@512 1009
jdaggett@1148 1010 <dd>Same as ‘<code class=css>400</code>’.
jdaggett@512 1011
jdaggett@8278 1012 <dt><dfn id=bold>bold</dfn>
jdaggett@512 1013
jdaggett@1148 1014 <dd>Same as ‘<code class=css>700</code>’.
jdaggett@512 1015
jdaggett@8278 1016 <dt><dfn id=bolder>bolder</dfn>
jdaggett@512 1017
jdaggett@8177 1018 <dd>Specifies a bolder weight than the inherited value.
jdaggett@512 1019
jdaggett@8278 1020 <dt><dfn id=lighter>lighter</dfn>
jdaggett@512 1021
jdaggett@8177 1022 <dd>Specifies a lighter weight than the inherited value.
jdaggett@512 1023 </dl>
jdaggett@512 1024
jdaggett@8177 1025 <p>Font formats that use a scale other than a nine-step scale should map
jdaggett@531 1026 their scale onto the CSS scale so that 400 roughly corresponds with a face
jdaggett@531 1027 that would be labeled as Regular, Book, Roman and 700 roughly matches a
jdaggett@531 1028 face that would be labeled as Bold. Or weights may be inferred from the
jdaggett@531 1029 style names, ones that correspond roughly with the scale above. The scale
jdaggett@1662 1030 is relative, so a face with a larger weight value must never appear
jdaggett@1148 1031 lighter. If style names are used to infer weights, care should be taken to
jdaggett@1148 1032 handle variations in style names across locales.
jdaggett@531 1033
jdaggett@531 1034 <p>Quite often there are only a few weights available for a particular font
jdaggett@534 1035 family. When a weight is specified for which no face exists, a face with a
jdaggett@534 1036 nearby weight is used. In general, bold weights map to faces with heavier
jdaggett@1269 1037 weights and light weights map to faces with lighter weights (see the <a
jdaggett@1269 1038 href="#font-matching-algorithm">font matching section below</a> for a
jdaggett@1269 1039 precise definition). The examples here illustrate which face is used for
jdaggett@1269 1040 different weights, grey indicates a face for that weight does not exist so
jdaggett@1269 1041 a face with a nearby weight is used:
jdaggett@532 1042
jdaggett@1150 1043 <div class=figure><img alt="weight mappings for a family with 400, 700 and
jdaggett@1150 1044 900 weights" src=optimaweights.png>
jdaggett@532 1045 <p class=caption>Weight mappings for a font family with 400, 700 and 900
jdaggett@890 1046 weight faces
jdaggett@518 1047 </div>
jdaggett@518 1048
jdaggett@1150 1049 <div class=figure><img alt="weight mappings for a family with 300, 600
jdaggett@1150 1050 weights" src=hiraginoweights.png>
jdaggett@532 1051 <p class=caption>Weight mappings for a font family with 300 and 600 weight
jdaggett@890 1052 faces
jdaggett@531 1053 </div>
jdaggett@518 1054
jdaggett@2487 1055 <p>Although the practice is not well-loved by typographers, bold faces are
jdaggett@2487 1056 often synthesized by user agents for faces that lack actual bold faces.
jdaggett@2487 1057 For the purposes of style matching, these faces must be treated as if they
jdaggett@8177 1058 exist within the family. Authors can explicitly avoid this behavior by
jdaggett@8177 1059 using the ‘<a href="#propdef-font-synthesis"><code
jdaggett@8177 1060 class=property>font-synthesis</code></a>’ property.
jdaggett@8177 1061
jdaggett@8278 1062 <p>Specified values of ‘<a href="#bolder"><code
jdaggett@8278 1063 class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
jdaggett@8278 1064 class=property>lighter</code></a>’ indicate weights relative to the
jdaggett@8177 1065 weight of the parent element. The computed weight is calculated based on
jdaggett@8278 1066 the inherited <a href="#propdef-font-weight"
jdaggett@8278 1067 title="font-weight!!property">‘<code
jdaggett@8278 1068 class=property>font-weight</code>’</a> value using the chart below.
jdaggett@1148 1069
jdaggett@6651 1070 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
jdaggett@1148 1071 <thead>
jdaggett@1148 1072 <tr>
jdaggett@6651 1073 <th>Inherited value
jdaggett@6651 1074
jdaggett@6651 1075 <th>bolder
jdaggett@6651 1076
jdaggett@6651 1077 <th>lighter
jdaggett@1148 1078
jdaggett@1148 1079 <tbody>
jdaggett@1148 1080 <tr>
jdaggett@1244 1081 <th>100
jdaggett@1148 1082
jdaggett@1148 1083 <td>400
jdaggett@1148 1084
jdaggett@1148 1085 <td>100
jdaggett@1148 1086
jdaggett@1148 1087 <tr>
jdaggett@1244 1088 <th>200
jdaggett@1148 1089
jdaggett@1148 1090 <td>400
jdaggett@1148 1091
jdaggett@1148 1092 <td>100
jdaggett@1148 1093
jdaggett@1148 1094 <tr>
jdaggett@1244 1095 <th>300
jdaggett@1148 1096
jdaggett@1148 1097 <td>400
jdaggett@1148 1098
jdaggett@1148 1099 <td>100
jdaggett@1148 1100
jdaggett@1148 1101 <tr>
jdaggett@1244 1102 <th>400
jdaggett@1148 1103
jdaggett@1148 1104 <td>700
jdaggett@1148 1105
jdaggett@1148 1106 <td>100
jdaggett@1148 1107
jdaggett@1148 1108 <tr>
jdaggett@1244 1109 <th>500
jdaggett@1148 1110
jdaggett@1148 1111 <td>700
jdaggett@1148 1112
jdaggett@1148 1113 <td>100
jdaggett@1148 1114
jdaggett@1148 1115 <tr>
jdaggett@1244 1116 <th>600
jdaggett@1148 1117
jdaggett@1148 1118 <td>900
jdaggett@1148 1119
jdaggett@1148 1120 <td>400
jdaggett@1148 1121
jdaggett@1148 1122 <tr>
jdaggett@1244 1123 <th>700
jdaggett@1148 1124
jdaggett@1148 1125 <td>900
jdaggett@1148 1126
jdaggett@1148 1127 <td>400
jdaggett@1148 1128
jdaggett@1148 1129 <tr>
jdaggett@1244 1130 <th>800
jdaggett@1148 1131
jdaggett@1148 1132 <td>900
jdaggett@1148 1133
jdaggett@1148 1134 <td>700
jdaggett@1148 1135
jdaggett@1148 1136 <tr>
jdaggett@1244 1137 <th>900
jdaggett@1148 1138
jdaggett@1148 1139 <td>900
jdaggett@1148 1140
jdaggett@1148 1141 <td>700
jdaggett@1148 1142 </table>
jdaggett@1148 1143
jdaggett@1148 1144 <p>The table above is equivalent to selecting the next relative bolder or
jdaggett@1148 1145 lighter face, given a font family containing normal and bold faces along
jdaggett@1148 1146 with a thin and a heavy face. Authors who desire finer control over the
jdaggett@8177 1147 exact weight values used for a given element may use numerical values
jdaggett@1148 1148 instead of relative weights.</p>
jdaggett@512 1149 <!-- prop: font-stretch -->
jdaggett@512 1150
jdaggett@1662 1151 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
jdaggett@1662 1152 href="#propdef-font-stretch">font-stretch</a> property</h3>
jdaggett@1662 1153
jdaggett@8278 1154 <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
jdaggett@484 1155 <tbody>
jdaggett@484 1156 <tr>
jdaggett@484 1157 <td>Name:
jdaggett@484 1158
jdaggett@8278 1159 <td><dfn id=propdef-font-stretch
jdaggett@8278 1160 title="font-stretch!!property">font-stretch</dfn>
jdaggett@484 1161
jdaggett@484 1162 <tr>
jdaggett@484 1163 <td>Value:
jdaggett@484 1164
jdaggett@8278 1165 <td> <a href="#font-stretch-normal-value"
jdaggett@8278 1166 title="normal!!font-stretch">normal</a> | <a
jdaggett@8278 1167 href="#ultra-condensed">ultra-condensed</a> | <a
jdaggett@8278 1168 href="#extra-condensed">extra-condensed</a> | <a
jdaggett@8278 1169 href="#condensed">condensed</a> | <a
jdaggett@8278 1170 href="#semi-condensed-">semi-condensed</a> | <a
jdaggett@8278 1171 href="#semi-expanded">semi-expanded</a> | <a
jdaggett@8278 1172 href="#expanded">expanded</a> | <a
jdaggett@8278 1173 href="#extra-expanded">extra-expanded</a> | <a
jdaggett@8278 1174 href="#ultra-expanded">ultra-expanded</a>
jdaggett@484 1175
jdaggett@484 1176 <tr>
jdaggett@484 1177 <td>Initial:
jdaggett@484 1178
jdaggett@484 1179 <td>normal
jdaggett@484 1180
jdaggett@484 1181 <tr>
jdaggett@484 1182 <td>Applies to:
jdaggett@484 1183
jdaggett@484 1184 <td>all elements
jdaggett@484 1185
jdaggett@484 1186 <tr>
jdaggett@484 1187 <td>Inherited:
jdaggett@484 1188
jdaggett@484 1189 <td>yes
jdaggett@484 1190
jdaggett@484 1191 <tr>
jdaggett@484 1192 <td>Percentages:
jdaggett@484 1193
jdaggett@484 1194 <td>N/A
jdaggett@484 1195
jdaggett@484 1196 <tr>
jdaggett@484 1197 <td>Media:
jdaggett@484 1198
jdaggett@484 1199 <td>visual
jdaggett@484 1200
jdaggett@484 1201 <tr>
jdaggett@1148 1202 <td>Computed value:
jdaggett@484 1203
jdaggett@484 1204 <td>as specified
jdaggett@7377 1205
jdaggett@7377 1206 <tr>
jdaggett@7377 1207 <td>Animatable:
jdaggett@7377 1208
jdaggett@7377 1209 <td>as <a href="#font-stretch-animation">font stretch</a>
jdaggett@484 1210 </table>
jdaggett@484 1211
jdaggett@8278 1212 <p>The <a href="#propdef-font-stretch"
jdaggett@8278 1213 title="font-stretch!!property">‘<code
jdaggett@8278 1214 class=property>font-stretch</code>’</a> property selects a normal,
jdaggett@8278 1215 condensed, or expanded face from a font family. Absolute keyword values
jdaggett@8278 1216 have the following ordering, from narrowest to widest:
jdaggett@512 1217
jdaggett@512 1218 <ul>
jdaggett@8278 1219 <li><dfn id=ultra-condensed>ultra-condensed</dfn>
jdaggett@8278 1220
jdaggett@8278 1221 <li><dfn id=extra-condensed>extra-condensed</dfn>
jdaggett@8278 1222
jdaggett@8278 1223 <li><dfn id=condensed>condensed</dfn>
jdaggett@8278 1224
jdaggett@8278 1225 <li><dfn id=semi-condensed->semi-condensed </dfn>
jdaggett@8278 1226
jdaggett@8278 1227 <li><dfn id=font-stretch-normal-value
jdaggett@8278 1228 title="normal!!font-stretch">normal</dfn>
jdaggett@8278 1229
jdaggett@8278 1230 <li><dfn id=semi-expanded>semi-expanded</dfn>
jdaggett@8278 1231
jdaggett@8278 1232 <li><dfn id=expanded>expanded</dfn>
jdaggett@8278 1233
jdaggett@8278 1234 <li><dfn id=extra-expanded>extra-expanded</dfn>
jdaggett@8278 1235
jdaggett@8278 1236 <li><dfn id=ultra-expanded>ultra-expanded</dfn>
jdaggett@512 1237 </ul>
jdaggett@512 1238
jdaggett@8197 1239 <p>When a face does not exist for a given width, normal or condensed values
jdaggett@8197 1240 map to a narrower face, otherwise a wider face. Conversely, expanded
jdaggett@8197 1241 values map to a wider face, otherwise a narrower face. The figure below
jdaggett@8197 1242 shows how the nine font-stretch property settings affect font selection
jdaggett@8197 1243 for font family containing a variety of widths, grey indicates a width for
jdaggett@8197 1244 which no face exists and a different width is substituted:
jdaggett@1148 1245
jdaggett@1150 1246 <div class=figure><img alt="width mappings for a family with condensed,
jdaggett@1150 1247 normal and expanded faces" src=universwidths.png>
jdaggett@1148 1248 <p class=caption>Width mappings for a font family with condensed, normal
jdaggett@1148 1249 and expanded width faces
jdaggett@1148 1250 </div>
jdaggett@7377 1251
jdaggett@7377 1252 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
jdaggett@7377 1253 interpolated in discrete steps. The interpolation happens as though the
jdaggett@7377 1254 ordered values are equally spaced real numbers. The interpolation result
jdaggett@7377 1255 is rounded to the nearest value, with values exactly halfway between two
jdaggett@7377 1256 values rounded towards the later value in the list above.</p>
jdaggett@512 1257 <!-- prop: font-style -->
jdaggett@512 1258
jdaggett@1662 1259 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
jdaggett@1662 1260 href="#propdef-font-style">font-style</a> property</h3>
jdaggett@1662 1261
jdaggett@4624 1262 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
jdaggett@484 1263 <tbody>
jdaggett@484 1264 <tr>
jdaggett@484 1265 <td>Name:
jdaggett@484 1266
jdaggett@8278 1267 <td><dfn id=propdef-font-style
jdaggett@8278 1268 title="font-style!!property">font-style</dfn>
jdaggett@484 1269
jdaggett@484 1270 <tr>
jdaggett@484 1271 <td>Value:
jdaggett@484 1272
jdaggett@8278 1273 <td><a href="#font-style-normal-value"
jdaggett@8278 1274 title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
jdaggett@8278 1275 <a href="#oblique">oblique</a>
jdaggett@484 1276
jdaggett@484 1277 <tr>
jdaggett@484 1278 <td>Initial:
jdaggett@484 1279
jdaggett@484 1280 <td>normal
jdaggett@484 1281
jdaggett@484 1282 <tr>
jdaggett@484 1283 <td>Applies to:
jdaggett@484 1284
jdaggett@484 1285 <td>all elements
jdaggett@484 1286
jdaggett@484 1287 <tr>
jdaggett@484 1288 <td>Inherited:
jdaggett@484 1289
jdaggett@484 1290 <td>yes
jdaggett@484 1291
jdaggett@484 1292 <tr>
jdaggett@484 1293 <td>Percentages:
jdaggett@484 1294
jdaggett@484 1295 <td>N/A
jdaggett@484 1296
jdaggett@484 1297 <tr>
jdaggett@484 1298 <td>Media:
jdaggett@484 1299
jdaggett@484 1300 <td>visual
jdaggett@484 1301
jdaggett@484 1302 <tr>
jdaggett@1148 1303 <td>Computed value:
jdaggett@484 1304
jdaggett@484 1305 <td>as specified
jdaggett@7377 1306
jdaggett@7377 1307 <tr>
jdaggett@7377 1308 <td>Animatable:
jdaggett@7377 1309
jdaggett@7377 1310 <td>no
jdaggett@484 1311 </table>
jdaggett@484 1312
jdaggett@8278 1313 <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
jdaggett@8278 1314 class=property>font-style</code>’</a> property allows italic or oblique
jdaggett@8278 1315 faces to be selected. Italic forms are generally cursive in nature while
jdaggett@8278 1316 oblique faces are typically sloped versions of the regular face. Oblique
jdaggett@8278 1317 faces can be simulated by artificially sloping the glyphs of the regular
jdaggett@8278 1318 face. Compare the artificially sloped renderings of Palatino ‘<code
jdaggett@2556 1319 class=property>a</code>’ and Baskerville ‘<code
jdaggett@1148 1320 class=property>N</code>’ in grey with the actual italic versions:
jdaggett@518 1321
jdaggett@1150 1322 <div class=figure><img alt="artificial sloping vs. real italics"
jdaggett@1150 1323 src=realvsfakeitalics.png>
jdaggett@890 1324 <p class=caption>Artificial sloping versus real italics
jdaggett@512 1325 </div>
jdaggett@518 1326
jdaggett@8278 1327 <p>Values have the following meanings:
jdaggett@8278 1328
jdaggett@8278 1329 <dl>
jdaggett@8278 1330 <dt><dfn id=font-style-normal-value
jdaggett@8278 1331 title="normal!!font-style">normal</dfn>
jdaggett@8278 1332
jdaggett@8278 1333 <dd>selects a face that is classified as a normal face, one that is
jdaggett@8278 1334 neither italic or obliqued
jdaggett@8278 1335
jdaggett@8278 1336 <dt><dfn id=italic>italic</dfn>
jdaggett@8278 1337
jdaggett@8278 1338 <dd>selects a font that is labeled as an italic face, or an oblique face
jdaggett@8278 1339 if one is not
jdaggett@8278 1340
jdaggett@8278 1341 <dt><dfn id=oblique>oblique</dfn>
jdaggett@8278 1342
jdaggett@8278 1343 <dd>selects a font that is labeled as an oblique face, or an italic face
jdaggett@8278 1344 if one is not
jdaggett@8278 1345 </dl>
jdaggett@8278 1346
jdaggett@8278 1347 <p>If no italic or oblique face is available, oblique faces can be
jdaggett@8363 1348 synthesized by rendering non-obliqued faces with an artificial obliquing
jdaggett@8363 1349 operation. The use of these artificially obliqued faces can be disabled
jdaggett@8363 1350 using the ‘<a href="#propdef-font-synthesis"><code
jdaggett@8363 1351 class=property>font-synthesis</code></a>’ property. The details of the
jdaggett@8363 1352 obliquing operation are not explicitly defined.</p>
jdaggett@8363 1353 <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
jdaggett@518 1354
jdaggett@518 1355 <p>Many scripts lack the tradition of mixing a cursive form within text
jdaggett@518 1356 rendered with a normal face. Chinese, Japanese and Korean fonts almost
jdaggett@518 1357 always lack italic or oblique faces. Fonts that support a mixture of
jdaggett@518 1358 scripts will sometimes omit specific scripts such as Arabic from the set
jdaggett@518 1359 of glyphs supported in the italic face. User agents should be careful
jdaggett@8225 1360 about making <a href="#character-map"><em>character map</em></a>
jdaggett@8363 1361 assumptions across faces when implementing support for <a
jdaggett@8363 1362 href="#system-font-fallback"><em>system font fallback</em></a>.</p>
jdaggett@1662 1363 <!-- prop: font-size -->
jdaggett@1662 1364
jdaggett@1662 1365 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
jdaggett@1662 1366 href="#propdef-font-size">font-size</a> property</h3>
jdaggett@1662 1367
jdaggett@8225 1368 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
jdaggett@484 1369 <tbody>
jdaggett@484 1370 <tr>
jdaggett@484 1371 <td>Name:
jdaggett@484 1372
jdaggett@1662 1373 <td><dfn id=propdef-font-size>font-size</dfn>
jdaggett@484 1374
jdaggett@484 1375 <tr>
jdaggett@484 1376 <td>Value:
jdaggett@484 1377
jdaggett@8225 1378 <td><a href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a>
jdaggett@8225 1379 | <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a> |
jdaggett@8225 1380 <a href="#length-size-value"><var>&lt;length&gt;</var></a> | <a
jdaggett@8225 1381 href="#percentage-size-value"><var>&lt;percentage&gt;</var></a>
jdaggett@484 1382
jdaggett@484 1383 <tr>
jdaggett@484 1384 <td>Initial:
jdaggett@484 1385
jdaggett@484 1386 <td>medium
jdaggett@484 1387
jdaggett@484 1388 <tr>
jdaggett@484 1389 <td>Applies to:
jdaggett@484 1390
jdaggett@484 1391 <td>all elements
jdaggett@484 1392
jdaggett@484 1393 <tr>
jdaggett@484 1394 <td>Inherited:
jdaggett@484 1395
jdaggett@484 1396 <td>yes
jdaggett@484 1397
jdaggett@484 1398 <tr>
jdaggett@484 1399 <td>Percentages:
jdaggett@484 1400
jdaggett@484 1401 <td>refer to parent element's font size
jdaggett@484 1402
jdaggett@484 1403 <tr>
jdaggett@484 1404 <td>Media:
jdaggett@484 1405
jdaggett@484 1406 <td>visual
jdaggett@484 1407
jdaggett@484 1408 <tr>
jdaggett@1148 1409 <td>Computed value:
jdaggett@484 1410
jdaggett@484 1411 <td>absolute length
jdaggett@7377 1412
jdaggett@7377 1413 <tr>
jdaggett@7377 1414 <td>Animatable:
jdaggett@7377 1415
jdaggett@7377 1416 <td>as <a
jdaggett@7377 1417 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
jdaggett@484 1418 </table>
jdaggett@484 1419
jdaggett@512 1420 <p>This property indicates the desired height of glyphs from the font. For
jdaggett@512 1421 scalable fonts, the font-size is a scale factor applied to the EM unit of
jdaggett@512 1422 the font. (Note that certain glyphs may bleed outside their EM box.) For
jdaggett@512 1423 non-scalable fonts, the font-size is converted into absolute units and
jdaggett@512 1424 matched against the declared font-size of the font, using the same
jdaggett@512 1425 absolute coordinate space for both of the matched values. Values have the
jdaggett@512 1426 following meanings:
jdaggett@512 1427
jdaggett@512 1428 <dl>
jdaggett@8225 1429 <dt><dfn id=absolute-size-value><var>&lt;absolute-size&gt;</var></dfn>
jdaggett@8225 1430
jdaggett@8225 1431 <dd> An <a
jdaggett@8225 1432 href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a> keyword
jdaggett@8225 1433 refers to an entry in a table of font sizes computed and kept by the user
jdaggett@8225 1434 agent. Possible values are:
jdaggett@512 1435 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
jdaggett@512 1436
jdaggett@8225 1437 <dt><dfn id=relative-size-value><var>&lt;relative-size&gt;</var></dfn>
jdaggett@8225 1438
jdaggett@8225 1439 <dd> A <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a>
jdaggett@8225 1440 keyword is interpreted relative to the table of font sizes and the
jdaggett@8225 1441 computed ‘<a href="#propdef-font-size"><code
jdaggett@8225 1442 class=property>font-size</code></a>’ of the parent element. Possible
jdaggett@8225 1443 values are:
jdaggett@890 1444 <p> [ larger | smaller ]
jdaggett@890 1445
jdaggett@1148 1446 <p> For example, if the parent element has a font size of ‘<code
jdaggett@1148 1447 class=property>medium</code>’, a value of ‘<code
jdaggett@1148 1448 class=property>larger</code>’ will make the font size of the current
jdaggett@1148 1449 element be ‘<code class=property>large</code>’. If the parent
jdaggett@1148 1450 element's size is not close to a table entry, the user agent is free to
jdaggett@1148 1451 interpolate between table entries or round off to the closest one. The
jdaggett@1148 1452 user agent may have to extrapolate table values if the numerical value
jdaggett@1148 1453 goes beyond the keywords.
jdaggett@512 1454
jdaggett@8225 1455 <dt><dfn id=length-size-value><var>&lt;length&gt;</var></dfn>
jdaggett@512 1456
jdaggett@8187 1457 <dd>A length value specifies an absolute font size (independent of the
jdaggett@8187 1458 user agent's font table). Negative lengths are illegal.
jdaggett@512 1459
jdaggett@8225 1460 <dt><dfn id=percentage-size-value><var>&lt;percentage&gt;</var></dfn>
jdaggett@512 1461
jdaggett@512 1462 <dd>A percentage value specifies an absolute font size relative to the
jdaggett@512 1463 parent element's font size. Use of percentage values, or values in
jdaggett@1148 1464 ‘<code class=property>em</code>’s, leads to more robust and
jdaggett@512 1465 cascadable style sheets.
jdaggett@512 1466 </dl>
jdaggett@512 1467
jdaggett@8187 1468 <p>The following table provides user agent guidelines for the absolute-size
jdaggett@8187 1469 scaling factor and their mapping to HTML heading and absolute font-sizes.
jdaggett@8187 1470 The ‘<code class=property>medium</code>’ value is used as the
jdaggett@8187 1471 reference middle value. The user agent may fine-tune these values for
jdaggett@8187 1472 different fonts or different types of display devices.
jdaggett@1244 1473
jdaggett@1244 1474 <table class=data>
jdaggett@1152 1475 <thead>
jdaggett@1152 1476 <tr>
jdaggett@1152 1477 <th>CSS absolute-size values
jdaggett@1152 1478
jdaggett@1152 1479 <th>xx-small
jdaggett@1152 1480
jdaggett@1152 1481 <th>x-small
jdaggett@1152 1482
jdaggett@1152 1483 <th>small
jdaggett@1152 1484
jdaggett@1152 1485 <th>medium
jdaggett@1152 1486
jdaggett@1152 1487 <th>large
jdaggett@1152 1488
jdaggett@1152 1489 <th>x-large
jdaggett@1152 1490
jdaggett@1152 1491 <th>xx-large
jdaggett@1152 1492
jdaggett@1152 1493 <th> 
jdaggett@1152 1494
jdaggett@512 1495 <tbody>
jdaggett@512 1496 <tr>
jdaggett@1152 1497 <th>scaling factor
jdaggett@1152 1498
jdaggett@1152 1499 <td>3/5
jdaggett@1152 1500
jdaggett@1152 1501 <td>3/4
jdaggett@1152 1502
jdaggett@1152 1503 <td>8/9
jdaggett@1152 1504
jdaggett@1152 1505 <td>1
jdaggett@1152 1506
jdaggett@1152 1507 <td>6/5
jdaggett@1152 1508
jdaggett@1152 1509 <td>3/2
jdaggett@1152 1510
jdaggett@1152 1511 <td>2/1
jdaggett@1152 1512
jdaggett@1152 1513 <td>3/1
jdaggett@512 1514
jdaggett@512 1515 <tr>
jdaggett@8187 1516 <th>HTML headings
jdaggett@1152 1517
jdaggett@1152 1518 <td>h6
jdaggett@1152 1519
jdaggett@1152 1520 <td> 
jdaggett@1152 1521
jdaggett@1152 1522 <td>h5
jdaggett@1152 1523
jdaggett@1152 1524 <td>h4
jdaggett@1152 1525
jdaggett@1152 1526 <td>h3
jdaggett@1152 1527
jdaggett@1152 1528 <td>h2
jdaggett@1152 1529
jdaggett@1152 1530 <td>h1
jdaggett@1152 1531
jdaggett@1152 1532 <td> 
jdaggett@512 1533
jdaggett@512 1534 <tr>
jdaggett@8187 1535 <th>HTML font sizes
jdaggett@1152 1536
jdaggett@1152 1537 <td>1
jdaggett@1152 1538
jdaggett@1152 1539 <td> 
jdaggett@1152 1540
jdaggett@1152 1541 <td>2
jdaggett@1152 1542
jdaggett@1152 1543 <td>3
jdaggett@1152 1544
jdaggett@1152 1545 <td>4
jdaggett@1152 1546
jdaggett@1152 1547 <td>5
jdaggett@1152 1548
jdaggett@1152 1549 <td>6
jdaggett@1152 1550
jdaggett@1152 1551 <td>7
jdaggett@512 1552 </table>
jdaggett@512 1553
jdaggett@512 1554 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
jdaggett@512 1555 applying these guidelines should nevertheless avoid creating font-size
jdaggett@8272 1556 resulting in less than 9 device pixels per EM unit on a computer
jdaggett@8272 1557 display.</em>
jdaggett@512 1558
jdaggett@512 1559 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
jdaggett@512 1560 factor between adjacent indexes was 1.5 which user experience proved to be
jdaggett@512 1561 too large. In CSS2, the suggested scaling factor for computer screen
jdaggett@512 1562 between adjacent indexes was 1.2 which still created issues for the small
jdaggett@512 1563 sizes. The new scaling factor varies between each index to provide a
jdaggett@512 1564 better readability.</em>
jdaggett@512 1565
jdaggett@6659 1566 <p>The actual value of this property may differ from the computed value due
jdaggett@6659 1567 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
jdaggett@4624 1568 class=property>font-size-adjust</code></a>’ and the unavailability of
jdaggett@4624 1569 certain font sizes.
jdaggett@512 1570
jdaggett@512 1571 <p>Child elements inherit the computed <a class=noxref
jdaggett@6659 1572 href="#font-size-prop"> <span class=property>‘<code
jdaggett@1148 1573 class=property>font-size</code>’</span></a> value (otherwise, the effect
jdaggett@2556 1574 of <a class=noxref href="#font-size-adjust-prop"><span
jdaggett@2556 1575 class=property>‘<code
jdaggett@1148 1576 class=property>font-size-adjust</code>’</span></a> would compound).
jdaggett@512 1577
jdaggett@512 1578 <div class=example>
jdaggett@8699 1579 <p style="display:none">Example(s):</p>
jdaggett@890 1580
jdaggett@512 1581 <pre>p { font-size: 12pt; }
jdaggett@512 1582 blockquote { font-size: larger }
jdaggett@512 1583 em { font-size: 150% }
jdaggett@512 1584 em { font-size: 1.5em }
jdaggett@512 1585 </pre>
jdaggett@512 1586 </div>
jdaggett@512 1587 <!-- prop: font-size-adjust -->
jdaggett@512 1588
jdaggett@1662 1589 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
jdaggett@1662 1590 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
jdaggett@1662 1591
jdaggett@8968 1592 <table class=propdef id=namefont-size-adjustvaluenone-ltnumbergt>
jdaggett@484 1593 <tbody>
jdaggett@484 1594 <tr>
jdaggett@484 1595 <td>Name:
jdaggett@484 1596
jdaggett@1662 1597 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
jdaggett@484 1598
jdaggett@484 1599 <tr>
jdaggett@484 1600 <td>Value:
jdaggett@484 1601
jdaggett@8278 1602 <td><a href="#font-size-adjust-none-value"
jdaggett@8278 1603 title="none!!font-size-adjust">none</a> | <a
jdaggett@8225 1604 href="#aspect-ratio-value"><var>&lt;number&gt;</var></a>
jdaggett@484 1605
jdaggett@484 1606 <tr>
jdaggett@484 1607 <td>Initial:
jdaggett@484 1608
jdaggett@484 1609 <td>none
jdaggett@484 1610
jdaggett@484 1611 <tr>
jdaggett@484 1612 <td>Applies to:
jdaggett@484 1613
jdaggett@484 1614 <td>all elements
jdaggett@484 1615
jdaggett@484 1616 <tr>
jdaggett@484 1617 <td>Inherited:
jdaggett@484 1618
jdaggett@484 1619 <td>yes
jdaggett@484 1620
jdaggett@484 1621 <tr>
jdaggett@484 1622 <td>Percentages:
jdaggett@484 1623
jdaggett@554 1624 <td>N/A
jdaggett@484 1625
jdaggett@484 1626 <tr>
jdaggett@484 1627 <td>Media:
jdaggett@484 1628
jdaggett@484 1629 <td>visual
jdaggett@484 1630
jdaggett@484 1631 <tr>
jdaggett@1148 1632 <td>Computed value:
jdaggett@484 1633
jdaggett@554 1634 <td>as specified
jdaggett@7377 1635
jdaggett@7377 1636 <tr>
jdaggett@7377 1637 <td>Animatable:
jdaggett@7377 1638
jdaggett@7377 1639 <td>as <a
jdaggett@7377 1640 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
jdaggett@484 1641 </table>
jdaggett@484 1642
jdaggett@555 1643 <p>For any given font size, the apparent size and legibility of text varies
jdaggett@555 1644 across fonts. For scripts such as Latin or Cyrillic that distinguish
jdaggett@555 1645 between upper and lowercase letters, the relative height of lowercase
jdaggett@555 1646 letters compared to their uppercase counterparts is a determining factor
jdaggett@555 1647 of legibility. This is commonly referred to as the <a class=index-def
jdaggett@4624 1648 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
jdaggett@4624 1649 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
jdaggett@4624 1650 the x-height of a font divided by the font size.
jdaggett@555 1651
jdaggett@555 1652 <p>In situations where font fallback occurs, fallback fonts may not share
jdaggett@555 1653 the same aspect ratio as the desired font family and will thus appear less
jdaggett@8968 1654 readable. The ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 1655 class=property>font-size-adjust</code></a>’ property is a way to
jdaggett@8968 1656 preserve the readability of text when font fallback occurs. It does this
jdaggett@8968 1657 by adjusting the font-size so that the x-height is the same regardless of
jdaggett@8968 1658 the font used.
jdaggett@547 1659
jdaggett@547 1660 <div class=example>
jdaggett@547 1661 <p>The style defined below defines Verdana as the desired font family, but
jdaggett@547 1662 if Verdana is not available Futura or Times will be used.</p>
jdaggett@547 1663
jdaggett@8277 1664 <pre>p {
jdaggett@8277 1665 font-family: Verdana, Futura, Times;
jdaggett@547 1666 }
jdaggett@547 1667
jdaggett@547 1668 &lt;p>Lorem ipsum dolor sit amet, ...&lt;/p>
jdaggett@547 1669 </pre>
jdaggett@547 1670
jdaggett@547 1671 <p>Verdana has a relatively high aspect ratio, lowercase letters are
jdaggett@547 1672 relatively tall compared to uppercase letters, so at small sizes text
jdaggett@547 1673 appears legible. Times has a lower aspect ratio and so if fallback
jdaggett@547 1674 occurs, the text will be less legible at small sizes than Verdana.</p>
jdaggett@547 1675 </div>
jdaggett@547 1676
jdaggett@547 1677 <p>How text rendered in each of these fonts compares is shown below, the
jdaggett@547 1678 columns show text rendered in Verdana, Futura and Times. The same
jdaggett@547 1679 font-size value is used across cells within each row and red lines are
jdaggett@547 1680 included to show the differences in x-height. In the upper half each row
jdaggett@547 1681 is rendered in the same font-size value. The same is true for the lower
jdaggett@8968 1682 half but in this half the ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 1683 class=property>font-size-adjust</code></a>’ property is also set so that
jdaggett@2462 1684 the actual font size is adjusted to preserve the x-height across each row.
jdaggett@547 1685 Note how small text remains relatively legible across each row in the
jdaggett@547 1686 lower half.
jdaggett@547 1687
jdaggett@8968 1688 <div class=figure><img alt="text with and without 'font-size-adjust'"
jdaggett@1150 1689 src=fontsizeadjust.png>
jdaggett@8968 1690 <p class=caption>Text with and without the use of ‘<a
jdaggett@8968 1691 href="#propdef-font-size-adjust"><code
jdaggett@8968 1692 class=property>font-size-adjust</code></a>’
jdaggett@547 1693 </div>
jdaggett@512 1694
jdaggett@8640 1695 <p>This property allows authors to specify an <a
jdaggett@8640 1696 href="#aspect-value"><i>aspect value</i></a> for an element that will
jdaggett@8640 1697 effectively preserve the x-height of the first choice font, whether it is
jdaggett@8640 1698 substituted or not. Values have the following meanings:
jdaggett@512 1699
jdaggett@512 1700 <dl>
jdaggett@8278 1701 <dt><dfn id=font-size-adjust-none-value
jdaggett@8278 1702 title="none!!font-size-adjust">none</dfn>
jdaggett@512 1703
jdaggett@512 1704 <dd>Do not preserve the font's x-height.
jdaggett@512 1705
jdaggett@8225 1706 <dt><dfn id=aspect-ratio-value><var>&lt;number&gt;</var></dfn>
jdaggett@512 1707
jdaggett@8640 1708 <dd>Specifies the <a href="#aspect-value"><i>aspect value</i></a> used in
jdaggett@8640 1709 the calculation below to calculate the adjusted font size:
jdaggett@8277 1710 <pre>c = ( a / a' ) s
jdaggett@512 1711 </pre>
jdaggett@512 1712
jdaggett@512 1713 <p>where:</p>
jdaggett@512 1714
jdaggett@554 1715 <pre>s = font-size value
jdaggett@8968 1716 a = <a href="#aspect-value"><i>aspect value</i></a> as specified by the 'font-size-adjust' property
jdaggett@8640 1717 a' = <a href="#aspect-value"><i>aspect value</i></a> of actual font
jdaggett@554 1718 c = adjusted font-size to use
jdaggett@512 1719 </pre>
jdaggett@554 1720
jdaggett@554 1721 <p>This value applies to any font that is selected but in typical usage
jdaggett@8640 1722 it should be based on the <a href="#aspect-value"><i>aspect
jdaggett@8640 1723 value</i></a> of the first font in the font-family list. If this is
jdaggett@8640 1724 specified accurately, the <tt>(a/a')</tt> term in the formula above is
jdaggett@8640 1725 effectively 1 for the first font and no adjustment occurs. If the value
jdaggett@8640 1726 is specified inaccurately, text rendered using the first font in the
jdaggett@8640 1727 family list will display differently in older user agents that don't
jdaggett@8968 1728 support ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 1729 class=property>font-size-adjust</code></a>’.</p>
jdaggett@512 1730 </dl>
jdaggett@512 1731
jdaggett@8640 1732 <p>The value of ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 1733 class=property>font-size-adjust</code></a>’ affects the used value of
jdaggett@8968 1734 ‘<a href="#propdef-font-size"><code
jdaggett@8968 1735 class=property>font-size</code></a>’ but does not affect the computed
jdaggett@8968 1736 value. It affects the size of relative units that are based on font
jdaggett@8968 1737 metrics of the <a href="#first-available-font"><i>first available
jdaggett@8968 1738 font</i></a> such as <code>ex</code> and <code>ch</code> but does not
jdaggett@8968 1739 affect the size of <code>em</code> units. Since numeric values of <a
jdaggett@8957 1740 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8968 1741 class=property>line-height</code>’</a> refer to the computed size of
jdaggett@8968 1742 ‘<a href="#propdef-font-size"><code
jdaggett@8968 1743 class=property>font-size</code></a>’, ‘<a
jdaggett@8968 1744 href="#propdef-font-size-adjust"><code
jdaggett@8968 1745 class=property>font-size-adjust</code></a>’ does not affect the used
jdaggett@8968 1746 value of <a
jdaggett@8957 1747 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8968 1748 class=property>line-height</code>’</a>.
jdaggett@8968 1749
jdaggett@8968 1750 <p class=note>In CSS, authors often specify <a
jdaggett@8968 1751 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8968 1752 class=property>line-height</code>’</a> as a multiple of the ‘<a
jdaggett@8968 1753 href="#propdef-font-size"><code class=property>font-size</code></a>’.
jdaggett@8968 1754 Since the ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 1755 class=property>font-size-adjust</code></a>’ property affects the used
jdaggett@8968 1756 value of ‘<a href="#propdef-font-size"><code
jdaggett@8968 1757 class=property>font-size</code></a>’, authors should take care setting
jdaggett@8968 1758 the line height when ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8957 1759 class=property>font-size-adjust</code></a>’ is used. Setting the line
jdaggett@8968 1760 height too tightly can result in overlapping lines of text in this
jdaggett@8957 1761 situation.
jdaggett@8957 1762
jdaggett@8640 1763 <p>Authors can calculate the <a href="#aspect-value"><i>aspect
jdaggett@8640 1764 value</i></a> for a given font by comparing spans with the same content
jdaggett@8968 1765 but different ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 1766 class=property>font-size-adjust</code></a>’ properties. If the same
jdaggett@8968 1767 font-size is used, the spans will match when the ‘<a
jdaggett@8968 1768 href="#propdef-font-size-adjust"><code
jdaggett@8968 1769 class=property>font-size-adjust</code></a>’ value is accurate for the
jdaggett@8640 1770 given font.
jdaggett@554 1771
jdaggett@554 1772 <div class=example>
jdaggett@8640 1773 <p>Two spans with borders are used to determine the <a
jdaggett@8968 1774 href="#aspect-value"><i>aspect value</i></a> of a font. The ‘<a
jdaggett@8968 1775 href="#propdef-font-size"><code class=property>font-size</code></a>’ is
jdaggett@8968 1776 the same for both spans but the ‘<a
jdaggett@8968 1777 href="#propdef-font-size-adjust"><code
jdaggett@8968 1778 class=property>font-size-adjust</code></a>’ property is specified only
jdaggett@8968 1779 for the right span. Starting with a value of 0.5, the aspect value can be
jdaggett@8968 1780 adjusted until the borders around the two letters line up.</p>
jdaggett@554 1781
jdaggett@554 1782 <pre>p {
jdaggett@554 1783 font-family: Futura;
jdaggett@554 1784 font-size: 500px;
jdaggett@554 1785 }
jdaggett@554 1786
jdaggett@554 1787 span {
jdaggett@554 1788 border: solid 1px red;
jdaggett@554 1789 }
jdaggett@554 1790
jdaggett@554 1791 .adjust {
jdaggett@554 1792 font-size-adjust: 0.5;
jdaggett@554 1793 }
jdaggett@554 1794
jdaggett@554 1795 &lt;p>&lt;span>b&lt;/span>&lt;span class="adjust">b&lt;/span>&lt;/p>
jdaggett@554 1796 </pre>
jdaggett@554 1797
jdaggett@8640 1798 <div class=figure><img alt="Futura with an <i>aspect value</i> of 0.5"
jdaggett@1150 1799 src=beforefontsizeadjust.png>
jdaggett@8640 1800 <p class=caption>Futura with an <a href="#aspect-value"><i>aspect
jdaggett@8640 1801 value</i></a> of 0.5
jdaggett@554 1802 </div>
jdaggett@554 1803
jdaggett@554 1804 <p>The box on the right is a bit bigger than the one on the left, so the
jdaggett@8640 1805 <a href="#aspect-value"><i>aspect value</i></a> of this font is something
jdaggett@8640 1806 less than 0.5. Adjust the value until the boxes align.</p>
jdaggett@554 1807 </div>
jdaggett@512 1808 <!-- prop: font -->
jdaggett@512 1809
jdaggett@1662 1810 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
jdaggett@1662 1811 <a href="#propdef-font">font</a> property</h3>
jdaggett@1662 1812
jdaggett@8225 1813 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
jdaggett@484 1814 <tbody>
jdaggett@484 1815 <tr>
jdaggett@484 1816 <td>Name:
jdaggett@484 1817
jdaggett@1662 1818 <td><dfn id=propdef-font>font</dfn>
jdaggett@484 1819
jdaggett@484 1820 <tr>
jdaggett@484 1821 <td>Value:
jdaggett@484 1822
jdaggett@8278 1823 <td>[ [ <var>&lt;<a href="#propdef-font-style"
jdaggett@8278 1824 title="font-style!!property">‘<code
jdaggett@8278 1825 class=property>font-style</code>’</a>&gt;</var> || <a
jdaggett@8225 1826 href="#font-variant-css21-values"><var>&lt;font-variant-css21&gt;</var></a>
jdaggett@8278 1827 || <var>&lt;<a href="#propdef-font-weight"
jdaggett@8278 1828 title="font-weight!!property">‘<code
jdaggett@8278 1829 class=property>font-weight</code>’</a>&gt;</var> || <var>&lt;<a
jdaggett@8278 1830 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
jdaggett@8278 1831 class=property>font-stretch</code>’</a></var> ]? <var>&lt;‘<a
jdaggett@8225 1832 href="#propdef-font-size"><code
jdaggett@8225 1833 class=property>font-size</code></a>’&gt;</var> [ / <var>&lt;‘<code
jdaggett@8278 1834 class=property>line-height</code>’&gt;</var> ]? <var>&lt;<a
jdaggett@8278 1835 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1836 class=property>font-family</code>’</a>&gt;</var> ] | caption | icon |
jdaggett@8225 1837 menu | message-box | small-caption | status-bar
jdaggett@484 1838
jdaggett@484 1839 <tr>
jdaggett@484 1840 <td>Initial:
jdaggett@484 1841
jdaggett@484 1842 <td>see individual properties
jdaggett@484 1843
jdaggett@484 1844 <tr>
jdaggett@484 1845 <td>Applies to:
jdaggett@484 1846
jdaggett@484 1847 <td>all elements
jdaggett@484 1848
jdaggett@484 1849 <tr>
jdaggett@484 1850 <td>Inherited:
jdaggett@484 1851
jdaggett@484 1852 <td>yes
jdaggett@484 1853
jdaggett@484 1854 <tr>
jdaggett@484 1855 <td>Percentages:
jdaggett@484 1856
jdaggett@484 1857 <td>see individual properties
jdaggett@484 1858
jdaggett@484 1859 <tr>
jdaggett@484 1860 <td>Media:
jdaggett@484 1861
jdaggett@484 1862 <td>visual
jdaggett@484 1863
jdaggett@484 1864 <tr>
jdaggett@1148 1865 <td>Computed value:
jdaggett@484 1866
jdaggett@484 1867 <td>see individual properties
jdaggett@7377 1868
jdaggett@7377 1869 <tr>
jdaggett@7377 1870 <td>Animatable:
jdaggett@7377 1871
jdaggett@7377 1872 <td>see individual properties
jdaggett@484 1873 </table>
jdaggett@1732 1874
jdaggett@4624 1875 <p>The <span class=property>‘<a href="#propdef-font"><code
jdaggett@4624 1876 class=property>font</code></a>’</span> property is, except as described
jdaggett@8278 1877 below, a shorthand property for setting <a href="#propdef-font-style"
jdaggett@8278 1878 title="font-style!!property">‘<code
jdaggett@8278 1879 class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
jdaggett@8278 1880 title="font-variant!!property">‘<code
jdaggett@8278 1881 class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
jdaggett@8278 1882 title="font-weight!!property">‘<code
jdaggett@8278 1883 class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
jdaggett@8278 1884 title="font-stretch!!property">‘<code
jdaggett@8278 1885 class=property>font-stretch</code>’</a>, <span class=property>‘<a
jdaggett@8278 1886 href="#propdef-font-size"><code
jdaggett@8278 1887 class=property>font-size</code></a>’</span>, <a class=property
jdaggett@8278 1888 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8278 1889 class=property>line-height</code>’</a>, <a href="#propdef-font-family"
jdaggett@8278 1890 title="font-family!!property">‘<code
jdaggett@8278 1891 class=property>font-family</code>’</a> at the same place in the
jdaggett@8278 1892 stylesheet. Values for the <a href="#propdef-font-variant"
jdaggett@8278 1893 title="font-variant!!property">‘<code
jdaggett@8278 1894 class=property>font-variant</code>’</a> property may also be included
jdaggett@8313 1895 but only those supported in CSS 2.1, none of the <a
jdaggett@8313 1896 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 1897 class=property>font-variant</code>’</a> values added in this
jdaggett@8313 1898 specification can be used in the <span class=property>‘<a
jdaggett@8278 1899 href="#propdef-font"><code class=property>font</code></a>’</span>
jdaggett@8278 1900 shorthand:
jdaggett@1732 1901
jdaggett@1732 1902 <pre
jdaggett@8225 1903 class=prod><dfn id=font-variant-css21-values><var>&lt;font-variant-css21&gt;</var></dfn> = [normal | small-caps]</pre>
jdaggett@1732 1904
jdaggett@1732 1905 <p>The syntax of this property is based on a traditional typographical
jdaggett@1732 1906 shorthand notation to set multiple properties related to fonts.
jdaggett@512 1907
jdaggett@8197 1908 <p>All subproperties of the ‘<a href="#propdef-font"><code
jdaggett@8197 1909 class=property>font</code></a>’ property are first reset to their
jdaggett@8197 1910 initial values, including those listed above plus <span
jdaggett@4624 1911 class=property>‘<a href="#propdef-font-size-adjust"><code
jdaggett@4624 1912 class=property>font-size-adjust</code></a>’</span>, <span
jdaggett@4624 1913 class=property>‘<a href="#propdef-font-kerning"><code
jdaggett@8278 1914 class=property>font-kerning</code></a>’</span>, subproperties of <a
jdaggett@8278 1915 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8278 1916 class=property>font-variant</code>’</a> and and <span>‘<a
jdaggett@8278 1917 href="#propdef-font-language-override"><code
jdaggett@8197 1918 class=property>font-language-override</code></a>’</span>. Then, those
jdaggett@8197 1919 properties that are given explicit values in the <span
jdaggett@8197 1920 class=property>‘<a href="#propdef-font"><code
jdaggett@4624 1921 class=property>font</code></a>’</span> shorthand are set to those
jdaggett@512 1922 values. For a definition of allowed and initial values, see the previously
jdaggett@512 1923 defined properties. For reasons of backwards compatibility, it is not
jdaggett@4624 1924 possible to set <span class=property>‘<a
jdaggett@7020 1925 href="#propdef-font-size-adjust"><code
jdaggett@7020 1926 class=property>font-size-adjust</code></a>’</span> to anything other
jdaggett@7020 1927 than its initial value using the <span class=property>‘<a
jdaggett@4624 1928 href="#propdef-font"><code class=property>font</code></a>’</span>
jdaggett@7020 1929 shorthand property; instead, use the individual property.
jdaggett@512 1930
jdaggett@512 1931 <div class=example>
jdaggett@8699 1932 <p style="display:none">Example(s):</p>
jdaggett@890 1933
jdaggett@512 1934 <pre>p { font: 12pt/14pt sans-serif }
jdaggett@512 1935 p { font: 80% sans-serif }
jdaggett@512 1936 p { font: x-large/110% &quot;new century schoolbook&quot;, serif }
jdaggett@512 1937 p { font: bold italic large Palatino, serif }
jdaggett@512 1938 p { font: normal small-caps 120%/120% fantasy }
jdaggett@7020 1939 p { font: condensed oblique 12pt &quot;Helvetica Neue&quot;, serif; }
jdaggett@512 1940 </pre>
jdaggett@512 1941
jdaggett@1148 1942 <p> In the second rule, the font size percentage value (‘<code
jdaggett@8187 1943 class=css>80%</code>’) refers to the computed ‘<a
jdaggett@8187 1944 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
jdaggett@8187 1945 the parent element. In the third rule, the line height percentage
jdaggett@8187 1946 (‘<code class=css>110%</code>’) refers to the font size of the
jdaggett@8187 1947 element itself.
jdaggett@512 1948
jdaggett@8278 1949 <p>The first three rules do not specify the <a
jdaggett@8278 1950 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8278 1951 class=property>font-variant</code>’</a> and <a
jdaggett@8278 1952 href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 1953 class=property>font-weight</code>’</a> explicitly, so these properties
jdaggett@8368 1954 receive their initial values (<span title="normal value">‘<code
jdaggett@8368 1955 class=property>normal</code>’</span>). Notice that the font family name
jdaggett@8279 1956 "new century schoolbook", which contains spaces, is enclosed in quotes.
jdaggett@8279 1957 The fourth rule sets the <a href="#propdef-font-weight"
jdaggett@8279 1958 title="font-weight!!property">‘<code
jdaggett@8278 1959 class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
jdaggett@8278 1960 class=property>bold</code></a>’, the <a href="#propdef-font-style"
jdaggett@8278 1961 title="font-style!!property">‘<code
jdaggett@8278 1962 class=property>font-style</code>’</a> to ‘<a href="#italic"><code
jdaggett@8278 1963 class=property>italic</code></a>’, and implicitly sets <a
jdaggett@8278 1964 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8368 1965 class=property>font-variant</code>’</a> to <a
jdaggett@8368 1966 href="#font-variant-normal-value" title="normal!!font-variant">‘<code
jdaggett@8368 1967 class=property>normal</code>’</a>.
jdaggett@8278 1968
jdaggett@8278 1969 <p> The fifth rule sets the <a href="#propdef-font-variant"
jdaggett@8278 1970 title="font-variant!!property">‘<code
jdaggett@8278 1971 class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
jdaggett@8278 1972 class=property>small-caps</code></a>’), the <span class=property>‘<a
jdaggett@8278 1973 href="#propdef-font-size"><code
jdaggett@4624 1974 class=property>font-size</code></a>’</span> (120% of the parent's font
jdaggett@8278 1975 size), the <a class=property
jdaggett@8278 1976 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8278 1977 class=property>line-height</code>’</a> (120% of the font size) and the
jdaggett@8278 1978 <a href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1979 class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
jdaggett@8368 1980 class=property>fantasy</code></a>’). It follows that the keyword <span
jdaggett@8368 1981 title="normal value">‘<code class=property>normal</code>’</span>
jdaggett@8368 1982 applies to the two remaining properties: <a href="#propdef-font-style"
jdaggett@8278 1983 title="font-style!!property">‘<code
jdaggett@8278 1984 class=property>font-style</code>’</a> and <a
jdaggett@8278 1985 href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 1986 class=property>font-weight</code>’</a>.
jdaggett@8278 1987
jdaggett@8278 1988 <p>The sixth rule sets the <a href="#propdef-font-style"
jdaggett@8278 1989 title="font-style!!property">‘<code
jdaggett@8278 1990 class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
jdaggett@8278 1991 title="font-stretch!!property">‘<code
jdaggett@8278 1992 class=property>font-stretch</code>’</a>, <span class=property>‘<a
jdaggett@8278 1993 href="#propdef-font-size"><code
jdaggett@8278 1994 class=property>font-size</code></a>’</span>, and <a
jdaggett@8278 1995 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1996 class=property>font-family</code>’</a>, the other font properties being
jdaggett@8278 1997 set to their initial values.
jdaggett@512 1998 </div>
jdaggett@512 1999
jdaggett@8278 2000 <p>Since the <a href="#propdef-font-stretch"
jdaggett@8278 2001 title="font-stretch!!property">‘<code
jdaggett@8278 2002 class=property>font-stretch</code>’</a> property was not defined in CSS
jdaggett@8278 2003 2.1, when using <a href="#propdef-font-stretch"
jdaggett@8278 2004 title="font-stretch!!property">‘<code
jdaggett@8278 2005 class=property>font-stretch</code>’</a> values within ‘<a
jdaggett@7020 2006 href="#propdef-font"><code class=property>font</code></a>’ rules,
jdaggett@7020 2007 authors should include a extra version compatible with older user agents:
jdaggett@7020 2008
jdaggett@7020 2009 <pre>p {
jdaggett@7020 2010 font: 80% sans-serif; /* for older user agents */
jdaggett@7020 2011 font: condensed 80% sans-serif;
jdaggett@7020 2012 }</pre>
jdaggett@7020 2013
jdaggett@1662 2014 <p>The following values refer to system fonts:
jdaggett@512 2015
jdaggett@512 2016 <dl>
jdaggett@512 2017 <dt><strong>caption</strong>
jdaggett@512 2018
jdaggett@512 2019 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
jdaggett@512 2020 etc.).
jdaggett@512 2021
jdaggett@512 2022 <dt><strong>icon</strong>
jdaggett@512 2023
jdaggett@512 2024 <dd>The font used to label icons.
jdaggett@512 2025
jdaggett@512 2026 <dt><strong>menu</strong>
jdaggett@512 2027
jdaggett@512 2028 <dd>The font used in menus (e.g., dropdown menus and menu lists).
jdaggett@512 2029
jdaggett@512 2030 <dt><strong>message-box</strong>
jdaggett@512 2031
jdaggett@512 2032 <dd>The font used in dialog boxes.
jdaggett@512 2033
jdaggett@512 2034 <dt><strong>small-caption</strong>
jdaggett@512 2035
jdaggett@512 2036 <dd>The font used for labeling small controls.
jdaggett@512 2037
jdaggett@512 2038 <dt><strong>status-bar</strong>
jdaggett@512 2039
jdaggett@512 2040 <dd>The font used in window status bars.
jdaggett@512 2041 </dl>
jdaggett@512 2042
jdaggett@512 2043 <p>System fonts may only be set as a whole; that is, the font family, size,
jdaggett@1662 2044 weight, style, etc. are all set at the same time. These values may then be
jdaggett@512 2045 altered individually if desired. If no font with the indicated
jdaggett@512 2046 characteristics exists on a given platform, the user agent should either
jdaggett@1148 2047 intelligently substitute (e.g., a smaller version of the ‘<code
jdaggett@1148 2048 class=property>caption</code>’ font might be used for the ‘<code
jdaggett@7242 2049 class=property>small-caption</code>’ font), or substitute a user agent
jdaggett@1148 2050 default font. As for regular fonts, if, for a system font, any of the
jdaggett@1148 2051 individual properties are not part of the operating system's available
jdaggett@1148 2052 user preferences, those properties should be set to their initial values.
jdaggett@512 2053
jdaggett@1662 2054 <p>That is why this property is "almost" a shorthand property: system fonts
jdaggett@8278 2055 can only be specified with this property, not with <a
jdaggett@8278 2056 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 2057 class=property>font-family</code>’</a> itself, so <span
jdaggett@4624 2058 class=property>‘<a href="#propdef-font"><code
jdaggett@4624 2059 class=property>font</code></a>’</span> allows authors to do more than
jdaggett@4624 2060 the sum of its subproperties. However, the individual properties such as
jdaggett@8278 2061 <a href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 2062 class=property>font-weight</code>’</a> are still given values taken from
jdaggett@8278 2063 the system font, which can be independently varied.
jdaggett@512 2064
jdaggett@7235 2065 <p>Note that the keywords used for the system fonts listed above are only
jdaggett@7235 2066 treated as keywords when they occur in the initial position, in other
jdaggett@7235 2067 positions the same string is treated as part of the font family name:
jdaggett@7235 2068
jdaggett@7235 2069 <pre> font: menu; /* use the font settings for system menus */
jdaggett@7235 2070 font: large menu; /* use a font family named "menu" */</pre>
jdaggett@7235 2071
jdaggett@512 2072 <div class=example>
jdaggett@8699 2073 <p style="display:none">Example(s):</p>
jdaggett@890 2074
jdaggett@512 2075 <pre>button { font: 300 italic 1.3em/1.7em &quot;FB Armada&quot;, sans-serif }
jdaggett@512 2076 button p { font: menu }
jdaggett@512 2077 button p em { font-weight: bolder }
jdaggett@512 2078 </pre>
jdaggett@512 2079
jdaggett@512 2080 <p>If the font used for dropdown menus on a particular system happened to
jdaggett@512 2081 be, for example, 9-point Charcoal, with a weight of 600, then P elements
jdaggett@512 2082 that were descendants of BUTTON would be displayed as if this rule were
jdaggett@890 2083 in effect:
jdaggett@512 2084
jdaggett@512 2085 <pre>button p { font: 600 9pt Charcoal }
jdaggett@512 2086 </pre>
jdaggett@512 2087
jdaggett@4624 2088 <p>Because the <span class=property>‘<a href="#propdef-font"><code
jdaggett@4624 2089 class=property>font</code></a>’</span> shorthand resets to its initial
jdaggett@4624 2090 value any property not explicitly given a value, this has the same effect
jdaggett@4624 2091 as this declaration:
jdaggett@512 2092
jdaggett@512 2093 <pre>button p {
jdaggett@512 2094 font-style: normal;
jdaggett@512 2095 font-variant: normal;
jdaggett@512 2096 font-weight: 600;
jdaggett@512 2097 font-size: 9pt;
jdaggett@512 2098 line-height: normal;
jdaggett@512 2099 font-family: Charcoal
jdaggett@8277 2100 }
jdaggett@512 2101 </pre>
jdaggett@512 2102 </div>
jdaggett@2487 2103 <!-- prop: font-synthesis -->
jdaggett@2487 2104
jdaggett@2487 2105 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
jdaggett@2487 2106 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
jdaggett@2487 2107 property</h3>
jdaggett@2487 2108
jdaggett@4624 2109 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
jdaggett@2457 2110 <tbody>
jdaggett@2457 2111 <tr>
jdaggett@2457 2112 <td>Name:
jdaggett@2457 2113
jdaggett@2487 2114 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
jdaggett@2457 2115
jdaggett@2457 2116 <tr>
jdaggett@2457 2117 <td>Value:
jdaggett@2457 2118
jdaggett@2487 2119 <td>none | [ weight || style ]
jdaggett@2457 2120
jdaggett@2457 2121 <tr>
jdaggett@2457 2122 <td>Initial:
jdaggett@2457 2123
jdaggett@2487 2124 <td>weight style
jdaggett@2457 2125
jdaggett@2457 2126 <tr>
jdaggett@2457 2127 <td>Applies to:
jdaggett@2457 2128
jdaggett@2457 2129 <td>all elements
jdaggett@2457 2130
jdaggett@2457 2131 <tr>
jdaggett@2457 2132 <td>Inherited:
jdaggett@2457 2133
jdaggett@2457 2134 <td>yes
jdaggett@2457 2135
jdaggett@2457 2136 <tr>
jdaggett@2457 2137 <td>Percentages:
jdaggett@2457 2138
jdaggett@2457 2139 <td>N/A
jdaggett@2457 2140
jdaggett@2457 2141 <tr>
jdaggett@2457 2142 <td>Media:
jdaggett@2457 2143
jdaggett@2457 2144 <td>visual
jdaggett@2457 2145
jdaggett@2457 2146 <tr>
jdaggett@2457 2147 <td>Computed value:
jdaggett@2457 2148
jdaggett@2457 2149 <td>as specified
jdaggett@7377 2150
jdaggett@7377 2151 <tr>
jdaggett@7377 2152 <td>Animatable:
jdaggett@7377 2153
jdaggett@7377 2154 <td>no
jdaggett@2457 2155 </table>
jdaggett@2457 2156
jdaggett@2487 2157 <p>This property controls whether user agents are allowed to synthesize
jdaggett@2487 2158 bold or oblique font faces when a font family lacks bold or italic faces.
jdaggett@7311 2159 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
jdaggett@7311 2160 specified, user agents must not synthesize bold faces and if ‘<code
jdaggett@2487 2161 class=property>style</code>’ is not specified user agents must not
jdaggett@8278 2162 synthesize italic faces. A value of ‘<code class=property>none</code>’
jdaggett@8278 2163 disallows all synthetic faces.
jdaggett@2457 2164
jdaggett@2457 2165 <div class=example>
jdaggett@2488 2166 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
jdaggett@2457 2167
jdaggett@2487 2168 <pre>*:lang(ar) { font-synthesis: none; }
jdaggett@2457 2169 </pre>
jdaggett@2457 2170 </div>
jdaggett@512 2171
jdaggett@6699 2172 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
jdaggett@545 2173
jdaggett@8311 2174 <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
jdaggett@8311 2175 id=at-font-face-rule style="font-weight: inherit; font-style:
jdaggett@8311 2176 inherit"><code>@font-face</code></dfn> rule</h3>
jdaggett@8311 2177
jdaggett@8311 2178 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
jdaggett@8311 2179 for linking to fonts that are automatically fetched and activated when
jdaggett@8311 2180 needed. This allows authors to select a font that closely matches the
jdaggett@8311 2181 design goals for a given page rather than limiting the font choice to a
jdaggett@8311 2182 set of fonts available on all platforms. A set of font descriptors define
jdaggett@8311 2183 the location of a font resource, either locally or externally, along with
jdaggett@8311 2184 the style characteristics of an individual face. Multiple <a
jdaggett@8311 2185 href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
jdaggett@8311 2186 construct font families with a variety of faces. Using CSS font matching
jdaggett@8311 2187 rules, a user agent can selectively download only those faces that are
jdaggett@8311 2188 needed for a given piece of text.
jdaggett@8311 2189
jdaggett@8311 2190 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
jdaggett@8311 2191 consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2192 at-keyword followed by a block of descriptor declarations. In terms of the
jdaggett@8311 2193 grammar, this specification defines the following productions:
jdaggett@8031 2194
jdaggett@8031 2195 <pre><dfn id=fontfacerule>font_face_rule</dfn>
jdaggett@8225 2196 : <a href="#fontfacesym"><i>FONT_FACE_SYM</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* '{' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#descriptordeclaration"><i>descriptor_declaration</i></a>? [ ';' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#descriptordeclaration"><i>descriptor_declaration</i></a>? ]* '}' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8031 2197 ;
jdaggett@8031 2198
jdaggett@8031 2199 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
jdaggett@8225 2200 : <a href="http://www.w3.org/TR/CSS21/grammar.html#grammar"><i>property</i></a> ':' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/grammar.html#grammar"><i>expr</i></a>
jdaggett@8031 2201 ;</pre>
jdaggett@8031 2202
jdaggett@8032 2203 <p>The following new definitions are introduced:
jdaggett@8032 2204
jdaggett@8032 2205 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
jdaggett@8032 2206 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
jdaggett@8032 2207
jdaggett@8032 2208 <p>The following new token is introduced:
jdaggett@8032 2209
jdaggett@8225 2210 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
jdaggett@8032 2211
jdaggett@8311 2212 <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
jdaggett@8311 2213 specifies a value for every font descriptor, either implicitly or
jdaggett@8311 2214 explicitly. Those not given explicit values in the rule take the initial
jdaggett@8311 2215 value listed with each descriptor in this specification. These descriptors
jdaggett@8311 2216 apply solely within the context of the <a
jdaggett@8311 2217 href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
jdaggett@8311 2218 are defined, and do not apply to document language elements. There is no
jdaggett@8311 2219 notion of which elements the descriptors apply to or whether the values
jdaggett@8311 2220 are inherited by child elements. When a given descriptor occurs multiple
jdaggett@8311 2221 times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2222 rule, only the last descriptor declaration is used and all prior
jdaggett@8311 2223 declarations for that descriptor are ignored.
jdaggett@512 2224
jdaggett@525 2225 <div class=example>
jdaggett@525 2226 <p>To use a downloadable font called Gentium:</p>
jdaggett@512 2227
jdaggett@512 2228 <pre>
jdaggett@525 2229 @font-face {
jdaggett@525 2230 font-family: Gentium;
jdaggett@8860 2231 src: url(http://example.com/fonts/Gentium.woff);
jdaggett@525 2232 }
jdaggett@525 2233
jdaggett@525 2234 p { font-family: Gentium, serif; }
jdaggett@512 2235 </pre>
jdaggett@512 2236
jdaggett@573 2237 <p>The user agent will download Gentium and use it when rendering text
jdaggett@573 2238 within paragraph elements. If for some reason the site serving the font
jdaggett@573 2239 is unavailable, the default serif font will be used.</p>
jdaggett@512 2240 </div>
jdaggett@512 2241
jdaggett@8311 2242 <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2243 rules define a set of fonts available for use within the documents that
jdaggett@8311 2244 contain these rules. When font matching is done, fonts defined using these
jdaggett@8311 2245 rules are considered before other available fonts on a system.
jdaggett@8198 2246
jdaggett@8198 2247 <p>Downloaded fonts are only available to documents that reference them.
jdaggett@8198 2248 The process of activating these fonts must not make them available to
jdaggett@2472 2249 other applications or to documents that don't directly link to the same
jdaggett@2556 2250 font. User agent implementers might consider it convenient to use
jdaggett@2472 2251 downloaded fonts when rendering characters in other documents for which no
jdaggett@8363 2252 other available font exists as part of the <a
jdaggett@8363 2253 href="#system-font-fallback"><em>system font fallback</em></a> procedure.
jdaggett@8198 2254 However, this would cause a security leak since the contents of one page
jdaggett@8198 2255 would be able to affect other pages, something an attacker could use as an
jdaggett@8198 2256 attack vector. These restrictions do not affect caching behavior, fonts
jdaggett@8198 2257 are cached the same way other web resources are cached.
jdaggett@8198 2258
jdaggett@8198 2259 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
jdaggett@8198 2260 properties in a declaration block, declarations of any descriptors that
jdaggett@8311 2261 are not supported by the user agent must be ignored. <a
jdaggett@8311 2262 href="#at-font-face-rule"><code>@font-face</code></a> rules require a
jdaggett@8311 2263 font-family and src descriptor; if either of these are missing, the <a
jdaggett@8311 2264 href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
jdaggett@8311 2265 must be ignored entirely.
jdaggett@1244 2266
jdaggett@1244 2267 <p>In cases where user agents have limited platform resources or implement
jdaggett@8311 2268 the ability to disable downloadable font resources, <a
jdaggett@8311 2269 href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
jdaggett@8311 2270 ignored; the behavior of individual descriptors as defined in this
jdaggett@8311 2271 specification should not be altered.
jdaggett@1662 2272
jdaggett@1662 2273 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
jdaggett@1662 2274 href="#descdef-font-family">font-family</a> descriptor</h3>
jdaggett@512 2275
jdaggett@512 2276 <table class=descdef>
jdaggett@512 2277 <tbody>
jdaggett@512 2278 <tr>
jdaggett@512 2279 <td>Name:
jdaggett@512 2280
jdaggett@8278 2281 <td><dfn id=descdef-font-family
jdaggett@8278 2282 title="font-family!!descriptor">font-family</dfn>
jdaggett@512 2283
jdaggett@512 2284 <tr>
jdaggett@512 2285 <td>Value:
jdaggett@512 2286
jdaggett@8225 2287 <td><a href="#family-name-value"><var>&lt;family-name&gt;</var></a>
jdaggett@890 2288
jdaggett@890 2289 <tr>
jdaggett@890 2290 <td><em>Initial:</em>
jdaggett@890 2291
jdaggett@890 2292 <td>N/A
jdaggett@512 2293 </table>
jdaggett@512 2294
jdaggett@525 2295 <p>This descriptor defines the font family name that will be used in all
jdaggett@8311 2296 CSS font family name matching. It is required for the <a
jdaggett@8311 2297 href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
jdaggett@8311 2298 overrides the font family names contained in the underlying font data. If
jdaggett@8311 2299 the font family name is the same as a font family available in a given
jdaggett@8311 2300 user's environment, it effectively hides the underlying font for documents
jdaggett@8311 2301 that use the stylesheet. This permits a web author to freely choose
jdaggett@8311 2302 font-family names without worrying about conflicts with font family names
jdaggett@8311 2303 present in a given user's environment. Likewise, platform substitutions
jdaggett@8311 2304 for a given font family name must not be used.
jdaggett@1244 2305
jdaggett@1662 2306 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
jdaggett@1662 2307 href="#descdef-src">src</a> descriptor</h3>
jdaggett@512 2308
jdaggett@512 2309 <table class=descdef>
jdaggett@512 2310 <tbody>
jdaggett@512 2311 <tr>
jdaggett@512 2312 <td>Name:
jdaggett@512 2313
jdaggett@1662 2314 <td><dfn id=descdef-src>src</dfn>
jdaggett@512 2315
jdaggett@512 2316 <tr>
jdaggett@512 2317 <td>Value:
jdaggett@512 2318
jdaggett@8225 2319 <td>[ &lt;url> [format(&lt;string> #)]? | <a
jdaggett@8225 2320 href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> ] #
jdaggett@890 2321
jdaggett@890 2322 <tr>
jdaggett@890 2323 <td><em>Initial:</em>
jdaggett@890 2324
jdaggett@890 2325 <td>N/A
jdaggett@512 2326 </table>
jdaggett@512 2327
jdaggett@899 2328 <p>This descriptor specifies the resource containing font data. It is
jdaggett@8311 2329 required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2330 rule to be valid. Its value is a prioritized, comma-separated list of
jdaggett@8311 2331 external references or locally-installed font face names. When a font is
jdaggett@8311 2332 needed the user agent iterates over the set of references listed, using
jdaggett@8311 2333 the first one it can successfully activate. Fonts containing invalid data
jdaggett@8311 2334 or local font faces that are not found are ignored and the user agent
jdaggett@8311 2335 loads the next font in the list.
jdaggett@8272 2336
jdaggett@8272 2337 <p>As with other URLs in CSS, the URL may be relative, in which case it is
jdaggett@8311 2338 resolved relative to the location of the style sheet containing the <a
jdaggett@8311 2339 href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
jdaggett@8311 2340 SVG fonts, the URL points to an element within a document containing SVG
jdaggett@8311 2341 font definitions. If the element reference is omitted, a reference to the
jdaggett@8311 2342 first defined font is implied. Similarly, font container formats that can
jdaggett@7096 2343 contain more than one font must load one and only one of the fonts for a
jdaggett@8311 2344 given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@8311 2345 Fragment identifiers are used to indicate which font to load. If a
jdaggett@8311 2346 container format lacks a defined fragment identifier scheme,
jdaggett@8311 2347 implementations should use a simple 1-based indexing scheme (e.g.
jdaggett@8311 2348 "font-collection#1" for the first font, "font-collection#2" for the second
jdaggett@8311 2349 font).
jdaggett@1244 2350
jdaggett@2527 2351 <pre>
jdaggett@8860 2352 src: url(fonts/simple.woff); /* load simple.woff relative to stylesheet location */
jdaggett@8860 2353 src: url(/fonts/simple.woff); /* load simple.woff from absolute location */
jdaggett@8860 2354 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
jdaggett@2527 2355 </pre>
jdaggett@2527 2356
jdaggett@8198 2357 <p>External references consist of a URL, followed by an optional hint
jdaggett@8198 2358 describing the format of the font resource referenced by that URL. The
jdaggett@2527 2359 format hint contains a comma-separated list of format strings that denote
jdaggett@2527 2360 well-known font formats. Conformant user agents must skip downloading a
jdaggett@2527 2361 font resource if the format hints indicate only unsupported or unknown
jdaggett@2527 2362 font formats. If no format hints are supplied, the user agent should
jdaggett@2527 2363 download the font resource.
jdaggett@2527 2364
jdaggett@2527 2365 <pre>
jdaggett@2527 2366 /* load WOFF font if possible, otherwise use OpenType font */
jdaggett@2527 2367 @font-face {
jdaggett@2527 2368 font-family: bodytext;
jdaggett@2527 2369 src: url(ideal-sans-serif.woff) format("woff"),
jdaggett@2527 2370 url(basic-sans-serif.ttf) format("opentype");
jdaggett@2527 2371 }
jdaggett@2527 2372 </pre>
jdaggett@2527 2373
jdaggett@2527 2374 <p>Format strings defined by this specification:
jdaggett@2527 2375
jdaggett@2527 2376 <table class=data id=fontformats>
jdaggett@2527 2377 <thead>
jdaggett@2527 2378 <tr>
jdaggett@2527 2379 <th>String
jdaggett@2527 2380
jdaggett@2527 2381 <th>Font Format
jdaggett@2527 2382
jdaggett@2527 2383 <th>Common extensions
jdaggett@2527 2384
jdaggett@2527 2385 <tbody>
jdaggett@2527 2386 <tr>
jdaggett@2527 2387 <th>"woff"
jdaggett@2527 2388
jdaggett@4624 2389 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
jdaggett@2527 2390
jdaggett@2527 2391 <td>.woff
jdaggett@2527 2392
jdaggett@2527 2393 <tr>
jdaggett@2527 2394 <th>"truetype"
jdaggett@2527 2395
jdaggett@4624 2396 <td><a
jdaggett@4624 2397 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
jdaggett@2527 2398
jdaggett@2527 2399 <td>.ttf
jdaggett@2527 2400
jdaggett@2527 2401 <tr>
jdaggett@2527 2402 <th>"opentype"
jdaggett@2527 2403
jdaggett@4624 2404 <td><a
jdaggett@4624 2405 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
jdaggett@2527 2406
jdaggett@2527 2407 <td>.ttf, .otf
jdaggett@2527 2408
jdaggett@2527 2409 <tr>
jdaggett@2527 2410 <th>"embedded-opentype"
jdaggett@2527 2411
jdaggett@4624 2412 <td><a
jdaggett@4624 2413 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
jdaggett@4624 2414 OpenType</a>
jdaggett@2527 2415
jdaggett@2527 2416 <td>.eot
jdaggett@2527 2417
jdaggett@2527 2418 <tr>
jdaggett@2527 2419 <th>"svg"
jdaggett@2527 2420
jdaggett@4624 2421 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
jdaggett@2527 2422
jdaggett@2527 2423 <td>.svg, .svgz
jdaggett@2527 2424 </table>
jdaggett@2527 2425
jdaggett@2527 2426 <p>Given the overlap in common usage between TrueType and OpenType, the
jdaggett@2527 2427 format hints "truetype" and "opentype" must be considered as synonymous; a
jdaggett@2527 2428 format hint of "opentype" does not imply that the font contains Postscript
jdaggett@2527 2429 CFF style glyph data or that it contains OpenType layout information (see
jdaggett@7377 2430 <a href="#platform-props-to-css">Appendix A</a> for more background on
jdaggett@7377 2431 this).
jdaggett@2527 2432
jdaggett@2527 2433 <p>When authors would prefer to use a locally available copy of a given
jdaggett@8198 2434 font and download it if it's not, <code>local()</code> can be used. The
jdaggett@8225 2435 locally-installed <dfn
jdaggett@8225 2436 id=font-face-name-value><var>&lt;font-face-name&gt;</var></dfn> argument
jdaggett@8272 2437 to <code>local()</code> is a format-specific string that uniquely
jdaggett@8272 2438 identifies a single font face within a larger family. The syntax for a <a
jdaggett@8225 2439 href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> is a
jdaggett@8241 2440 unique font face name enclosed by "local(" and ")". The name can
jdaggett@8241 2441 optionally be enclosed in quotes. If unquoted, the unquoted font family
jdaggett@8241 2442 name processing conventions apply; the name must be a sequence of
jdaggett@8241 2443 identifiers separated by whitespace which is converted to a string by
jdaggett@8241 2444 joining the identifiers together separated by a single space.
jdaggett@2527 2445
jdaggett@2527 2446 <pre>
jdaggett@2527 2447 /* regular face of Gentium */
jdaggett@573 2448 @font-face {
jdaggett@2527 2449 font-family: MyGentium;
jdaggett@8860 2450 src: local(Gentium), /* use locally available Gentium */
jdaggett@8860 2451 url(Gentium.woff); /* otherwise, download it */
jdaggett@573 2452 }
jdaggett@573 2453 </pre>
jdaggett@573 2454
jdaggett@8241 2455 <p>For OpenType and TrueType fonts, this string is used to match only the
jdaggett@8241 2456 Postscript name or the full font name in the name table of locally
jdaggett@8241 2457 available fonts. Which type of name is used varies by platform and font,
jdaggett@8241 2458 so authors should include both of these names to assure proper matching
jdaggett@8241 2459 across platforms. Platform substitutions for a given font name must not be
jdaggett@8241 2460 used.
jdaggett@2527 2461
jdaggett@2527 2462 <pre>
jdaggett@2527 2463 /* bold face of Gentium */
jdaggett@2527 2464 @font-face {
jdaggett@2527 2465 font-family: MyGentium;
jdaggett@8860 2466 src: local(Gentium Bold), /* full font name */
jdaggett@8860 2467 local(Gentium-Bold), /* Postscript name */
jdaggett@8860 2468 url(GentiumBold.woff); /* otherwise, download it */
jdaggett@2527 2469 font-weight: bold;
jdaggett@2527 2470 }
jdaggett@2527 2471 </pre>
jdaggett@2527 2472
jdaggett@8311 2473 <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
jdaggett@8311 2474 specifies the characteristics of a single font within a family, the unique
jdaggett@8311 2475 name used with <code>local()</code> specifies a single font, not an entire
jdaggett@8311 2476 font family. Defined in terms of OpenType font data, the Postscript name
jdaggett@8311 2477 is found in the font's <a
jdaggett@2527 2478 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
jdaggett@2527 2479 in the name record with nameID = 6 (see <a href="#OPENTYPE"
jdaggett@2556 2480 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
jdaggett@2527 2481 Postscript name is the commonly used key for all fonts on OSX and for
jdaggett@2527 2482 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
jdaggett@2527 2483 used as a unique key for fonts with TrueType glyphs on Windows.
jdaggett@2527 2484
jdaggett@2527 2485 <p>For OpenType fonts with multiple localizations of the full font name,
jdaggett@2527 2486 the US English version is used (language ID = 0x409 for Windows and
jdaggett@2527 2487 language ID = 0 for Macintosh) or the first localization when a US English
jdaggett@2527 2488 full font name is not available (the OpenType specification recommends
jdaggett@2527 2489 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
jdaggett@2527 2490 fonts minimally include US English names</a>). User agents that also match
jdaggett@2527 2491 other full font names, e.g. matching the Dutch name when the current
jdaggett@2527 2492 system locale is set to Dutch, are considered non-conformant. This is done
jdaggett@2527 2493 not to prefer English but to avoid matching inconsistencies across font
jdaggett@2527 2494 versions and OS localizations, since font style names (e.g. "Bold") are
jdaggett@2527 2495 frequently localized into many languages and the set of localizations
jdaggett@2527 2496 available varies widely across platform and font version. User agents that
jdaggett@2527 2497 match a concatenation of family name (nameID = 1) with style name (nameID
jdaggett@2527 2498 = 2) are considered non-conformant.
jdaggett@2527 2499
jdaggett@2527 2500 <p>This also allows for referencing faces that belong to larger families
jdaggett@2527 2501 that cannot otherwise be referenced.
jdaggett@2527 2502
jdaggett@2527 2503 <div class=example>
jdaggett@525 2504 <p>Use a local font or reference an SVG font in another document:</p>
jdaggett@525 2505
jdaggett@525 2506 <pre>
jdaggett@525 2507 @font-face {
jdaggett@525 2508 font-family: Headline;
jdaggett@8277 2509 src: local(Futura-Medium),
jdaggett@1148 2510 url(fonts.svg#MyGeometricModern) format("svg");
jdaggett@525 2511 }
jdaggett@525 2512 </pre>
jdaggett@525 2513
jdaggett@525 2514 <p>Create an alias for local Japanese fonts on different platforms:</p>
jdaggett@525 2515
jdaggett@525 2516 <pre>
jdaggett@525 2517 @font-face {
jdaggett@2527 2518 font-family: jpgothic;
jdaggett@525 2519 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
jdaggett@525 2520 }
jdaggett@525 2521 </pre>
jdaggett@525 2522
jdaggett@525 2523 <p>Reference a font face that cannot be matched within a larger family:</p>
jdaggett@525 2524
jdaggett@525 2525 <pre>
jdaggett@525 2526 @font-face {
jdaggett@525 2527 font-family: Hoefler Text Ornaments;
jdaggett@525 2528 /* has the same font properties as Hoefler Text Regular */
jdaggett@8277 2529 src: local(HoeflerText-Ornaments);
jdaggett@525 2530 }
jdaggett@525 2531 </pre>
jdaggett@2527 2532
jdaggett@8198 2533 <p>Since localized fullnames never match, a document with the header style
jdaggett@8198 2534 rules below would always render using the default serif font, regardless
jdaggett@8198 2535 whether a particular system locale parameter is set to Finnish or not:</p>
jdaggett@1662 2536
jdaggett@1662 2537 <pre>
jdaggett@1662 2538 @font-face {
jdaggett@1662 2539 font-family: SectionHeader;
jdaggett@6653 2540 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
jdaggett@1662 2541 font-weight: bold;
jdaggett@1662 2542 }
jdaggett@1662 2543
jdaggett@1662 2544 h2 { font-family: SectionHeader, serif; }
jdaggett@1662 2545 </pre>
jdaggett@1662 2546
jdaggett@8198 2547 <p>A conformant user agent would never load the font ‘<code
jdaggett@1662 2548 class=css>gentium.eot</code>’ in the example below, since it is
jdaggett@4624 2549 included in the first definition of the ‘<a href="#descdef-src"><code
jdaggett@4624 2550 class=property>src</code></a>’ descriptor which is overridden by the
jdaggett@8311 2551 second definition in the same <a
jdaggett@8311 2552 href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
jdaggett@1662 2553
jdaggett@1662 2554 <pre>
jdaggett@1662 2555 @font-face {
jdaggett@1662 2556 font-family: MainText;
jdaggett@8860 2557 src: url(gentium.eot); /* for use with older user agents */
jdaggett@8860 2558 src: local("Gentium"), url(gentium.woff); /* Overrides src definition */
jdaggett@1662 2559 }
jdaggett@1662 2560 </pre>
jdaggett@1662 2561 </div>
jdaggett@1662 2562
jdaggett@1662 2563 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
jdaggett@1662 2564 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
jdaggett@1662 2565 href="#descdef-font-weight">font-weight</a>, <a
jdaggett@1662 2566 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
jdaggett@518 2567
jdaggett@518 2568 <table class=descdef>
jdaggett@518 2569 <tbody>
jdaggett@518 2570 <tr>
jdaggett@518 2571 <td>Name:
jdaggett@518 2572
jdaggett@8278 2573 <td><dfn id=descdef-font-style
jdaggett@8278 2574 title="font-style!!descriptor">font-style</dfn>
jdaggett@518 2575
jdaggett@518 2576 <tr>
jdaggett@518 2577 <td>Value:
jdaggett@518 2578
jdaggett@545 2579 <td>normal | italic | oblique
jdaggett@890 2580
jdaggett@890 2581 <tr>
jdaggett@890 2582 <td><em>Initial:</em>
jdaggett@890 2583
jdaggett@890 2584 <td>normal
jdaggett@518 2585 </table>
jdaggett@518 2586
jdaggett@518 2587 <table class=descdef>
jdaggett@518 2588 <tbody>
jdaggett@518 2589 <tr>
jdaggett@518 2590 <td>Name:
jdaggett@518 2591
jdaggett@8278 2592 <td><dfn id=descdef-font-weight
jdaggett@8278 2593 title="font-weight!!descriptor">font-weight</dfn>
jdaggett@518 2594
jdaggett@518 2595 <tr>
jdaggett@518 2596 <td>Value:
jdaggett@518 2597
jdaggett@545 2598 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
jdaggett@890 2599
jdaggett@890 2600 <tr>
jdaggett@890 2601 <td><em>Initial:</em>
jdaggett@890 2602
jdaggett@890 2603 <td>normal
jdaggett@518 2604 </table>
jdaggett@518 2605
jdaggett@518 2606 <table class=descdef>
jdaggett@518 2607 <tbody>
jdaggett@518 2608 <tr>
jdaggett@518 2609 <td>Name:
jdaggett@518 2610
jdaggett@8278 2611 <td><dfn id=descdef-font-stretch
jdaggett@8278 2612 title="font-stretch!!descriptor">font-stretch</dfn>
jdaggett@518 2613
jdaggett@518 2614 <tr>
jdaggett@518 2615 <td>Value:
jdaggett@518 2616
jdaggett@545 2617 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@518 2618 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@525 2619 ultra-expanded
jdaggett@890 2620
jdaggett@890 2621 <tr>
jdaggett@890 2622 <td><em>Initial:</em>
jdaggett@890 2623
jdaggett@890 2624 <td>normal
jdaggett@518 2625 </table>
jdaggett@518 2626
jdaggett@573 2627 <p>These descriptors define the characteristics of a font face and are used
jdaggett@573 2628 in the process of matching styles to specific faces. For a font family
jdaggett@8311 2629 defined with several <a
jdaggett@8311 2630 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
jdaggett@8311 2631 can either download all faces in the family or use these descriptors to
jdaggett@8311 2632 selectively download font faces that match actual styles used in document.
jdaggett@8311 2633 The values for these descriptors are the same as those for the
jdaggett@8311 2634 corresponding font properties except that relative keywords are not
jdaggett@8311 2635 allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
jdaggett@8311 2636 and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
jdaggett@8311 2637 these descriptors are omitted, initial values are assumed.
jdaggett@890 2638
jdaggett@890 2639 <p>The value for these font face style attributes is used in place of the
jdaggett@890 2640 style implied by the underlying font data. This allows authors to combine
jdaggett@890 2641 faces in flexible combinations, even in situations where the original font
jdaggett@890 2642 data was arranged differently. User agents that implement synthetic
jdaggett@8272 2643 bolding and obliquing must only apply synthetic styling in cases where the
jdaggett@8272 2644 font descriptors imply this is needed, rather than based on the style
jdaggett@890 2645 attributes implied by the font data.
jdaggett@573 2646
jdaggett@1662 2647 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
jdaggett@1662 2648 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
jdaggett@518 2649
jdaggett@518 2650 <table class=descdef>
jdaggett@518 2651 <tbody>
jdaggett@518 2652 <tr>
jdaggett@518 2653 <td>Name:
jdaggett@518 2654
jdaggett@1662 2655 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
jdaggett@518 2656
jdaggett@518 2657 <tr>
jdaggett@518 2658 <td>Value:
jdaggett@518 2659
jdaggett@8225 2660 <td><a href="#urange-value"><var>&lt;urange&gt;</var></a> #
jdaggett@890 2661
jdaggett@890 2662 <tr>
jdaggett@890 2663 <td><em>Initial:</em>
jdaggett@890 2664
jdaggett@1148 2665 <td>U+0-10FFFF
jdaggett@518 2666 </table>
jdaggett@518 2667
jdaggett@8213 2668 <p>This descriptor defines the set of Unicode codepoints that may be
jdaggett@8213 2669 supported by the font face for which it is declared. The descriptor value
jdaggett@8225 2670 is a comma-delimited list of Unicode range (<a
jdaggett@8225 2671 href="#urange-value"><var>&lt;urange&gt;</var></a>) values. The union of
jdaggett@8225 2672 these ranges defines the set of codepoints that serves as a hint for user
jdaggett@8225 2673 agents when deciding whether or not to download a font resource for a
jdaggett@8225 2674 given text run.
jdaggett@8225 2675
jdaggett@8225 2676 <p>Each <dfn id=urange-value><var>&lt;urange&gt;</var></dfn> value is a <a
jdaggett@8225 2677 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
jdaggett@8225 2678 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
jdaggett@8225 2679 "U+" or "u+" prefix followed by a codepoint range in one of the three
jdaggett@8241 2680 forms listed below. Ranges that do not fit one of the these forms are
jdaggett@8241 2681 invalid and cause the declaration to be ignored.
jdaggett@8241 2682
jdaggett@8241 2683 <dl>
jdaggett@8241 2684 <dt>single codepoint (e.g. U+416)
jdaggett@8241 2685
jdaggett@8241 2686 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
jdaggett@8241 2687 digits
jdaggett@8241 2688
jdaggett@8246 2689 <dt>interval range (e.g. U+400-4ff)
jdaggett@8241 2690
jdaggett@8241 2691 <dd>represented as two hyphen-separated valid Unicode codepoints
jdaggett@8241 2692 indicating the inclusive start and end codepoints of a range
jdaggett@8241 2693
jdaggett@8246 2694 <dt>wildcard range (e.g. U+4??)
jdaggett@8241 2695
jdaggett@8241 2696 <dd>defined by the set of codepoints implied when trailing ‘<code
jdaggett@8246 2697 class=css>?</code>’ characters signify any hexadeximal digit
jdaggett@8241 2698 </dl>
jdaggett@573 2699
jdaggett@8213 2700 <p>Individual codepoints are written using hexadecimal values that
jdaggett@8213 2701 correspond to <a href="http://www.unicode.org/charts/">Unicode character
jdaggett@8225 2702 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
jdaggett@8225 2703 inclusive. Digit values of codepoints are ASCII case-insensitive. For
jdaggett@8360 2704 interval ranges, the start and end codepoints are valid Unicode values and
jdaggett@8360 2705 the end codepoint is greater than or equal to the start codepoint.
jdaggett@8225 2706
jdaggett@8225 2707 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
jdaggett@8225 2708 "U+???") are valid and equivalent to a wildcard range with an initial zero
jdaggett@8225 2709 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
jdaggett@8225 2710 the range of valid Unicode codepoints are invalid. Because of this, the
jdaggett@8225 2711 maximum number of trailing ‘<code class=css>?</code>’ wildcard
jdaggett@8272 2712 characters is five, even though the <a
jdaggett@8225 2713 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
jdaggett@8225 2714 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
jdaggett@8213 2715
jdaggett@8213 2716 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
jdaggett@8213 2717 href="#descdef-unicode-range"><code
jdaggett@8213 2718 class=property>unicode-range</code></a>’ descriptor declaration, ranges
jdaggett@8241 2719 may overlap. The union of these ranges defines the set of codepoints for
jdaggett@8241 2720 which the corresponding font may be used. User agents must not download or
jdaggett@8241 2721 use the font for codepoints outside this set. User agents may normalize
jdaggett@8241 2722 the list of ranges into a list that is different but represents the same
jdaggett@8241 2723 set of codepoints.
jdaggett@8213 2724
jdaggett@8272 2725 <p>The associated font might not contain glyphs for the entire set of
jdaggett@8213 2726 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
jdaggett@8213 2727 class=property>unicode-range</code></a>’ descriptor. When the font is
jdaggett@8391 2728 used, the <dfn id=effective-character-map>effective character map</dfn> is
jdaggett@8225 2729 the intersection of the codepoints defined by ‘<a
jdaggett@8225 2730 href="#descdef-unicode-range"><code
jdaggett@8225 2731 class=property>unicode-range</code></a>’ with the font's <a
jdaggett@8225 2732 href="#character-map"><em>character map</em></a>. This allows authors to
jdaggett@8225 2733 define supported ranges in terms of broad ranges without worrying about
jdaggett@8225 2734 the precise codepoint ranges supported by the underlying font.
jdaggett@8225 2735
jdaggett@8225 2736 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
jdaggett@8225 2737 to define composite fonts</h3>
jdaggett@8225 2738
jdaggett@8311 2739 <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
jdaggett@8311 2740 with different unicode ranges for the same family and style descriptor
jdaggett@8311 2741 values can be used to create composite fonts that mix the glyphs from
jdaggett@8311 2742 different fonts for different scripts. This can be used to combine fonts
jdaggett@8311 2743 that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
jdaggett@8311 2744 or it can be used by authors as a way of segmenting a font into fonts for
jdaggett@8311 2745 commonly used characters and less frequently used characters. Since the
jdaggett@8311 2746 user agent will only pull down the fonts it needs this helps reduce page
jdaggett@8311 2747 bandwidth.
jdaggett@8311 2748
jdaggett@8311 2749 <p>If the unicode ranges overlap for a set of <a
jdaggett@8311 2750 href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
jdaggett@8311 2751 family and style descriptor values, the rules are ordered in the reverse
jdaggett@8311 2752 order they were defined; the last rule defined is the first to be checked
jdaggett@8311 2753 for a given character.
jdaggett@890 2754
jdaggett@890 2755 <p>Example ranges for specific languages or characters:
jdaggett@518 2756
jdaggett@518 2757 <dl>
jdaggett@529 2758 <dt>unicode-range: U+A5;
jdaggett@529 2759
jdaggett@1149 2760 <dd>a single code point, the yen/yuan symbol
jdaggett@529 2761
jdaggett@1148 2762 <dt>unicode-range: U+0-7F;
jdaggett@1148 2763
jdaggett@1148 2764 <dd>code range for basic ASCII characters
jdaggett@1148 2765
jdaggett@529 2766 <dt>unicode-range: U+590-5ff;
jdaggett@529 2767
jdaggett@529 2768 <dd>code range for Hebrew characters
jdaggett@529 2769
jdaggett@529 2770 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
jdaggett@529 2771
jdaggett@529 2772 <dd>code range for Japanese kanji, hiragana and katakana characters plus
jdaggett@529 2773 yen/yuan symbol
jdaggett@518 2774 </dl>
jdaggett@518 2775
jdaggett@529 2776 <div class=example>
jdaggett@531 2777 <p>The BBC provides news services in a wide variety of languages, many
jdaggett@8311 2778 that are not well supported across all platforms. Using an <a
jdaggett@8311 2779 href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
jdaggett@8311 2780 provide a font for any of these languages, as it already does via a
jdaggett@8311 2781 manual font download.</p>
jdaggett@531 2782
jdaggett@531 2783 <pre>
jdaggett@531 2784 @font-face {
jdaggett@531 2785 font-family: BBCBengali;
jdaggett@8860 2786 src: url(fonts/BBCBengali.woff) format("woff");
jdaggett@531 2787 unicode-range: U+00-FF, U+980-9FF;
jdaggett@531 2788 }
jdaggett@531 2789 </pre>
jdaggett@529 2790 </div>
jdaggett@529 2791
jdaggett@529 2792 <div class=example>
jdaggett@531 2793 <p>Technical documents often require a wide range of symbols. The STIX
jdaggett@531 2794 Fonts project is one project aimed at providing fonts to support a wide
jdaggett@531 2795 range of technical typesetting in a standardized way. The example below
jdaggett@531 2796 shows the use of a font that provides glyphs for many of the mathematical
jdaggett@531 2797 and technical symbol ranges within Unicode:</p>
jdaggett@531 2798
jdaggett@531 2799 <pre>
jdaggett@531 2800 @font-face {
jdaggett@531 2801 font-family: STIXGeneral;
jdaggett@531 2802 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
jdaggett@531 2803 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
jdaggett@531 2804 }
jdaggett@531 2805 </pre>
jdaggett@529 2806 </div>
jdaggett@529 2807
jdaggett@529 2808 <div class=example>
jdaggett@529 2809 <p>This example shows how an author can override the glyphs used for Latin
jdaggett@529 2810 characters in a Japanese font with glyphs from a different font. The
jdaggett@529 2811 first rule specifies no range so it defaults to the entire range. The
jdaggett@529 2812 range specified in the second rule overlaps but takes precedence because
jdaggett@529 2813 it is defined later.</p>
jdaggett@529 2814
jdaggett@529 2815 <pre>
jdaggett@529 2816 @font-face {
jdaggett@529 2817 font-family: JapaneseWithGentium;
jdaggett@529 2818 src: local(MSMincho);
jdaggett@529 2819 /* no range specified, defaults to entire range */
jdaggett@529 2820 }
jdaggett@529 2821
jdaggett@529 2822 @font-face {
jdaggett@529 2823 font-family: JapaneseWithGentium;
jdaggett@8860 2824 src: url(../fonts/Gentium.woff);
jdaggett@529 2825 unicode-range: U+0-2FF;
jdaggett@529 2826 }
jdaggett@529 2827 </pre>
jdaggett@529 2828 </div>
jdaggett@1148 2829
jdaggett@1148 2830 <div class=example>
jdaggett@1148 2831 <p>Consider a family constructed to optimize bandwidth by separating out
jdaggett@1148 2832 Latin, Japanese and other characters into different font files:</p>
jdaggett@1148 2833
jdaggett@1148 2834 <pre>
jdaggett@1148 2835 /* fallback font - size: 4.5MB */
jdaggett@1148 2836 @font-face {
jdaggett@1148 2837 font-family: DroidSans;
jdaggett@8860 2838 src: url(DroidSansFallback.woff);
jdaggett@1148 2839 /* no range specified, defaults to entire range */
jdaggett@1148 2840 }
jdaggett@1148 2841
jdaggett@1148 2842 /* Japanese glyphs - size: 1.2MB */
jdaggett@1148 2843 @font-face {
jdaggett@1148 2844 font-family: DroidSans;
jdaggett@8860 2845 src: url(DroidSansJapanese.woff);
jdaggett@1148 2846 unicode-range: U+3000-9FFF, U+ff??;
jdaggett@1148 2847 }
jdaggett@1148 2848
jdaggett@8277 2849 /* Latin, Greek, Cyrillic along with some
jdaggett@1148 2850 punctuation and symbols - size: 190KB */
jdaggett@1148 2851 @font-face {
jdaggett@1148 2852 font-family: DroidSans;
jdaggett@8860 2853 src: url(DroidSans.woff);
jdaggett@1148 2854 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
jdaggett@1148 2855 }
jdaggett@1148 2856 </pre>
jdaggett@1148 2857
jdaggett@1148 2858 <p>For simple Latin text, only the font for Latin characters is
jdaggett@1148 2859 downloaded:</p>
jdaggett@1148 2860
jdaggett@1148 2861 <pre>
jdaggett@1148 2862 body { font-family: DroidSans; }
jdaggett@1148 2863
jdaggett@1148 2864 &lt;p>This is that&lt;/p>
jdaggett@1148 2865 </pre>
jdaggett@1148 2866
jdaggett@1148 2867 <p>In this case the user agent first checks the unicode-range for the font
jdaggett@8860 2868 containing Latin characters (DroidSans.woff). Since all the characters
jdaggett@1148 2869 above are in the range U+0-5FF, the user agent downloads the font and
jdaggett@1148 2870 renders the text with that font.</p>
jdaggett@1148 2871
jdaggett@1148 2872 <p>Next, consider text that makes use of an arrow character (⇨):</p>
jdaggett@1148 2873
jdaggett@1148 2874 <pre>
jdaggett@1148 2875 &lt;p>This &amp;#x21e8; that&lt;p>
jdaggett@1148 2876 </pre>
jdaggett@1148 2877
jdaggett@1148 2878 <p>The user agent again first checks the unicode-range of the font
jdaggett@1149 2879 containing Latin characters. Since U+2000-2300 includes the arrow code
jdaggett@1149 2880 point (U+21E8), the user agent downloads the font. For this character
jdaggett@1148 2881 however the Latin font does not have a matching glyph, so the effective
jdaggett@1149 2882 unicode-range used for font matching excludes this code point. Next, the
jdaggett@1148 2883 user agent evaluates the Japanese font. The unicode-range for the
jdaggett@1148 2884 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
jdaggett@1662 2885 user agent does not download the Japanese font. Next the fallback font is
jdaggett@8311 2886 considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2887 rule for the fallback font does not define unicode-range so its value
jdaggett@8311 2888 defaults to the range of all Unicode code points. The fallback font is
jdaggett@8311 2889 downloaded and used to render the arrow character.</p>
jdaggett@1148 2890 </div>
jdaggett@890 2891
jdaggett@8225 2892 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
jdaggett@1662 2893 href="#descdef-font-variant">font-variant</a> and <a
jdaggett@1662 2894 href="#descdef-font-feature-settings">font-feature-settings</a>
jdaggett@1662 2895 descriptors</h3>
jdaggett@1662 2896
jdaggett@1662 2897 <table class=descdef>
jdaggett@1662 2898 <tbody>
jdaggett@1662 2899 <tr>
jdaggett@1662 2900 <td>Name:
jdaggett@1662 2901
jdaggett@8278 2902 <td><dfn id=descdef-font-variant
jdaggett@8278 2903 title="font-variant!!descriptor">font-variant</dfn>
jdaggett@1662 2904
jdaggett@1662 2905 <tr>
jdaggett@1662 2906 <td>Value:
jdaggett@1662 2907
jdaggett@8278 2908 <td><a href="#font-variant-normal-value"
jdaggett@8278 2909 title="normal!!font-variant">normal</a> | <a
jdaggett@8278 2910 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
jdaggett@8278 2911 <a href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a>
jdaggett@8278 2912 || <a
jdaggett@8225 2913 href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
jdaggett@8225 2914 || <a
jdaggett@8225 2915 href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
jdaggett@8225 2916 || <a
jdaggett@8225 2917 href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
jdaggett@8225 2918 || <a href="#stylistic"><var
jdaggett@8225 2919 title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 2920 href="#historical-forms"><var>historical-forms</var></a> || <a
jdaggett@8225 2921 href="#styleset"><var
jdaggett@8225 2922 title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
jdaggett@8225 2923 href="#character-variant"><var
jdaggett@8225 2924 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 2925 #)</var></a> || <a href="#swash"><var
jdaggett@8225 2926 title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 2927 href="#ornaments"><var
jdaggett@8225 2928 title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 2929 href="#annotation"><var
jdaggett@8225 2930 title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
jdaggett@8225 2931 <a href="#small-caps"><i>small-caps</i></a> | <a
jdaggett@8225 2932 href="#all-small-caps"><i>all-small-caps</i></a> | <a
jdaggett@8225 2933 href="#petite-caps"><i>petite-caps</i></a> | <a
jdaggett@8225 2934 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
jdaggett@8225 2935 href="#unicase"><i>unicase</i></a> | <a
jdaggett@8225 2936 href="#titling-caps"><i>titling-caps</i></a> ] || <a
jdaggett@8225 2937 href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
jdaggett@8225 2938 || <a
jdaggett@8225 2939 href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
jdaggett@8225 2940 || <a
jdaggett@8225 2941 href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
jdaggett@8225 2942 || <a href="#ordinal"><i>ordinal</i></a> || <a
jdaggett@8225 2943 href="#slashed-zero"><i>slashed-zero</i></a> || <a
jdaggett@8225 2944 href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
jdaggett@8225 2945 || <a
jdaggett@8225 2946 href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
jdaggett@8225 2947 || <a href="#ruby"><i>ruby</i></a> ]
jdaggett@1662 2948
jdaggett@1662 2949 <tr>
jdaggett@1662 2950 <td><em>Initial:</em>
jdaggett@1662 2951
jdaggett@1662 2952 <td>normal
jdaggett@1662 2953 </table>
jdaggett@1662 2954
jdaggett@1662 2955 <table class=descdef>
jdaggett@1662 2956 <tbody>
jdaggett@1662 2957 <tr>
jdaggett@1662 2958 <td>Name:
jdaggett@1662 2959
jdaggett@8278 2960 <td><dfn id=descdef-font-feature-settings
jdaggett@8278 2961 title="font-feature-settings!!descriptor">font-feature-settings</dfn>
jdaggett@1662 2962
jdaggett@1662 2963 <tr>
jdaggett@1662 2964 <td>Value:
jdaggett@1662 2965
jdaggett@8278 2966 <td><a href="#font-feature-settings-normal-value"
jdaggett@8278 2967 title="normal!!font-feature-settings">normal</a> | <a
jdaggett@8225 2968 href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
jdaggett@1662 2969
jdaggett@1662 2970 <tr>
jdaggett@1662 2971 <td><em>Initial:</em>
jdaggett@1662 2972
jdaggett@1662 2973 <td>normal
jdaggett@1662 2974 </table>
jdaggett@1662 2975
jdaggett@8213 2976 <p>These descriptors define initial settings that apply when the font
jdaggett@8311 2977 defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2978 rule is rendered. They do not affect font selection. Values are identical
jdaggett@8311 2979 to those defined for the corresponding <a href="#propdef-font-variant"
jdaggett@8278 2980 title="font-variant!!property">‘<code
jdaggett@8279 2981 class=property>font-variant</code>’</a> and <a
jdaggett@8279 2982 href="#propdef-font-feature-settings"
jdaggett@8279 2983 title="font-feature-settings!!property">‘<code
jdaggett@8279 2984 class=property>font-feature-settings</code>’</a> properties defined
jdaggett@8279 2985 below except that the value ‘<code class=property>inherit</code>’ is
jdaggett@8279 2986 omitted. When multiple font feature descriptors or properties are used,
jdaggett@8279 2987 the cumulative effect on text rendering is detailed in the section <a
jdaggett@8031 2988 href="#font-feature-resolution">Font Feature Resolution</a> below. In
jdaggett@8278 2989 cases where specific values define synthesized fallback for certain <a
jdaggett@8278 2990 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8278 2991 class=property>font-variant</code>’</a> subproperties, the same
jdaggett@8031 2992 synthesized fallback applies when used within those values are used with
jdaggett@8278 2993 the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
jdaggett@8031 2994 class=property>font-variant</code>’</a> descriptor.
jdaggett@1662 2995
jdaggett@8225 2996 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
jdaggett@2563 2997 guidelines</h3>
jdaggett@2563 2998
jdaggett@8311 2999 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
jdaggett@8311 3000 designed to allow lazy loading of font resources that are only downloaded
jdaggett@8311 3001 when used within a document. A stylesheet can include <a
jdaggett@8311 3002 href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
jdaggett@8311 3003 of fonts of which only a select set are used; user agents must only
jdaggett@8311 3004 download those fonts that are referred to within the style rules
jdaggett@8311 3005 applicable to a given page. User agents that download all fonts defined in
jdaggett@8311 3006 <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
jdaggett@8311 3007 considering whether those fonts are in fact used within a page are
jdaggett@8311 3008 considered non-conformant. In cases where a font might be downloaded in
jdaggett@8360 3009 character fallback cases, user agents may download a font if it's
jdaggett@8360 3010 contained within the computed value of <a href="#propdef-font-family"
jdaggett@8360 3011 title="font-family!!property">‘<code
jdaggett@8360 3012 class=property>font-family</code>’</a> for a given text run.
jdaggett@2563 3013
jdaggett@2563 3014 <pre>
jdaggett@2563 3015 @font-face {
jdaggett@2563 3016 font-family: GeometricModern;
jdaggett@8860 3017 src: url(font.woff);
jdaggett@2563 3018 }
jdaggett@2563 3019
jdaggett@2563 3020 p {
jdaggett@2563 3021 /* font will be downloaded for pages with p elements */
jdaggett@2563 3022 font-family: GeometricModern, sans-serif;
jdaggett@2563 3023 }
jdaggett@2563 3024
jdaggett@2563 3025 h2 {
jdaggett@2563 3026 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
jdaggett@2563 3027 font-family: Futura, GeometricModern, sans-serif;
jdaggett@2563 3028 }
jdaggett@2563 3029 </pre>
jdaggett@2563 3030
jdaggett@2563 3031 <p>In cases where textual content is loaded before downloadable fonts are
jdaggett@2563 3032 available, user agents may render text as it would be rendered if
jdaggett@2563 3033 downloadable font resources are not available or they may render text
jdaggett@2563 3034 transparently with fallback fonts to avoid a flash of text using a
jdaggett@2563 3035 fallback font. In cases where the font download fails user agents must
jdaggett@2563 3036 display text, simply leaving transparent text is considered non-conformant
jdaggett@2563 3037 behavior. Authors are advised to use fallback fonts in their font lists
jdaggett@8431 3038 that closely match the metrics of the downloadable fonts to avoid large
jdaggett@8431 3039 page reflows where possible.
jdaggett@2563 3040
jdaggett@8863 3041 <p><a id=same-origin-restriction> </a><a
jdaggett@8863 3042 id=allowing-cross-origin-font-loading> </a>
jdaggett@8863 3043
jdaggett@8863 3044 <h3 id=font-fetching-requirements><span class=secno>4.9 </span>Font
jdaggett@8863 3045 fetching requirements</h3>
jdaggett@7253 3046 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
jdaggett@7253 3047 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
jdaggett@7253 3048 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
jdaggett@7253 3049 -->
jdaggett@2740 3050
jdaggett@8640 3051 <p>For font loads, user agents must use the <a
jdaggett@8640 3052 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
jdaggett@8640 3053 CORS-enabled fetch</a> method defined by the <a href="#HTML5"
jdaggett@8640 3054 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification for URL's
jdaggett@8640 3055 defined within @font-face rules. When fetching, user agents must use
jdaggett@8640 3056 "Anonymous" mode, set the referrer source to the stylesheet's URL and set
jdaggett@8640 3057 the origin to the URL of the containing document.
jdaggett@2737 3058
jdaggett@8863 3059 <p class=note>The implications of this for authors are that fonts will
jdaggett@8863 3060 typically not be loaded cross-origin unless authors specifically takes
jdaggett@8863 3061 steps to permit cross-origin loads. Sites can explicitly allow cross-site
jdaggett@8863 3062 loading of font data using the <code>Access-Control-Allow-Origin</code>
jdaggett@8863 3063 HTTP header. For other schemes, no explicit mechanism to allow
jdaggett@8864 3064 cross-origin loading, beyond what is permitted by the <a
jdaggett@8863 3065 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
jdaggett@8864 3066 CORS-enabled fetch</a> method, is defined or required.
jdaggett@8863 3067
jdaggett@8872 3068 <div class=example> For the examples given below, assume that a document is
jdaggett@8872 3069 located at <code>http://example.com/page.html</code> and all URL's link to
jdaggett@8872 3070 valid font resources supported by the user agent. Fonts defined with the
jdaggett@8872 3071 ‘<a href="#descdef-src"><code class=property>src</code></a>’
jdaggett@8872 3072 descriptor values below will be loaded:
jdaggett@8872 3073 <pre>/* same origin (i.e. domain, scheme, port match document) */
jdaggett@8872 3074 src: url(fonts/simple.woff);
jdaggett@8872 3075 src: url(//fonts/simple.woff);
jdaggett@8872 3076
jdaggett@8872 3077 /* data url's with no redirects are treated as same origin */
jdaggett@8872 3078 src: url("data:application/font-woff;base64,...");
jdaggett@8872 3079
jdaggett@8872 3080 /* cross origin, different domain */
jdaggett@8872 3081 /* Access-Control-Allow-Origin response header set to '*' */
jdaggett@8872 3082 src: url(http://another.example.com/fonts/simple.woff);
jdaggett@8872 3083 </pre>
jdaggett@8872 3084 Fonts defined with the ‘<a href="#descdef-src"><code
jdaggett@8872 3085 class=property>src</code></a>’ descriptor values below will fail to
jdaggett@8872 3086 load:
jdaggett@8872 3087 <pre>/* cross origin, different scheme */
jdaggett@8872 3088 /* no Access-Control-xxx headers in response */
jdaggett@8872 3089 src: url(https://example.com/fonts/simple.woff);
jdaggett@8872 3090
jdaggett@8872 3091 /* cross origin, different domain */
jdaggett@8872 3092 /* no Access-Control-xxx headers in response */
jdaggett@8872 3093 src: url(http://another.example.com/fonts/simple.woff);
jdaggett@8872 3094 </pre>
jdaggett@8872 3095 </div>
jdaggett@8872 3096
jdaggett@6699 3097 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
jdaggett@6699 3098 Algorithm</h2>
jdaggett@484 3099
jdaggett@2457 3100 <p>The algorithm below describes how fonts are associated with individual
jdaggett@2457 3101 runs of text. For each character in the run a font family is chosen and a
jdaggett@2457 3102 particular font face is selected containing a glyph for that character.
jdaggett@2457 3103
jdaggett@7309 3104 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
jdaggett@7309 3105 font family names</h3>
jdaggett@7309 3106
jdaggett@7309 3107 <p>As part of the font matching algorithm outlined below, user agents must
jdaggett@7309 3108 match font family names used in style rules with actual font family names
jdaggett@8391 3109 contained in fonts available in a given environment or with font family
jdaggett@8391 3110 names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8391 3111 rules. User agents must match these names case insensitively, using the
jdaggett@8391 3112 "Default Caseless Matching" algorithm outlined in the Unicode
jdaggett@8391 3113 specification <a href="#UNICODE6"
jdaggett@8391 3114 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
jdaggett@8391 3115 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
jdaggett@8391 3116 the algorithm must be applied without normalizing the strings involved and
jdaggett@8391 3117 without applying any language-specific tailorings. The case folding method
jdaggett@8391 3118 specified by this algorithm uses the case mappings with status field
jdaggett@8391 3119 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
jdaggett@8391 3120 in the CaseFolding.txt file of the Unicode Character Database.
jdaggett@7355 3121
jdaggett@7355 3122 <p class=note> For authors this means that font family names are matched
jdaggett@8272 3123 case insensitively, whether those names exist in a platform font or in the
jdaggett@8311 3124 <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
jdaggett@8311 3125 in a stylesheet. Authors should take care to ensure that names use a
jdaggett@8311 3126 character sequence consistent with the actual font family name,
jdaggett@8311 3127 particularly when using combining characters such as diacritical marks.
jdaggett@8311 3128 For example, a family name that contains an uppercase A (U+0041) followed
jdaggett@8311 3129 by a combining ring (U+030A) will <strong>not</strong> match a name that
jdaggett@8311 3130 looks identical but which uses the precomposed lowercase a-ring character
jdaggett@8311 3131 (U+00E5) instead of the combining sequence.
jdaggett@7309 3132
jdaggett@8391 3133 <p class=note> Implementors should take care to verify that a given
jdaggett@8391 3134 caseless string comparison implementation uses this precise algorithm and
jdaggett@8391 3135 not assume that a given platform string matching routine follows it, as
jdaggett@8391 3136 many of these have locale-specific behavior or use some level of string
jdaggett@8391 3137 normalization.
jdaggett@8391 3138
jdaggett@7309 3139 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
jdaggett@2457 3140 styles</h3>
jdaggett@2457 3141
jdaggett@8391 3142 <p>The procedure for choosing a font for a given character in a run of text
jdaggett@8391 3143 consists of iterating over the font families named by the <a
jdaggett@8391 3144 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8391 3145 class=property>font-family</code>’</a> property, selecting a font face
jdaggett@531 3146 with the appropriate style based on other font properties and then
jdaggett@8391 3147 determining whether a glyph exists for the given character. This is done
jdaggett@7311 3148 using the <dfn id=character-map>character map</dfn> of the font, data
jdaggett@8397 3149 which maps characters to the default glyph for that character. A font is
jdaggett@8397 3150 considered to <dfn id=support>support</dfn> a given character if (1) the
jdaggett@8397 3151 character is contained in the font's <a
jdaggett@8397 3152 href="#character-map"><em>character map</em></a> and (2) if required by
jdaggett@8397 3153 the containing script, shaping information is available for that
jdaggett@8397 3154 character.
jdaggett@8397 3155
jdaggett@8397 3156 <p>Some legacy fonts may include a given character in the <a
jdaggett@8397 3157 href="#character-map"><em>character map</em></a> but lack the shaping
jdaggett@8397 3158 information (e.g. <a
jdaggett@8397 3159 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
jdaggett@8397 3160 layout tables</a> or <a
jdaggett@8397 3161 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&amp;item_id=graphite_techAbout">Graphite
jdaggett@8397 3162 tables</a>) necessary for correctly rendering text runs containing that
jdaggett@8397 3163 character.
jdaggett@8397 3164
jdaggett@8397 3165 <p>Codepoint sequences consisting of a base character followed by a
jdaggett@8397 3166 sequence of combining characters are treated slightly differently, see the
jdaggett@8397 3167 section on <a href="#cluster-matching">cluster matching</a> below.
jdaggett@531 3168
jdaggett@7232 3169 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
jdaggett@7232 3170 given font family is defined to be the face that would be selected if all
jdaggett@7232 3171 font style properties were set to their initial value.
jdaggett@7232 3172
jdaggett@531 3173 <ol id=fontmatchingalg>
jdaggett@2457 3174 <li>Using the computed font property values for a given element, the user
jdaggett@8391 3175 agent starts with the first family name specified by the <a
jdaggett@8391 3176 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 3177 class=property>font-family</code>’</a> property.
jdaggett@2457 3178
jdaggett@8391 3179 <li>If the family name is a generic family keyword, the user agent looks
jdaggett@8391 3180 up the appropriate font family name to be used. User agents may choose
jdaggett@8391 3181 the generic font family to use based on the language of the containing
jdaggett@8391 3182 element or the Unicode range of the character.
jdaggett@2457 3183
jdaggett@2457 3184 <li>For other family names, the user agent attempts to find the family
jdaggett@8311 3185 name among fonts defined via <a
jdaggett@8311 3186 href="#at-font-face-rule"><code>@font-face</code></a> rules and then
jdaggett@8391 3187 among available system fonts, matching names with a <a
jdaggett@8391 3188 href="#font-family-casing">case-insensitive comparison</a> as outlined in
jdaggett@8391 3189 the section above. On systems containing fonts with multiple localized
jdaggett@8391 3190 font family names, user agents must match any of these names independent
jdaggett@8391 3191 of the underlying system locale or platform API used. If the font
jdaggett@8391 3192 resources defined for a given face in an <a
jdaggett@8311 3193 href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
jdaggett@8311 3194 available or contain invalid font data, then the face should be treated
jdaggett@8311 3195 as not present in the family. If no faces are present for a family
jdaggett@8311 3196 defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 3197 rules, the family should be treated as missing; matching a platform font
jdaggett@8311 3198 with the same name must not occur in this case.
jdaggett@2457 3199
jdaggett@2457 3200 <li>If a font family match occurs, the user agent assembles the set of
jdaggett@6701 3201 font faces in that family and then narrows the set to a single face using
jdaggett@8391 3202 other font properties in the order given below. A group of faces defined
jdaggett@8391 3203 via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
jdaggett@8391 3204 identical font descriptor values but differing ‘<a
jdaggett@8391 3205 href="#descdef-unicode-range"><code
jdaggett@8391 3206 class=property>unicode-range</code></a>’ values are considered to be a
jdaggett@8391 3207 single <dfn id=composite-face>composite face</dfn> for this step:
jdaggett@2457 3208 <ol id=fontstylematchingalg>
jdaggett@8278 3209 <li><a href="#propdef-font-stretch"
jdaggett@8278 3210 title="font-stretch!!property">‘<code
jdaggett@8278 3211 class=property>font-stretch</code>’</a> is tried first. If the
jdaggett@8278 3212 matching set contains faces with width values matching the <a
jdaggett@8278 3213 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
jdaggett@8278 3214 class=property>font-stretch</code>’</a> value, faces with other width
jdaggett@4624 3215 values are removed from the matching set. If there is no face that
jdaggett@4624 3216 exactly matches the width value the nearest width is used instead. If
jdaggett@8278 3217 the value of <a href="#propdef-font-stretch"
jdaggett@8278 3218 title="font-stretch!!property">‘<code
jdaggett@8368 3219 class=property>font-stretch</code>’</a> is <a
jdaggett@8368 3220 href="#font-stretch-normal-value" title="normal!!font-stretch">‘<code
jdaggett@8368 3221 class=property>normal</code>’</a> or one of the condensed values,
jdaggett@8278 3222 narrower width values are checked first, then wider values. If the
jdaggett@8278 3223 value of <a href="#propdef-font-stretch"
jdaggett@8278 3224 title="font-stretch!!property">‘<code
jdaggett@8278 3225 class=property>font-stretch</code>’</a> is one of the expanded
jdaggett@4624 3226 values, wider values are checked first, followed by narrower values.
jdaggett@4624 3227 Once the closest matching width has been determined by this process,
jdaggett@4624 3228 faces with other widths are removed from the matching set.
jdaggett@4624 3229
jdaggett@8278 3230 <li><a href="#propdef-font-style" title="font-style!!property">‘<code
jdaggett@8278 3231 class=property>font-style</code>’</a> is tried next. If the value of
jdaggett@8278 3232 <a href="#propdef-font-style" title="font-style!!property">‘<code
jdaggett@8278 3233 class=property>font-style</code>’</a> is ‘<a href="#italic"><code
jdaggett@8278 3234 class=property>italic</code></a>’, italic faces are checked first,
jdaggett@8278 3235 then oblique, then normal faces. If the value is ‘<a
jdaggett@8278 3236 href="#oblique"><code class=property>oblique</code></a>’, oblique
jdaggett@8278 3237 faces are checked first, then italic faces and then normal faces. If
jdaggett@8368 3238 the value is <a href="#font-style-normal-value"
jdaggett@8368 3239 title="normal!!font-style">‘<code
jdaggett@8368 3240 class=property>normal</code>’</a>, normal faces are checked first,
jdaggett@8279 3241 then oblique faces, then italic faces. Faces with other style values
jdaggett@8279 3242 are excluded from the matching set. User agents are permitted to
jdaggett@8279 3243 distinguish between italic and oblique faces within platform font
jdaggett@8391 3244 families but this is not required, so all italic or oblique faces may
jdaggett@8391 3245 be treated as italic faces. However, within font families defined via
jdaggett@8391 3246 <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
jdaggett@8391 3247 and oblique faces must be distinguished using the value of the <a
jdaggett@8311 3248 href="#descdef-font-style" title="font-style!!descriptor">‘<code
jdaggett@8391 3249 class=property>font-style</code>’</a> descriptor. For families that
jdaggett@8391 3250 lack any italic or oblique faces, users agents may create artificial
jdaggett@8391 3251 oblique faces, if this is permitted by the value of the ‘<a
jdaggett@8391 3252 href="#propdef-font-synthesis"><code
jdaggett@8391 3253 class=property>font-synthesis</code></a>’ property.
jdaggett@8278 3254
jdaggett@8278 3255 <li><a href="#propdef-font-weight"
jdaggett@8278 3256 title="font-weight!!property">‘<code
jdaggett@8391 3257 class=property>font-weight</code>’</a> is matched next, so it will
jdaggett@8278 3258 always reduce the matching set to a single font face. If bolder/lighter
jdaggett@8278 3259 relative weights are used, the effective weight is calculated based on
jdaggett@8278 3260 the inherited weight value, as described in the definition of the <a
jdaggett@8278 3261 href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 3262 class=property>font-weight</code>’</a> property. Given the desired
jdaggett@4624 3263 weight and the weights of faces in the matching set after the steps
jdaggett@4624 3264 above, if the desired weight is available that face matches. Otherwise,
jdaggett@4624 3265 a weight is chosen using the rules below:
jdaggett@531 3266 <ul>
jdaggett@531 3267 <li>If the desired weight is less than 400, weights below the desired
jdaggett@531 3268 weight are checked in descending order followed by weights above the
jdaggett@531 3269 desired weight in ascending order until a match is found.
jdaggett@531 3270
jdaggett@531 3271 <li>If the desired weight is greater than 500, weights above the
jdaggett@531 3272 desired weight are checked in ascending order followed by weights
jdaggett@531 3273 below the desired weight in descending order until a match is found.
jdaggett@531 3274
jdaggett@531 3275 <li>If the desired weight is 400, 500 is checked first and then the
jdaggett@531 3276 rule for desired weights less than 400 is used.
jdaggett@531 3277
jdaggett@531 3278 <li>If the desired weight is 500, 400 is checked first and then the
jdaggett@532 3279 rule for desired weights less than 400 is used.
jdaggett@531 3280 </ul>
jdaggett@531 3281
jdaggett@4624 3282 <li><span class=property>‘<a href="#propdef-font-size"><code
jdaggett@4624 3283 class=property>font-size</code></a>’</span> must be matched within a
jdaggett@4624 3284 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
jdaggett@4624 3285 are rounded to the nearest whole pixel, while the tolerance for
jdaggett@4624 3286 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
jdaggett@4624 3287 by ‘<code class=property>em</code>’ values in other properties, are
jdaggett@4624 3288 based on the <span class=property>‘<a href="#propdef-font-size"><code
jdaggett@4624 3289 class=property>font-size</code></a>’</span> value that is used, not
jdaggett@4624 3290 the one that is specified.
jdaggett@531 3291 </ol>
jdaggett@531 3292
jdaggett@7232 3293 <li>
jdaggett@8391 3294 <p>If the matched face is defined via <a
jdaggett@8391 3295 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
jdaggett@8391 3296 must use the procedure below to select a single font:
jdaggett@8391 3297
jdaggett@8391 3298 <ol>
jdaggett@8391 3299 <li>If the font resource has not been loaded and the range of characters
jdaggett@8391 3300 defined by the ‘<a href="#descdef-unicode-range"><code
jdaggett@8391 3301 class=property>unicode-range</code></a>’ descriptor value includes
jdaggett@8391 3302 the character in question, load the font.
jdaggett@8391 3303
jdaggett@8391 3304 <li>After downloading, if the <a
jdaggett@8391 3305 href="#effective-character-map"><em>effective character map</em></a>
jdaggett@8391 3306 supports the character in question, select that font.
jdaggett@8391 3307 </ol>
jdaggett@8391 3308
jdaggett@8391 3309 <p>When the matched face is a <a href="#composite-face"><em>composite
jdaggett@8391 3310 face</em></a>, user agents must use the procedure above on each of the
jdaggett@8391 3311 faces in the <a href="#composite-face"><em>composite face</em></a> in
jdaggett@8391 3312 reverse order of <a
jdaggett@8391 3313 href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
jdaggett@8391 3314
jdaggett@8391 3315 <p>While the download occurs, user agents may either wait until the font
jdaggett@8391 3316 is downloaded or render once with substituted font metrics and render
jdaggett@8391 3317 again once the font is downloaded.</p>
jdaggett@8391 3318
jdaggett@8391 3319 <li>
jdaggett@7232 3320 <p>If no matching face exists or the matched face does not contain a
jdaggett@7232 3321 glyph for the character to be rendered, the next family name is selected
jdaggett@8391 3322 and the previous three steps repeated. Glyphs from other faces in the
jdaggett@7232 3323 family are not considered. The only exception is that user agents may
jdaggett@8391 3324 optionally substitute a synthetically obliqued version of the <a
jdaggett@7232 3325 href="#default-face"><em>default face</em></a> if that face supports a
jdaggett@8391 3326 given glyph and synthesis of these faces is permitted by the value of
jdaggett@8391 3327 the ‘<a href="#propdef-font-synthesis"><code
jdaggett@8391 3328 class=property>font-synthesis</code></a>’ property. For example, a
jdaggett@8391 3329 synthetic italic version of the regular face may be used if the italic
jdaggett@8391 3330 face doesn't support glyphs for Arabic.</p>
jdaggett@7242 3331 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
jdaggett@7242 3332
jdaggett@531 3333
jdaggett@531 3334 <li>If there are no more font families to be evaluated and no matching
jdaggett@8363 3335 face has been found, then the user agent performs a <dfn
jdaggett@8363 3336 id=system-font-fallback>system font fallback</dfn> procedure to find the
jdaggett@8363 3337 best match for the character to be rendered. The result of this procedure
jdaggett@8363 3338 may vary across user agents.
jdaggett@531 3339
jdaggett@531 3340 <li>If a particular character cannot be displayed using any font, the user
jdaggett@531 3341 agent should indicate by some means that a character is not being
jdaggett@2457 3342 displayed, displaying either a symbolic representation of the missing
jdaggett@2457 3343 glyph (e.g. using a <a
jdaggett@2457 3344 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
jdaggett@2457 3345 Font</a>) or using the missing character glyph from a default font.
jdaggett@512 3346 </ol>
jdaggett@2457 3347
jdaggett@8430 3348 <p>Optimizations of this process are allowed provided that an
jdaggett@8430 3349 implementation behaves as if the algorithm had been followed exactly.
jdaggett@8430 3350 Matching occurs in a well-defined order to insure that the results are as
jdaggett@8430 3351 consistent as possible across user agents, given an identical set of
jdaggett@8430 3352 available fonts and rendering technology.
jdaggett@8430 3353
jdaggett@8431 3354 <p>The <dfn id=first-available-font>first available font</dfn>, used in the
jdaggett@8431 3355 definition of <a
jdaggett@8431 3356 href="http://www.w3.org/TR/css3-values/#font-relative-lengths"><em>font-relative
jdaggett@8431 3357 lengths</em></a> such as ‘<code class=property>ex</code>’ and ‘<code
jdaggett@8431 3358 class=property>ch</code>’, is defined to be the first available font
jdaggett@8431 3359 that would match any character given font families in the ‘<code
jdaggett@8431 3360 class=property>font-family</code>’ list (or a user agent's default font
jdaggett@8431 3361 if none are available).
jdaggett@8431 3362
jdaggett@7309 3363 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
jdaggett@6701 3364
jdaggett@8397 3365 <p>When text contains characters such as combining marks, ideally the base
jdaggett@8397 3366 character should be rendered using the same font as the mark, this assures
jdaggett@8397 3367 proper placement of the mark. For this reason, the font matching algorithm
jdaggett@8397 3368 for clusters is more specialized than the general case of matching a
jdaggett@8397 3369 single character by itself. For sequences containing variation selectors,
jdaggett@8397 3370 which indicate the precise glyph to be used for a given character, user
jdaggett@8397 3371 agents always attempt <a href="#system-font-fallback"><em>system font
jdaggett@8397 3372 fallback</em></a> to find the appropriate glyph before using the default
jdaggett@8397 3373 glyph of the base character.
jdaggett@8397 3374
jdaggett@8397 3375 <p>A sequence of codepoints containing combining mark or other modifiers is
jdaggett@8397 3376 termed a grapheme cluster (see <a href="#CSS3TEXT"
jdaggett@6701 3377 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
jdaggett@6701 3378 description). For a given cluster containing a base character, <em>b</em>
jdaggett@6701 3379 and a sequence of combining characters <em>c1, c2…</em>, the entire
jdaggett@6701 3380 cluster is matched using these steps:
jdaggett@6701 3381
jdaggett@6701 3382 <ol>
jdaggett@6701 3383 <li>For each family in the font list, a face is chosen using the style
jdaggett@6701 3384 selection rules defined in the previous section.
jdaggett@6701 3385 <ol>
jdaggett@7020 3386 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
jdaggett@7021 3387 completely supported by the font, select this font for the sequence.
jdaggett@6701 3388
jdaggett@6701 3389 <li>If a sequence of multiple codepoints is canonically equivalent to a
jdaggett@8397 3390 single character and the font <a href="#support"><em
jdaggett@8397 3391 title=support>supports</em></a> that character, select this font for
jdaggett@8397 3392 the sequence.
jdaggett@6701 3393 </ol>
jdaggett@6701 3394
jdaggett@6701 3395 <li>If no font was found in the font list in step 1:
jdaggett@6701 3396 <ol>
jdaggett@6701 3397 <li>If <em>c1</em> is a variation selector, system fallback must be used
jdaggett@8397 3398 to find a font that <a href="#support"><em
jdaggett@8397 3399 title=support>supports</em></a> the full sequence of <em>b + c1</em>.
jdaggett@8397 3400 If no font on the system <a href="#support"><em
jdaggett@8397 3401 title=support>supports</em></a> the full sequence, match the single
jdaggett@6701 3402 character <em>b</em> using the normal procedure for matching single
jdaggett@6701 3403 characters and ignore the variation selector. Note: a sequence with
jdaggett@8397 3404 more than one variation selector must be treated as an encoding error
jdaggett@8397 3405 and the trailing selectors must be ignored. <a href="#UNICODE6"
jdaggett@8397 3406 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>
jdaggett@6701 3407
jdaggett@6701 3408 <li>Otherwise, the user agent may optionally use system font fallback to
jdaggett@8397 3409 match a font that <a href="#support"><em
jdaggett@8397 3410 title=support>supports</em></a> the entire cluster.
jdaggett@6701 3411 </ol>
jdaggett@6701 3412
jdaggett@6701 3413 <li>If no font is found in step 2, use the matching sequence from step 1
jdaggett@8397 3414 to determine the longest sequence that is completely <a
jdaggett@8397 3415 href="#support"><em title=support>supported</em></a> by a font in the
jdaggett@8397 3416 font list and attempt to match the remaining combining characters
jdaggett@6701 3417 separately using the rules for single characters.
jdaggett@6701 3418 </ol>
jdaggett@6701 3419
jdaggett@7309 3420 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
jdaggett@2457 3421 issues</h3>
jdaggett@2457 3422
jdaggett@8430 3423 <p>CSS font matching is always performed on text runs containing Unicode
jdaggett@8430 3424 characters, so documents using legacy encodings are assumed to have been
jdaggett@7311 3425 transcoded before matching fonts. For fonts containing <a
jdaggett@7311 3426 href="#character-map"><em title="character map">character maps</em></a>
jdaggett@7311 3427 for both legacy encodings and Unicode, the contents of the legacy encoding
jdaggett@7311 3428 <a href="#character-map"><em>character map</em></a> must have no effect on
jdaggett@7311 3429 the results of the font matching process.
jdaggett@2461 3430
jdaggett@2461 3431 <p>The font matching process does not assume that text runs are in either
jdaggett@2461 3432 normalized or denormalized form (see <a href="#CHARMOD-NORM"
jdaggett@3042 3433 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
jdaggett@8430 3434 details). Fonts may only support precomposed forms and not the decomposed
jdaggett@8430 3435 sequence of base character plus combining marks. Authors should always
jdaggett@6701 3436 tailor their choice of fonts to their content, including whether that
jdaggett@6701 3437 content contains normalized or denormalized character streams.
jdaggett@2457 3438
jdaggett@8430 3439 <p>If a given character is a Private-Use Area Unicode codepoint, user
jdaggett@8430 3440 agents must only match font families named in the ‘<code
jdaggett@8430 3441 class=property>font-family</code>’ list that are not generic families.
jdaggett@8430 3442 If none of the families named in the ‘<code
jdaggett@8430 3443 class=property>font-family</code>’ list contain a glyph for that
jdaggett@8430 3444 codepoint, user agents must display some form of missing glyph symbol for
jdaggett@8430 3445 that character rather than attempting <a
jdaggett@8430 3446 href="#system-font-fallback"><em>system font fallback</em></a> for that
jdaggett@8430 3447 codepoint. When matching the replacement character U+FFFD, user agents may
jdaggett@8430 3448 skip the font matching process and immediately display some form of
jdaggett@8430 3449 missing glyph symbol, they are not required to display the glyph from the
jdaggett@8430 3450 font that would be selected by the font matching process.
jdaggett@2457 3451
jdaggett@2457 3452 <p>In general, the fonts for a given family will all have the same or
jdaggett@7311 3453 similar <a href="#character-map"><em title="character map">character
jdaggett@7311 3454 maps</em></a>. The process outlined here is designed to handle even font
jdaggett@7311 3455 families containing faces with widely variant <a href="#character-map"><em
jdaggett@7311 3456 title="character map">character maps</em></a>. However, authors are
jdaggett@7311 3457 cautioned that the use of such families can lead to unexpected results.
jdaggett@2457 3458
jdaggett@7309 3459 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
jdaggett@2509 3460 changes since CSS 2.1</h3>
jdaggett@2509 3461
jdaggett@2509 3462 <p>The algorithm above is different from CSS 2.1 in a number of key places.
jdaggett@2509 3463 These changes were made to better reflect actual font matching behavior
jdaggett@2509 3464 across user agent implementations.
jdaggett@2509 3465
jdaggett@2509 3466 <p>Differences compared to the font matching algorithm in CSS 2.1:
jdaggett@2509 3467
jdaggett@2509 3468 <ul>
jdaggett@2509 3469 <li>The algorithm includes font-stretch matching.
jdaggett@2509 3470
jdaggett@2509 3471 <li>All possible font-style matching scenarios are delineated.
jdaggett@2509 3472
jdaggett@2509 3473 <li>Small-caps fonts are not matched as part of the font matching process,
jdaggett@2509 3474 they are now handled via font features.
jdaggett@2509 3475
jdaggett@2509 3476 <li>Unicode variation selector matching is required.
jdaggett@6701 3477
jdaggett@6701 3478 <li>Cluster sequences are matched as a unit.
jdaggett@2509 3479 </ul>
jdaggett@531 3480
jdaggett@7309 3481 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
jdaggett@6701 3482 examples</h3>
jdaggett@6701 3483
jdaggett@531 3484 <div class=example>
jdaggett@531 3485 <p>It's useful to note that the CSS selector syntax may be used to create
jdaggett@531 3486 language-sensitive typography. For example, some Chinese and Japanese
jdaggett@1149 3487 characters are unified to have the same Unicode code point, although the
jdaggett@890 3488 abstract glyphs are not the same in the two languages.
jdaggett@531 3489
jdaggett@531 3490 <pre>*:lang(ja-jp) { font: 900 14pt/16pt &quot;Heisei Mincho W9&quot;, serif; }
jdaggett@531 3491 *:lang(zh-tw) { font: 800 14pt/16.5pt &quot;Li Sung&quot;, serif; }
jdaggett@512 3492 </pre>
jdaggett@531 3493
jdaggett@8430 3494 <p>This selects any element that has the given language — Japanese or
jdaggett@8430 3495 Traditional Chinese — and uses the appropriate font.
jdaggett@512 3496 </div>
jdaggett@1662 3497
jdaggett@6699 3498 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
jdaggett@1662 3499
jdaggett@1856 3500 <p>Modern font technologies support a variety of advanced typographic and
jdaggett@1856 3501 language-specific font features. Using these features, a single font can
jdaggett@1856 3502 provide glyphs for a wide range of ligatures, contextual and stylistic
jdaggett@1856 3503 alternates, tabular and old-style figures, small capitals, automatic
jdaggett@1856 3504 fractions, swashes, and alternates specific to a given language. To allow
jdaggett@8313 3505 authors control over these font capabilities, the ‘<code
jdaggett@8313 3506 class=property>font-variant</code>’ property has been expanded for CSS3.
jdaggett@8313 3507 It now functions as a shorthand for a set of properties that provide
jdaggett@8313 3508 control over stylistic font features.
jdaggett@1856 3509
jdaggett@1856 3510 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
jdaggett@1856 3511 selection and positioning</h3>
jdaggett@1856 3512
jdaggett@1856 3513 <p>Simple fonts used for displaying Latin text use a very basic processing
jdaggett@8313 3514 model. Fonts contain a <a href="#character-map"><em>character map</em></a>
jdaggett@8313 3515 which maps each character to a glyph for that character. Glyphs for
jdaggett@8313 3516 subsequent characters are simply placed one after the other along a run of
jdaggett@8313 3517 text. Modern font formats such as OpenType and AAT (Apple Advanced
jdaggett@8313 3518 Typography) use a richer processing model. The glyph for a given character
jdaggett@8313 3519 can be chosen and positioned not just based on the codepoint of the
jdaggett@8313 3520 character itself, but also on adjacent characters as well as the language,
jdaggett@8313 3521 script, and features enabled for the text. Font features may be required
jdaggett@8313 3522 for specific scripts, or recommended as enabled by default or they might
jdaggett@8313 3523 be stylistic features meant to be used under author control.
jdaggett@1856 3524
jdaggett@1856 3525 <p>For a good visual overview of these features, see the <a
jdaggett@1856 3526 href="#OPENTYPE-FONT-GUIDE"
jdaggett@1856 3527 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
jdaggett@1856 3528 For a detailed description of glyph processing for OpenType fonts, see <a
jdaggett@1856 3529 href="#WINDOWS-GLYPH-PROC"
jdaggett@1856 3530 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
jdaggett@1856 3531
jdaggett@8313 3532 <p>Stylistic font features can be classified into two broad categories:
jdaggett@6177 3533 ones that affect the harmonization of glyph shapes with the surrounding
jdaggett@8313 3534 context, such as kerning and ligature features, and ones such as the
jdaggett@6177 3535 small-caps, subscript/superscript and alternate features that affect shape
jdaggett@6177 3536 selection.
jdaggett@6176 3537
jdaggett@8313 3538 <p>The subproperties of <a href="#propdef-font-variant"
jdaggett@8313 3539 title="font-variant!!property">‘<code
jdaggett@8313 3540 class=property>font-variant</code>’</a> listed below are used to control
jdaggett@8313 3541 these stylistic font features. They do not control features that are
jdaggett@8313 3542 required for displaying certain scripts, such as the OpenType features
jdaggett@8313 3543 used when displaying Arabic or Indic language text. They affect glyph
jdaggett@8313 3544 selection and positioning, but do not affect font selection as described
jdaggett@8313 3545 in the font matching section (except in cases required for compatibility
jdaggett@8313 3546 with CSS 2.1).
jdaggett@1856 3547
jdaggett@1856 3548 <p>To assure consistent behavior across user agents, the equivalent
jdaggett@8313 3549 OpenType property settings are listed for individual properties and are
jdaggett@8313 3550 normative. When using other font formats these should be used as a
jdaggett@8313 3551 guideline to map CSS font feature property values to specific font
jdaggett@8313 3552 features.
jdaggett@1856 3553
jdaggett@1856 3554 <h3 id=language-specific-support><span class=secno>6.2
jdaggett@1856 3555 </span>Language-specific display</h3>
jdaggett@1856 3556
jdaggett@1856 3557 <p>OpenType also supports language-specific glyph selection and
jdaggett@1856 3558 positioning, so that text can be displayed correctly in cases where the
jdaggett@8313 3559 language dictates a specific display behavior. Many languages share a
jdaggett@8313 3560 common script, but the shape of certain letters can vary across those
jdaggett@8313 3561 languages. For example, certain Cyrillic letters have different shapes in
jdaggett@8313 3562 Russian text than in Bulgarian. In Latin text, it's common to render "fi"
jdaggett@8313 3563 with an explicit fi-ligature that lacks a dot on the "i". However, in
jdaggett@8313 3564 languages such as Turkish which uses both a dotted-i and a dotless-i, it's
jdaggett@8313 3565 important to not use this ligature or use a specialized version that
jdaggett@8313 3566 contains a dot over the "i". The example below shows language-specific
jdaggett@8313 3567 variations based on stylistic traditions found in Spanish, Italian and
jdaggett@8313 3568 French orthography:
jdaggett@2515 3569
jdaggett@2515 3570 <div class=featex><img alt="language specific forms, spanish"
jdaggett@2515 3571 src=locl-1.png></div>
jdaggett@2515 3572
jdaggett@2515 3573 <div class=featex><img alt="language specific forms, italian"
jdaggett@2515 3574 src=locl-2.png></div>
jdaggett@2515 3575
jdaggett@2515 3576 <div class=featex><img alt="language specific forms, french"
jdaggett@2515 3577 src=locl-3.png></div>
jdaggett@1856 3578
jdaggett@8313 3579 <p>If the content language of the element is known according to the rules
jdaggett@7355 3580 of the <a
jdaggett@7355 3581 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
jdaggett@7355 3582 language</a>, user agents are required to infer the OpenType language
jdaggett@7355 3583 system from the content language and use that when selecting and
jdaggett@7355 3584 positioning glyphs using an OpenType font.
jdaggett@7355 3585
jdaggett@7355 3586 <p>For OpenType fonts, in some cases it may be necessary to explicitly
jdaggett@7355 3587 declare the OpenType language to be used, for example when displaying text
jdaggett@7355 3588 in a given language that uses the typographic conventions of another
jdaggett@7355 3589 language or when the font does not explicitly support a given language but
jdaggett@7355 3590 supports a language that shares common typographic conventions. The ‘<a
jdaggett@4624 3591 href="#propdef-font-language-override"><code
jdaggett@4624 3592 class=property>font-language-override</code></a>’ property is used for
jdaggett@8225 3593 this purpose.</p>
jdaggett@1662 3594 <!-- prop: font-kerning -->
jdaggett@1662 3595
jdaggett@1856 3596 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
jdaggett@1662 3597 href="#propdef-font-kerning">font-kerning</a> property</h3>
jdaggett@1662 3598
jdaggett@4624 3599 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
jdaggett@1662 3600 <tbody>
jdaggett@1662 3601 <tr>
jdaggett@1662 3602 <td>Name:
jdaggett@1662 3603
jdaggett@1662 3604 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
jdaggett@1662 3605
jdaggett@1662 3606 <tr>
jdaggett@1662 3607 <td>Value:
jdaggett@1662 3608
jdaggett@8278 3609 <td><a href="#font-kerning-auto-value"
jdaggett@8278 3610 title="auto!!font-kerning">auto</a> | <a
jdaggett@8278 3611 href="#font-kerning-normal-value"
jdaggett@8278 3612 title="normal!!font-kerning">normal</a> | <a
jdaggett@8278 3613 href="#font-kerning-none-value" title="none!!font-kerning">none</a>
jdaggett@1662 3614
jdaggett@1662 3615 <tr>
jdaggett@1662 3616 <td>Initial:
jdaggett@1662 3617
jdaggett@1856 3618 <td>auto
jdaggett@1662 3619
jdaggett@1662 3620 <tr>
jdaggett@1662 3621 <td>Applies to:
jdaggett@1662 3622
jdaggett@1662 3623 <td>all elements
jdaggett@1662 3624
jdaggett@1662 3625 <tr>
jdaggett@1662 3626 <td>Inherited:
jdaggett@1662 3627
jdaggett@1662 3628 <td>yes
jdaggett@1662 3629
jdaggett@1662 3630 <tr>
jdaggett@1662 3631 <td>Percentages:
jdaggett@1662 3632
jdaggett@1662 3633 <td>N/A
jdaggett@1662 3634
jdaggett@1662 3635 <tr>
jdaggett@1662 3636 <td>Media:
jdaggett@1662 3637
jdaggett@1662 3638 <td>visual
jdaggett@1662 3639
jdaggett@1662 3640 <tr>
jdaggett@1662 3641 <td>Computed value:
jdaggett@1662 3642
jdaggett@1662 3643 <td>as specified
jdaggett@7377 3644
jdaggett@7377 3645 <tr>
jdaggett@7377 3646 <td>Animatable:
jdaggett@7377 3647
jdaggett@7377 3648 <td>no
jdaggett@1662 3649 </table>
jdaggett@1662 3650
jdaggett@2509 3651 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
jdaggett@2509 3652 property controls metric kerning, kerning that utilizes adjustment data
jdaggett@8276 3653 contained in the font.
jdaggett@8276 3654
jdaggett@8276 3655 <dl>
jdaggett@8278 3656 <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
jdaggett@8276 3657
jdaggett@8276 3658 <dd>Specifies that kerning is applied at the discretion of the user agent
jdaggett@8276 3659
jdaggett@8278 3660 <dt><dfn id=font-kerning-normal-value
jdaggett@8278 3661 title="normal!!font-kerning">normal</dfn>
jdaggett@8276 3662
jdaggett@8276 3663 <dd>Specifies that kerning is applied
jdaggett@8276 3664
jdaggett@8278 3665 <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
jdaggett@8276 3666
jdaggett@8276 3667 <dd>Specifies that kerning is not applied
jdaggett@8276 3668 </dl>
jdaggett@1662 3669
jdaggett@1662 3670 <p>For fonts that do not include kerning data this property will have no
jdaggett@1662 3671 visible effect. When rendering with OpenType fonts, the <a
jdaggett@1662 3672 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
jdaggett@2515 3673 specification suggests that kerning be enabled by default. When kerning is
jdaggett@6436 3674 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
jdaggett@8276 3675 vertical text runs the <span class=tag>vkrn</span> feature is enabled
jdaggett@8276 3676 instead). User agents must also support fonts that only support kerning
jdaggett@8276 3677 via data contained in a <span class=tag>kern</span> font table, as
jdaggett@8276 3678 detailed in the OpenType specification. If the ‘<code
jdaggett@8276 3679 class=property>letter-spacing</code>’ property is defined, kerning
jdaggett@8276 3680 adjustments are considered part of the default spacing and letter spacing
jdaggett@8276 3681 adjustments are made after kerning has been applied.
jdaggett@8276 3682
jdaggett@8276 3683 <p>When set to ‘<code class=property>auto</code>’, user agents can
jdaggett@8276 3684 determine whether to apply kerning or not based on a number of factors:
jdaggett@8276 3685 text size, script, or other factors that influence text processing speed.
jdaggett@8368 3686 Authors who want proper kerning should use <a
jdaggett@8368 3687 href="#font-kerning-normal-value" title="normal!!font-kerning">‘<code
jdaggett@8368 3688 class=property>normal</code>’</a> to explicitly enable kerning.
jdaggett@8279 3689 Likewise, some authors may prefer to disable kerning in situations where
jdaggett@8279 3690 performance is more important than precise appearance. However, in
jdaggett@8279 3691 well-designed modern implementations the use of kerning generally does not
jdaggett@8279 3692 have a large impact on text rendering speed.</p>
jdaggett@6176 3693 <!-- prop: font-variant-ligatures -->
jdaggett@6176 3694
jdaggett@6176 3695 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
jdaggett@6176 3696 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
jdaggett@6176 3697 property</h3>
jdaggett@6176 3698
jdaggett@6436 3699 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
jdaggett@6176 3700 <tbody>
jdaggett@6176 3701 <tr>
jdaggett@6176 3702 <td>Name:
jdaggett@6176 3703
jdaggett@6176 3704 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
jdaggett@6176 3705
jdaggett@6176 3706 <tr>
jdaggett@6176 3707 <td>Value:
jdaggett@6176 3708
jdaggett@8278 3709 <td><a href="#font-variant-ligatures-normal-value"
jdaggett@8278 3710 title="normal!!font-variant-ligatures">normal</a> | <a
jdaggett@8278 3711 href="#font-variant-ligatures-none-value"
jdaggett@8278 3712 title="none!!font-variant-ligatures">none</a> | [ <a
jdaggett@8225 3713 href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a> ||
jdaggett@8225 3714 <a
jdaggett@8225 3715 href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
jdaggett@8225 3716 || <a
jdaggett@8225 3717 href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
jdaggett@8225 3718 || <a
jdaggett@8225 3719 href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
jdaggett@8225 3720 ]
jdaggett@6176 3721
jdaggett@6176 3722 <tr>
jdaggett@6176 3723 <td>Initial:
jdaggett@6176 3724
jdaggett@6176 3725 <td>normal
jdaggett@6176 3726
jdaggett@6176 3727 <tr>
jdaggett@6176 3728 <td>Applies to:
jdaggett@6176 3729
jdaggett@6176 3730 <td>all elements
jdaggett@6176 3731
jdaggett@6176 3732 <tr>
jdaggett@6176 3733 <td>Inherited:
jdaggett@6176 3734
jdaggett@6176 3735 <td>yes
jdaggett@6176 3736
jdaggett@6176 3737 <tr>
jdaggett@6176 3738 <td>Percentages:
jdaggett@6176 3739
jdaggett@6176 3740 <td>N/A
jdaggett@6176 3741
jdaggett@6176 3742 <tr>
jdaggett@6176 3743 <td>Media:
jdaggett@6176 3744
jdaggett@6176 3745 <td>visual
jdaggett@6176 3746
jdaggett@6176 3747 <tr>
jdaggett@6176 3748 <td>Computed value:
jdaggett@6176 3749
jdaggett@6176 3750 <td>as specified
jdaggett@7377 3751
jdaggett@7377 3752 <tr>
jdaggett@7377 3753 <td>Animatable:
jdaggett@7377 3754
jdaggett@7377 3755 <td>no
jdaggett@6176 3756 </table>
jdaggett@6176 3757
jdaggett@6436 3758 <p>Ligatures and contextual forms are ways of combining glyphs to produce
jdaggett@8276 3759 more harmonized forms.
jdaggett@6176 3760
jdaggett@6176 3761 <pre
jdaggett@8225 3762 class=prod><dfn id=common-lig-values><var>&lt;common-lig-values&gt;</var></dfn> = [ <a href="#common-ligatures">common-ligatures</a> | <a href="#no-common-ligatures">no-common-ligatures</a> ]</pre>
jdaggett@6176 3763
jdaggett@6176 3764 <pre
jdaggett@8225 3765 class=prod><dfn id=discretionary-lig-values><var>&lt;discretionary-lig-values&gt;</var></dfn> = [ <a href="#discretionary-ligatures">discretionary-ligatures</a> | <a href="#no-discretionary-ligatures">no-discretionary-ligatures</a> ]</pre>
jdaggett@6176 3766
jdaggett@6176 3767 <pre
jdaggett@8225 3768 class=prod><dfn id=historical-lig-values><var>&lt;historical-lig-values&gt;</var></dfn> = [ <a href="#historical-ligatures">historical-ligatures</a> | <a href="#no-historical-ligatures">no-historical-ligatures</a> ]</pre>
jdaggett@6176 3769
jdaggett@6176 3770 <pre
jdaggett@8225 3771 class=prod><dfn id=contextual-alt-values><var>&lt;contextual-alt-values&gt;</var></dfn> = [ <a href="#contextual">contextual</a> | <a href="#no-contextual">no-contextual</a> ]</pre>
jdaggett@6176 3772
jdaggett@6176 3773 <p>Individual values have the following meanings:
jdaggett@6176 3774
jdaggett@6176 3775 <dl>
jdaggett@8278 3776 <dt><dfn id=font-variant-ligatures-normal-value
jdaggett@8278 3777 title="normal!!font-variant-ligatures">normal</dfn>
jdaggett@8278 3778
jdaggett@8368 3779 <dd>A value of <a href="#font-variant-ligatures-normal-value"
jdaggett@8368 3780 title="normal!!font-variant-ligatures">‘<code
jdaggett@8368 3781 class=property>normal</code>’</a> specifies that common default
jdaggett@8279 3782 features are enabled, <a href="#font-feature-resolution">as described in
jdaggett@8279 3783 detail in the next section</a>. For OpenType fonts, common ligatures and
jdaggett@8279 3784 contextual forms are on by default, discretionary and historical
jdaggett@8279 3785 ligatures are not.
jdaggett@8278 3786
jdaggett@8278 3787 <dt><dfn id=font-variant-ligatures-none-value
jdaggett@8278 3788 title="none!!font-variant-ligatures">none</dfn>
jdaggett@8276 3789
jdaggett@8276 3790 <dd>Specifies that all types of ligatures and contextual forms covered by
jdaggett@8276 3791 this property are explicitly disabled. In situations where ligatures are
jdaggett@8276 3792 not considered necessary, this may improve the speed of text rendering.
jdaggett@8276 3793
jdaggett@6176 3794 <dt><dfn id=common-ligatures>common-ligatures</dfn>
jdaggett@6176 3795
jdaggett@6436 3796 <dd>Enables display of common ligatures (OpenType features: <span
jdaggett@6436 3797 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
jdaggett@6436 3798 enabled by default.
jdaggett@6176 3799 </dl>
jdaggett@6176 3800
jdaggett@6176 3801 <div class=featex><img alt="common ligature example" src=liga.png></div>
jdaggett@6176 3802
jdaggett@6176 3803 <dl>
jdaggett@6176 3804 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
jdaggett@6176 3805
jdaggett@6436 3806 <dd>Disables display of common ligatures (OpenType features: <span
jdaggett@6436 3807 class=tag>liga, clig</span>).
jdaggett@6176 3808
jdaggett@6176 3809 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
jdaggett@6176 3810
jdaggett@6436 3811 <dd>Enables display of discretionary ligatures (OpenType feature: <span
jdaggett@8277 3812 class=tag>dlig</span>). Which ligatures are discretionary or optional is
jdaggett@8277 3813 decided by the type designer, so authors will need to refer to the
jdaggett@6176 3814 documentation of a given font to understand which ligatures are
jdaggett@6176 3815 considered discretionary.
jdaggett@6176 3816 </dl>
jdaggett@6176 3817
jdaggett@6176 3818 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
jdaggett@6176 3819
jdaggett@6176 3820 <dl>
jdaggett@6176 3821 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
jdaggett@6176 3822
jdaggett@6436 3823 <dd>Disables display of discretionary ligatures (OpenType feature: <span
jdaggett@6436 3824 class=tag>dlig</span>).
jdaggett@6176 3825
jdaggett@6176 3826 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
jdaggett@6176 3827
jdaggett@6436 3828 <dd>Enables display of historical ligatures (OpenType feature: <span
jdaggett@6436 3829 class=tag>hlig</span>).
jdaggett@6176 3830 </dl>
jdaggett@6176 3831
jdaggett@6176 3832 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
jdaggett@6176 3833
jdaggett@6176 3834 <dl>
jdaggett@6176 3835 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
jdaggett@6176 3836
jdaggett@6436 3837 <dd>Disables display of historical ligatures (OpenType feature: <span
jdaggett@6436 3838 class=tag>hlig</span>).
jdaggett@6176 3839
jdaggett@6176 3840 <dt><dfn id=contextual>contextual</dfn>
jdaggett@6176 3841
jdaggett@6436 3842 <dd>Enables display of contextual alternates (OpenType feature: <span
jdaggett@6436 3843 class=tag>calt</span>). Although not strictly a ligature feature, like
jdaggett@6176 3844 ligatures this feature is commonly used to harmonize the shapes of glyphs
jdaggett@6436 3845 with the surrounding context. For OpenType fonts, this feature is on by
jdaggett@6436 3846 default.
jdaggett@6176 3847 </dl>
jdaggett@6176 3848
jdaggett@6176 3849 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
jdaggett@6176 3850
jdaggett@6176 3851 <dl>
jdaggett@6176 3852 <dt><dfn id=no-contextual>no-contextual</dfn>
jdaggett@6176 3853
jdaggett@6436 3854 <dd>Disables display of contextual alternates (OpenType feature: <span
jdaggett@6436 3855 class=tag>calt</span>).
jdaggett@6176 3856 </dl>
jdaggett@6176 3857
jdaggett@6176 3858 <p>Required ligatures, needed for correctly rendering complex scripts, are
jdaggett@8278 3859 not affected by the settings above, including ‘<code
jdaggett@8278 3860 class=property>none</code>’ (OpenType feature: <span
jdaggett@6436 3861 class=tag>rlig</span>).</p>
jdaggett@3460 3862 <!-- prop: font-variant-position -->
jdaggett@3460 3863
jdaggett@6176 3864 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
jdaggett@3638 3865 and superscript forms: the <a
jdaggett@3460 3866 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
jdaggett@3460 3867
jdaggett@4624 3868 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
jdaggett@1662 3869 <tbody>
jdaggett@1662 3870 <tr>
jdaggett@1662 3871 <td>Name:
jdaggett@1662 3872
jdaggett@3460 3873 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
jdaggett@1662 3874
jdaggett@1662 3875 <tr>
jdaggett@1662 3876 <td>Value:
jdaggett@1662 3877
jdaggett@8368 3878 <td><a href="#font-variant-position-normal-value"
jdaggett@8368 3879 title="normal!!font-variant-position">normal</a> | <a
jdaggett@8279 3880 href="#sub">sub</a> | <a href="#super">super</a>
jdaggett@1732 3881
jdaggett@1732 3882 <tr>
jdaggett@1732 3883 <td>Initial:
jdaggett@1732 3884
jdaggett@1732 3885 <td>normal
jdaggett@1732 3886
jdaggett@1732 3887 <tr>
jdaggett@1732 3888 <td>Applies to:
jdaggett@1732 3889
jdaggett@1732 3890 <td>all elements
jdaggett@1732 3891
jdaggett@1732 3892 <tr>
jdaggett@1732 3893 <td>Inherited:
jdaggett@1732 3894
jdaggett@1732 3895 <td>yes
jdaggett@1732 3896
jdaggett@1732 3897 <tr>
jdaggett@1732 3898 <td>Percentages:
jdaggett@1732 3899
jdaggett@1732 3900 <td>N/A
jdaggett@1732 3901
jdaggett@1732 3902 <tr>
jdaggett@1732 3903 <td>Media:
jdaggett@1732 3904
jdaggett@1732 3905 <td>visual
jdaggett@1732 3906
jdaggett@1732 3907 <tr>
jdaggett@1732 3908 <td>Computed value:
jdaggett@1732 3909
jdaggett@1732 3910 <td>as specified
jdaggett@7377 3911
jdaggett@7377 3912 <tr>
jdaggett@7377 3913 <td>Animatable:
jdaggett@7377 3914
jdaggett@7377 3915 <td>no
jdaggett@1732 3916 </table>
jdaggett@1732 3917
jdaggett@5890 3918 <p>This property is used to enable typographic subscript and superscript
jdaggett@5890 3919 glyphs. These are alternate glyphs designed within the same em-box as
jdaggett@5890 3920 default glyphs and are intended to be laid out on the same baseline as the
jdaggett@5890 3921 default glyphs, with no resizing or repositioning of the baseline. They
jdaggett@5890 3922 are explicitly designed to match the surrounding text and to be more
jdaggett@5890 3923 readable without affecting the line height.
jdaggett@3511 3924
jdaggett@3511 3925 <div class=figure><img alt="comparison between real subscript glyphs and
jdaggett@3511 3926 synthesized ones" src=realsubscripts.png>
jdaggett@3511 3927 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
jdaggett@3511 3928 (bottom)
jdaggett@3511 3929 </div>
jdaggett@3460 3930
jdaggett@8279 3931 <p>Individual values have the following meanings:
jdaggett@8279 3932
jdaggett@8279 3933 <dl>
jdaggett@8368 3934 <dt><dfn id=font-variant-position-normal-value
jdaggett@8368 3935 title="normal!!font-variant-position">normal</dfn>
jdaggett@8279 3936
jdaggett@8279 3937 <dd>None of the features listed below are enabled.
jdaggett@8279 3938
jdaggett@8279 3939 <dt><dfn id=sub>sub</dfn>
jdaggett@8279 3940
jdaggett@8279 3941 <dd>Enables display of subscript variants (OpenType feature: <span
jdaggett@8279 3942 class=tag>subs</span>).
jdaggett@8279 3943
jdaggett@8279 3944 <dt><dfn id=super>super</dfn>
jdaggett@8279 3945
jdaggett@8279 3946 <dd>Enables display of superscript variants (OpenType feature: <span
jdaggett@8279 3947 class=tag>sups</span>).
jdaggett@8279 3948 </dl>
jdaggett@5890 3949
jdaggett@5890 3950 <p>Because of the semantic nature of subscripts and superscripts, when the
jdaggett@8279 3951 value is either ‘<a href="#sub"><code class=property>sub</code></a>’
jdaggett@8279 3952 or ‘<a href="#super"><code class=property>super</code></a>’ for a
jdaggett@8279 3953 given contiguous run of text, if a variant glyph is not available for all
jdaggett@8279 3954 the characters in the run, simulated glyphs must be synthesized for all
jdaggett@8279 3955 characters using reduced forms of the glyphs that would be used without
jdaggett@8280 3956 this feature applied. This is done per run to avoid a mixture of variant
jdaggett@8280 3957 glyphs and synthesized ones that would not align correctly. In the case of
jdaggett@8280 3958 OpenType fonts that lack subscript or superscript glyphs for a given
jdaggett@8280 3959 character, user agents must use the appropriate subscript and superscript
jdaggett@8280 3960 metrics specified in the selected font's <a
jdaggett@3460 3961 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
jdaggett@3460 3962 table</a> <a href="#OPENTYPE"
jdaggett@5891 3963 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
jdaggett@5891 3964 and offset of the synthesized substitutes.
jdaggett@2461 3965
jdaggett@8280 3966 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
jdaggett@8280 3967 using superscript metrics" src=superscript-alt-synth.png>
jdaggett@8280 3968 <p class=caption>Superscript alternate glyph (left), synthesized
jdaggett@8280 3969 superscript glyphs (middle), and incorrect mixture of the two (right)
jdaggett@8280 3970 </div>
jdaggett@8280 3971
jdaggett@8385 3972 <p>In situations where text decorations are only applied to runs of text
jdaggett@8385 3973 containing superscript or subscript glyphs, the synthesized glyphs must be
jdaggett@8385 3974 used to avoid problems with the placement of decorations.
jdaggett@8385 3975
jdaggett@2461 3976 <p>In the past, user agents have used font-size and vertical-align to
jdaggett@8368 3977 simulate subscripts and superscripts for the <code title="HTML sub
jdaggett@8368 3978 element">sub</code> and <code title="HTML sup element">sup</code>
jdaggett@8368 3979 elements. To allow a backwards compatible way of defining subscripts and
jdaggett@8368 3980 superscripts, it is recommended that authors use conditional rules <a
jdaggett@8368 3981 href="#CSS3-CONDITIONAL"
jdaggett@3460 3982 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
jdaggett@5890 3983 older user agents will still render subscripts and superscripts via the
jdaggett@5890 3984 older mechanism.
jdaggett@5890 3985
jdaggett@5890 3986 <p>Authors should note that fonts typically only provide subscript and
jdaggett@5890 3987 superscript glyphs for a subset of all characters supported by the font.
jdaggett@8280 3988 For example, while subscript and superscript glyphs are often available
jdaggett@8280 3989 for Latin numbers, glyphs for punctuation and letter characters are less
jdaggett@8280 3990 frequently provided. The synthetic fallback rules defined for this
jdaggett@8280 3991 property assure that subscripts and superscripts will always appear but
jdaggett@8280 3992 the appearance may not match author expectations if the font used does not
jdaggett@8280 3993 provide the appropriate alternate glyph for all characters contained in a
jdaggett@8280 3994 subscript or superscript.
jdaggett@8280 3995
jdaggett@8280 3996 <p>This property is not cumulative. Applying it to elements within a
jdaggett@5890 3997 subscript or superscript won't nest the placement of a subscript or
jdaggett@5890 3998 superscript glyph. Images contained within text runs where the value of
jdaggett@8279 3999 this property is ‘<a href="#sub"><code class=property>sub</code></a>’
jdaggett@8279 4000 or ‘<a href="#super"><code class=property>super</code></a>’ will be
jdaggett@8368 4001 drawn just as they would if the value was <a
jdaggett@8368 4002 href="#font-variant-position-normal-value"
jdaggett@8368 4003 title="normal!!font-variant-position">‘<code
jdaggett@8368 4004 class=property>normal</code>’</a>.</p>
jdaggett@8364 4005 <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
jdaggett@8364 4006 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
jdaggett@8280 4007
jdaggett@8280 4008 <p>Because of these limitations, ‘<a
jdaggett@8280 4009 href="#propdef-font-variant-position"><code
jdaggett@8280 4010 class=property>font-variant-position</code></a>’ is not recommended for
jdaggett@8280 4011 use in user agent stylesheets. Authors should use it in cases where
jdaggett@5890 4012 subscripts or superscripts will only contain the narrow range of
jdaggett@5890 4013 characters supported by the fonts specified.
jdaggett@2509 4014
jdaggett@8368 4015 <p class=note>The variant glyphs use the same baseline as the default
jdaggett@8368 4016 glyphs would use. There is no shift in the placement along the baseline,
jdaggett@8368 4017 so the use of variant glyphs doesn't affect the height of the inline box
jdaggett@8368 4018 or alter the height of the linebox. This makes superscript and subscript
jdaggett@8368 4019 variants ideal for situations where it's important that leading remain
jdaggett@8368 4020 constant, such as in multi-column layout.
jdaggett@8368 4021
jdaggett@2461 4022 <div class=example>
jdaggett@8279 4023 <p>A typical user agent default style for the <a class=tag
jdaggett@8279 4024 href="#sub">sub</a> element:</p>
jdaggett@2461 4025
jdaggett@2461 4026 <pre>sub {
jdaggett@2461 4027 vertical-align: sub;
jdaggett@2461 4028 font-size: smaller;
jdaggett@2461 4029 line-height: normal;
jdaggett@2461 4030 }
jdaggett@2461 4031 </pre>
jdaggett@2461 4032
jdaggett@3460 4033 <p>Using font-variant-position to specify typographic subscripts in a way
jdaggett@3460 4034 that will still show subscripts in older user agents:</p>
jdaggett@3460 4035
jdaggett@3460 4036 <pre>@supports ( font-variant-position: sub ) {
jdaggett@3460 4037
jdaggett@3460 4038 sub {
jdaggett@8280 4039 vertical-align: baseline;
jdaggett@3460 4040 font-size: 100%;
jdaggett@3460 4041 line-height: inherit;
jdaggett@3460 4042 font-variant-position: sub;
jdaggett@3460 4043 }
jdaggett@3460 4044
jdaggett@2461 4045 }
jdaggett@2461 4046 </pre>
jdaggett@2461 4047
jdaggett@4624 4048 <p>User agents that support the ‘<a
jdaggett@4624 4049 href="#propdef-font-variant-position"><code
jdaggett@4624 4050 class=property>font-variant-position</code></a>’ property will select a
jdaggett@4624 4051 subscript variant glyph and render this without adjusting the baseline or
jdaggett@4624 4052 font-size. Older user agents will ignore the ‘<a
jdaggett@4624 4053 href="#propdef-font-variant-position"><code
jdaggett@4624 4054 class=property>font-variant-position</code></a>’ property definition
jdaggett@4624 4055 and use the standard defaults for subscripts.</p>
jdaggett@2461 4056 </div>
jdaggett@2118 4057 <!-- prop: font-variant-caps -->
jdaggett@2118 4058
jdaggett@2118 4059 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
jdaggett@1662 4060 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
jdaggett@1662 4061
jdaggett@5809 4062 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
jdaggett@1662 4063 <tbody>
jdaggett@1662 4064 <tr>
jdaggett@1662 4065 <td>Name:
jdaggett@1662 4066
jdaggett@1662 4067 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
jdaggett@1662 4068
jdaggett@1662 4069 <tr>
jdaggett@1662 4070 <td>Value:
jdaggett@1662 4071
jdaggett@8278 4072 <td><a href="#font-variant-caps-normal-value"
jdaggett@8278 4073 title="normal!!font-variant-caps">normal</a> | <a
jdaggett@8278 4074 href="#small-caps">small-caps</a> | <a
jdaggett@8278 4075 href="#all-small-caps">all-small-caps</a> | <a
jdaggett@8278 4076 href="#petite-caps">petite-caps</a> | <a
jdaggett@8278 4077 href="#all-petite-caps">all-petite-caps</a> | <a
jdaggett@8278 4078 href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
jdaggett@1662 4079
jdaggett@1662 4080 <tr>
jdaggett@1662 4081 <td>Initial:
jdaggett@1662 4082
jdaggett@1662 4083 <td>normal
jdaggett@1662 4084
jdaggett@1662 4085 <tr>
jdaggett@1662 4086 <td>Applies to:
jdaggett@1662 4087
jdaggett@1662 4088 <td>all elements
jdaggett@1662 4089
jdaggett@1662 4090 <tr>
jdaggett@1662 4091 <td>Inherited:
jdaggett@1662 4092
jdaggett@1662 4093 <td>yes
jdaggett@1662 4094
jdaggett@1662 4095 <tr>
jdaggett@1662 4096 <td>Percentages:
jdaggett@1662 4097
jdaggett@1662 4098 <td>N/A
jdaggett@1662 4099
jdaggett@1662 4100 <tr>
jdaggett@1662 4101 <td>Media:
jdaggett@1662 4102
jdaggett@1662 4103 <td>visual
jdaggett@1662 4104
jdaggett@1662 4105 <tr>
jdaggett@1662 4106 <td>Computed value:
jdaggett@1662 4107
jdaggett@1662 4108 <td>as specified
jdaggett@7377 4109
jdaggett@7377 4110 <tr>
jdaggett@7377 4111 <td>Animatable:
jdaggett@7377 4112
jdaggett@7377 4113 <td>no
jdaggett@1662 4114 </table>
jdaggett@1662 4115
jdaggett@8280 4116 <p>This property allows the selection of alternate glyphs used for small or
jdaggett@8280 4117 petite capitals or for titling. These glyphs are specifically designed to
jdaggett@8280 4118 blend well with the surrounding normal glyphs, to maintain the weight and
jdaggett@8280 4119 readability which suffers when text is simply resized to fit this purpose.
jdaggett@1662 4120
jdaggett@1732 4121 <p>Individual values have the following meanings:
jdaggett@1662 4122
jdaggett@1662 4123 <dl>
jdaggett@8278 4124 <dt><dfn id=font-variant-caps-normal-value
jdaggett@8278 4125 title="normal!!font-variant-caps">normal</dfn>
jdaggett@5809 4126
jdaggett@5809 4127 <dd>None of the features listed below are enabled.
jdaggett@5809 4128
jdaggett@1662 4129 <dt><dfn id=small-caps>small-caps</dfn>
jdaggett@1662 4130
jdaggett@6436 4131 <dd>Enables display of small capitals (OpenType feature: <span
jdaggett@6436 4132 class=tag>smcp</span>). Small-caps glyphs typically use the form of
jdaggett@6436 4133 uppercase letters but are reduced to the size of lowercase letters.
jdaggett@1662 4134 </dl>
jdaggett@1662 4135
jdaggett@1662 4136 <div class=featex><img alt="small-caps example" src=smcp.png></div>
jdaggett@1662 4137
jdaggett@1662 4138 <dl>
jdaggett@1732 4139 <dt><dfn id=all-small-caps>all-small-caps</dfn>
jdaggett@1732 4140
jdaggett@1732 4141 <dd>Enables display of small capitals for both upper and lowercase letters
jdaggett@6436 4142 (OpenType features: <span class=tag>c2sc, smcp</span>).
jdaggett@1732 4143
jdaggett@1662 4144 <dt><dfn id=petite-caps>petite-caps</dfn>
jdaggett@1662 4145
jdaggett@6436 4146 <dd>Enables display of petite capitals (OpenType feature: <span
jdaggett@6436 4147 class=tag>pcap</span>).
jdaggett@1662 4148
jdaggett@1732 4149 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
jdaggett@1732 4150
jdaggett@1732 4151 <dd>Enables display of petite capitals for both upper and lowercase
jdaggett@6436 4152 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
jdaggett@1732 4153
jdaggett@6648 4154 <dt><dfn id=unicase>unicase</dfn>
jdaggett@6648 4155
jdaggett@6648 4156 <dd>Enables display of mixture of small capitals for uppercase letters
jdaggett@6648 4157 with normal lowercase letters (OpenType feature: <span
jdaggett@6648 4158 class=tag>unic</span>).
jdaggett@6648 4159
jdaggett@1662 4160 <dt><dfn id=titling-caps>titling-caps</dfn>
jdaggett@1662 4161
jdaggett@6436 4162 <dd>Enables display of titling capitals (OpenType feature: <span
jdaggett@6436 4163 class=tag>titl</span>). Uppercase letter glyphs are often designed for
jdaggett@6436 4164 use with lowercase letters. When used in all uppercase titling sequences
jdaggett@6436 4165 they can appear too strong. Titling capitals are designed specifically
jdaggett@6436 4166 for this situation.
jdaggett@1662 4167 </dl>
jdaggett@1662 4168
jdaggett@6648 4169 <p>The availability of these glyphs is based on whether a given feature is
jdaggett@6648 4170 defined or not in the feature list of the font. User agents can optionally
jdaggett@6648 4171 decide this on a per-script basis but should explicitly not decide this on
jdaggett@6648 4172 a per-character basis.
jdaggett@6648 4173
jdaggett@6648 4174 <p>Some fonts may only support a subset or none of the features described
jdaggett@6648 4175 for this property. For backwards compatibility with CSS 2.1, if ‘<a
jdaggett@4624 4176 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
jdaggett@4624 4177 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
jdaggett@4624 4178 is specified but small-caps glyphs are not available for a given font,
jdaggett@4624 4179 user agents should simulate a small-caps font, for example by taking a
jdaggett@6648 4180 normal font and replacing the glyphs for lowercase letters with scaled
jdaggett@6648 4181 versions of the glyphs for uppercase characters (replacing the glyphs for
jdaggett@6648 4182 both upper and lowercase letters in the case of ‘<a
jdaggett@4624 4183 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
jdaggett@6648 4184
jdaggett@6648 4185 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
jdaggett@6648 4186 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
bert@8683 4187 width=512>
jdaggett@6648 4188 <p class=caption>Synthetic vs. real small-caps
jdaggett@6648 4189 </div>
jdaggett@6648 4190
jdaggett@6648 4191 <p>To match the surrounding text, a font may provide alternate glyphs for
jdaggett@6648 4192 caseless characters when these features are enabled but when a user agent
jdaggett@6648 4193 simulates small capitals, it must not attempt to simulate alternates for
jdaggett@6648 4194 codepoints which are considered caseless.
jdaggett@6648 4195
jdaggett@6648 4196 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
jdaggett@6648 4197 characters with small-caps, all-small-caps enabled" class=hires
bert@8683 4198 src=small-capitals-variations.png width=418>
jdaggett@6648 4199 <p class=caption>Caseless characters with small-caps, all-small-caps
jdaggett@6648 4200 enabled
jdaggett@6648 4201 </div>
jdaggett@6648 4202
jdaggett@6648 4203 <p>If either ‘<a href="#petite-caps"><code
jdaggett@4624 4204 class=property>petite-caps</code></a>’ or ‘<a
jdaggett@4624 4205 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
jdaggett@4624 4206 is specified for a font that doesn't support these features, the property
jdaggett@4624 4207 behaves as if ‘<a href="#small-caps"><code
jdaggett@4624 4208 class=property>small-caps</code></a>’ or ‘<a
jdaggett@4624 4209 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
jdaggett@6648 4210 respectively, had been specified. If ‘<a href="#unicase"><code
jdaggett@6648 4211 class=property>unicase</code></a>’ is specified for a font that doesn't
jdaggett@6648 4212 support that feature, the property behaves as if ‘<a
jdaggett@6648 4213 href="#small-caps"><code class=property>small-caps</code></a>’ was
jdaggett@6648 4214 applied only to lowercased uppercase letters. If ‘<a
jdaggett@6648 4215 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
jdaggett@6648 4216 specified with a font that does not support this feature, this property
jdaggett@6648 4217 has no visible effect. When simulated small capital glyphs are used, for
jdaggett@4624 4218 scripts that lack uppercase and lowercase letters, ‘<a
jdaggett@4624 4219 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
jdaggett@4624 4220 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
jdaggett@4624 4221 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
jdaggett@4624 4222 ‘<a href="#all-petite-caps"><code
jdaggett@4624 4223 class=property>all-petite-caps</code></a>’ and ‘<a
jdaggett@4624 4224 href="#unicase"><code class=property>unicase</code></a>’ have no visible
jdaggett@2462 4225 effect.
jdaggett@1662 4226
jdaggett@6648 4227 <p>When casing transforms are used to simulate small capitals, the casing
jdaggett@8280 4228 transformations must match those used for the <span
jdaggett@6648 4229 class=property>‘<code class=property>text-transform</code>’</span>
jdaggett@6648 4230 property.
jdaggett@6648 4231
jdaggett@6648 4232 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
jdaggett@6648 4233 replace glyphs in a small-caps font so that the text appears in all
jdaggett@6648 4234 uppercase letters.
jdaggett@6648 4235
jdaggett@6648 4236 <div class=figure style="padding: 0; margin: auto;"><img alt="using
jdaggett@6648 4237 all-small-caps in acronym-laden text" class=hires
bert@8683 4238 src=acronym-laden-text.png width=596>
jdaggett@6648 4239 <p class=caption>Using small capitals to improve readability in
jdaggett@6648 4240 acronym-laden text
jdaggett@6648 4241 </div>
jdaggett@6648 4242
jdaggett@1662 4243 <div class=example>
jdaggett@1662 4244 <p>Quotes rendered italicised, with small-caps on the first line:</p>
jdaggett@1662 4245
jdaggett@1662 4246 <pre>blockquote { font-style: italic; }
jdaggett@1662 4247 blockquote:first-line { font-variant: small-caps; }
jdaggett@1662 4248
jdaggett@8397 4249 &lt;blockquote><a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/0036.html" style="text-decoration: none; border: none;">I'll be honor-bound to slap them like a haddock.</a>&lt;/blockquote>
jdaggett@1662 4250 </pre>
jdaggett@1662 4251 </div>
jdaggett@2118 4252 <!-- prop: font-variant-numeric -->
jdaggett@2118 4253
jdaggett@2118 4254 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
jdaggett@1662 4255 formatting: the <a
jdaggett@1662 4256 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
jdaggett@1662 4257
jdaggett@5809 4258 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
jdaggett@1662 4259 <tbody>
jdaggett@1662 4260 <tr>
jdaggett@1662 4261 <td>Name:
jdaggett@1662 4262
jdaggett@1662 4263 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
jdaggett@1662 4264
jdaggett@1662 4265 <tr>
jdaggett@1662 4266 <td>Value:
jdaggett@1662 4267
jdaggett@8278 4268 <td><a href="#font-variant-numeric-normal-value"
jdaggett@8278 4269 title="normal!!font-variant-numeric">normal</a> | [ <a
jdaggett@8225 4270 href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
jdaggett@8225 4271 || <a
jdaggett@8225 4272 href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
jdaggett@8225 4273 || <a
jdaggett@8225 4274 href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
jdaggett@8225 4275 || <a href="#ordinal">ordinal</a> || <a
jdaggett@8225 4276 href="#slashed-zero">slashed-zero</a> ]
jdaggett@1662 4277
jdaggett@1662 4278 <tr>
jdaggett@1662 4279 <td>Initial:
jdaggett@1662 4280
jdaggett@1662 4281 <td>normal
jdaggett@1662 4282
jdaggett@1662 4283 <tr>
jdaggett@1662 4284 <td>Applies to:
jdaggett@1662 4285
jdaggett@1662 4286 <td>all elements
jdaggett@1662 4287
jdaggett@1662 4288 <tr>
jdaggett@1662 4289 <td>Inherited:
jdaggett@1662 4290
jdaggett@1662 4291 <td>yes
jdaggett@1662 4292
jdaggett@1662 4293 <tr>
jdaggett@1662 4294 <td>Percentages:
jdaggett@1662 4295
jdaggett@1662 4296 <td>N/A
jdaggett@1662 4297
jdaggett@1662 4298 <tr>
jdaggett@1662 4299 <td>Media:
jdaggett@1662 4300
jdaggett@1662 4301 <td>visual
jdaggett@1662 4302
jdaggett@1662 4303 <tr>
jdaggett@1662 4304 <td>Computed value:
jdaggett@1662 4305
jdaggett@1662 4306 <td>as specified
jdaggett@7377 4307
jdaggett@7377 4308 <tr>
jdaggett@7377 4309 <td>Animatable:
jdaggett@7377 4310
jdaggett@7377 4311 <td>no
jdaggett@1662 4312 </table>
jdaggett@1662 4313
jdaggett@8311 4314 <p>Specifies control over numerical forms. The example below shows how some
jdaggett@8311 4315 of these values can be combined to influence the rendering of tabular data
jdaggett@8311 4316 with fonts that support these features. Within normal paragraph text,
jdaggett@8311 4317 proportional numbers are used while tabular numbers are used so that
jdaggett@8311 4318 columns of numbers line up properly:
jdaggett@1662 4319
jdaggett@1662 4320 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
jdaggett@1662 4321 number styles" src=numberstyles.png>
jdaggett@1662 4322 <p class=caption>Using number styles
jdaggett@1662 4323 </div>
jdaggett@1662 4324
jdaggett@8311 4325 <p>Possible combinations:
jdaggett@8311 4326
jdaggett@8311 4327 <pre
jdaggett@8311 4328 class=prod><dfn id=numeric-figure-values><var>&lt;numeric-figure-values&gt;</var></dfn> = [ <a href="#lining-nums">lining-nums</a> | <a href="#oldstyle-nums">oldstyle-nums</a> ]</pre>
jdaggett@8311 4329
jdaggett@8311 4330 <pre
jdaggett@8311 4331 class=prod><dfn id=numeric-spacing-values><var>&lt;numeric-spacing-values&gt;</var></dfn> = [ <a href="#proportional-nums">proportional-nums</a> | <a href="#tabular-nums">tabular-nums</a> ]</pre>
jdaggett@8311 4332
jdaggett@8311 4333 <pre
jdaggett@8311 4334 class=prod><dfn id=numeric-fraction-values><var>&lt;numeric-fraction-values&gt;</var></dfn> = [ <a href="#diagonal-fractions">diagonal-fractions</a> | <a href="#stacked-fractions">stacked-fractions</a> ]</pre>
jdaggett@8311 4335
jdaggett@8311 4336 <p>Individual values have the following meanings:
jdaggett@8311 4337
jdaggett@1662 4338 <dl>
jdaggett@8311 4339 <dt><dfn id=font-variant-numeric-normal-value
jdaggett@8311 4340 title="normal!!font-variant-numeric">normal</dfn>
jdaggett@8311 4341
jdaggett@8311 4342 <dd>None of the features listed below are enabled.
jdaggett@8311 4343
jdaggett@8311 4344 <dt><dfn id=lining-nums>lining-nums</dfn>
jdaggett@8311 4345
jdaggett@8311 4346 <dd>Enables display of lining numerals (OpenType feature: <span
jdaggett@8311 4347 class=tag>lnum</span>).
jdaggett@8311 4348
jdaggett@8311 4349 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
jdaggett@8311 4350
jdaggett@8311 4351 <dd>Enables display of old-style numerals (OpenType feature: <span
jdaggett@8311 4352 class=tag>onum</span>).
jdaggett@8311 4353
jdaggett@8311 4354 <dt><dfn id=proportional-nums>proportional-nums</dfn>
jdaggett@8311 4355
jdaggett@8311 4356 <dd>Enables display of proportional numerals (OpenType feature: <span
jdaggett@8311 4357 class=tag>pnum</span>).
jdaggett@8311 4358
jdaggett@8311 4359 <dt><dfn id=tabular-nums>tabular-nums</dfn>
jdaggett@8311 4360
jdaggett@8311 4361 <dd>Enables display of tabular numerals (OpenType feature: <span
jdaggett@8311 4362 class=tag>tnum</span>).
jdaggett@8311 4363
jdaggett@1662 4364 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
jdaggett@1662 4365
jdaggett@6436 4366 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
jdaggett@6436 4367 class=tag>frac</span>).
jdaggett@1662 4368 </dl>
jdaggett@1662 4369
jdaggett@1662 4370 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
jdaggett@1662 4371
jdaggett@1662 4372 <dl>
jdaggett@1662 4373 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
jdaggett@1662 4374
jdaggett@6436 4375 <dd>Enables display of lining stacked fractions (OpenType feature: <span
jdaggett@6436 4376 class=tag>afrc</span>).
jdaggett@1662 4377 </dl>
jdaggett@1662 4378
jdaggett@1662 4379 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
jdaggett@1662 4380
jdaggett@1662 4381 <dl>
jdaggett@3638 4382 <dt><dfn id=ordinal>ordinal</dfn>
jdaggett@3638 4383
jdaggett@3638 4384 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
jdaggett@6436 4385 <span class=tag>ordn</span>).
jdaggett@8983 4386 </dl>
jdaggett@8983 4387
jdaggett@8983 4388 <div class=featex><img alt="ordinals example" src=ordinals.png></div>
jdaggett@8983 4389
jdaggett@8983 4390 <dl>
jdaggett@1662 4391 <dt><dfn id=slashed-zero>slashed-zero</dfn>
jdaggett@1662 4392
jdaggett@6436 4393 <dd>Enables display of slashed zeros (OpenType feature: <span
jdaggett@6436 4394 class=tag>zero</span>).
jdaggett@1662 4395 </dl>
jdaggett@1662 4396
jdaggett@1662 4397 <div class=featex><img alt="slashed zero example" src=zero.png></div>
jdaggett@1662 4398
jdaggett@8984 4399 <div class=example>
jdaggett@8984 4400 <p>In the case of ‘<a href="#ordinal"><code
jdaggett@8984 4401 class=property>ordinal</code></a>’, although ordinal forms are often
jdaggett@8984 4402 the same as superscript forms, they are marked up differently.</p>
jdaggett@8984 4403
jdaggett@8984 4404 <p>For superscripts, the variant property is only applied to the
jdaggett@8984 4405 sub-element containing the superscript:</p>
jdaggett@8984 4406
jdaggett@8984 4407 <pre>
jdaggett@8984 4408 sup { font-variant-position: super; }
jdaggett@8984 4409 x&lt;sup&gt;2&lt;/sup&gt;
jdaggett@8984 4410 </pre>
jdaggett@8984 4411
jdaggett@8984 4412 <p>For ordinals, the variant property is applied to the entire ordinal
jdaggett@8984 4413 number:</p>
jdaggett@8984 4414
jdaggett@8984 4415 <pre>
jdaggett@8984 4416 .ordinal { font-variant-numeric: ordinal; }
jdaggett@8984 4417 &lt;span class="ordinal"&gt;17th&lt;/span&gt;
jdaggett@8984 4418 </pre>
jdaggett@8984 4419
jdaggett@8984 4420 <p>In this case only the "th" will appear in ordinal form, the digits will
jdaggett@8984 4421 remain unchanged. Depending upon the typographic traditions used in a
jdaggett@8984 4422 given language, ordinal forms may differ from superscript forms. In
jdaggett@8984 4423 Italian, for example, ordinal forms sometimes include an underline in the
jdaggett@8984 4424 design of ordinals.</p>
jdaggett@8984 4425 </div>
jdaggett@8984 4426
jdaggett@1662 4427 <div class=example id=steak-marinade>
jdaggett@1662 4428 <p>A simple flank steak marinade recipe, rendered with automatic fractions
jdaggett@1662 4429 and old-style numerals:</p>
jdaggett@1662 4430
jdaggett@1662 4431 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
jdaggett@1662 4432
jdaggett@1662 4433 &lt;h4>Steak marinade:&lt;/h4>
jdaggett@1662 4434 &lt;ul>
jdaggett@1662 4435 &lt;li>&lt;span class="amount">2&lt;/span> tbsp olive oil&lt;/li>
jdaggett@1662 4436 &lt;li>&lt;span class="amount">1&lt;/span> tbsp lemon juice&lt;/li>
jdaggett@1662 4437 &lt;li>&lt;span class="amount">1&lt;/span> tbsp soy sauce&lt;/li>
jdaggett@1662 4438 &lt;li>&lt;span class="amount">1 1/2&lt;/span> tbsp dry minced onion&lt;/li>
jdaggett@1662 4439 &lt;li>&lt;span class="amount">2 1/2&lt;/span> tsp italian seasoning&lt;/li>
jdaggett@1732 4440 &lt;li>Salt &amp;amp; pepper&lt;/li>
jdaggett@1662 4441 &lt;/ul>
jdaggett@1662 4442
jdaggett@5596 4443 &lt;p>Mix the meat with the marinade and let it sit covered in the refrigerator
jdaggett@5596 4444 for a few hours or overnight.&lt;/p>
jdaggett@1662 4445 </pre>
jdaggett@8311 4446
jdaggett@8311 4447 <p>Note that the fraction feature is only applied to values not the entire
jdaggett@8311 4448 paragraph. Fonts often implement this feature using contextual rules
jdaggett@8311 4449 based on the use of the slash (‘<code class=css>/</code>’) character.
jdaggett@8311 4450 As such, it's not suitable for use as a paragraph-level style.</p>
jdaggett@1662 4451 </div>
jdaggett@2118 4452 <!-- prop: font-variant-alternates -->
jdaggett@2118 4453
jdaggett@2118 4454 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
jdaggett@2118 4455 and swashes: the <a
jdaggett@2118 4456 href="#propdef-font-variant-alternates">font-variant-alternates</a>
jdaggett@2118 4457 property</h3>
jdaggett@2118 4458
jdaggett@6176 4459 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
jdaggett@2118 4460 <tbody>
jdaggett@2118 4461 <tr>
jdaggett@2118 4462 <td>Name:
jdaggett@2118 4463
jdaggett@2118 4464 <td><dfn
jdaggett@2118 4465 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
jdaggett@2118 4466
jdaggett@2118 4467 <tr>
jdaggett@2118 4468 <td>Value:
jdaggett@2118 4469
jdaggett@8225 4470 <td>normal | [ <a href="#stylistic"
jdaggett@8225 4471 title=stylistic>stylistic(&lt;feature-value-name&gt;)</a> || <a
jdaggett@8225 4472 href="#historical-forms">historical-forms</a> || <a href="#styleset"
jdaggett@8225 4473 title=styleset>styleset(&lt;feature-value-name&gt; #)</a> || <a
jdaggett@8225 4474 href="#character-variant"
jdaggett@8225 4475 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 4476 #)</a> || <a href="#swash"
jdaggett@8225 4477 title=swash>swash(&lt;feature-value-name&gt;)</a> || <a
jdaggett@8225 4478 href="#ornaments"
jdaggett@8225 4479 title=ornaments>ornaments(&lt;feature-value-name&gt;)</a> || <a
jdaggett@8225 4480 href="#annotation"
jdaggett@8225 4481 title=annotation>annotation(&lt;feature-value-name&gt;)</a> ]
jdaggett@2118 4482
jdaggett@2118 4483 <tr>
jdaggett@2118 4484 <td>Initial:
jdaggett@2118 4485
jdaggett@2118 4486 <td>normal
jdaggett@2118 4487
jdaggett@2118 4488 <tr>
jdaggett@2118 4489 <td>Applies to:
jdaggett@2118 4490
jdaggett@2118 4491 <td>all elements
jdaggett@2118 4492
jdaggett@2118 4493 <tr>
jdaggett@2118 4494 <td>Inherited:
jdaggett@2118 4495
jdaggett@2118 4496 <td>yes
jdaggett@2118 4497
jdaggett@2118 4498 <tr>
jdaggett@2118 4499 <td>Percentages:
jdaggett@2118 4500
jdaggett@2118 4501 <td>N/A
jdaggett@2118 4502
jdaggett@2118 4503 <tr>
jdaggett@2118 4504 <td>Media:
jdaggett@2118 4505
jdaggett@2118 4506 <td>visual
jdaggett@2118 4507
jdaggett@2118 4508 <tr>
jdaggett@2118 4509 <td>Computed value:
jdaggett@2118 4510
jdaggett@2118 4511 <td>as specified
jdaggett@7377 4512
jdaggett@7377 4513 <tr>
jdaggett@7377 4514 <td>Animatable:
jdaggett@7377 4515
jdaggett@7377 4516 <td>no
jdaggett@2118 4517 </table>
jdaggett@2118 4518
jdaggett@2118 4519 <p>For any given character, fonts can provide a variety of alternate glyphs
jdaggett@2118 4520 in addition to the default glyph for that character. This property
jdaggett@2118 4521 provides control over the selection of these alternate glyphs.
jdaggett@2118 4522
jdaggett@8311 4523 <p>For many of the property values listed below, several different
jdaggett@8311 4524 alternate glyphs are available. How many alternates are available and what
jdaggett@8356 4525 they represent is font-specific, so these are each marked <dfn
jdaggett@8356 4526 id=font-specific>font specific</dfn> in the value definitions below.
jdaggett@8356 4527 Because the nature of these alternates is font-specific, the <a
jdaggett@8311 4528 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 4529 rule is used to define values for a specific font family or set of
jdaggett@8311 4530 families that associate a font-specific numeric
jdaggett@8311 4531 <code>&lt;feature-index&gt;</code> with a custom
jdaggett@8311 4532 <code>&lt;feature-value-name&gt;</code>, which is then used in this
jdaggett@8311 4533 property to select specific alternates:
jdaggett@8311 4534
jdaggett@8311 4535 <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
jdaggett@8311 4536
jdaggett@8311 4537 p {
jdaggett@8311 4538 font-family: Noble Script;
jdaggett@8311 4539 font-variant-alternates: swash(flowing); /* use swash alternate #2 */
jdaggett@8311 4540 }</pre>
jdaggett@8311 4541
jdaggett@8312 4542 <p>When a particular <code>&lt;feature-value-name&gt;</code> has not been
jdaggett@8312 4543 defined for a given family or for a particular feature type, the computed
jdaggett@8312 4544 value must be the same as if it had been defined. However, property values
jdaggett@8312 4545 that contain these undefined <code>&lt;feature-value-name&gt;</code>
jdaggett@8312 4546 identifiers must be ignored when choosing glyphs.
jdaggett@8312 4547
jdaggett@8312 4548 <pre>/* these two style rules are effectively the same */
jdaggett@8312 4549 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
jdaggett@8312 4550 p { font-variant-alternates: normal; }
jdaggett@8312 4551 </pre>
jdaggett@8312 4552
jdaggett@8312 4553 <p>This allows values to be defined and used for a given set of font
jdaggett@8312 4554 families but ignored if fallback occurs, since the font family name would
jdaggett@8312 4555 be different. If a given value is outside the range supported by a given
jdaggett@8312 4556 font, the value is ignored. These values never apply to generic font
jdaggett@8312 4557 families.
jdaggett@2556 4558
jdaggett@2118 4559 <p>Individual values have the following meanings:
jdaggett@2118 4560
jdaggett@2118 4561 <dl>
jdaggett@8278 4562 <dt><dfn id=font-variant-alternates-normal-value
jdaggett@8278 4563 title="normal!!font-variant-alternates">normal</dfn>
jdaggett@5809 4564
jdaggett@5809 4565 <dd>None of the features listed below are enabled.
jdaggett@5809 4566
jdaggett@2118 4567 <dt><dfn id=historical-forms>historical-forms</dfn>
jdaggett@2118 4568
jdaggett@6436 4569 <dd>Enables display of historical forms (OpenType feature: <span
jdaggett@6436 4570 class=tag>hist</span>).
jdaggett@2118 4571 </dl>
jdaggett@2118 4572
jdaggett@2118 4573 <div class=featex><img alt="historical form example" src=hist.png></div>
jdaggett@2118 4574
jdaggett@2118 4575 <dl>
jdaggett@8311 4576 <dt><dfn id=stylistic
jdaggett@8311 4577 title=stylistic>stylistic(&lt;feature-value-name&gt;)</dfn>
jdaggett@8311 4578
jdaggett@8356 4579 <dd>Enables display of stylistic alternates (<a
jdaggett@8356 4580 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
jdaggett@8356 4581 class=tag>salt &lt;feature-index&gt;</span>).
jdaggett@8311 4582 </dl>
jdaggett@8311 4583
jdaggett@8311 4584 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
jdaggett@8311 4585
jdaggett@8311 4586 <dl>
jdaggett@8225 4587 <dt><dfn id=styleset title=styleset>styleset(&lt;feature-value-name&gt;
jdaggett@8225 4588 #)</dfn>
jdaggett@2118 4589
jdaggett@8356 4590 <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
jdaggett@8356 4591 specific</em></a>, OpenType feature: <span
jdaggett@8356 4592 class=tag>ss&lt;feature-index&gt;</span> OpenType currently defines <span
jdaggett@8356 4593 class=tag>ss01</span> through <span class=tag>ss20</span>).
jdaggett@2118 4594 </dl>
jdaggett@2118 4595
jdaggett@2118 4596 <div class=featex><img alt="styleset example" src=ssnn.png></div>
jdaggett@2118 4597
jdaggett@2118 4598 <dl>
jdaggett@8225 4599 <dt><dfn id=character-variant
jdaggett@8225 4600 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 4601 #)</dfn>
jdaggett@2118 4602
jdaggett@8356 4603 <dd>Enables display of specific character variants (<a
jdaggett@8356 4604 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
jdaggett@6436 4605 class=tag>cv&lt;feature-index&gt;</span> OpenType currently defines <span
jdaggett@6436 4606 class=tag>cv01</span> through <span class=tag>cv99</span>).
jdaggett@2118 4607
jdaggett@8225 4608 <dt><dfn id=swash title=swash>swash(&lt;feature-value-name&gt;)</dfn>
jdaggett@2118 4609
jdaggett@8356 4610 <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
jdaggett@8356 4611 specific</em></a>, OpenType feature: <span class=tag>swsh
jdaggett@8356 4612 &lt;feature-index&gt;, cswh &lt;feature-index&gt;</span>).
jdaggett@2118 4613 </dl>
jdaggett@2118 4614
jdaggett@2118 4615 <div class=featex><img alt="swash example" src=swsh.png></div>
jdaggett@2118 4616
jdaggett@2118 4617 <dl>
jdaggett@8225 4618 <dt><dfn id=ornaments
jdaggett@7060 4619 title=ornaments>ornaments(&lt;feature-value-name&gt;)</dfn>
jdaggett@2118 4620
jdaggett@2118 4621 <dd>Enables replacement of default glyphs with ornaments, if provided in
jdaggett@8356 4622 the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
jdaggett@8356 4623 feature: <span class=tag>ornm &lt;feature-index&gt;</span>). Some fonts
jdaggett@8356 4624 may offer ornament glyphs as alternates for a wide collection of
jdaggett@8356 4625 characters; however, displaying arbitrary characters (e.g.,
jdaggett@8356 4626 alphanumerics) as ornaments is poor practice as it distorts the semantics
jdaggett@8356 4627 of the data. Font designers are encouraged to encode all ornaments
jdaggett@8356 4628 (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
jdaggett@8356 4629 alternates for the bullet character (U+2022) to allow authors to select
jdaggett@8356 4630 the desired glyph using ‘<a href="#ornaments"><code
jdaggett@8356 4631 class=property>ornaments</code></a>’.
jdaggett@2118 4632 </dl>
jdaggett@2118 4633
jdaggett@2118 4634 <div class=featex><img alt="ornaments example" src=ornm.png></div>
jdaggett@2118 4635
jdaggett@2118 4636 <dl>
jdaggett@8225 4637 <dt><dfn id=annotation
jdaggett@7060 4638 title=annotation>annotation(&lt;feature-value-name&gt;)</dfn>
jdaggett@2118 4639
jdaggett@8356 4640 <dd>Enables display of alternate annotation forms (<a
jdaggett@8356 4641 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
jdaggett@8356 4642 class=tag>nalt &lt;feature-index&gt;</span>).
jdaggett@2118 4643 </dl>
jdaggett@2118 4644
jdaggett@2118 4645 <div class=featex><img alt="alternate annotation form example"
jdaggett@2118 4646 src=nalt.png></div>
jdaggett@2118 4647
jdaggett@2472 4648 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
jdaggett@8311 4649 specific alternates: the <dfn id=at-font-feature-values-rule
jdaggett@8311 4650 style="font-weight: inherit; font-style:
jdaggett@8311 4651 inherit"><code>@font-feature-values</code></dfn> rule</h3>
jdaggett@2472 4652
jdaggett@4624 4653 <p>Several of the possible values of ‘<a
jdaggett@4624 4654 href="#propdef-font-variant-alternates"><code
jdaggett@4624 4655 class=property>font-variant-alternates</code></a>’ listed above are
jdaggett@8356 4656 labeled as <a href="#font-specific"><em>font specific</em></a>. For these
jdaggett@8356 4657 features fonts may define not just a single glyph but a set of alternate
jdaggett@8356 4658 glyphs with an index to select a given alternate. Since these are font
jdaggett@8356 4659 family specific, the <a
jdaggett@8311 4660 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8356 4661 rule is used to define named values for these indices for a given family.
jdaggett@8356 4662
jdaggett@8356 4663 <p class=note>See the <a href="#om-fontfeaturevalues">object model
jdaggett@8356 4664 reference section</a> for a description of the interfaces used to modify
jdaggett@8356 4665 these rules via the CSS Object Model.
jdaggett@8356 4666
jdaggett@8356 4667 <div class=example>
jdaggett@8356 4668 <p>In the case of the swash Q in the example shown above, the swash could
jdaggett@8356 4669 be specified using these style rules:</p>
jdaggett@8356 4670
jdaggett@8356 4671 <pre>
jdaggett@7041 4672
jdaggett@2472 4673 @font-feature-values Jupiter Sans {
jdaggett@7041 4674 @swash {
jdaggett@7041 4675 delicate: 1;
jdaggett@7041 4676 flowing: 2;
jdaggett@7041 4677 }
jdaggett@2472 4678 }
jdaggett@2472 4679
jdaggett@2472 4680 h2 { font-family: Jupiter Sans, sans-serif; }
jdaggett@2472 4681
jdaggett@2472 4682 /* show the second swash variant in h2 headings */
jdaggett@2472 4683 h2:first-letter { font-variant-alternates: swash(flowing); }
jdaggett@2472 4684
jdaggett@2479 4685 &lt;h2>Quick&lt;/h2></pre>
jdaggett@2472 4686
jdaggett@8356 4687 <p>When Jupiter Sans is present, the second alternate swash alternate will
jdaggett@8356 4688 be displayed. When not present, no swash character will be shown, since
jdaggett@8356 4689 the specific named value "flowing" is only defined for the Jupiter Sans
jdaggett@8356 4690 family. The @-mark indicates the name of the property value for which a
jdaggett@8356 4691 named value can be used. The name "flowing" is chosen by the author. The
jdaggett@8356 4692 index that represents each alternate is defined within a given font's
jdaggett@8356 4693 data.</p>
jdaggett@8356 4694 </div>
jdaggett@8356 4695
jdaggett@8356 4696 <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
jdaggett@8356 4697
jdaggett@8356 4698 <p>An <a
jdaggett@8356 4699 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8356 4700 rule is composed of a list of font families followed by a block containing
jdaggett@8356 4701 individual <a href="#featurevalueblock"><i
jdaggett@8356 4702 title="feature_value_block">feature value blocks</i></a> that take the
jdaggett@8356 4703 form of @-rules. Each block defines a set of named values for a specific
jdaggett@8356 4704 font feature when a given set of font families is used. Effectively, they
jdaggett@8356 4705 define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
jdaggett@8356 4706 ⟨values⟩ are the numeric indices used for specific features defined
jdaggett@8356 4707 for a given font.
jdaggett@8031 4708
jdaggett@8031 4709 <p>In terms of the grammar, this specification defines the following
jdaggett@8312 4710 productions:
jdaggett@8225 4711
jdaggett@8225 4712 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
jdaggett@8225 4713 : <a href="#fontfeaturevaluessym"><i>FONT_FEATURE_VALUES_SYM</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#fontfamilynamelist"><i>font_family_name_list</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4714 '{' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevalueblock"><i>feature_value_block</i></a>? [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevalueblock"><i>feature_value_block</i></a>? ]* '}' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4715 ;
jdaggett@8225 4716
jdaggett@8225 4717 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
jdaggett@8225 4718 : <a href="#fontfamilyname"><i>font_family_name</i></a> [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ',' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#fontfamilyname"><i>font_family_name</i></a> ]*
jdaggett@8225 4719 ;
jdaggett@8225 4720
jdaggett@8225 4721 <dfn id=fontfamilyname>font_family_name</dfn>
jdaggett@8225 4722 : <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>STRING</i></a> | [ <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>IDENT</i></a> [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>IDENT</i></a> ]* ]
jdaggett@8225 4723 ;
jdaggett@8225 4724
jdaggett@8225 4725 <dfn id=featurevalueblock>feature_value_block</dfn>
jdaggett@8225 4726 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4727 '{' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevaluedefinition"><i>feature_value_definition</i></a>? [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ';' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevaluedefinition"><i>feature_value_definition</i></a>? ]* '}' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4728 ;
jdaggett@8225 4729
jdaggett@8225 4730 <dfn id=featuretype>feature_type</dfn>:
jdaggett@8225 4731 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
jdaggett@8225 4732 ;
jdaggett@8225 4733
jdaggett@8225 4734 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
jdaggett@8225 4735 : <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>IDENT</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ':' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>NUMBER</i></a> [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>NUMBER</i></a> ]*
jdaggett@8225 4736 ;
jdaggett@8225 4737 </pre>
jdaggett@8225 4738
jdaggett@8032 4739 <p>The following new token is introduced:
jdaggett@8032 4740
jdaggett@8225 4741 <pre>@{F}{O}{N}{T}{-}{F}{E}{A}{T}{U}{R}{E}{-}{V}{A}{L}{U}{E}{S} {return <dfn id=fontfeaturevaluessym>FONT_FEATURE_VALUES_SYM</dfn>;}
jdaggett@2118 4742 </pre>
jdaggett@2118 4743
jdaggett@8356 4744 <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
jdaggett@8356 4745 value blocks</i></a> are handled as <a
jdaggett@8356 4746 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
jdaggett@8356 4747 consist of everything up to the next block or semi-colon, whichever comes
jdaggett@8356 4748 first.
jdaggett@8356 4749
jdaggett@8356 4750 <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
jdaggett@8356 4751 family list</i></a> is a comma-delimited list of <a
jdaggett@8356 4752 href="#fontfamilyname"><i title="font_family_name">font family
jdaggett@8356 4753 names</i></a> that match the definition of <a
jdaggett@8356 4754 href="#family-name-value"><var>&lt;family-name&gt;</var></a> for the <a
jdaggett@8278 4755 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8356 4756 class=property>font-family</code>’</a> property. This means that only
jdaggett@8356 4757 named font families are allowed, rules that include generic or system
jdaggett@8356 4758 fonts in the list of font families are syntax errors. However, if a user
jdaggett@8356 4759 agent defines a generic font to be a specific named font (e.g. Helvetica),
jdaggett@8356 4760 the settings associated with that family name will be used. If syntax
jdaggett@8356 4761 errors occur within the font family list, the entire rule must be ignored.
jdaggett@8356 4762
jdaggett@8356 4763 <p>Within <a href="#featurevalueblock"><i
jdaggett@8356 4764 title="feature_value_block">feature value blocks</i></a>, the <a
jdaggett@8356 4765 href="#featuretype"><i title="feature_type">feature type</i></a> is
jdaggett@8356 4766 ‘<code class=css>@</code>’ followed by the name of one of the <a
jdaggett@8356 4767 href="#font-specific"><em>font specific</em></a> property values of ‘<a
jdaggett@8356 4768 href="#propdef-font-variant-alternates"><code
jdaggett@8356 4769 class=property>font-variant-alternates</code></a>’ (e.g. <a
jdaggett@8356 4770 href="#swash"><code>@swash</code></a>). The identifiers used within
jdaggett@8356 4771 feature value definitions follow the rules of CSS user identifiers and are
jdaggett@8356 4772 case-sensitive. They are unique only for a given set of font families and
jdaggett@8356 4773 <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
jdaggett@8356 4774 same identifier used with a different <a href="#featuretype"><i
jdaggett@8356 4775 title="feature_type">feature type</i></a> is treated as a separate and
jdaggett@8356 4776 distinct value. If the same identifier is defined mulitple times for a
jdaggett@8356 4777 given <a href="#featuretype"><i title="feature_type">feature type</i></a>
jdaggett@8356 4778 and font family, the last defined value is used. Values associated with a
jdaggett@8356 4779 given identifier are limited to integer values 0 or greater.
jdaggett@8356 4780
jdaggett@8356 4781 <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
jdaggett@8356 4782 title="feature_value_definition">feature value definition</i></a>, such as
jdaggett@8356 4783 invalid identifiers or values, the entire <a
jdaggett@8356 4784 href="#featurevaluedefinition"><i title="feature_value_definition">feature
jdaggett@8356 4785 value definition</i></a> must be omitted, just as syntax errors in style
jdaggett@8356 4786 declarations are handled. When the <a href="#featuretype"><i
jdaggett@8356 4787 title="feature_type">feature type</i></a> is invalid, the entire
jdaggett@8356 4788 associated <a href="#featurevalueblock"><i
jdaggett@8356 4789 title="feature_value_block">feature value block</i></a> must be ignored.
jdaggett@8356 4790
jdaggett@8356 4791 <div class=example>
jdaggett@8356 4792 <p>Rules that are equivalent given syntax error handling:</p>
jdaggett@8356 4793
jdaggett@8356 4794 <pre>@font-feature-values Bongo {
jdaggett@7679 4795 @swash { ornate: 1; }
jdaggett@7679 4796 annotation { boxed: 4; } /* should be @annotation! */
jdaggett@8031 4797 @swash { double-loops: 1; flowing: -1; } /* negative value */
jdaggett@8031 4798 @ornaments ; /* incomplete definition */
jdaggett@8031 4799 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
jdaggett@8356 4800 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a> /* random editing mistake */
jdaggett@7679 4801 }</pre>
jdaggett@7679 4802
jdaggett@8356 4803 <p>The example above is equivalent to:</p>
jdaggett@8356 4804
jdaggett@8356 4805 <pre>@font-feature-values Bongo {
jdaggett@7679 4806 @swash { ornate: 1; }
jdaggett@8031 4807 @swash { double-loops: 1; }
jdaggett@8031 4808 @styleset { double-W: 14; sharp-terminals: 16 1; }
jdaggett@7679 4809 }</pre>
jdaggett@8356 4810 </div>
jdaggett@7096 4811
jdaggett@8311 4812 <p>If multiple <a
jdaggett@8311 4813 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8356 4814 rules are defined for a given family, the resulting values definitions are
jdaggett@8356 4815 the union of the definitions contained within these rules. This allows a
jdaggett@8356 4816 set of named values to be defined for a given font family globally for a
jdaggett@8356 4817 site and specific additions made per-page.
jdaggett@8356 4818
jdaggett@8356 4819 <div class=example>
jdaggett@8356 4820 <p>Using both site-wide and per-page feature values:</p>
jdaggett@8356 4821
jdaggett@8356 4822 <pre>
jdaggett@2472 4823 site.css:
jdaggett@2472 4824
jdaggett@2472 4825 @font-feature-values Mercury Serif {
jdaggett@7041 4826 @styleset {
jdaggett@7041 4827 stacked-g: 3; /* "two-storey" versions of g, a */
jdaggett@7041 4828 stacked-a: 4;
jdaggett@7041 4829 }
jdaggett@2472 4830 }
jdaggett@2472 4831
jdaggett@2472 4832 page.css:
jdaggett@8277 4833
jdaggett@2472 4834 @font-feature-values Mercury Serif {
jdaggett@7041 4835 @styleset {
jdaggett@7041 4836 geometric-m: 7; /* alternate version of m */
jdaggett@7041 4837 }
jdaggett@2472 4838 }
jdaggett@8277 4839
jdaggett@2472 4840 body {
jdaggett@2472 4841 font-family: Mercury Serif, serif;
jdaggett@2472 4842
jdaggett@2472 4843 /* enable both the use of stacked g and alternate m */
jdaggett@2472 4844 font-variant-alternates: styleset(stacked-g, geometric-m);
jdaggett@2472 4845 }</pre>
jdaggett@8356 4846 </div>
jdaggett@8356 4847
jdaggett@8356 4848 <div class=example>
jdaggett@8356 4849 <p>Using a commonly named value allows authors to use a single style rule
jdaggett@8356 4850 to cover a set of fonts for which the underlying selector is different
jdaggett@8356 4851 for each font. If either font in the example below is found, a circled
jdaggett@8356 4852 number glyph will be used:</p>
jdaggett@8356 4853
jdaggett@8356 4854 <pre>@font-feature-values Taisho Gothic {
jdaggett@7041 4855 @annotation { boxed: 1; circled: 4; }
jdaggett@2118 4856 }
jdaggett@2118 4857
jdaggett@2118 4858 @font-feature-values Otaru Kisa {
jdaggett@7041 4859 @annotation { circled: 1; black-boxed: 3; }
jdaggett@2118 4860 }
jdaggett@2118 4861
jdaggett@2118 4862 h3.title {
jdaggett@2118 4863 /* circled form defined for both fonts */
jdaggett@2118 4864 font-family: Taisho Gothic, Otaru Kisa;
jdaggett@2118 4865 font-variant: annotation(circled);
jdaggett@2118 4866 }</pre>
jdaggett@8356 4867 </div>
jdaggett@8356 4868
jdaggett@8356 4869 <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
jdaggett@8356 4870 </span>Multi-valued feature value definitions</h4>
jdaggett@8356 4871
jdaggett@8356 4872 <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
jdaggett@8356 4873 href="#propdef-font-variant-alternates"><code
jdaggett@8356 4874 class=property>font-variant-alternates</code></a>’ property values take
jdaggett@8356 4875 a single value (e.g. ‘<a href="#swash"><code
jdaggett@8356 4876 class=property>swash</code></a>’). The ‘<a
jdaggett@8356 4877 href="#character-variant"><code
jdaggett@8356 4878 class=property>character-variant</code></a>’ property value allows two
jdaggett@8356 4879 values and ‘<a href="#styleset"><code
jdaggett@8356 4880 class=property>styleset</code></a>’ allows an unlimited number.
jdaggett@3571 4881
jdaggett@3571 4882 <p>For the styleset property value, multiple values indicate the style sets
jdaggett@7095 4883 to be enabled. Values between 1 and 99 enable OpenType features <span
jdaggett@7095 4884 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
jdaggett@7095 4885 OpenType standard only officially defines <span class=tag>ss01</span>
jdaggett@8356 4886 through <span class=tag>ss20</span>. For OpenType fonts, values greater
jdaggett@8356 4887 than 99 or equal to 0 do not generate a syntax error when parsed but
jdaggett@8356 4888 enable no OpenType features.
jdaggett@2472 4889
jdaggett@2472 4890 <pre>@font-feature-values Mars Serif {
jdaggett@8277 4891 @styleset {
jdaggett@7041 4892 alt-g: 1; /* implies ss01 = 1 */
jdaggett@7041 4893 curly-quotes: 3; /* implies ss03 = 1 */
jdaggett@7041 4894 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
jdaggett@7041 4895 }
jdaggett@7041 4896
jdaggett@7041 4897 @styleset {
jdaggett@7095 4898 dumb: 125; /* &gt;99, ignored */
jdaggett@7041 4899 }
jdaggett@7041 4900
jdaggett@7041 4901 @swash {
jdaggett@7041 4902 swishy: 3 5; /* more than 1 value for swash, syntax error */
jdaggett@7041 4903 }
jdaggett@2472 4904 }
jdaggett@2472 4905
jdaggett@2472 4906 p.codeblock {
jdaggett@2472 4907 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
jdaggett@2472 4908 font-variant-alternates: styleset(curly-quotes, code);
jdaggett@2472 4909 }</pre>
jdaggett@2472 4910
jdaggett@2472 4911 <p>For character-variant, a single value between 1 and 99 indicates the
jdaggett@6436 4912 enabling of OpenType feature <span class=tag>cv01</span> through <span
jdaggett@7095 4913 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
jdaggett@8356 4914 to 0 are ignored but do not generate a syntax error when parsed but enable
jdaggett@8356 4915 no OpenType features. When two values are listed, the first value
jdaggett@8356 4916 indicates the feature used and the second the value passed for that
jdaggett@8356 4917 feature. If more than two values are assigned to a given name, a syntax
jdaggett@8356 4918 error occurs and the entire <a href="#featurevaluedefinition"><i
jdaggett@8356 4919 title="feature_value_definition">feature value definition</i></a> is
jdaggett@8356 4920 ignored.
jdaggett@2472 4921
jdaggett@2472 4922 <pre>@font-feature-values MM Greek {
jdaggett@7041 4923 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
jdaggett@7041 4924 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
jdaggett@8356 4925 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
jdaggett@7041 4926 @character-variant { gamma: 12; } /* implies cv12 = 1 */
jdaggett@7041 4927 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
jdaggett@7041 4928 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
jdaggett@7041 4929 @character-variant { silly: 105; } /* &gt;99, ignored */
jdaggett@7041 4930 @character-variant { dumb: 323 3; } /* &gt;99, ignored */
jdaggett@2472 4931 }
jdaggett@2472 4932
jdaggett@2472 4933 #title {
jdaggett@2472 4934 /* use the third alternate beta, first alternate gamma */
jdaggett@2472 4935 font-variant-alternates: character-variant(beta-3, gamma);
jdaggett@3571 4936 }
jdaggett@3571 4937
jdaggett@3571 4938 p {
jdaggett@3571 4939 /* zeta-2 follows zeta, implies cv20 = 2 */
jdaggett@3571 4940 font-variant-alternates: character-variant(zeta, zeta-2);
jdaggett@3571 4941 }
jdaggett@3571 4942
jdaggett@3571 4943 .special {
jdaggett@3571 4944 /* zeta follows zeta-2, implies cv20 = 3 */
jdaggett@3571 4945 font-variant-alternates: character-variant(zeta-2, zeta);
jdaggett@2472 4946 }</pre>
jdaggett@2472 4947
jdaggett@2472 4948 <div class=figure><img alt="Matching text on Byzantine seals using
jdaggett@2472 4949 character variants" src=byzantineseal.png>
jdaggett@2472 4950 <p class=caption>Byzantine seal text displayed with character variants
jdaggett@2472 4951 </div>
jdaggett@2472 4952
jdaggett@2472 4953 <div class=example>
jdaggett@2472 4954 <p>In the figure above, the text in red is rendered using a font
jdaggett@2472 4955 containing character variants that mimic the character forms found on a
jdaggett@2472 4956 Byzantine seal from the 8th century A.D. Two lines below is the same text
jdaggett@2472 4957 displayed in a font without variants. Note the two variants for U and N
jdaggett@2509 4958 used on the seal.</p>
jdaggett@2472 4959
jdaggett@2472 4960 <pre>@font-feature-values Athena Ruby {
jdaggett@7041 4961 @character-variant {
jdaggett@7041 4962 leo-B: 2 1;
jdaggett@7041 4963 leo-M: 13 3;
jdaggett@7041 4964 leo-alt-N: 14 1;
jdaggett@7041 4965 leo-N: 14 2;
jdaggett@8277 4966 leo-T: 20 1;
jdaggett@7041 4967 leo-U: 21 2;
jdaggett@7041 4968 leo-alt-U: 21 4;
jdaggett@7041 4969 }
jdaggett@2472 4970 }
jdaggett@2472 4971
jdaggett@2472 4972 p {
jdaggett@6653 4973 font-variant: discretionary-ligatures,
jdaggett@6653 4974 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
jdaggett@2472 4975 }
jdaggett@2472 4976
jdaggett@8277 4977 span.alt-N {
jdaggett@2472 4978 font-variant-alternates: character-variant(leo-alt-N);
jdaggett@2472 4979 }
jdaggett@2472 4980
jdaggett@2472 4981 span.alt-U {
jdaggett@2472 4982 font-variant-alternates: character-variant(leo-alt-U);
jdaggett@2472 4983 }
jdaggett@2472 4984
jdaggett@2472 4985 &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@2472 4986
jdaggett@8277 4987 &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@2472 4988 </pre>
jdaggett@2118 4989 </div>
jdaggett@2118 4990
jdaggett@2118 4991 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
jdaggett@2118 4992 Asian text rendering: the <a
jdaggett@1662 4993 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
jdaggett@1662 4994 property</h3>
jdaggett@1662 4995
jdaggett@5809 4996 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
jdaggett@1662 4997 <tbody>
jdaggett@1662 4998 <tr>
jdaggett@1662 4999 <td>Name:
jdaggett@1662 5000
jdaggett@1662 5001 <td><dfn
jdaggett@1662 5002 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
jdaggett@1662 5003
jdaggett@1662 5004 <tr>
jdaggett@1662 5005 <td>Value:
jdaggett@1662 5006
jdaggett@8278 5007 <td><a href="#font-variant-east-asian-normal-value"
jdaggett@8278 5008 title="normal!!font-variant-east-asian">normal</a> | [ <a
jdaggett@8225 5009 href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
jdaggett@8225 5010 || <a
jdaggett@8225 5011 href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
jdaggett@8225 5012 || <a href="#ruby">ruby</a> ]
jdaggett@1662 5013
jdaggett@1662 5014 <tr>
jdaggett@1662 5015 <td>Initial:
jdaggett@1662 5016
jdaggett@1662 5017 <td>normal
jdaggett@1662 5018
jdaggett@1662 5019 <tr>
jdaggett@1662 5020 <td>Applies to:
jdaggett@1662 5021
jdaggett@1662 5022 <td>all elements
jdaggett@1662 5023
jdaggett@1662 5024 <tr>
jdaggett@1662 5025 <td>Inherited:
jdaggett@1662 5026
jdaggett@1662 5027 <td>yes
jdaggett@1662 5028
jdaggett@1662 5029 <tr>
jdaggett@1662 5030 <td>Percentages:
jdaggett@1662 5031
jdaggett@1662 5032 <td>N/A
jdaggett@1662 5033
jdaggett@1662 5034 <tr>
jdaggett@1662 5035 <td>Media:
jdaggett@1662 5036
jdaggett@1662 5037 <td>visual
jdaggett@1662 5038
jdaggett@1662 5039 <tr>
jdaggett@1662 5040 <td>Computed value:
jdaggett@1662 5041
jdaggett@1662 5042 <td>as specified
jdaggett@7377 5043
jdaggett@7377 5044 <tr>
jdaggett@7377 5045 <td>Animatable:
jdaggett@7377 5046
jdaggett@7377 5047 <td>no
jdaggett@1662 5048 </table>
jdaggett@1662 5049
jdaggett@6693 5050 <p>Allows control of glyph substitution and sizing in East Asian text.
jdaggett@1662 5051
jdaggett@1662 5052 <pre
jdaggett@8225 5053 class=prod><dfn id=east-asian-variant-values><var>&lt;east-asian-variant-values&gt;</var></dfn> = [ <a href="#jis78">jis78</a> | <a href="#jis83">jis83</a> | <a href="#jis90">jis90</a> | <a href="#jis04">jis04</a> | <a href="#simplified">simplified</a> | <a href="#traditional">traditional</a> ]</pre>
jdaggett@1662 5054
jdaggett@1662 5055 <pre
jdaggett@8225 5056 class=prod><dfn id=east-asian-width-values><var>&lt;east-asian-width-values&gt;</var></dfn> = [ <a href="#full-width">full-width</a> | <a href="#proportional-width">proportional-width</a> ]</pre>
jdaggett@1732 5057
jdaggett@1732 5058 <p>Individual values have the following meanings:
jdaggett@1662 5059
jdaggett@1662 5060 <dl>
jdaggett@8278 5061 <dt><dfn id=font-variant-east-asian-normal-value
jdaggett@8278 5062 title="normal!!font-variant-east-asian">normal</dfn>
jdaggett@5809 5063
jdaggett@5809 5064 <dd>None of the features listed below are enabled.
jdaggett@5809 5065
jdaggett@1662 5066 <dt><dfn id=jis78>jis78</dfn>
jdaggett@1662 5067
jdaggett@6436 5068 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
jdaggett@6436 5069 class=tag>jp78</span>).
jdaggett@1662 5070 </dl>
jdaggett@1662 5071
jdaggett@1662 5072 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
jdaggett@1662 5073
jdaggett@1662 5074 <dl>
jdaggett@1662 5075 <dt><dfn id=jis83>jis83</dfn>
jdaggett@1662 5076
jdaggett@6436 5077 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
jdaggett@6436 5078 class=tag>jp83</span>).
jdaggett@1662 5079
jdaggett@1662 5080 <dt><dfn id=jis90>jis90</dfn>
jdaggett@1662 5081
jdaggett@6436 5082 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
jdaggett@6436 5083 class=tag>jp90</span>).
jdaggett@1662 5084
jdaggett@1662 5085 <dt><dfn id=jis04>jis04</dfn>
jdaggett@1662 5086
jdaggett@6436 5087 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
jdaggett@6436 5088 class=tag>jp04</span>).
jdaggett@6693 5089 <p>The various JIS variants reflect the glyph forms defined in different
jdaggett@6693 5090 Japanese national standards. Fonts generally include glyphs defined by
jdaggett@6693 5091 the most recent national standard but it's sometimes necessary to use
jdaggett@6693 5092 older variants, to match signage for example.</p>
jdaggett@1662 5093
jdaggett@2504 5094 <dt><dfn id=simplified>simplified</dfn>
jdaggett@2504 5095
jdaggett@6436 5096 <dd>Enables rendering of simplified forms (OpenType feature: <span
jdaggett@6436 5097 class=tag>smpl</span>).
jdaggett@2504 5098
jdaggett@2504 5099 <dt><dfn id=traditional>traditional</dfn>
jdaggett@2504 5100
jdaggett@6436 5101 <dd>Enables rendering of traditional forms (OpenType feature: <span
jdaggett@6436 5102 class=tag>trad</span>).
jdaggett@1662 5103 </dl>
jdaggett@1662 5104
jdaggett@8312 5105 <p>The ‘<a href="#simplified"><code
jdaggett@8312 5106 class=property>simplified</code></a>’ and ‘<a
jdaggett@8312 5107 href="#traditional"><code class=property>traditional</code></a>’ values
jdaggett@8312 5108 allow control over the glyph forms for characters which have been
jdaggett@8312 5109 simplified over time but for which the older, traditional form is still
jdaggett@8312 5110 used in some contexts. The exact set of characters and glyph forms will
jdaggett@8312 5111 vary to some degree by context for which a given font was designed.
jdaggett@8312 5112
jdaggett@1662 5113 <div class=featex><img alt="tradtional form example" src=trad.png></div>
jdaggett@1662 5114
jdaggett@1662 5115 <dl>
jdaggett@1662 5116 <dt><dfn id=full-width>full-width</dfn>
jdaggett@1662 5117
jdaggett@6436 5118 <dd>Enables rendering of full-width variants (OpenType feature: <span
jdaggett@6436 5119 class=tag>fwid</span>).
jdaggett@1662 5120
jdaggett@1662 5121 <dt><dfn id=proportional-width>proportional-width</dfn>
jdaggett@1662 5122
jdaggett@1662 5123 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
jdaggett@6436 5124 <span class=tag>pwid</span>).
jdaggett@1662 5125 </dl>
jdaggett@1662 5126
jdaggett@1662 5127 <div class=featex><img alt="proportionally spaced Japanese example"
jdaggett@1662 5128 src=pwid.png></div>
jdaggett@1662 5129
jdaggett@3638 5130 <dl>
jdaggett@3638 5131 <dt><dfn id=ruby>ruby</dfn>
jdaggett@3638 5132
jdaggett@6436 5133 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
jdaggett@6436 5134 class=tag>ruby</span>). Since ruby text is generally smaller than the
jdaggett@3638 5135 associated body text, font designers can design special glyphs for use
jdaggett@3638 5136 with ruby that are more readable than scaled down versions of the default
jdaggett@3638 5137 glyphs. Only glyph selection is affected, there is no associated font
jdaggett@3638 5138 scaling or other change that affects line layout. The red ruby text below
jdaggett@3638 5139 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
jdaggett@3638 5140 Note the slight difference in stroke thickness.
jdaggett@3638 5141 </dl>
jdaggett@3638 5142
jdaggett@3638 5143 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
jdaggett@3638 5144
jdaggett@2118 5145 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
jdaggett@1856 5146 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
jdaggett@1662 5147 property</h3>
jdaggett@1662 5148
jdaggett@6436 5149 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
jdaggett@1662 5150 <tbody>
jdaggett@1662 5151 <tr>
jdaggett@1662 5152 <td>Name:
jdaggett@1662 5153
jdaggett@8278 5154 <td><dfn id=propdef-font-variant
jdaggett@8278 5155 title="font-variant!!property">font-variant</dfn>
jdaggett@1662 5156
jdaggett@1662 5157 <tr>
jdaggett@1662 5158 <td>Value:
jdaggett@1662 5159
jdaggett@8278 5160 <td><a href="#font-variant-normal-value"
jdaggett@8278 5161 title="normal!!font-variant">normal</a> | <a
jdaggett@8278 5162 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
jdaggett@8278 5163 <a href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a>
jdaggett@8278 5164 || <a
jdaggett@8225 5165 href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
jdaggett@8225 5166 || <a
jdaggett@8225 5167 href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
jdaggett@8225 5168 || <a
jdaggett@8225 5169 href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
jdaggett@8225 5170 || <a href="#stylistic"><var
jdaggett@8225 5171 title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 5172 href="#historical-forms"><var>historical-forms</var></a> || <a
jdaggett@8225 5173 href="#styleset"><var
jdaggett@8225 5174 title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
jdaggett@8225 5175 href="#character-variant"><var
jdaggett@8225 5176 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 5177 #)</var></a> || <a href="#swash"><var
jdaggett@8225 5178 title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 5179 href="#ornaments"><var
jdaggett@8225 5180 title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 5181 href="#annotation"><var
jdaggett@8225 5182 title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
jdaggett@8225 5183 <a href="#small-caps"><i>small-caps</i></a> | <a
jdaggett@8225 5184 href="#all-small-caps"><i>all-small-caps</i></a> | <a
jdaggett@8225 5185 href="#petite-caps"><i>petite-caps</i></a> | <a
jdaggett@8225 5186 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
jdaggett@8225 5187 href="#unicase"><i>unicase</i></a> | <a
jdaggett@8225 5188 href="#titling-caps"><i>titling-caps</i></a> ] || <a
jdaggett@8225 5189 href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
jdaggett@8225 5190 || <a
jdaggett@8225 5191 href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
jdaggett@8225 5192 || <a
jdaggett@8225 5193 href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
jdaggett@8225 5194 || <a href="#ordinal"><i>ordinal</i></a> || <a
jdaggett@8225 5195 href="#slashed-zero"><i>slashed-zero</i></a> || <a
jdaggett@8225 5196 href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
jdaggett@8225 5197 || <a
jdaggett@8225 5198 href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
jdaggett@8225 5199 || <a href="#ruby"><i>ruby</i></a> ]
jdaggett@1662 5200
jdaggett@1662 5201 <tr>
jdaggett@1662 5202 <td>Initial:
jdaggett@1662 5203
jdaggett@1662 5204 <td>normal
jdaggett@1662 5205
jdaggett@1662 5206 <tr>
jdaggett@1662 5207 <td>Applies to:
jdaggett@1662 5208
jdaggett@1662 5209 <td>all elements
jdaggett@1662 5210
jdaggett@1662 5211 <tr>
jdaggett@1662 5212 <td>Inherited:
jdaggett@1662 5213
jdaggett@1662 5214 <td>yes
jdaggett@1662 5215
jdaggett@1662 5216 <tr>
jdaggett@1662 5217 <td>Percentages:
jdaggett@1662 5218
jdaggett@7377 5219 <td>see individual properties
jdaggett@1662 5220
jdaggett@1662 5221 <tr>
jdaggett@1662 5222 <td>Media:
jdaggett@1662 5223
jdaggett@1662 5224 <td>visual
jdaggett@1662 5225
jdaggett@1662 5226 <tr>
jdaggett@1662 5227 <td>Computed value:
jdaggett@1662 5228
jdaggett@7377 5229 <td>see individual properties
jdaggett@7377 5230
jdaggett@7377 5231 <tr>
jdaggett@7377 5232 <td>Animatable:
jdaggett@7377 5233
jdaggett@7377 5234 <td>see individual properties
jdaggett@1662 5235 </table>
jdaggett@1662 5236
jdaggett@8313 5237 <p>The <a href="#propdef-font-variant"
jdaggett@8313 5238 title="font-variant!!property">‘<code
jdaggett@8313 5239 class=property>font-variant</code>’</a> property is a shorthand for all
jdaggett@8313 5240 font-variant subproperties. The value <dfn id=font-variant-normal-value
jdaggett@8313 5241 title="normal!!font-variant">‘<code
jdaggett@8313 5242 class=property>normal</code>’</dfn> resets all subproperties of <a
jdaggett@8313 5243 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 5244 class=property>font-variant</code>’</a> to their inital value. The <dfn
jdaggett@8313 5245 id=font-variant-none-value title="none!!font-variant">‘<code
jdaggett@8313 5246 class=property>none</code>’</dfn> value sets ‘<a
jdaggett@8313 5247 href="#propdef-font-variant-ligatures"><code
jdaggett@8278 5248 class=property>font-variant-ligatures</code></a>’ to ‘<code
jdaggett@8278 5249 class=property>none</code>’ and resets all other font feature properties
jdaggett@8278 5250 to their initial value. Like other shorthands, using <a
jdaggett@8278 5251 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 5252 class=property>font-variant</code>’</a> resets unspecified <a
jdaggett@8313 5253 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 5254 class=property>font-variant</code>’</a> subproperties to their initial
jdaggett@8313 5255 values. It does not reset the values of either ‘<a
jdaggett@8313 5256 href="#propdef-font-language-override"><code
jdaggett@8279 5257 class=property>font-language-override</code></a>’ or <a
jdaggett@8279 5258 href="#propdef-font-feature-settings"
jdaggett@8279 5259 title="font-feature-settings!!property">‘<code
jdaggett@8279 5260 class=property>font-feature-settings</code>’</a>.
jdaggett@1662 5261
jdaggett@2118 5262 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
jdaggett@2509 5263 font feature settings control: the <a
jdaggett@1662 5264 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
jdaggett@1662 5265
jdaggett@4624 5266 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
jdaggett@1662 5267 <tbody>
jdaggett@1662 5268 <tr>
jdaggett@1662 5269 <td>Name:
jdaggett@1662 5270
jdaggett@8279 5271 <td><dfn id=propdef-font-feature-settings
jdaggett@8279 5272 title="font-feature-settings!!property">font-feature-settings</dfn>
jdaggett@1662 5273
jdaggett@1662 5274 <tr>
jdaggett@1662 5275 <td>Value:
jdaggett@1662 5276
jdaggett@8278 5277 <td><a href="#font-feature-settings-normal-value"
jdaggett@8278 5278 title="normal!!font-feature-settings">normal</a> | <a
jdaggett@8225 5279 href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
jdaggett@1662 5280
jdaggett@1662 5281 <tr>
jdaggett@1662 5282 <td>Initial:
jdaggett@1662 5283
jdaggett@1662 5284 <td>normal
jdaggett@1662 5285
jdaggett@1662 5286 <tr>
jdaggett@1662 5287 <td>Applies to:
jdaggett@1662 5288
jdaggett@1662 5289 <td>all elements
jdaggett@1662 5290
jdaggett@1662 5291 <tr>
jdaggett@1662 5292 <td>Inherited:
jdaggett@1662 5293
jdaggett@1662 5294 <td>yes
jdaggett@1662 5295
jdaggett@1662 5296 <tr>
jdaggett@1662 5297 <td>Percentages:
jdaggett@1662 5298
jdaggett@1662 5299 <td>N/A
jdaggett@1662 5300
jdaggett@1662 5301 <tr>
jdaggett@1662 5302 <td>Media:
jdaggett@1662 5303
jdaggett@1662 5304 <td>visual
jdaggett@1662 5305
jdaggett@1662 5306 <tr>
jdaggett@1662 5307 <td>Computed value:
jdaggett@1662 5308
jdaggett@1662 5309 <td>as specified
jdaggett@7377 5310
jdaggett@7377 5311 <tr>
jdaggett@7377 5312 <td>Animatable:
jdaggett@7377 5313
jdaggett@7377 5314 <td>no
jdaggett@1662 5315 </table>
jdaggett@2474 5316
jdaggett@2474 5317 <p>This property provides low-level control over OpenType font features. It
jdaggett@2474 5318 is intended as a way of providing access to font features that are not
jdaggett@8312 5319 widely used but are needed for a particular use case.
jdaggett@8312 5320
jdaggett@8312 5321 <p>Authors should generally use <a href="#propdef-font-variant"
jdaggett@8312 5322 title="font-variant!!property">‘<code
jdaggett@8312 5323 class=property>font-variant</code>’</a> and its related subproperties
jdaggett@8312 5324 whenever possible and only use this property for special cases where its
jdaggett@8312 5325 use is the only way of accessing a particular infrequently used font
jdaggett@8312 5326 feature.
jdaggett@8312 5327
jdaggett@8312 5328 <pre>/* enable small caps and use second swash alternate */
jdaggett@8312 5329 font-feature-settings: "smcp", "swsh" 2;</pre>
jdaggett@8312 5330
jdaggett@8312 5331 <p>A value of <dfn id=font-feature-settings-normal-value
jdaggett@8278 5332 title="normal!!font-feature-settings">‘<code
jdaggett@8278 5333 class=property>normal</code>’</dfn> means that no change in glyph
jdaggett@8278 5334 selection or positioning occurs due to this property.
jdaggett@2474 5335
jdaggett@2509 5336 <p>Feature tag values have the following syntax:
jdaggett@2474 5337
jdaggett@2474 5338 <pre
jdaggett@8225 5339 class=prod><dfn id=feature-tag-value><var>&lt;feature-tag-value&gt;</var></dfn> = &lt;string&gt; [ &lt;integer&gt; | on | off ]?</pre>
jdaggett@2509 5340
jdaggett@5532 5341 <p>The &lt;string&gt; is a case-sensitive OpenType feature tag. As
jdaggett@5532 5342 specified in the OpenType specification, feature tags contain four ASCII
jdaggett@5532 5343 characters. Tag strings longer or shorter than four characters, or
jdaggett@5596 5344 containing characters outside the U+20–7E codepoint range are invalid.
jdaggett@8312 5345 Feature tags need only match a feature tag defined in the font, so they
jdaggett@8312 5346 are not limited to explicitly registered OpenType features. Fonts defining
jdaggett@8312 5347 custom feature tags should follow the <a
jdaggett@2474 5348 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
jdaggett@2474 5349 rules</a> defined in the OpenType specification <a
jdaggett@1662 5350 href="#OPENTYPE-FEATURES"
jdaggett@2474 5351 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
jdaggett@8927 5352
jdaggett@8927 5353 <p>Feature tags not present in the font are ignored; a user agent must not
jdaggett@8927 5354 attempt to synthesize fallback behavior based on these feature tags. The
jdaggett@8927 5355 one exception is that user agents may synthetically support the <span
jdaggett@8927 5356 class=tag>kern</span> feature with fonts that contain kerning data in the
jdaggett@8927 5357 form of a ‘<code class=property>kern</code>’ table but lack <span
jdaggett@8927 5358 class=tag>kern</span> feature support in the ‘<code
jdaggett@8927 5359 class=property>GPOS</code>’ table.
jdaggett@8927 5360
jdaggett@8927 5361 <p class=note>In general, authors should use the ‘<a
jdaggett@5946 5362 href="#propdef-font-kerning"><code
jdaggett@8927 5363 class=property>font-kerning</code></a>’ property to explicitly enable or
jdaggett@8927 5364 disable kerning since this property always affects fonts with either type
jdaggett@8927 5365 of kerning data.
jdaggett@5946 5366
jdaggett@2509 5367 <p>If present, a value indicates an index used for glyph selection. An
jdaggett@2509 5368 &lt;integer&gt; value must be 0 or greater. A value of 0 indicates that
jdaggett@2509 5369 the feature is disabled. For boolean features, a value of 1 enables the
jdaggett@2509 5370 feature. For non-boolean features, a value of 1 or greater enables the
jdaggett@2509 5371 feature and indicates the feature selection index. A value of ‘<code
jdaggett@2509 5372 class=property>on</code>’ is synonymous with 1 and ‘<code
jdaggett@2509 5373 class=property>off</code>’ is synonymous with 0. If the value is
jdaggett@2509 5374 omitted, a value of 1 is assumed.
jdaggett@2474 5375
jdaggett@2474 5376 <pre>
jdaggett@2509 5377 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
jdaggett@2509 5378 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
jdaggett@2515 5379 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
jdaggett@2509 5380 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
jdaggett@2515 5381 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
jdaggett@5530 5382 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
jdaggett@8859 5383 font-feature-settings: "silly" off; /* invalid, tag too long */
jdaggett@2509 5384 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
jdaggett@5530 5385 font-feature-settings: dlig; /* invalid, tag must be a string */
jdaggett@2474 5386 </pre>
jdaggett@1662 5387
jdaggett@8272 5388 <p>When values greater than the range supported by the font are specified,
jdaggett@8272 5389 the behavior is explicitly undefined. For boolean features, in general
jdaggett@8272 5390 these will enable the feature. For non-boolean features, out of range
jdaggett@8272 5391 values will in general be equivalent to a 0 value. However, in both cases
jdaggett@8272 5392 the exact behavior will depend upon the way the font is designed
jdaggett@8272 5393 (specifically, which type of lookup is used to define the feature).
jdaggett@8272 5394
jdaggett@2474 5395 <p>Although specifically defined for OpenType feature tags, feature tags
jdaggett@2474 5396 for other modern font formats that support font features may be added in
jdaggett@5530 5397 the future. Where possible, features defined for other font formats should
jdaggett@5530 5398 attempt to follow the pattern of registered OpenType tags.
jdaggett@2509 5399
jdaggett@1662 5400 <div class=example>
jdaggett@1662 5401 <p>The Japanese text below will be rendered with half-width kana
jdaggett@1662 5402 characters:</p>
jdaggett@1662 5403
jdaggett@1662 5404 <pre lang=ja>
jdaggett@2509 5405 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
jdaggett@1662 5406
jdaggett@1662 5407 &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@1662 5408 </pre>
jdaggett@1662 5409 </div>
jdaggett@1662 5410
jdaggett@2118 5411 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
jdaggett@1732 5412 language override: the <a
jdaggett@1732 5413 href="#propdef-font-language-override">font-language-override</a> property</h3>
jdaggett@1732 5414
jdaggett@5809 5415 <table class=propdef id=namefont-language-overridevaluenormal-lt>
jdaggett@1662 5416 <tbody>
jdaggett@1662 5417 <tr>
jdaggett@1662 5418 <td>Name:
jdaggett@1662 5419
jdaggett@1732 5420 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
jdaggett@1662 5421
jdaggett@1662 5422 <tr>
jdaggett@1662 5423 <td>Value:
jdaggett@1662 5424
jdaggett@8278 5425 <td><a href="#font-language-override-normal-value"
jdaggett@8278 5426 title="normal!!font-language-override">normal</a> | <a
jdaggett@8278 5427 href="#font-language-override-string-value"><var>&lt;string&gt;</var></a>
jdaggett@1662 5428
jdaggett@1662 5429 <tr>
jdaggett@1662 5430 <td>Initial:
jdaggett@1662 5431
jdaggett@8278 5432 <td><a href="#font-language-override-normal-value"
jdaggett@8278 5433 title="normal!!font-language-override">normal</a>
jdaggett@1662 5434
jdaggett@1662 5435 <tr>
jdaggett@1662 5436 <td>Applies to:
jdaggett@1662 5437
jdaggett@1662 5438 <td>all elements
jdaggett@1662 5439
jdaggett@1662 5440 <tr>
jdaggett@1662 5441 <td>Inherited:
jdaggett@1662 5442
jdaggett@1662 5443 <td>yes
jdaggett@1662 5444
jdaggett@1662 5445 <tr>
jdaggett@1662 5446 <td>Percentages:
jdaggett@1662 5447
jdaggett@1662 5448 <td>N/A
jdaggett@1662 5449
jdaggett@1662 5450 <tr>
jdaggett@1662 5451 <td>Media:
jdaggett@1662 5452
jdaggett@1662 5453 <td>visual
jdaggett@1662 5454
jdaggett@1662 5455 <tr>
jdaggett@1662 5456 <td>Computed value:
jdaggett@1662 5457
jdaggett@1662 5458 <td>as specified
jdaggett@7377 5459
jdaggett@7377 5460 <tr>
jdaggett@7377 5461 <td>Animatable:
jdaggett@7377 5462
jdaggett@7377 5463 <td>no
jdaggett@1662 5464 </table>
jdaggett@1662 5465
jdaggett@8278 5466 <p>Normally, authors can control the use of language-specific glyph
jdaggett@8278 5467 substitutions and positioning by setting the content language of an
jdaggett@8278 5468 element, as <a href="#language-specific-support">described above</a>:
jdaggett@8278 5469
jdaggett@8278 5470 <pre>&lt;!-- Display text using S'gaw Karen specific features -->
jdaggett@8387 5471 &lt;p lang="ksw">...&lt;/p></pre>
jdaggett@8278 5472
jdaggett@8278 5473 <p>In some cases, authors may need to specify a language system that
jdaggett@8278 5474 differs from the content language, for example due to the need to mimic
jdaggett@8278 5475 another language's typographic traditions. The ‘<a
jdaggett@8278 5476 href="#propdef-font-language-override"><code
jdaggett@8278 5477 class=property>font-language-override</code></a>’ property allows
jdaggett@8278 5478 authors to explicitly specify the language system of the font, overriding
jdaggett@8278 5479 the language system implied by the content language.
jdaggett@8278 5480
jdaggett@8278 5481 <p>Values have the following meanings:
jdaggett@8278 5482
jdaggett@8278 5483 <dl>
jdaggett@8278 5484 <dt><dfn id=font-language-override-normal-value
jdaggett@8278 5485 title="normal!!font-language-override">normal</dfn>
jdaggett@8278 5486
jdaggett@8278 5487 <dd>specifies that when rendering with OpenType fonts, the content
jdaggett@8278 5488 language of the element is used to infer the OpenType language system
jdaggett@8278 5489
jdaggett@8278 5490 <dt><dfn
jdaggett@8278 5491 id=font-language-override-string-value><var>&lt;string&gt;</var></dfn>
jdaggett@8278 5492
jdaggett@8368 5493 <dd>single three-letter case-sensitive OpenType <a
jdaggett@8278 5494 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
jdaggett@8278 5495 system tag</a>, specifies the OpenType language system to be used instead
jdaggett@8278 5496 of the language system implied by the language of the element
jdaggett@8278 5497 </dl>
jdaggett@8385 5498 <!-- For this level, string represents a single language code, there's no concept of "fallback"
jdaggett@8385 5499 http://www.w3.org/2013/06/07-css-minutes.html#item04 -->
jdaggett@1662 5500
jdaggett@8312 5501 <p>Use of invalid OpenType language system tags must not generate a parse
jdaggett@8312 5502 error but must be ignored when doing glyph selection and placement.
jdaggett@8312 5503
jdaggett@1662 5504 <div class=example>
jdaggett@7179 5505 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
jdaggett@1662 5506 Declaration of Human Rights</a> has been translated into a wide variety
jdaggett@1662 5507 of languages. In Turkish, Article 9 of this document might be marked up
jdaggett@1662 5508 as below:</p>
jdaggett@1662 5509
jdaggett@1662 5510 <pre lang=tr>&lt;body lang="tr">
jdaggett@1662 5511
jdaggett@1662 5512 &lt;h4>Madde 9&lt;/h4>
jdaggett@1662 5513 &lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
jdaggett@1662 5514 </pre>
jdaggett@1662 5515
jdaggett@1662 5516 <p>Here the user agent uses the value of the ‘<code
jdaggett@1662 5517 class=property>lang</code>’ attribute when rendering text and
jdaggett@1662 5518 appropriately renders this text without ‘<code
jdaggett@4624 5519 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
jdaggett@4624 5520 href="#propdef-font-language-override"><code
jdaggett@4624 5521 class=property>font-language-override</code></a>’ property.</p>
jdaggett@1662 5522
jdaggett@1662 5523 <p>However, a given font may lack support for a specific language. In this
jdaggett@1662 5524 situation authors may need to use the typographic conventions of a
jdaggett@1662 5525 related language that are supported by that font:</p>
jdaggett@1662 5526
jdaggett@1662 5527 <pre lang=mk>&lt;body lang="mk"> &lt;!-- Macedonian lang code --&gt;
jdaggett@1662 5528
jdaggett@1732 5529 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
jdaggett@1662 5530
jdaggett@1662 5531 &lt;h4>Члeн 9&lt;/h4>
jdaggett@1662 5532 &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@1662 5533
jdaggett@1662 5534 </pre>
jdaggett@1662 5535
jdaggett@1662 5536 <p>The Macedonian text here will be rendered using Serbian typographic
jdaggett@1662 5537 conventions, with the assumption that the font specified supports
jdaggett@1662 5538 Serbian.</p>
jdaggett@1662 5539 </div>
jdaggett@1662 5540
jdaggett@6176 5541 <p><a id=rendering-considerations></a>
jdaggett@6176 5542
jdaggett@6699 5543 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
jdaggett@6699 5544 Resolution</h2>
jdaggett@6176 5545
jdaggett@6176 5546 <p>As described in the previous section, font features can be enabled in a
jdaggett@8278 5547 variety of ways, either via the use of <a href="#propdef-font-variant"
jdaggett@8278 5548 title="font-variant!!property">‘<code
jdaggett@8279 5549 class=property>font-variant</code>’</a> or <a
jdaggett@8279 5550 href="#propdef-font-feature-settings"
jdaggett@8279 5551 title="font-feature-settings!!property">‘<code
jdaggett@8279 5552 class=property>font-feature-settings</code>’</a> in a style rule or
jdaggett@8311 5553 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@8311 5554 The resolution order for the union of these settings is defined below.
jdaggett@8311 5555 Features defined via CSS properties are applied on top of layout engine
jdaggett@8311 5556 default features.
jdaggett@6176 5557
jdaggett@6699 5558 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
jdaggett@6699 5559
jdaggett@6176 5560 <p>For OpenType fonts, user agents must enable the default features defined
jdaggett@6436 5561 in the OpenType documentation for a given script and writing mode.
jdaggett@6436 5562 Required ligatures, common ligatures and contextual forms must be enabled
jdaggett@6436 5563 by default (OpenType features: <span class=tag>rlig, liga, clig,
jdaggett@6436 5564 calt</span>), along with localized forms (OpenType feature: <span
jdaggett@6436 5565 class=tag>locl</span>), and features required for proper display of
jdaggett@6436 5566 composed characters and marks (OpenType features: <span class=tag>ccmp,
jdaggett@6436 5567 mark, mkmk</span>). These features must always be enabled, even when the
jdaggett@8278 5568 value of the <a href="#propdef-font-variant"
jdaggett@8278 5569 title="font-variant!!property">‘<code
jdaggett@8279 5570 class=property>font-variant</code>’</a> and <a
jdaggett@8279 5571 href="#propdef-font-feature-settings"
jdaggett@8279 5572 title="font-feature-settings!!property">‘<code
jdaggett@8368 5573 class=property>font-feature-settings</code>’</a> properties is <span
jdaggett@8368 5574 title="normal value">‘<code class=property>normal</code>’</span>.
jdaggett@8368 5575 Individual features are only disabled when explicitly overridden by the
jdaggett@8368 5576 author, as when ‘<a href="#propdef-font-variant-ligatures"><code
jdaggett@6176 5577 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
jdaggett@6176 5578 href="#no-common-ligatures"><code
jdaggett@7377 5579 class=property>no-common-ligatures</code></a>’. For handling complex
jdaggett@7377 5580 scripts such as <a
jdaggett@6176 5581 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
jdaggett@6176 5582 <a
jdaggett@6176 5583 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
jdaggett@6176 5584 or <a
jdaggett@6176 5585 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
jdaggett@6436 5586 additional features are required. For upright text within vertical text
jdaggett@6436 5587 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
jdaggett@6436 5588 must be enabled.
jdaggett@1662 5589
jdaggett@6699 5590 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
jdaggett@6699 5591
jdaggett@8356 5592 <p>General and <a href="#font-specific"><em>font specific</em></a> font
jdaggett@8356 5593 feature property settings are resolved in the order below, in ascending
jdaggett@8360 5594 order of precedence. This ordering is used to construct a combined list of
jdaggett@8356 5595 font features that affect a given text run.
jdaggett@1662 5596
jdaggett@1662 5597 <ol>
jdaggett@6436 5598 <li>Font features enabled by default, including features required for a
jdaggett@6436 5599 given script.
jdaggett@6176 5600
jdaggett@8311 5601 <li>If the font is defined via an <a
jdaggett@8311 5602 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
jdaggett@8311 5603 features implied by the font-variant descriptor in the <a
jdaggett@8311 5604 href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@8311 5605
jdaggett@8311 5606 <li>If the font is defined via an <a
jdaggett@8311 5607 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
jdaggett@8311 5608 features implied by the font-feature-settings descriptor in the <a
jdaggett@8311 5609 href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@1662 5610
jdaggett@8804 5611 <li>Font features implied by the value of the <a
jdaggett@8804 5612 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8804 5613 class=property>font-variant</code>’</a> property, the related <a
jdaggett@8804 5614 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8804 5615 class=property>font-variant</code>’</a> subproperties and any other CSS
jdaggett@8804 5616 property that uses OpenType features (e.g. the ‘<a
jdaggett@8804 5617 href="#propdef-font-kerning"><code
jdaggett@8804 5618 class=property>font-kerning</code></a>’ property).</li>
jdaggett@8804 5619 <!-- other CSS props override 'font-variant' but not 'font-feature-settings' -->
jdaggett@8804 5620 <!-- http://lists.w3.org/Archives/Public/www-style/2013Aug/0110.html -->
jdaggett@8804 5621
jdaggett@8278 5622 <li>Feature settings determined by properties other than <a
jdaggett@8278 5623 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8279 5624 class=property>font-variant</code>’</a> or <a
jdaggett@8279 5625 href="#propdef-font-feature-settings"
jdaggett@8279 5626 title="font-feature-settings!!property">‘<code
jdaggett@8279 5627 class=property>font-feature-settings</code>’</a>. For example, setting
jdaggett@8279 5628 a non-default value for the ‘<code
jdaggett@8360 5629 class=property>letter-spacing</code>’ property disables common
jdaggett@8360 5630 ligatures.
jdaggett@6176 5631
jdaggett@8279 5632 <li>Font features implied by the value of <a
jdaggett@8279 5633 href="#propdef-font-feature-settings"
jdaggett@8279 5634 title="font-feature-settings!!property">‘<code
jdaggett@8279 5635 class=property>font-feature-settings</code>’</a> property.
jdaggett@1662 5636 </ol>
jdaggett@1662 5637
jdaggett@3511 5638 <p>This ordering allows authors to set up a general set of defaults for
jdaggett@8311 5639 fonts within their <a
jdaggett@8311 5640 href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
jdaggett@8311 5641 them with property settings for specific elements. General property
jdaggett@8311 5642 settings override the settings in <a
jdaggett@8311 5643 href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
jdaggett@8311 5644 font feature settings override <a href="#propdef-font-variant"
jdaggett@8278 5645 title="font-variant!!property">‘<code
jdaggett@8278 5646 class=property>font-variant</code>’</a> property settings.
jdaggett@1732 5647
jdaggett@1732 5648 <p>For situations where the combined list of font feature settings contains
jdaggett@3511 5649 more than one value for the same feature, the last value is used. When a
jdaggett@3511 5650 font lacks support for a given underlying font feature, text is simply
jdaggett@3511 5651 rendered as if that font feature was not enabled; font fallback does not
jdaggett@3511 5652 occur and no attempt is made to synthesize the feature except where
jdaggett@8360 5653 explicitly defined for specific properties.
jdaggett@1662 5654
jdaggett@6699 5655 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
jdaggett@6699 5656 precedence examples</h3>
jdaggett@6699 5657
jdaggett@1662 5658 <div class=example>
jdaggett@1662 5659 <p>With the styles below, numbers are rendered proportionally when used
jdaggett@1662 5660 within a paragraph but are shown in tabular form within tables of prices:</p>
jdaggett@1662 5661
jdaggett@8277 5662 <pre>body {
jdaggett@8277 5663 font-variant-numeric: proportional-nums;
jdaggett@1662 5664 }
jdaggett@1662 5665
jdaggett@1662 5666 table.prices td {
jdaggett@8277 5667 font-variant-numeric: tabular-nums;
jdaggett@1662 5668 }
jdaggett@1662 5669 </pre>
jdaggett@1662 5670 </div>
jdaggett@1662 5671
jdaggett@1662 5672 <div class=example>
jdaggett@8360 5673 <p>When the <a href="#descdef-font-variant"
jdaggett@8360 5674 title="font-variant!!descriptor">font-variant</a> descriptor is used
jdaggett@8360 5675 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
jdaggett@8360 5676 it only applies to the font defined by that rule.</p>
jdaggett@1662 5677
jdaggett@1662 5678 <pre>@font-face {
jdaggett@1662 5679 font-family: MainText;
jdaggett@8860 5680 src: url(http://example.com/font.woff);
jdaggett@1662 5681 font-variant: oldstyle-nums proportional-nums styleset(1,3);
jdaggett@1662 5682 }
jdaggett@1662 5683
jdaggett@1662 5684 body {
jdaggett@1662 5685 font-family: MainText, Helvetica;
jdaggett@1662 5686 }
jdaggett@1662 5687
jdaggett@1662 5688 table.prices td {
jdaggett@8277 5689 font-variant-numeric: tabular-nums;
jdaggett@1662 5690 }
jdaggett@1662 5691 </pre>
jdaggett@1662 5692
jdaggett@1662 5693 <p>In this case, old-style numerals will be used throughout but only where
jdaggett@1662 5694 the font "MainText" is used. Just as in the previous example, tabular
jdaggett@4624 5695 values will be used in price tables since ‘<a
jdaggett@4624 5696 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
jdaggett@4624 5697 appears in a general style rule and its use is mutually exclusive with
jdaggett@4624 5698 ‘<a href="#proportional-nums"><code
jdaggett@4624 5699 class=property>proportional-nums</code></a>’. Stylistic alternate sets
jdaggett@4624 5700 will only be used where MainText is used.</p>
jdaggett@1662 5701 </div>
jdaggett@1662 5702
jdaggett@1662 5703 <div class=example>
jdaggett@8311 5704 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
jdaggett@8311 5705 also be used to access font features in locally available fonts via the
jdaggett@8311 5706 use of <code>local()</code> in the ‘<a href="#descdef-src"><code
jdaggett@8311 5707 class=property>src</code></a>’ descriptor of the <a
jdaggett@8311 5708 href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
jdaggett@1662 5709
jdaggett@1662 5710 <pre>@font-face {
jdaggett@1662 5711 font-family: BodyText;
jdaggett@1662 5712 src: local("HiraMaruPro-W4");
jdaggett@1662 5713 font-variant: proportional-width;
jdaggett@2509 5714 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
jdaggett@1662 5715 }
jdaggett@1662 5716
jdaggett@1662 5717 body { font-family: BodyText, serif; }
jdaggett@1662 5718 </pre>
jdaggett@1662 5719
jdaggett@1662 5720 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
jdaggett@1662 5721 text rendering occurs, Japanese kana will be proportionally spaced and
jdaggett@1662 5722 Latin text will be italicised. Text rendered with the fallback serif font
jdaggett@1662 5723 will use default rendering properties.</p>
jdaggett@1662 5724 </div>
jdaggett@1662 5725
jdaggett@1662 5726 <div class=example>
jdaggett@3460 5727 <p>In the example below, discretionary ligatures are enabled only for a
jdaggett@1662 5728 downloadable font but are disabled within spans of class "special":</p>
jdaggett@1662 5729
jdaggett@1662 5730 <pre>@font-face {
jdaggett@1662 5731 font-family: main;
jdaggett@1662 5732 src: url(fonts/ffmeta.woff) format("woff");
jdaggett@3460 5733 font-variant: discretionary-ligatures;
jdaggett@1662 5734 }
jdaggett@1662 5735
jdaggett@1662 5736 body { font-family: main, Helvetica; }
jdaggett@3460 5737 span.special { font-variant-ligatures: no-discretionary-ligatures; }
jdaggett@1662 5738 </pre>
jdaggett@1662 5739
jdaggett@8360 5740 <p>Suppose one adds a rule using ‘<code
jdaggett@8360 5741 class=property>font-feature-settings</code>’ to enable discretionary
jdaggett@8360 5742 ligatures:</p>
jdaggett@1662 5743
jdaggett@1662 5744 <pre>body { font-family: main, Helvetica; }
jdaggett@2509 5745 span { font-feature-settings: "dlig"; }
jdaggett@3460 5746 span.special { font-variant-ligatures: no-discretionary-ligatures; }
jdaggett@1662 5747 </pre>
jdaggett@1662 5748
jdaggett@8360 5749 <p>In this case, discretionary ligatures <em>will</em> be rendered within
jdaggett@8360 5750 spans of class "special". This is because both the <a
jdaggett@8279 5751 href="#propdef-font-feature-settings"
jdaggett@8279 5752 title="font-feature-settings!!property">‘<code
jdaggett@8279 5753 class=property>font-feature-settings</code>’</a> and ‘<a
jdaggett@4624 5754 href="#propdef-font-variant-ligatures"><code
jdaggett@4624 5755 class=property>font-variant-ligatures</code></a>’ properties apply to
jdaggett@4624 5756 these spans. Although the ‘<code class=css>no-discretionary
jdaggett@4624 5757 ligatures</code>’ setting of ‘<a
jdaggett@4624 5758 href="#propdef-font-variant-ligatures"><code
jdaggett@4624 5759 class=property>font-variant-ligatures</code></a>’ effectively disables
jdaggett@8279 5760 the OpenType <span class=tag>dlig</span> feature, because the <a
jdaggett@8279 5761 href="#propdef-font-feature-settings"
jdaggett@8279 5762 title="font-feature-settings!!property">‘<code
jdaggett@8279 5763 class=property>font-feature-settings</code>’</a> is resolved after
jdaggett@8279 5764 that, the ‘<code class=property>dlig</code>’ value reenables
jdaggett@4624 5765 discretionary ligatures.</p>
jdaggett@1662 5766 </div>
jdaggett@1244 5767
jdaggett@7021 5768 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
jdaggett@7021 5769
jdaggett@8311 5770 <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 5771 and <a
jdaggett@8311 5772 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 5773 rules can be accessed via the following extensions to the CSS Object
jdaggett@8311 5774 Model.
jdaggett@7021 5775
jdaggett@7021 5776 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
jdaggett@7021 5777 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
jdaggett@7021 5778
jdaggett@7021 5779 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
jdaggett@8311 5780 <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@7021 5781
jdaggett@7021 5782 <pre class=idl>
jdaggett@7021 5783 interface CSSFontFaceRule : CSSRule {
jdaggett@7041 5784 attribute DOMString family;
jdaggett@7041 5785 attribute DOMString src;
jdaggett@7041 5786 attribute DOMString style;
jdaggett@7041 5787 attribute DOMString weight;
jdaggett@7041 5788 attribute DOMString stretch;
jdaggett@7041 5789 attribute DOMString unicodeRange;
jdaggett@7041 5790 attribute DOMString variant;
jdaggett@7041 5791 attribute DOMString featureSettings;
jdaggett@7021 5792 }</pre>
jdaggett@7021 5793
jdaggett@7022 5794 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
jdaggett@7022 5795 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
jdaggett@7022 5796 defined a different variant of this rule. This definition supercedes that
jdaggett@7022 5797 one.
jdaggett@7021 5798
jdaggett@7021 5799 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
jdaggett@7021 5800 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
jdaggett@7021 5801 interface</h3>
jdaggett@7021 5802
jdaggett@7021 5803 <p>The <code>CSSRule</code> interface is extended as follows:
jdaggett@7021 5804
jdaggett@7021 5805 <pre class=idl>partial interface CSSRule {
jdaggett@7021 5806 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
jdaggett@7021 5807 }</pre>
jdaggett@7021 5808
jdaggett@7021 5809 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
jdaggett@8311 5810 interface represents a <a
jdaggett@8311 5811 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 5812 rule.
jdaggett@7021 5813
jdaggett@7021 5814 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
jdaggett@8640 5815 attribute DOMString fontFamily;
jdaggett@8640 5816 readonly attribute CSSFontFeatureValuesMap annotation;
jdaggett@8640 5817 readonly attribute CSSFontFeatureValuesMap ornaments;
jdaggett@8640 5818 readonly attribute CSSFontFeatureValuesMap stylistic;
jdaggett@8640 5819 readonly attribute CSSFontFeatureValuesMap swash;
jdaggett@8640 5820 readonly attribute CSSFontFeatureValuesMap characterVariant;
jdaggett@8640 5821 readonly attribute CSSFontFeatureValuesMap styleset;
jdaggett@8640 5822 }
jdaggett@8640 5823
jdaggett@8640 5824 [MapClass(DOMString, sequence&lt;unsigned long&gt;)]
jdaggett@8640 5825 interface CSSFontFeatureValuesMap {
jdaggett@8646 5826 void set(DOMString featureValueName,
jdaggett@8646 5827 (unsigned long or sequence&lt;unsigned long&gt;) values);
jdaggett@8640 5828 }</pre>
jdaggett@7021 5829
jdaggett@7021 5830 <dl class=idl-attributes>
jdaggett@8640 5831 <dt><var>fontFamily</var> of type <code>DOMString</code>
jdaggett@7021 5832
jdaggett@7021 5833 <dd>The list of one or more font families for which a given set of feature
jdaggett@7021 5834 values is defined.
jdaggett@7021 5835
jdaggett@8640 5836 <dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
jdaggett@8640 5837
jdaggett@8640 5838 <dd>Maps of feature values associated with feature value names for a given
jdaggett@8640 5839 ‘<a href="#propdef-font-variant-alternates"><code
jdaggett@8640 5840 class=property>font-variant-alternates</code></a>’ value type
jdaggett@7021 5841 </dl>
jdaggett@7021 5842
jdaggett@8640 5843 <p>Each value map attribute of <a
jdaggett@8640 5844 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
jdaggett@8640 5845 reflects the values defined via a corresponding <a
jdaggett@8640 5846 href="#featurevalueblock"><i title="feature_value_block">feature value
jdaggett@8640 5847 block</i></a>. Thus, the <var title="annotation
jdaggett@8640 5848 attribute">annotation</var> attribute contains the values contained within
jdaggett@8640 5849 a <code title="@annotation">@annotation</code> <a
jdaggett@8640 5850 href="#featurevalueblock"><i title="feature_value_block">feature value
jdaggett@8640 5851 block</i></a>, the <var title="ornaments attribute">ornaments</var>
jdaggett@8640 5852 attribute contains the values contained with a <code
jdaggett@8640 5853 title="@ornaments">@ornaments</code> <a href="#featurevalueblock"><i
jdaggett@8640 5854 title="feature_value_block">feature value block</i></a> and so forth.
jdaggett@8640 5855
jdaggett@8654 5856 <p>The <code>CSSFontFeatureValuesMap</code> interface uses the <a
jdaggett@8655 5857 href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map
jdaggett@8655 5858 class methods</a> but the <code>set</code> method has different behavior.
jdaggett@8655 5859 It takes a sequence of unsigned integers and associates it with a given
jdaggett@8654 5860 <code>featureValueName</code>. The method behaves the same as the default
jdaggett@8654 5861 map class method except that a single unsigned long value is treated as a
jdaggett@8654 5862 sequence of a single value. The method throws an exception if an invalid
jdaggett@8654 5863 number of values is passed in. If the associated <a
jdaggett@8654 5864 href="#featurevalueblock"><i title="feature_value_block">feature value
jdaggett@8640 5865 block</i></a> only allows a limited number of values, the <code>set</code>
jdaggett@8640 5866 method throws an <code>InvalidAccessError</code> exception when the input
jdaggett@8653 5867 sequence to <code>set</code> contains more than the limited number of
jdaggett@8653 5868 values. See the description of <a
jdaggett@8640 5869 href="#multi-valued-feature-value-definitions">multi-valued feature value
jdaggett@8640 5870 definitions</a> for details on the maximum number of values allowed for a
jdaggett@8640 5871 given type of <a href="#featurevalueblock"><i
jdaggett@8646 5872 title="feature_value_block">feature value block</i></a>. The
jdaggett@8653 5873 <code>get</code> method always returns a sequence of values, even if the
jdaggett@8653 5874 sequence only contains a single value.
jdaggett@8279 5875
jdaggett@2737 5876 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
jdaggett@1662 5877 properties to CSS properties</h2>
jdaggett@1662 5878
jdaggett@1662 5879 <p><em>This appendix is included as background for some of the problems and
jdaggett@890 5880 situations that are described in other sections. It should be viewed as
jdaggett@890 5881 informative only.</em>
jdaggett@890 5882
jdaggett@512 5883 <p>Font properties in CSS are designed to be independent of the underlying
jdaggett@512 5884 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
jdaggett@890 5885 SVG fonts in addition to the common TrueType and OpenType fonts. But there
jdaggett@1244 5886 are facets of the TrueType and OpenType formats that often cause confusion
jdaggett@2556 5887 for authors and present challenges to implementers on different platforms.
jdaggett@1244 5888
jdaggett@1244 5889 <p>Originally developed at Apple, TrueType was designed as an outline font
jdaggett@1244 5890 format for both screen and print. Microsoft joined Apple in developing the
jdaggett@1244 5891 TrueType format and both platforms have supported TrueType fonts since
jdaggett@1244 5892 then. Font data in the TrueType format consists of a set of tables
jdaggett@1244 5893 distinguished with common four-letter tag names, each containing a
jdaggett@1244 5894 specific type of data. For example, naming information, including
jdaggett@1244 5895 copyright and license information, is stored in the ‘<code
jdaggett@7311 5896 class=property>name</code>’ table. The <a
jdaggett@7311 5897 href="#character-map"><em>character map</em></a> (‘<code
jdaggett@1244 5898 class=property>cmap</code>’) table contains a mapping of character
jdaggett@1244 5899 encodings to glyphs. Apple later added additional tables for supporting
jdaggett@1244 5900 enhanced typographic functionality; these are now called Apple Advanced
jdaggett@1244 5901 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
jdaggett@1662 5902 tables for advanced typography and called their format OpenType <a
jdaggett@1662 5903 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
jdaggett@890 5904
jdaggett@890 5905 <p>In many cases the font data used under Microsoft Windows or Linux is
jdaggett@890 5906 slightly different from the data used under Apple's Mac OS X because the
jdaggett@6694 5907 TrueType format allowed for explicit variation across platforms. This
jdaggett@7311 5908 includes font metrics, names and <a href="#character-map"><em>character
jdaggett@7311 5909 map</em></a> data.
jdaggett@6694 5910
jdaggett@6694 5911 <p>Specifically, font family name data is handled differently across
jdaggett@6694 5912 platforms. For TrueType and OpenType fonts these names are contained in
jdaggett@6694 5913 the ‘<code class=property>name</code>’ table, in name records with
jdaggett@8276 5914 name ID 1. Mulitple names can be stored for different locales, but
jdaggett@6694 5915 Microsoft recommends fonts always include at least a US English version of
jdaggett@6694 5916 the name. On Windows, Microsoft made the decision for backwards
jdaggett@6694 5917 compatibility to limit this family name to a maximum of four faces; for
jdaggett@6694 5918 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
jdaggett@6694 5919 ID 21) can be used. Other platforms such as OSX don't have this
jdaggett@8276 5920 limitation, so the family name is used to define all possible groupings.
jdaggett@6694 5921
jdaggett@6694 5922 <p>Other name table data provides names used to uniquely identify a
jdaggett@6694 5923 specific face within a family. The full font name (name ID 4) and the
jdaggett@8276 5924 Postscript name (name ID 6) describe a single face uniquely. For example,
jdaggett@8276 5925 the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
jdaggett@8276 5926 and a Postscript name of "GillSans-Bold". There can be multiple localized
jdaggett@8276 5927 versions of the fullname for a given face, but the Postscript name is
jdaggett@1244 5928 always a unique name made from a limited set of ASCII characters.
jdaggett@1244 5929
jdaggett@1244 5930 <p>On various platforms, different names are used to search for a font. For
jdaggett@1244 5931 example, with the Windows GDI CreateIndirectFont API, either a family or
jdaggett@8276 5932 fullname can be used to lookup a face, while on Mac OS X the
jdaggett@8095 5933 CTFontCreateWithName API call is used to lookup a given face using the
jdaggett@8095 5934 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
jdaggett@8095 5935 to be searched using any of these names. In situations where platform
jdaggett@8095 5936 API's automatically substitute other font choices, it may be necessary to
jdaggett@8095 5937 verify a returned font matches a given name.
jdaggett@1244 5938
jdaggett@1244 5939 <p>The weight of a given face can be determined via the usWeightClass field
jdaggett@1244 5940 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
jdaggett@1244 5941 the width can be determined via the usWidthClass of the OS/2 table or
jdaggett@6694 5942 inferred from the style name. For historical reasons related to synthetic
jdaggett@6694 5943 bolding at weights 200 or lower with the Windows GDI API, font designers
jdaggett@6694 5944 have sometimes skewed values in the OS/2 table to avoid these weights.
jdaggett@1244 5945
jdaggett@1244 5946 <p>Rendering complex scripts that use contextual shaping such as Thai,
jdaggett@1244 5947 Arabic and Devanagari requires features present only in OpenType or AAT
jdaggett@1244 5948 fonts. Currently, complex script rendering is supported on Windows and
jdaggett@7521 5949 Linux using OpenType font features while both OpenType and AAT font
jdaggett@7521 5950 features are used under Mac OS X.
jdaggett@1244 5951
jdaggett@2472 5952 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
jdaggett@2472 5953
jdaggett@2472 5954 <h3 class=no-num id=recent-changes> Changes from the <a
jdaggett@8699 5955 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">July 2013 CSS3
jdaggett@8699 5956 Fonts Last Call Working Draft</a></h3>
jdaggett@2472 5957
jdaggett@2472 5958 <p>Major changes include:
jdaggett@2472 5959
jdaggett@2472 5960 <ul>
jdaggett@8804 5961 <li>reorder feature precedence such that features implied by other CSS
jdaggett@8804 5962 properties override ‘<code class=property>font-variant</code>’
jdaggett@8804 5963 settings
jdaggett@8860 5964
jdaggett@8860 5965 <li>switched examples to use .woff files
jdaggett@8860 5966
jdaggett@8872 5967 <li>revised wording of font fetching algorithm
jdaggett@8872 5968
jdaggett@8968 5969 <li>drop ‘<code class=property>auto</code>’ value for ‘<a
jdaggett@8968 5970 href="#propdef-font-size-adjust"><code
jdaggett@8930 5971 class=property>font-size-adjust</code></a>’
jdaggett@8930 5972
jdaggett@8968 5973 <li>clarify effect of ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8968 5974 class=property>font-size-adjust</code></a>’ on <a class=property
jdaggett@8968 5975 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8968 5976 class=property>line-height</code>’</a>
jdaggett@8968 5977
jdaggett@8930 5978 <li>allow user agents to synthesize OpenType <span class=tag>kern</span>
jdaggett@8930 5979 feature
jdaggett@8930 5980
jdaggett@8984 5981 <li>add example of ordinals and associated markup
jdaggett@8984 5982
jdaggett@8860 5983 <li>minor editorial cleanups
jdaggett@2472 5984 </ul>
jdaggett@2472 5985
jdaggett@529 5986 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
jdaggett@529 5987
jdaggett@1662 5988 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
jdaggett@1662 5989 their help and feedback. John Hudson was kind enough to take the time to
jdaggett@2472 5990 explain the subtleties of OpenType language tags and provided the example
jdaggett@2472 5991 of character variant usage for displaying text on Byzantine seals. Ken
jdaggett@2472 5992 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
jdaggett@2472 5993 and Unicode variation selectors. The idea for supporting font features by
jdaggett@8313 5994 using <a href="#propdef-font-variant"
jdaggett@8313 5995 title="font-variant!!property">‘<code
jdaggett@8313 5996 class=property>font-variant</code>’</a> subproperties originated with
jdaggett@8313 5997 Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
jdaggett@8313 5998 of the initial design ideas for the <a
jdaggett@8311 5999 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 6000 rule. Thanks also to House Industries for allowing the use of Ed Interlock
jdaggett@8311 6001 in the discretionary ligatures example.
jdaggett@1662 6002
jdaggett@529 6003 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
jdaggett@529 6004 that is <em>The Elements of Typographic Style</em>.
jdaggett@529 6005
jdaggett@7242 6006 <h2 class=no-num id=conformance> Conformance</h2>
jdaggett@7242 6007
jdaggett@7242 6008 <h3 class=no-num id=conventions> Document Conventions</h3>
jdaggett@7242 6009
jdaggett@7242 6010 <p>Conformance requirements are expressed with a combination of descriptive
jdaggett@7242 6011 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
jdaggett@7242 6012 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
jdaggett@7242 6013 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
jdaggett@7242 6014 normative parts of this document are to be interpreted as described in RFC
jdaggett@7242 6015 2119. However, for readability, these words do not appear in all uppercase
jdaggett@7242 6016 letters in this specification.
jdaggett@7242 6017
jdaggett@7242 6018 <p>All of the text of this specification is normative except sections
jdaggett@7242 6019 explicitly marked as non-normative, examples, and notes. <a
jdaggett@7242 6020 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
jdaggett@7242 6021
jdaggett@7242 6022 <p>Examples in this specification are introduced with the words “for
jdaggett@7242 6023 example” or are set apart from the normative text with
jdaggett@7242 6024 <code>class="example"</code>, like this:
jdaggett@7242 6025
jdaggett@7242 6026 <div class=example>
jdaggett@7242 6027 <p>This is an example of an informative example.
jdaggett@7242 6028 </div>
jdaggett@7242 6029
jdaggett@7242 6030 <p>Informative notes begin with the word “Note” and are set apart from
jdaggett@7242 6031 the normative text with <code>class="note"</code>, like this:
jdaggett@7242 6032
jdaggett@7242 6033 <p class=note>Note, this is an informative note.
jdaggett@7242 6034
jdaggett@7242 6035 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
jdaggett@7242 6036
jdaggett@7242 6037 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
jdaggett@7242 6038 classes:
jdaggett@7242 6039
jdaggett@7242 6040 <dl>
jdaggett@7243 6041 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
jdaggett@7242 6042 sheet</dfn>
jdaggett@7242 6043
jdaggett@7242 6044 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
jdaggett@7242 6045 style sheet</a>.
jdaggett@7242 6046
jdaggett@7243 6047 <dt><dfn id=renderer>renderer</dfn>
jdaggett@7242 6048
jdaggett@7242 6049 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jdaggett@7242 6050 that interprets the semantics of a style sheet and renders documents that
jdaggett@7242 6051 use them.
jdaggett@7242 6052
jdaggett@7242 6053 <dt><dfn id=authoring-tool>authoring tool</dfn>
jdaggett@7242 6054
jdaggett@7242 6055 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jdaggett@7242 6056 that writes a style sheet.
jdaggett@7242 6057 </dl>
jdaggett@7242 6058
jdaggett@7242 6059 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
jdaggett@7242 6060 declarations that use properties defined in this module have values that
jdaggett@7242 6061 are valid according to the generic CSS grammar and the individual grammars
jdaggett@7242 6062 of each property as given in this module.
jdaggett@7242 6063
jdaggett@7242 6064 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
jdaggett@7242 6065 interpreting the style sheet as defined by the appropriate specifications,
jdaggett@7242 6066 it supports all the features defined by CSS Fonts Level 3 Module by
jdaggett@7242 6067 parsing them correctly and rendering the document accordingly. However,
jdaggett@7242 6068 the inability of a UA to correctly render a document due to limitations of
jdaggett@7242 6069 the device does not make the UA non-conformant. (For example, a UA is not
jdaggett@7242 6070 required to render color on a monochrome monitor.)
jdaggett@7242 6071
jdaggett@7242 6072 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
jdaggett@7242 6073 style sheets that are syntactically correct according to the generic CSS
jdaggett@7242 6074 grammar and the individual grammars of each feature in this module, and
jdaggett@7242 6075 meet all other conformance requirements of style sheets as described in
jdaggett@7242 6076 this module.
jdaggett@7242 6077
jdaggett@7242 6078 <h3 class=no-num id=partial> Partial Implementations</h3>
jdaggett@7242 6079
jdaggett@7242 6080 <p>So that authors can exploit the forward-compatible parsing rules to
jdaggett@7242 6081 assign fallback values, CSS renderers <strong>must</strong> treat as
jdaggett@7242 6082 invalid (and <a
jdaggett@7242 6083 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
jdaggett@7242 6084 appropriate</a>) any at-rules, properties, property values, keywords, and
jdaggett@7242 6085 other syntactic constructs for which they have no usable level of support.
jdaggett@7242 6086 In particular, user agents <strong>must not</strong> selectively ignore
jdaggett@7242 6087 unsupported component values and honor supported values in a single
jdaggett@7242 6088 multi-value property declaration: if any value is considered invalid (as
jdaggett@7242 6089 unsupported values must be), CSS requires that the entire declaration be
jdaggett@7242 6090 ignored.
jdaggett@7242 6091
jdaggett@7242 6092 <h3 class=no-num id=experimental> Experimental Implementations</h3>
jdaggett@7242 6093
jdaggett@7242 6094 <p>To avoid clashes with future CSS features, the CSS2.1 specification
jdaggett@7242 6095 reserves a <a
jdaggett@7242 6096 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
jdaggett@7242 6097 syntax</a> for proprietary and experimental extensions to CSS.
jdaggett@7242 6098
jdaggett@7242 6099 <p>Prior to a specification reaching the Candidate Recommendation stage in
jdaggett@7242 6100 the W3C process, all implementations of a CSS feature are considered
jdaggett@7242 6101 experimental. The CSS Working Group recommends that implementations use a
jdaggett@7242 6102 vendor-prefixed syntax for such features, including those in W3C Working
jdaggett@7242 6103 Drafts. This avoids incompatibilities with future changes in the draft.
jdaggett@7242 6104
jdaggett@7242 6105 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
jdaggett@7242 6106
jdaggett@7242 6107 <p>Once a specification reaches the Candidate Recommendation stage,
jdaggett@7242 6108 non-experimental implementations are possible, and implementors should
jdaggett@7242 6109 release an unprefixed implementation of any CR-level feature they can
jdaggett@7242 6110 demonstrate to be correctly implemented according to spec.
jdaggett@7242 6111
jdaggett@7242 6112 <p>To establish and maintain the interoperability of CSS across
jdaggett@7242 6113 implementations, the CSS Working Group requests that non-experimental CSS
jdaggett@7242 6114 renderers submit an implementation report (and, if necessary, the
jdaggett@7242 6115 testcases used for that implementation report) to the W3C before releasing
jdaggett@7242 6116 an unprefixed implementation of any CSS features. Testcases submitted to
jdaggett@7242 6117 W3C are subject to review and correction by the CSS Working Group.
jdaggett@7242 6118
jdaggett@7242 6119 <p>Further information on submitting testcases and implementation reports
jdaggett@7242 6120 can be found from on the CSS Working Group's website at <a
jdaggett@7242 6121 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
jdaggett@7242 6122 Questions should be directed to the <a
jdaggett@7242 6123 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
jdaggett@7242 6124 mailing list.
jdaggett@7242 6125
jdaggett@484 6126 <h2 class=no-num id=references>References</h2>
jdaggett@484 6127
jdaggett@1662 6128 <h3 class=no-num id=normative-references>Normative References</h3>
jdaggett@484 6129 <!--begin-normative-->
jdaggett@484 6130 <!-- Sorted by label -->
jdaggett@484 6131
jdaggett@484 6132 <dl class=bibliography>
jdaggett@8031 6133 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
jdaggett@484 6134 <!---->
jdaggett@531 6135
jdaggett@2461 6136 <dt id=CHARMOD>[CHARMOD]
jdaggett@2461 6137
jdaggett@2461 6138 <dd>Martin J. Dürst; et al. <a
jdaggett@2737 6139 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
jdaggett@2461 6140 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
jdaggett@2461 6141 2005. W3C Recommendation. URL: <a
jdaggett@2737 6142 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
jdaggett@2461 6143 </dd>
jdaggett@2461 6144 <!---->
jdaggett@2461 6145
jdaggett@2457 6146 <dt id=CORS>[CORS]
jdaggett@1662 6147
jdaggett@1662 6148 <dd>Anne van Kesteren. <a
jdaggett@7242 6149 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
jdaggett@7242 6150 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
jdaggett@7242 6151 Recommendation. (Work in progress.) URL: <a
jdaggett@7242 6152 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
jdaggett@1662 6153 </dd>
jdaggett@1662 6154 <!---->
jdaggett@1662 6155
jdaggett@3041 6156 <dt id=CSS21>[CSS21]
jdaggett@3041 6157
jdaggett@3041 6158 <dd>Bert Bos; et al. <a
jdaggett@8031 6159 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
jdaggett@3041 6160 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
jdaggett@3041 6161 2011. W3C Recommendation. URL: <a
jdaggett@8031 6162 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
jdaggett@3041 6163 </dd>
jdaggett@3041 6164 <!---->
jdaggett@3041 6165
jdaggett@5833 6166 <dt id=CSS3VAL>[CSS3VAL]
jdaggett@5833 6167
jdaggett@5833 6168 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
jdaggett@8957 6169 href="http://www.w3.org/TR/2013/CR-css3-values-20130730/"><cite>CSS
jdaggett@8957 6170 Values and Units Module Level 3.</cite></a> 30 July 2013. W3C Candidate
jdaggett@6701 6171 Recommendation. (Work in progress.) URL: <a
jdaggett@8957 6172 href="http://www.w3.org/TR/2013/CR-css3-values-20130730/">http://www.w3.org/TR/2013/CR-css3-values-20130730/</a>
jdaggett@5833 6173 </dd>
jdaggett@5833 6174 <!---->
jdaggett@5833 6175
jdaggett@1662 6176 <dt id=HTML5>[HTML5]
jdaggett@1662 6177
jdaggett@8957 6178 <dd>Robin Berjon; et al. <a
jdaggett@8957 6179 href="http://www.w3.org/TR/2013/CR-html5-20130806/"><cite>HTML5.</cite></a>
jdaggett@8957 6180 6 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a
jdaggett@8957 6181 href="http://www.w3.org/TR/2013/CR-html5-20130806/">http://www.w3.org/TR/2013/CR-html5-20130806/</a>
jdaggett@1662 6182 </dd>
jdaggett@1662 6183 <!---->
jdaggett@1662 6184
jdaggett@1662 6185 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
jdaggett@1662 6186
jdaggett@1662 6187 <dd><a
bert@8683 6188 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136"><cite>Information
jdaggett@1662 6189 technology — Coding of audio-visual objects — Part 22: Open Font
jdaggett@1662 6190 Format.</cite></a> International Organization for Standardization.
jdaggett@1662 6191 ISO/IEC 14496-22:2009. URL: <a
bert@8683 6192 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136">http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136</a>
jdaggett@1662 6193 </dd>
jdaggett@1662 6194 <!---->
jdaggett@1662 6195
jdaggett@1662 6196 <dt id=OPENTYPE>[OPENTYPE]
jdaggett@1662 6197
jdaggett@1662 6198 <dd><a
jdaggett@1662 6199 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
jdaggett@1662 6200 specification.</cite></a> Microsoft. URL: <a
jdaggett@1662 6201 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
jdaggett@1662 6202 </dd>
jdaggett@1662 6203 <!---->
jdaggett@1662 6204
jdaggett@1662 6205 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
jdaggett@1662 6206
jdaggett@1662 6207 <dd><a
jdaggett@1662 6208 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
jdaggett@1662 6209 feature registry.</cite></a> Microsoft. URL: <a
jdaggett@1662 6210 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
jdaggett@1662 6211 </dd>
jdaggett@1662 6212 <!---->
jdaggett@1662 6213
jdaggett@7103 6214 <dt id=RFC2119>[RFC2119]
jdaggett@7103 6215
jdaggett@7103 6216 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
jdaggett@7103 6217 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
jdaggett@7103 6218 RFC 2119. URL: <a
jdaggett@7103 6219 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
jdaggett@7103 6220 </dd>
jdaggett@7103 6221 <!---->
jdaggett@7103 6222
jdaggett@2457 6223 <dt id=UAX15>[UAX15]
jdaggett@2457 6224
jdaggett@7242 6225 <dd>Mark Davis; Ken Whistler. <a
jdaggett@7242 6226 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
jdaggett@7242 6227 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
jdaggett@7242 6228 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
jdaggett@2457 6229 </dd>
jdaggett@2457 6230 <!---->
jdaggett@2457 6231
jdaggett@1856 6232 <dt id=UAX29>[UAX29]
jdaggett@1856 6233
jdaggett@1856 6234 <dd>Mark Davis. <a
jdaggett@5809 6235 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
jdaggett@7242 6236 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
jdaggett@2461 6237 URL: <a
jdaggett@5809 6238 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
jdaggett@1856 6239 </dd>
jdaggett@1856 6240 <!---->
jdaggett@1856 6241
jdaggett@3041 6242 <dt id=UNICODE6>[UNICODE6]
jdaggett@531 6243
jdaggett@531 6244 <dd>The Unicode Consortium. <a
jdaggett@7242 6245 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
jdaggett@7242 6246 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
jdaggett@7242 6247 Version 6.2.0 URL: <a
jdaggett@7242 6248 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
jdaggett@531 6249 </dd>
jdaggett@531 6250 <!---->
jdaggett@484 6251 </dl>
jdaggett@484 6252 <!--end-normative-->
jdaggett@3041 6253 <!--{{!CSS21}}-->
jdaggett@5833 6254 <!--{{!CSS3VAL}}-->
jdaggett@1662 6255 <!--{{!OPENTYPE}}-->
jdaggett@1662 6256 <!--{{!OPENTYPE-FEATURES}}-->
jdaggett@1662 6257 <!--{{!OPEN-FONT-FORMAT}}-->
jdaggett@3041 6258 <!--{{!UNICODE6}}-->
jdaggett@2457 6259 <!--{{!UAX15}}-->
jdaggett@1856 6260 <!--{{!UAX29}}-->
jdaggett@2457 6261 <!--{{!CORS}}-->
jdaggett@1662 6262 <!--{{!HTML5}}-->
jdaggett@2461 6263 <!--{{!CHARMOD}}-->
jdaggett@1662 6264
jdaggett@1662 6265 <h3 class=no-num id=other-references>Other References</h3>
jdaggett@484 6266 <!--begin-informative-->
jdaggett@484 6267 <!-- Sorted by label -->
jdaggett@484 6268
jdaggett@484 6269 <dl class=bibliography>
jdaggett@8031 6270 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
jdaggett@484 6271 <!---->
jdaggett@484 6272
jdaggett@3042 6273 <dt id=AAT-FEATURES>[AAT-FEATURES]
jdaggett@3042 6274
jdaggett@3042 6275 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
jdaggett@3042 6276 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
jdaggett@3042 6277 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
jdaggett@3042 6278 </dd>
jdaggett@3042 6279 <!---->
jdaggett@3042 6280
jdaggett@512 6281 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
jdaggett@512 6282
jdaggett@513 6283 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
jdaggett@1148 6284 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
jdaggett@512 6285 <!---->
jdaggett@512 6286
jdaggett@3042 6287 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
jdaggett@3042 6288
jdaggett@3042 6289 <dd>François Yergeau; et al. <a
jdaggett@5809 6290 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
jdaggett@5809 6291 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
jdaggett@5809 6292 W3C Working Draft. (Work in progress.) URL: <a
jdaggett@5809 6293 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
jdaggett@3042 6294 </dd>
jdaggett@3042 6295 <!---->
jdaggett@3042 6296
jdaggett@1732 6297 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
jdaggett@1732 6298
jdaggett@1732 6299 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
jdaggett@1732 6300 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
jdaggett@1732 6301 <!---->
jdaggett@1732 6302
jdaggett@3460 6303 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
jdaggett@3460 6304
jdaggett@3460 6305 <dd>L. David Baron. <a
jdaggett@8386 6306 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/"><cite>CSS
jdaggett@8386 6307 Conditional Rules Module Level 3.</cite></a> 4 April 2013. W3C Candidate
jdaggett@8386 6308 Recommendation. (Work in progress.) URL: <a
jdaggett@8386 6309 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/">http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a>
jdaggett@3460 6310 </dd>
jdaggett@3460 6311 <!---->
jdaggett@3460 6312
jdaggett@6701 6313 <dt id=CSS3TEXT>[CSS3TEXT]
jdaggett@6701 6314
jdaggett@6701 6315 <dd>Elika J. Etemad; Koji Ishii. <a
jdaggett@7041 6316 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
jdaggett@7041 6317 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
jdaggett@6701 6318 progress.) URL: <a
jdaggett@7041 6319 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
jdaggett@6701 6320 </dd>
jdaggett@6701 6321 <!---->
jdaggett@6701 6322
jdaggett@1856 6323 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
jdaggett@1856 6324
jdaggett@1856 6325 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
jdaggett@1856 6326 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
jdaggett@1856 6327 ISBN 0-201-17633-5.</dd>
jdaggett@1856 6328 <!---->
jdaggett@1856 6329
jdaggett@7022 6330 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
jdaggett@7022 6331
jdaggett@7022 6332 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
jdaggett@7179 6333 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
jdaggett@7022 6334 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
jdaggett@7022 6335 2000. W3C Recommendation. URL: <a
jdaggett@7179 6336 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@7022 6337 </dd>
jdaggett@7022 6338 <!---->
jdaggett@7022 6339
jdaggett@498 6340 <dt id=ELEMTYPO>[ELEMTYPO]
jdaggett@498 6341
jdaggett@498 6342 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
jdaggett@7488 6343 4.</cite> Hartley &amp; Marks. 2013. ISBN 0-88179-212-8.</dd>
jdaggett@498 6344 <!---->
jdaggett@498 6345
jdaggett@513 6346 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
jdaggett@513 6347
jdaggett@1148 6348 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
jdaggett@1148 6349 ISBN 1-932026-01-0.</dd>
jdaggett@512 6350 <!---->
jdaggett@1662 6351
jdaggett@1662 6352 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
jdaggett@1662 6353
jdaggett@1662 6354 <dd><a
jdaggett@3538 6355 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
jdaggett@1662 6356 User Guide.</cite></a> FontShop International. URL: <a
jdaggett@3538 6357 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@1662 6358 </dd>
jdaggett@1662 6359 <!---->
jdaggett@1856 6360
jdaggett@2527 6361 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
jdaggett@2527 6362
jdaggett@2527 6363 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
jdaggett@6659 6364 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
jdaggett@2527 6365 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
jdaggett@2527 6366 <!---->
jdaggett@2527 6367
jdaggett@1856 6368 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
jdaggett@1856 6369
jdaggett@1856 6370 <dd>John Hudson. <a
jdaggett@1856 6371 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
jdaggett@1856 6372 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
jdaggett@1856 6373 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
jdaggett@1856 6374 </dd>
jdaggett@1856 6375 <!---->
jdaggett@484 6376 </dl>
jdaggett@484 6377 <!--end-informative-->
jdaggett@518 6378 <!--{{ARABIC-TYPO}}-->
jdaggett@1732 6379 <!--{{CJKV-INFO-PROCESSING}}-->
jdaggett@1856 6380 <!--{{DIGITAL-TYPOGRAPHY}}-->
jdaggett@7022 6381 <!--{{DOM-LEVEL-2-STYLE}}-->
jdaggett@518 6382 <!--{{ELEMTYPO}}-->
jdaggett@1856 6383 <!--{{LANGCULTTYPE}}-->
jdaggett@1662 6384 <!--{{OPENTYPE-FONT-GUIDE}}-->
jdaggett@2527 6385 <!--{{RASTER-TRAGEDY}}-->
jdaggett@1856 6386 <!--{{WINDOWS-GLYPH-PROC}}-->
jdaggett@3042 6387 <!--{{CHARMOD-NORM}}-->
jdaggett@3042 6388 <!--{{AAT-FEATURES}}-->
jdaggett@3460 6389 <!--{{CSS3-CONDITIONAL}}-->
jdaggett@6701 6390 <!--{{CSS3TEXT}}-->
jdaggett@484 6391
jdaggett@484 6392 <h2 class=no-num id=index>Index</h2>
jdaggett@484 6393 <!--begin-index-->
jdaggett@484 6394
jdaggett@484 6395 <ul class=indexlist>
jdaggett@8278 6396 <li>100...900 weight values, <a href="#font-weight-numeric-values"
jdaggett@8278 6397 title="100...900 weight values"><strong>3.2</strong></a>
jdaggett@8278 6398
jdaggett@8225 6399 <li><var>&lt;absolute-size&gt;</var>, <a href="#absolute-size-value"
jdaggett@7060 6400 title="&lt;absolute-size&gt;"><strong>3.5</strong></a>
jdaggett@890 6401
jdaggett@8225 6402 <li><var>&lt;common-lig-values&gt;</var>, <a href="#common-lig-values"
jdaggett@8225 6403 title="&lt;common-lig-values&gt;"><strong>6.4</strong></a>
jdaggett@2479 6404
jdaggett@2479 6405 <li><var>&lt;contextual-alt-values&gt;</var>, <a
jdaggett@8225 6406 href="#contextual-alt-values"
jdaggett@6176 6407 title="&lt;contextual-alt-values&gt;"><strong>6.4</strong></a>
jdaggett@2479 6408
jdaggett@8225 6409 <li><var>&lt;discretionary-lig-values&gt;</var>, <a
jdaggett@8225 6410 href="#discretionary-lig-values"
jdaggett@8225 6411 title="&lt;discretionary-lig-values&gt;"><strong>6.4</strong></a>
jdaggett@3460 6412
jdaggett@2479 6413 <li><var>&lt;east-asian-variant-values&gt;</var>, <a
jdaggett@8225 6414 href="#east-asian-variant-values"
jdaggett@2479 6415 title="&lt;east-asian-variant-values&gt;"><strong>6.10</strong></a>
jdaggett@2479 6416
jdaggett@2479 6417 <li><var>&lt;east-asian-width-values&gt;</var>, <a
jdaggett@8225 6418 href="#east-asian-width-values"
jdaggett@2479 6419 title="&lt;east-asian-width-values&gt;"><strong>6.10</strong></a>
jdaggett@2479 6420
jdaggett@8225 6421 <li><var>&lt;family-name&gt;</var>, <a href="#family-name-value"
jdaggett@8225 6422 title="&lt;family-name&gt;"><strong>3.1</strong></a>
jdaggett@8225 6423
jdaggett@8225 6424 <li><var>&lt;feature-tag-value&gt;</var>, <a href="#feature-tag-value"
jdaggett@2515 6425 title="&lt;feature-tag-value&gt;"><strong>6.12</strong></a>
jdaggett@2515 6426
jdaggett@8225 6427 <li><var>&lt;font-face-name&gt;</var>, <a href="#font-face-name-value"
jdaggett@7060 6428 title="&lt;font-face-name&gt;"><strong>4.3</strong></a>
jdaggett@4624 6429
jdaggett@4624 6430 <li><var>&lt;font-variant-css21&gt;</var>, <a
jdaggett@8225 6431 href="#font-variant-css21-values"
jdaggett@4624 6432 title="&lt;font-variant-css21&gt;"><strong>3.7</strong></a>
jdaggett@4624 6433
jdaggett@8225 6434 <li><var>&lt;generic-family&gt;</var>, <a href="#generic-family-value"
jdaggett@8225 6435 title="&lt;generic-family&gt;"><strong>3.1</strong></a>
jdaggett@8225 6436
jdaggett@8225 6437 <li><var>&lt;historical-lig-values&gt;</var>, <a
jdaggett@8225 6438 href="#historical-lig-values"
jdaggett@8225 6439 title="&lt;historical-lig-values&gt;"><strong>6.4</strong></a>
jdaggett@8225 6440
jdaggett@8225 6441 <li><var>&lt;length&gt;</var>, <a href="#length-size-value"
jdaggett@8225 6442 title="&lt;length&gt;"><strong>3.5</strong></a>
jdaggett@8225 6443
jdaggett@8225 6444 <li><var>&lt;number&gt;</var>, <a href="#aspect-ratio-value"
jdaggett@8225 6445 title="&lt;number&gt;"><strong>3.6</strong></a>
jdaggett@4624 6446
jdaggett@4624 6447 <li><var>&lt;numeric-figure-values&gt;</var>, <a
jdaggett@8225 6448 href="#numeric-figure-values"
jdaggett@4624 6449 title="&lt;numeric-figure-values&gt;"><strong>6.7</strong></a>
jdaggett@4624 6450
jdaggett@4624 6451 <li><var>&lt;numeric-fraction-values&gt;</var>, <a
jdaggett@8225 6452 href="#numeric-fraction-values"
jdaggett@4624 6453 title="&lt;numeric-fraction-values&gt;"><strong>6.7</strong></a>
jdaggett@4624 6454
jdaggett@4624 6455 <li><var>&lt;numeric-spacing-values&gt;</var>, <a
jdaggett@8225 6456 href="#numeric-spacing-values"
jdaggett@4624 6457 title="&lt;numeric-spacing-values&gt;"><strong>6.7</strong></a>
jdaggett@4624 6458
jdaggett@8225 6459 <li><var>&lt;percentage&gt;</var>, <a href="#percentage-size-value"
jdaggett@8225 6460 title="&lt;percentage&gt;"><strong>3.5</strong></a>
jdaggett@8225 6461
jdaggett@8225 6462 <li><var>&lt;relative-size&gt;</var>, <a href="#relative-size-value"
jdaggett@7060 6463 title="&lt;relative-size&gt;"><strong>3.5</strong></a>
jdaggett@7060 6464
jdaggett@8278 6465 <li><var>&lt;string&gt;</var>, <a
jdaggett@8278 6466 href="#font-language-override-string-value"
jdaggett@8278 6467 title="&lt;string&gt;"><strong>6.13</strong></a>
jdaggett@8278 6468
jdaggett@8225 6469 <li><var>&lt;urange&gt;</var>, <a href="#urange-value"
jdaggett@8225 6470 title="&lt;urange&gt;"><strong>4.5</strong></a>
jdaggett@2479 6471
jdaggett@8311 6472 <li><code>@font-face</code>, <a href="#at-font-face-rule"
jdaggett@8311 6473 title="@font-face"><strong>4.1</strong></a>
jdaggett@8311 6474
jdaggett@8311 6475 <li><code>@font-feature-values</code>, <a
jdaggett@8311 6476 href="#at-font-feature-values-rule"
jdaggett@8311 6477 title="@font-feature-values"><strong>6.9</strong></a>
jdaggett@2479 6478
jdaggett@4624 6479 <li>all-petite-caps, <a href="#all-petite-caps"
jdaggett@4624 6480 title=all-petite-caps><strong>6.6</strong></a>
jdaggett@4624 6481
jdaggett@4624 6482 <li>all-small-caps, <a href="#all-small-caps"
jdaggett@4624 6483 title=all-small-caps><strong>6.6</strong></a>
jdaggett@4624 6484
jdaggett@8225 6485 <li>annotation, <a href="#annotation"
jdaggett@7060 6486 title=annotation><strong>6.8</strong></a>
jdaggett@4624 6487
jdaggett@4624 6488 <li>aspect value, <a href="#aspect-value0" title="aspect
jdaggett@4624 6489 value"><strong>3.6</strong></a>
jdaggett@4624 6490
jdaggett@7103 6491 <li>authoring tool, <a href="#authoring-tool" title="authoring
jdaggett@7243 6492 tool"><strong>#</strong></a>
jdaggett@7103 6493
jdaggett@8278 6494 <li>auto
jdaggett@8278 6495 <ul>
jdaggett@8278 6496 <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
jdaggett@8278 6497 font-kerning"><strong>6.3</strong></a>
jdaggett@8278 6498 </ul>
jdaggett@8278 6499
jdaggett@8278 6500 <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
jdaggett@8278 6501
jdaggett@8278 6502 <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
jdaggett@8278 6503
jdaggett@7311 6504 <li>character map, <a href="#character-map" title="character
jdaggett@7311 6505 map"><strong>5.2</strong></a>
jdaggett@7311 6506
jdaggett@8225 6507 <li>character-variant, <a href="#character-variant"
jdaggett@7060 6508 title=character-variant><strong>6.8</strong></a>
jdaggett@4624 6509
jdaggett@4624 6510 <li>common-ligatures, <a href="#common-ligatures"
jdaggett@6176 6511 title=common-ligatures><strong>6.4</strong></a>
jdaggett@4624 6512
jdaggett@8391 6513 <li>composite face, <a href="#composite-face" title="composite
jdaggett@8391 6514 face"><strong>5.2</strong></a>
jdaggett@8391 6515
jdaggett@8278 6516 <li>condensed, <a href="#condensed"
jdaggett@8278 6517 title=condensed><strong>3.3</strong></a>
jdaggett@8278 6518
jdaggett@4624 6519 <li>contextual, <a href="#contextual"
jdaggett@6176 6520 title=contextual><strong>6.4</strong></a>
jdaggett@4624 6521
jdaggett@7021 6522 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
jdaggett@7021 6523 title=CSSFontFaceRule><strong>8.1</strong></a>
jdaggett@7021 6524
jdaggett@7021 6525 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
jdaggett@7021 6526 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
jdaggett@7021 6527
jdaggett@4624 6528 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
jdaggett@4624 6529 of"><strong>#</strong></a>
jdaggett@4624 6530
jdaggett@7232 6531 <li>default face, <a href="#default-face" title="default
jdaggett@7309 6532 face"><strong>5.2</strong></a>
jdaggett@7232 6533
jdaggett@8031 6534 <li>descriptor_declaration, <a href="#descriptordeclaration"
jdaggett@8031 6535 title="descriptor_declaration"><strong>4.1</strong></a>
jdaggett@8031 6536
jdaggett@4624 6537 <li>diagonal-fractions, <a href="#diagonal-fractions"
jdaggett@4624 6538 title=diagonal-fractions><strong>6.7</strong></a>
jdaggett@4624 6539
jdaggett@4624 6540 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
jdaggett@6176 6541 title=discretionary-ligatures><strong>6.4</strong></a>
jdaggett@4624 6542
jdaggett@8391 6543 <li>effective character map, <a href="#effective-character-map"
jdaggett@8391 6544 title="effective character map"><strong>4.5</strong></a>
jdaggett@8391 6545
jdaggett@8278 6546 <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
jdaggett@8278 6547
jdaggett@8278 6548 <li>extra-condensed, <a href="#extra-condensed"
jdaggett@8278 6549 title=extra-condensed><strong>3.3</strong></a>
jdaggett@8278 6550
jdaggett@8278 6551 <li>extra-expanded, <a href="#extra-expanded"
jdaggett@8278 6552 title=extra-expanded><strong>3.3</strong></a>
jdaggett@8278 6553
jdaggett@4624 6554 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
jdaggett@4624 6555 of"><strong>#</strong></a>
jdaggett@4624 6556
jdaggett@8031 6557 <li>feature_type, <a href="#featuretype"
jdaggett@8356 6558 title="feature_type"><strong>6.9.1</strong></a>
jdaggett@8031 6559
jdaggett@8031 6560 <li>feature_value_block, <a href="#featurevalueblock"
jdaggett@8356 6561 title="feature_value_block"><strong>6.9.1</strong></a>
jdaggett@8031 6562
jdaggett@8031 6563 <li>feature_value_definition, <a href="#featurevaluedefinition"
jdaggett@8356 6564 title="feature_value_definition"><strong>6.9.1</strong></a>
jdaggett@7679 6565
jdaggett@8431 6566 <li>first available font, <a href="#first-available-font" title="first
jdaggett@8431 6567 available font"><strong>5.2</strong></a>
jdaggett@8431 6568
jdaggett@4624 6569 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
jdaggett@2472 6570
jdaggett@8356 6571 <li>font specific, <a href="#font-specific" title="font
jdaggett@8356 6572 specific"><strong>6.8</strong></a>
jdaggett@8356 6573
jdaggett@8278 6574 <li>font-family
jdaggett@8278 6575 <ul>
jdaggett@8278 6576 <li>descriptor, <a href="#descdef-font-family" title="font-family,
jdaggett@8278 6577 descriptor"><strong>4.2</strong></a>
jdaggett@8278 6578
jdaggett@8278 6579 <li>property, <a href="#propdef-font-family" title="font-family,
jdaggett@8278 6580 property"><strong>3.1</strong></a>
jdaggett@8278 6581 </ul>
jdaggett@1662 6582
jdaggett@8279 6583 <li>font-feature-settings
jdaggett@8278 6584 <ul>
jdaggett@8278 6585 <li>descriptor, <a href="#descdef-font-feature-settings"
jdaggett@8278 6586 title="font-feature-settings, descriptor"><strong>4.7</strong></a>
jdaggett@8279 6587
jdaggett@8279 6588 <li>property, <a href="#propdef-font-feature-settings"
jdaggett@8279 6589 title="font-feature-settings, property"><strong>6.12</strong></a>
jdaggett@8278 6590 </ul>
jdaggett@7060 6591
jdaggett@1662 6592 <li>font-kerning, <a href="#propdef-font-kerning"
jdaggett@1856 6593 title=font-kerning><strong>6.3</strong></a>
jdaggett@1662 6594
jdaggett@1732 6595 <li>font-language-override, <a href="#propdef-font-language-override"
jdaggett@2118 6596 title=font-language-override><strong>6.13</strong></a>
jdaggett@1662 6597
jdaggett@1662 6598 <li>font-size, <a href="#propdef-font-size"
jdaggett@1662 6599 title=font-size><strong>3.5</strong></a>
jdaggett@1662 6600
jdaggett@1662 6601 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
jdaggett@1662 6602 title=font-size-adjust><strong>3.6</strong></a>
jdaggett@1662 6603
jdaggett@8278 6604 <li>font-stretch
jdaggett@8278 6605 <ul>
jdaggett@8278 6606 <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
jdaggett@8278 6607 descriptor"><strong>4.4</strong></a>
jdaggett@8278 6608
jdaggett@8278 6609 <li>property, <a href="#propdef-font-stretch" title="font-stretch,
jdaggett@8278 6610 property"><strong>3.3</strong></a>
jdaggett@8278 6611 </ul>
jdaggett@8278 6612
jdaggett@8278 6613 <li>font-style
jdaggett@8278 6614 <ul>
jdaggett@8278 6615 <li>descriptor, <a href="#descdef-font-style" title="font-style,
jdaggett@8278 6616 descriptor"><strong>4.4</strong></a>
jdaggett@8278 6617
jdaggett@8278 6618 <li>property, <a href="#propdef-font-style" title="font-style,
jdaggett@8278 6619 property"><strong>3.4</strong></a>
jdaggett@8278 6620 </ul>
jdaggett@7060 6621
jdaggett@2487 6622 <li>font-synthesis, <a href="#propdef-font-synthesis"
jdaggett@2487 6623 title=font-synthesis><strong>3.8</strong></a>
jdaggett@2457 6624
jdaggett@8278 6625 <li>font-variant
jdaggett@8278 6626 <ul>
jdaggett@8278 6627 <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
jdaggett@8278 6628 descriptor"><strong>4.7</strong></a>
jdaggett@8278 6629
jdaggett@8278 6630 <li>property, <a href="#propdef-font-variant" title="font-variant,
jdaggett@8278 6631 property"><strong>6.11</strong></a>
jdaggett@8278 6632 </ul>
jdaggett@1662 6633
jdaggett@1662 6634 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
jdaggett@2118 6635 title=font-variant-alternates><strong>6.8</strong></a>
jdaggett@1662 6636
jdaggett@1662 6637 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
jdaggett@2118 6638 title=font-variant-caps><strong>6.6</strong></a>
jdaggett@1732 6639
jdaggett@1662 6640 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
jdaggett@2118 6641 title=font-variant-east-asian><strong>6.10</strong></a>
jdaggett@1662 6642
jdaggett@1662 6643 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
jdaggett@6176 6644 title=font-variant-ligatures><strong>6.4</strong></a>
jdaggett@1662 6645
jdaggett@1662 6646 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
jdaggett@2118 6647 title=font-variant-numeric><strong>6.7</strong></a>
jdaggett@2118 6648
jdaggett@3460 6649 <li>font-variant-position, <a href="#propdef-font-variant-position"
jdaggett@6176 6650 title=font-variant-position><strong>6.5</strong></a>
jdaggett@3460 6651
jdaggett@8278 6652 <li>font-weight
jdaggett@8278 6653 <ul>
jdaggett@8278 6654 <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
jdaggett@8278 6655 descriptor"><strong>4.4</strong></a>
jdaggett@8278 6656
jdaggett@8278 6657 <li>property, <a href="#propdef-font-weight" title="font-weight,
jdaggett@8278 6658 property"><strong>3.2</strong></a>
jdaggett@8278 6659 </ul>
jdaggett@1662 6660
jdaggett@8031 6661 <li>font_face_rule, <a href="#fontfacerule"
jdaggett@8031 6662 title="font_face_rule"><strong>4.1</strong></a>
jdaggett@8031 6663
jdaggett@8225 6664 <li>FONT_FACE_SYM, <a href="#fontfacesym"
jdaggett@8225 6665 title="FONT_FACE_SYM"><strong>4.1</strong></a>
jdaggett@8225 6666
jdaggett@8031 6667 <li>font_family_name, <a href="#fontfamilyname"
jdaggett@8356 6668 title="font_family_name"><strong>6.9.1</strong></a>
jdaggett@8031 6669
jdaggett@8031 6670 <li>font_family_name_list, <a href="#fontfamilynamelist"
jdaggett@8356 6671 title="font_family_name_list"><strong>6.9.1</strong></a>
jdaggett@8031 6672
jdaggett@8031 6673 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
jdaggett@8356 6674 title="font_feature_values_rule"><strong>6.9.1</strong></a>
jdaggett@8031 6675
jdaggett@8225 6676 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
jdaggett@8356 6677 title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
jdaggett@8225 6678
jdaggett@1662 6679 <li>full-width, <a href="#full-width"
jdaggett@2118 6680 title=full-width><strong>6.10</strong></a>
jdaggett@1662 6681
jdaggett@1662 6682 <li>historical-forms, <a href="#historical-forms"
jdaggett@2118 6683 title=historical-forms><strong>6.8</strong></a>
jdaggett@1662 6684
jdaggett@1662 6685 <li>historical-ligatures, <a href="#historical-ligatures"
jdaggett@6176 6686 title=historical-ligatures><strong>6.4</strong></a>
jdaggett@1732 6687
jdaggett@8278 6688 <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
jdaggett@8278 6689
jdaggett@2118 6690 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
jdaggett@2118 6691
jdaggett@2118 6692 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
jdaggett@2118 6693
jdaggett@2118 6694 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
jdaggett@2118 6695
jdaggett@2118 6696 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
jdaggett@1662 6697
jdaggett@8278 6698 <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
jdaggett@8278 6699
jdaggett@1662 6700 <li>lining-nums, <a href="#lining-nums"
jdaggett@2118 6701 title=lining-nums><strong>6.7</strong></a>
jdaggett@890 6702
jdaggett@890 6703 <li>monospace, definition of, <a href="#monospace0" title="monospace,
jdaggett@890 6704 definition of"><strong>#</strong></a>
jdaggett@890 6705
jdaggett@1662 6706 <li>no-common-ligatures, <a href="#no-common-ligatures"
jdaggett@6176 6707 title=no-common-ligatures><strong>6.4</strong></a>
jdaggett@1662 6708
jdaggett@1662 6709 <li>no-contextual, <a href="#no-contextual"
jdaggett@6176 6710 title=no-contextual><strong>6.4</strong></a>
jdaggett@1662 6711
jdaggett@3460 6712 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
jdaggett@6176 6713 title=no-discretionary-ligatures><strong>6.4</strong></a>
jdaggett@3460 6714
jdaggett@1662 6715 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
jdaggett@6176 6716 title=no-historical-ligatures><strong>6.4</strong></a>
jdaggett@1662 6717
jdaggett@8278 6718 <li>none
jdaggett@8278 6719 <ul>
jdaggett@8278 6720 <li>font-kerning, <a href="#font-kerning-none-value" title="none,
jdaggett@8278 6721 font-kerning"><strong>6.3</strong></a>
jdaggett@8278 6722
jdaggett@8278 6723 <li>font-size-adjust, <a href="#font-size-adjust-none-value"
jdaggett@8278 6724 title="none, font-size-adjust"><strong>3.6</strong></a>
jdaggett@8278 6725
jdaggett@8278 6726 <li>font-variant, <a href="#font-variant-none-value" title="none,
jdaggett@8278 6727 font-variant"><strong>6.11</strong></a>
jdaggett@8278 6728
jdaggett@8278 6729 <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
jdaggett@8278 6730 title="none, font-variant-ligatures"><strong>6.4</strong></a>
jdaggett@8278 6731 </ul>
jdaggett@8278 6732
jdaggett@8368 6733 <li>normal
jdaggett@8278 6734 <ul>
jdaggett@8278 6735 <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
jdaggett@8278 6736 title="normal, font-feature-settings"><strong>6.12</strong></a>
jdaggett@8278 6737
jdaggett@8278 6738 <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
jdaggett@8278 6739 font-kerning"><strong>6.3</strong></a>
jdaggett@8278 6740
jdaggett@8278 6741 <li>font-language-override, <a
jdaggett@8278 6742 href="#font-language-override-normal-value" title="normal,
jdaggett@8278 6743 font-language-override"><strong>6.13</strong></a>
jdaggett@8278 6744
jdaggett@8278 6745 <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
jdaggett@8278 6746 font-stretch"><strong>3.3</strong></a>
jdaggett@8278 6747
jdaggett@8278 6748 <li>font-style, <a href="#font-style-normal-value" title="normal,
jdaggett@8278 6749 font-style"><strong>3.4</strong></a>
jdaggett@8278 6750
jdaggett@8278 6751 <li>font-variant, <a href="#font-variant-normal-value" title="normal,
jdaggett@8278 6752 font-variant"><strong>6.11</strong></a>
jdaggett@8278 6753
jdaggett@8278 6754 <li>font-variant-alternates, <a
jdaggett@8278 6755 href="#font-variant-alternates-normal-value" title="normal,
jdaggett@8278 6756 font-variant-alternates"><strong>6.8</strong></a>
jdaggett@8278 6757
jdaggett@8278 6758 <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
jdaggett@8278 6759 title="normal, font-variant-caps"><strong>6.6</strong></a>
jdaggett@8278 6760
jdaggett@8278 6761 <li>font-variant-east-asian, <a
jdaggett@8278 6762 href="#font-variant-east-asian-normal-value" title="normal,
jdaggett@8278 6763 font-variant-east-asian"><strong>6.10</strong></a>
jdaggett@8278 6764
jdaggett@8278 6765 <li>font-variant-ligatures, <a
jdaggett@8278 6766 href="#font-variant-ligatures-normal-value" title="normal,
jdaggett@8278 6767 font-variant-ligatures"><strong>6.4</strong></a>
jdaggett@8278 6768
jdaggett@8278 6769 <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
jdaggett@8278 6770 title="normal, font-variant-numeric"><strong>6.7</strong></a>
jdaggett@8278 6771
jdaggett@8368 6772 <li>font-variant-position, <a href="#font-variant-position-normal-value"
jdaggett@8368 6773 title="normal, font-variant-position"><strong>6.5</strong></a>
jdaggett@8368 6774
jdaggett@8278 6775 <li>font-weight, <a href="#font-weight-normal-value" title="normal,
jdaggett@8278 6776 font-weight"><strong>3.2</strong></a>
jdaggett@8278 6777 </ul>
jdaggett@8278 6778
jdaggett@8278 6779 <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
jdaggett@5809 6780
jdaggett@1662 6781 <li>oldstyle-nums, <a href="#oldstyle-nums"
jdaggett@2118 6782 title=oldstyle-nums><strong>6.7</strong></a>
jdaggett@2118 6783
jdaggett@3638 6784 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
jdaggett@3638 6785
jdaggett@8225 6786 <li>ornaments, <a href="#ornaments"
jdaggett@7060 6787 title=ornaments><strong>6.8</strong></a>
jdaggett@2118 6788
jdaggett@1662 6789 <li>petite-caps, <a href="#petite-caps"
jdaggett@2118 6790 title=petite-caps><strong>6.6</strong></a>
jdaggett@1662 6791
jdaggett@1662 6792 <li>proportional-nums, <a href="#proportional-nums"
jdaggett@2118 6793 title=proportional-nums><strong>6.7</strong></a>
jdaggett@1662 6794
jdaggett@1662 6795 <li>proportional-width, <a href="#proportional-width"
jdaggett@2118 6796 title=proportional-width><strong>6.10</strong></a>
jdaggett@512 6797
jdaggett@7243 6798 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
jdaggett@7103 6799
jdaggett@3638 6800 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
jdaggett@1662 6801
jdaggett@890 6802 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
jdaggett@890 6803 definition of"><strong>#</strong></a>
jdaggett@890 6804
jdaggett@8278 6805 <li>semi-condensed, <a href="#semi-condensed-"
jdaggett@8278 6806 title=semi-condensed><strong>3.3</strong></a>
jdaggett@8278 6807
jdaggett@8278 6808 <li>semi-expanded, <a href="#semi-expanded"
jdaggett@8278 6809 title=semi-expanded><strong>3.3</strong></a>
jdaggett@8278 6810
jdaggett@890 6811 <li>serif, definition of, <a href="#serif0" title="serif, definition
jdaggett@890 6812 of"><strong>#</strong></a>
jdaggett@890 6813
jdaggett@2504 6814 <li>simplified, <a href="#simplified"
jdaggett@2504 6815 title=simplified><strong>6.10</strong></a>
jdaggett@1662 6816
jdaggett@1662 6817 <li>slashed-zero, <a href="#slashed-zero"
jdaggett@2118 6818 title=slashed-zero><strong>6.7</strong></a>
jdaggett@1662 6819
jdaggett@1662 6820 <li>small-caps, <a href="#small-caps"
jdaggett@2118 6821 title=small-caps><strong>6.6</strong></a>
jdaggett@1662 6822
jdaggett@1662 6823 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
jdaggett@1662 6824
jdaggett@1662 6825 <li>stacked-fractions, <a href="#stacked-fractions"
jdaggett@2118 6826 title=stacked-fractions><strong>6.7</strong></a>
jdaggett@2118 6827
jdaggett@7103 6828 <li>style sheet
jdaggett@7103 6829 <ul>
jdaggett@7103 6830 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
jdaggett@7243 6831 conformance class"><strong>#</strong></a>
jdaggett@7103 6832 </ul>
jdaggett@7103 6833
jdaggett@8225 6834 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
jdaggett@8225 6835
jdaggett@8225 6836 <li>stylistic, <a href="#stylistic"
jdaggett@7060 6837 title=stylistic><strong>6.8</strong></a>
jdaggett@7060 6838
jdaggett@8279 6839 <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
jdaggett@8279 6840
jdaggett@8279 6841 <li>super, <a href="#super" title=super><strong>6.5</strong></a>
jdaggett@8279 6842
jdaggett@8397 6843 <li>support, <a href="#support" title=support><strong>5.2</strong></a>
jdaggett@8397 6844
jdaggett@8225 6845 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
jdaggett@1662 6846
jdaggett@8363 6847 <li>system font fallback, <a href="#system-font-fallback" title="system
jdaggett@8363 6848 font fallback"><strong>5.2</strong></a>
jdaggett@8363 6849
jdaggett@1662 6850 <li>tabular-nums, <a href="#tabular-nums"
jdaggett@2118 6851 title=tabular-nums><strong>6.7</strong></a>
jdaggett@1662 6852
jdaggett@1662 6853 <li>titling-caps, <a href="#titling-caps"
jdaggett@2118 6854 title=titling-caps><strong>6.6</strong></a>
jdaggett@1856 6855
jdaggett@2504 6856 <li>traditional, <a href="#traditional"
jdaggett@2504 6857 title=traditional><strong>6.10</strong></a>
jdaggett@2118 6858
jdaggett@8278 6859 <li>ultra-condensed, <a href="#ultra-condensed"
jdaggett@8278 6860 title=ultra-condensed><strong>3.3</strong></a>
jdaggett@8278 6861
jdaggett@8278 6862 <li>ultra-expanded, <a href="#ultra-expanded"
jdaggett@8278 6863 title=ultra-expanded><strong>3.3</strong></a>
jdaggett@8278 6864
jdaggett@2118 6865 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
jdaggett@1662 6866
jdaggett@1662 6867 <li>unicode-range, <a href="#descdef-unicode-range"
jdaggett@890 6868 title=unicode-range><strong>4.5</strong></a>
jdaggett@7311 6869
jdaggett@7311 6870 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
jdaggett@7311 6871
jdaggett@7311 6872 <li>width, <a href="#width" title=width><strong>2</strong></a>
jdaggett@484 6873 </ul>
jdaggett@484 6874 <!--end-index-->
jdaggett@484 6875
jdaggett@484 6876 <h2 class=no-num id=property-index>Property index</h2>
jdaggett@890 6877 <!--begin-properties-->
jdaggett@484 6878
jdaggett@484 6879 <table class=proptable>
jdaggett@484 6880 <thead>
jdaggett@484 6881 <tr>
jdaggett@484 6882 <th>Property
jdaggett@484 6883
jdaggett@484 6884 <th>Values
jdaggett@484 6885
jdaggett@484 6886 <th>Initial
jdaggett@484 6887
jdaggett@1148 6888 <th>Applies to
jdaggett@484 6889
jdaggett@484 6890 <th>Inh.
jdaggett@484 6891
jdaggett@484 6892 <th>Percentages
jdaggett@484 6893
jdaggett@484 6894 <th>Media
jdaggett@484 6895
jdaggett@484 6896 <tbody>
jdaggett@3460 6897 <tr>
jdaggett@3460 6898 <th><a class=property href="#propdef-font">font</a>
jdaggett@484 6899
jdaggett@8225 6900 <td>[ [ &lt;‘font-style’&gt; || &lt;font-variant-css21&gt; ||
jdaggett@8225 6901 &lt;‘font-weight’&gt; || &lt;‘font-stretch’ ]?
jdaggett@8225 6902 &lt;‘font-size’&gt; [ / &lt;‘line-height’&gt; ]?
jdaggett@8225 6903 &lt;‘font-family’&gt; ] | caption | icon | menu | message-box |
jdaggett@7020 6904 small-caption | status-bar
jdaggett@484 6905
jdaggett@484 6906 <td>see individual properties
jdaggett@484 6907
jdaggett@484 6908 <td>all elements
jdaggett@484 6909
jdaggett@484 6910 <td>yes
jdaggett@484 6911
jdaggett@484 6912 <td>see individual properties
jdaggett@484 6913
jdaggett@484 6914 <td>visual
jdaggett@484 6915
jdaggett@3460 6916 <tr>
jdaggett@8278 6917 <th><span class=property>font-family</span>
jdaggett@484 6918
jdaggett@8225 6919 <td>[ &lt;family-name&gt; | &lt;generic-family&gt; ] #
jdaggett@484 6920
jdaggett@484 6921 <td>depends on user agent
jdaggett@484 6922
jdaggett@484 6923 <td>all elements
jdaggett@484 6924
jdaggett@484 6925 <td>yes
jdaggett@484 6926
jdaggett@484 6927 <td>N/A
jdaggett@484 6928
jdaggett@484 6929 <td>visual
jdaggett@484 6930
jdaggett@3460 6931 <tr>
jdaggett@8279 6932 <th><span class=property>font-feature-settings</span>
jdaggett@1662 6933
jdaggett@8225 6934 <td>normal | &lt;feature-tag-value&gt; #
jdaggett@1662 6935
jdaggett@1662 6936 <td>normal
jdaggett@1662 6937
jdaggett@1662 6938 <td>all elements
jdaggett@1662 6939
jdaggett@1662 6940 <td>yes
jdaggett@1662 6941
jdaggett@1662 6942 <td>N/A
jdaggett@1662 6943
jdaggett@1662 6944 <td>visual
jdaggett@1662 6945
jdaggett@3460 6946 <tr>
jdaggett@3460 6947 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
jdaggett@1662 6948
jdaggett@1856 6949 <td>auto | normal | none
jdaggett@1856 6950
jdaggett@1856 6951 <td>auto
jdaggett@1662 6952
jdaggett@1662 6953 <td>all elements
jdaggett@1662 6954
jdaggett@1662 6955 <td>yes
jdaggett@1662 6956
jdaggett@1662 6957 <td>N/A
jdaggett@1662 6958
jdaggett@1662 6959 <td>visual
jdaggett@1662 6960
jdaggett@3460 6961 <tr>
jdaggett@3460 6962 <th><a class=property
jdaggett@1732 6963 href="#propdef-font-language-override">font-language-override</a>
jdaggett@1662 6964
jdaggett@5809 6965 <td>normal | &lt;string&gt;
jdaggett@1662 6966
jdaggett@1662 6967 <td>normal
jdaggett@1662 6968
jdaggett@1662 6969 <td>all elements
jdaggett@1662 6970
jdaggett@1662 6971 <td>yes
jdaggett@1662 6972
jdaggett@1662 6973 <td>N/A
jdaggett@1662 6974
jdaggett@1662 6975 <td>visual
jdaggett@1662 6976
jdaggett@3460 6977 <tr>
jdaggett@3460 6978 <th><a class=property href="#propdef-font-size">font-size</a>
jdaggett@484 6979
jdaggett@8225 6980 <td>&lt;absolute-size&gt; | &lt;relative-size&gt; | &lt;length&gt; |
jdaggett@8225 6981 &lt;percentage&gt;
jdaggett@484 6982
jdaggett@484 6983 <td>medium
jdaggett@484 6984
jdaggett@484 6985 <td>all elements
jdaggett@484 6986
jdaggett@484 6987 <td>yes
jdaggett@484 6988
jdaggett@484 6989 <td>refer to parent element's font size
jdaggett@484 6990
jdaggett@484 6991 <td>visual
jdaggett@484 6992
jdaggett@3460 6993 <tr>
jdaggett@3460 6994 <th><a class=property
jdaggett@1662 6995 href="#propdef-font-size-adjust">font-size-adjust</a>
jdaggett@484 6996
jdaggett@8968 6997 <td>none | &lt;number&gt;
jdaggett@484 6998
jdaggett@484 6999 <td>none
jdaggett@484 7000
jdaggett@484 7001 <td>all elements
jdaggett@484 7002
jdaggett@484 7003 <td>yes
jdaggett@484 7004
jdaggett@554 7005 <td>N/A
jdaggett@484 7006
jdaggett@484 7007 <td>visual
jdaggett@484 7008
jdaggett@3460 7009 <tr>
jdaggett@8278 7010 <th><span class=property>font-stretch</span>
jdaggett@1662 7011
jdaggett@1662 7012 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@1662 7013 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@5809 7014 ultra-expanded
jdaggett@484 7015
jdaggett@484 7016 <td>normal
jdaggett@484 7017
jdaggett@484 7018 <td>all elements
jdaggett@484 7019
jdaggett@484 7020 <td>yes
jdaggett@484 7021
jdaggett@484 7022 <td>N/A
jdaggett@484 7023
jdaggett@484 7024 <td>visual
jdaggett@484 7025
jdaggett@3460 7026 <tr>
jdaggett@8278 7027 <th><span class=property>font-style</span>
jdaggett@484 7028
jdaggett@5809 7029 <td>normal | italic | oblique
jdaggett@484 7030
jdaggett@484 7031 <td>normal
jdaggett@484 7032
jdaggett@484 7033 <td>all elements
jdaggett@484 7034
jdaggett@484 7035 <td>yes
jdaggett@484 7036
jdaggett@484 7037 <td>N/A
jdaggett@484 7038
jdaggett@484 7039 <td>visual
jdaggett@484 7040
jdaggett@3460 7041 <tr>
jdaggett@3460 7042 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
jdaggett@2487 7043
jdaggett@2487 7044 <td>none | [ weight || style ]
jdaggett@2487 7045
jdaggett@2487 7046 <td>weight style
jdaggett@2457 7047
jdaggett@2457 7048 <td>all elements
jdaggett@2457 7049
jdaggett@2457 7050 <td>yes
jdaggett@2457 7051
jdaggett@2457 7052 <td>N/A
jdaggett@2457 7053
jdaggett@2457 7054 <td>visual
jdaggett@2457 7055
jdaggett@3460 7056 <tr>
jdaggett@8278 7057 <th><span class=property>font-variant</span>
jdaggett@1662 7058
jdaggett@6436 7059 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@3460 7060 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@3041 7061 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@8225 7062 || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
jdaggett@8225 7063 character-variant(&lt;feature-value-name&gt; #) ||
jdaggett@5833 7064 swash(&lt;feature-value-name&gt;) ||
jdaggett@3041 7065 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@4545 7066 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@6648 7067 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@2509 7068 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@3638 7069 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@3638 7070 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@3638 7071 ruby ]
jdaggett@484 7072
jdaggett@484 7073 <td>normal
jdaggett@484 7074
jdaggett@484 7075 <td>all elements
jdaggett@484 7076
jdaggett@484 7077 <td>yes
jdaggett@484 7078
jdaggett@7377 7079 <td>see individual properties
jdaggett@484 7080
jdaggett@484 7081 <td>visual
jdaggett@484 7082
jdaggett@3460 7083 <tr>
jdaggett@3460 7084 <th><a class=property
jdaggett@1662 7085 href="#propdef-font-variant-alternates">font-variant-alternates</a>
jdaggett@1662 7086
jdaggett@6176 7087 <td>normal | [ stylistic(&lt;feature-value-name&gt;) || historical-forms
jdaggett@8225 7088 || styleset(&lt;feature-value-name&gt; #) ||
jdaggett@8225 7089 character-variant(&lt;feature-value-name&gt; #) ||
jdaggett@5833 7090 swash(&lt;feature-value-name&gt;) ||
jdaggett@3638 7091 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@3638 7092 annotation(&lt;feature-value-name&gt;) ]
jdaggett@1662 7093
jdaggett@1662 7094 <td>normal
jdaggett@1662 7095
jdaggett@1662 7096 <td>all elements
jdaggett@1662 7097
jdaggett@1662 7098 <td>yes
jdaggett@1662 7099
jdaggett@1662 7100 <td>N/A
jdaggett@1662 7101
jdaggett@1662 7102 <td>visual
jdaggett@1662 7103
jdaggett@3460 7104 <tr>
jdaggett@3460 7105 <th><a class=property
jdaggett@1662 7106 href="#propdef-font-variant-caps">font-variant-caps</a>
jdaggett@1662 7107
jdaggett@5809 7108 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
jdaggett@6648 7109 | unicase | titling-caps
jdaggett@1662 7110
jdaggett@1662 7111 <td>normal
jdaggett@1662 7112
jdaggett@1662 7113 <td>all elements
jdaggett@1662 7114
jdaggett@1662 7115 <td>yes
jdaggett@1662 7116
jdaggett@1662 7117 <td>N/A
jdaggett@1662 7118
jdaggett@1662 7119 <td>visual
jdaggett@1662 7120
jdaggett@3460 7121 <tr>
jdaggett@3460 7122 <th><a class=property
jdaggett@1662 7123 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
jdaggett@1662 7124
jdaggett@5809 7125 <td>normal | [ &lt;east-asian-variant-values&gt; ||
jdaggett@3638 7126 &lt;east-asian-width-values&gt; || ruby ]
jdaggett@1662 7127
jdaggett@1662 7128 <td>normal
jdaggett@1662 7129
jdaggett@1662 7130 <td>all elements
jdaggett@1662 7131
jdaggett@1662 7132 <td>yes
jdaggett@1662 7133
jdaggett@1662 7134 <td>N/A
jdaggett@1662 7135
jdaggett@1662 7136 <td>visual
jdaggett@1662 7137
jdaggett@3460 7138 <tr>
jdaggett@3460 7139 <th><a class=property
jdaggett@1662 7140 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
jdaggett@1662 7141
jdaggett@8225 7142 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@8225 7143 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@8225 7144 &lt;contextual-alt-values&gt; ]
jdaggett@1662 7145
jdaggett@1662 7146 <td>normal
jdaggett@1662 7147
jdaggett@1662 7148 <td>all elements
jdaggett@1662 7149
jdaggett@1662 7150 <td>yes
jdaggett@1662 7151
jdaggett@1662 7152 <td>N/A
jdaggett@1662 7153
jdaggett@1662 7154 <td>visual
jdaggett@1662 7155
jdaggett@3460 7156 <tr>
jdaggett@3460 7157 <th><a class=property
jdaggett@1662 7158 href="#propdef-font-variant-numeric">font-variant-numeric</a>
jdaggett@1662 7159
jdaggett@5809 7160 <td>normal | [ &lt;numeric-figure-values&gt; ||
jdaggett@1732 7161 &lt;numeric-spacing-values&gt; || &lt;numeric-fraction-values&gt; ||
jdaggett@3638 7162 ordinal || slashed-zero ]
jdaggett@1662 7163
jdaggett@1662 7164 <td>normal
jdaggett@1662 7165
jdaggett@1662 7166 <td>all elements
jdaggett@1662 7167
jdaggett@1662 7168 <td>yes
jdaggett@1662 7169
jdaggett@1662 7170 <td>N/A
jdaggett@1662 7171
jdaggett@1662 7172 <td>visual
jdaggett@1662 7173
jdaggett@3460 7174 <tr>
jdaggett@3460 7175 <th><a class=property
jdaggett@3460 7176 href="#propdef-font-variant-position">font-variant-position</a>
jdaggett@3460 7177
jdaggett@3638 7178 <td>normal | sub | super
jdaggett@3460 7179
jdaggett@3460 7180 <td>normal
jdaggett@3460 7181
jdaggett@3460 7182 <td>all elements
jdaggett@3460 7183
jdaggett@3460 7184 <td>yes
jdaggett@3460 7185
jdaggett@3460 7186 <td>N/A
jdaggett@3460 7187
jdaggett@3460 7188 <td>visual
jdaggett@3460 7189
jdaggett@3460 7190 <tr>
jdaggett@8278 7191 <th><span class=property>font-weight</span>
jdaggett@484 7192
jdaggett@484 7193 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
jdaggett@5809 7194 | 700 | 800 | 900
jdaggett@484 7195
jdaggett@484 7196 <td>normal
jdaggett@484 7197
jdaggett@484 7198 <td>all elements
jdaggett@484 7199
jdaggett@484 7200 <td>yes
jdaggett@484 7201
jdaggett@484 7202 <td>N/A
jdaggett@484 7203
jdaggett@484 7204 <td>visual
jdaggett@484 7205 </table>
jdaggett@890 7206 <!--end-properties-->
jdaggett@5596 7207 <!--begin-descriptors-->
jdaggett@5596 7208
jdaggett@5596 7209 <table class=proptable>
jdaggett@5596 7210 <thead>
jdaggett@5596 7211 <tr>
jdaggett@5596 7212 <th>Descriptor
jdaggett@5596 7213
jdaggett@5596 7214 <th>Value
jdaggett@5596 7215
jdaggett@5596 7216 <th>Initial
jdaggett@5596 7217
jdaggett@5596 7218 <th>Percentages
jdaggett@5596 7219
jdaggett@5596 7220 <th>Media
jdaggett@5596 7221
jdaggett@5596 7222 <tbody>
jdaggett@5596 7223 <tr>
jdaggett@8278 7224 <th><span class=property>font-family</span>
jdaggett@5596 7225
jdaggett@8225 7226 <td>&lt;family-name&gt;
jdaggett@5596 7227
jdaggett@5596 7228 <td>N/A
jdaggett@5596 7229
jdaggett@5596 7230 <tr>
jdaggett@8279 7231 <th><span class=property>font-feature-settings</span>
jdaggett@5596 7232
jdaggett@8225 7233 <td>normal | &lt;feature-tag-value&gt; #
jdaggett@5596 7234
jdaggett@5596 7235 <td>normal
jdaggett@5596 7236
jdaggett@5596 7237 <tr>
jdaggett@8278 7238 <th><span class=property>font-stretch</span>
jdaggett@5596 7239
jdaggett@5596 7240 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@5596 7241 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@5596 7242 ultra-expanded
jdaggett@5596 7243
jdaggett@5596 7244 <td>normal
jdaggett@5596 7245
jdaggett@5596 7246 <tr>
jdaggett@8278 7247 <th><span class=property>font-style</span>
jdaggett@5596 7248
jdaggett@5596 7249 <td>normal | italic | oblique
jdaggett@5596 7250
jdaggett@5596 7251 <td>normal
jdaggett@5596 7252
jdaggett@5596 7253 <tr>
jdaggett@8278 7254 <th><span class=property>font-variant</span>
jdaggett@5596 7255
jdaggett@8225 7256 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@5596 7257 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@5596 7258 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@8225 7259 || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
jdaggett@8225 7260 character-variant(&lt;feature-value-name&gt; #) ||
jdaggett@5833 7261 swash(&lt;feature-value-name&gt;) ||
jdaggett@5596 7262 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@5596 7263 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@6648 7264 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@5596 7265 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@5596 7266 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@5596 7267 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@5596 7268 ruby ]
jdaggett@5596 7269
jdaggett@5596 7270 <td>normal
jdaggett@5596 7271
jdaggett@5596 7272 <tr>
jdaggett@8278 7273 <th><span class=property>font-weight</span>
jdaggett@5596 7274
jdaggett@5596 7275 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
jdaggett@5596 7276
jdaggett@5596 7277 <td>normal
jdaggett@5596 7278
jdaggett@5596 7279 <tr>
jdaggett@5596 7280 <th><a class=property href="#descdef-src">src</a>
jdaggett@5596 7281
jdaggett@8225 7282 <td>[ &lt;url> [format(&lt;string> #)]? | &lt;font-face-name&gt; ] #
jdaggett@5596 7283
jdaggett@5596 7284 <td>N/A
jdaggett@5596 7285
jdaggett@5596 7286 <tr>
jdaggett@5596 7287 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
jdaggett@5596 7288
jdaggett@8225 7289 <td>&lt;urange&gt; #
jdaggett@5596 7290
jdaggett@5596 7291 <td>U+0-10FFFF
jdaggett@5596 7292 </table>
jdaggett@5596 7293 <!--end-descriptors-->
jdaggett@6648 7294 <script type="text/javascript">
jdaggett@6648 7295 window.onload = function () {
jdaggett@6648 7296 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
jdaggett@6648 7297 var i, hiresElements = document.getElementsByClassName("hires");
jdaggett@6648 7298 for (i = 0; i < hiresElements.length; i++) {
jdaggett@6648 7299 var h = hiresElements[i];
jdaggett@6648 7300 if (h.tagName != "IMG") continue;
jdaggett@6648 7301 var src = h.getAttribute("src");
jdaggett@6648 7302 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
jdaggett@6648 7303 h.src = src2x;
jdaggett@6648 7304 }
jdaggett@6648 7305 }
jdaggett@6648 7306 </script>
jdaggett@484 7307 </html>
jdaggett@484 7308 <!-- Keep this comment at the end of the file
jdaggett@484 7309 Local variables:
jdaggett@484 7310 mode: sgml
jdaggett@484 7311 sgml-declaration:"~/SGML/HTML4.decl"
jdaggett@484 7312 sgml-default-doctype-name:"html"
jdaggett@484 7313 sgml-minimize-attributes:t
jdaggett@484 7314 sgml-nofill-elements:("pre" "style" "br")
jdaggett@484 7315 sgml-live-element-indicator:t
jdaggett@484 7316 sgml-omittag:nil
jdaggett@484 7317 sgml-shorttag:nil
jdaggett@484 7318 sgml-namecase-general:t
jdaggett@484 7319 sgml-general-insert-case:lower
jdaggett@484 7320 sgml-always-quote-attributes:t
jdaggett@484 7321 sgml-indent-step:nil
jdaggett@484 7322 sgml-indent-data:t
jdaggett@484 7323 sgml-parent-document:nil
jdaggett@484 7324 sgml-exposed-tags:nil
jdaggett@484 7325 sgml-local-catalogs:nil
jdaggett@484 7326 sgml-local-ecat-files:nil
jdaggett@484 7327 End:
jdaggett@484 7328 -->
jdaggett@8277 7329 <!--
jdaggett@1856 7330
jdaggett@1856 7331 to do:
jdaggett@1856 7332
jdaggett@1856 7333 - wording of OpenType family name handling
jdaggett@1856 7334 - handling combining sequences in the font matching algorithm
jdaggett@1856 7335 - fix-up fi ligature example
jdaggett@1856 7336
jdaggett@1856 7337 -->

mercurial