css-fonts/Fonts.html

Fri, 31 May 2013 15:40:35 +0900

author
John Daggett <jdaggett@mozilla.com>
date
Fri, 31 May 2013 15:40:35 +0900
changeset 8313
f7084873c602
parent 8312
4fb97110e8dc
child 8356
46cef6470f58
permissions
-rw-r--r--

[css-fonts] font feature properties copyedits

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

mercurial