css-fonts/Fonts.html

Tue, 21 May 2013 17:25:57 +0800

author
John Daggett <jdaggett@mozilla.com>
date
Tue, 21 May 2013 17:25:57 +0800
changeset 8213
6fc1fa06eae3
parent 8198
d4d9fa6daec2
child 8225
351f9086c29d
permissions
-rw-r--r--

[css-fonts] first pass on revised description of unicode-range descriptor

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

mercurial