css-fonts/Fonts.html

Mon, 26 Aug 2013 16:14:56 +0900

author
John Daggett <jdaggett@mozilla.com>
date
Mon, 26 Aug 2013 16:14:56 +0900
changeset 8930
77d3edf17f8c
parent 8927
9c4ae1da9e9a
child 8957
b3ad55a4d7fc
permissions
-rw-r--r--

[css3-fonts] revise description of font-size-adjust to prevent confusion

jdaggett@484 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
jdaggett@484 2 "http://www.w3.org/TR/html4/strict.dtd">
jdaggett@484 3
jdaggett@484 4 <html lang=en>
jdaggett@484 5 <head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
jdaggett@484 6
jdaggett@1244 7 <title>CSS Fonts Module Level 3</title>
jdaggett@484 8 <!--
jdaggett@484 9 FIXME when publishing: copy the current default.css and link to
jdaggett@484 10 "default.css" rather than "../default.css"
jdaggett@484 11 -->
jdaggett@484 12 <link href="../default.css" rel=stylesheet type="text/css">
jdaggett@8699 13 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
jdaggett@4546 14 <!-- I'm just experimenting here, don't get your bee in a bonnet -->
jdaggett@4546 15 <script src="http://use.typekit.com/xon2bky.js"
jdaggett@4546 16 type="text/javascript"></script>
jdaggett@4546 17 <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
jdaggett@484 18
jdaggett@497 19 <style type="text/css">
jdaggett@4546 20
jdaggett@4547 21 body, th, td, h1, h2, h3, h4, h5, h6 {
jdaggett@4547 22 font-family: "myriad-pro", sans-serif !important;
jdaggett@4547 23 }
jdaggett@8277 24
jdaggett@524 25 body {
jdaggett@524 26 padding: 2em 70px 2em 70px;
jdaggett@524 27 }
jdaggett@4546 28
jdaggett@497 29 p + p, p.mtb {
jdaggett@497 30 margin-top: 0.8em;
jdaggett@497 31 text-indent: 0px;
jdaggett@497 32 }
jdaggett@6651 33
jdaggett@6651 34 #bolderlighter {
jdaggett@6651 35 width: 40%;
jdaggett@6651 36 }
jdaggett@6651 37
jdaggett@6651 38 #bolderlighter th {
jdaggett@6651 39 text-align: center;
jdaggett@6651 40 }
jdaggett@8277 41
jdaggett@7103 42 #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
jdaggett@1244 43 padding-right: 2em;
jdaggett@512 44 text-align: left;
jdaggett@512 45 }
jdaggett@8277 46
jdaggett@518 47 dd {
jdaggett@518 48 margin-bottom: 1em;
jdaggett@514 49 }
jdaggett@8277 50
jdaggett@516 51 #authors dd {
jdaggett@516 52 margin-bottom: 0;
jdaggett@516 53 }
jdaggett@8277 54
jdaggett@531 55 #fontstylematchingalg {
jdaggett@531 56 list-style-type: lower-alpha;
jdaggett@531 57 }
jdaggett@8277 58
jdaggett@531 59 #fontmatchingalg ul, #fontmatchingalg ol {
jdaggett@531 60 margin-top: 0.8em;
jdaggett@531 61 }
jdaggett@8277 62
jdaggett@531 63 #fontmatchingalg li + li {
jdaggett@531 64 margin-top: 0.8em;
jdaggett@531 65 }
jdaggett@8277 66
jdaggett@531 67 div.example {
jdaggett@531 68 padding: 1em;
jdaggett@531 69 margin-top: 1em;
jdaggett@531 70 }
jdaggett@531 71
jdaggett@531 72 div.example + div.example {
jdaggett@531 73 margin-top: 2em;
jdaggett@531 74 }
jdaggett@8277 75
jdaggett@531 76 div.figure {
jdaggett@531 77 page-break-inside: avoid;
jdaggett@531 78 }
jdaggett@1244 79
jdaggett@1662 80 pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
jdaggett@8277 81
jdaggett@8277 82 div.featex {
jdaggett@1662 83 width: 700px;
jdaggett@1662 84 }
jdaggett@8277 85
jdaggett@1662 86 div.featex img {
jdaggett@1662 87 margin: auto;
jdaggett@1662 88 display: block;
jdaggett@1662 89 }
jdaggett@6436 90
jdaggett@6436 91 span.tag {
jdaggett@6436 92 font-family: monospace;
jdaggett@6436 93 font-size: 120%;
jdaggett@6436 94 }
jdaggett@6648 95
jdaggett@6701 96 ol ol {
jdaggett@6701 97 list-style-type: lower-alpha;
jdaggett@6701 98 }
jdaggett@7060 99
jdaggett@7060 100 .idl-code {
jdaggett@7060 101 font-weight: bold;
jdaggett@7060 102 color: #c50;
jdaggett@7060 103 }
jdaggett@497 104 </style>
jdaggett@2556 105 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
jdaggett@2556 106 type="text/css">
peter@8369 107 <script defer=defer
jdaggett@8385 108 src="http://test.csswg.org/harness/annotate.js#CSS3-FONTS_DEV"
jdaggett@8385 109 type="text/javascript"></script>
jdaggett@497 110
jdaggett@484 111 <body>
jdaggett@484 112 <div class=head> <!--begin-logo-->
jdaggett@484 113 <p><a href="http://www.w3.org/"><img alt=W3C height=48
jdaggett@890 114 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
jdaggett@890 115
jdaggett@901 116 <h1>CSS Fonts Module Level 3</h1>
jdaggett@901 117
jdaggett@8927 118 <h2 class="no-num no-toc" id=editors-draft-26-august-2013>Editor's Draft
jdaggett@8927 119 26 August 2013</h2>
jdaggett@484 120
jdaggett@516 121 <dl id=authors>
jdaggett@484 122 <dt>This version:
jdaggett@484 123
jdaggett@484 124 <dd><a
jdaggett@8699 125 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
jdaggett@8927 126 <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css-fonts-3-20130826/">http://www.w3.org/TR/2013/ED-css-fonts-3-20130826/</a> -->
jdaggett@8699 127
jdaggett@484 128
jdaggett@484 129 <dt>Latest version:
jdaggett@484 130
jdaggett@484 131 <dd><a
jdaggett@8699 132 href="http://www.w3.org/TR/css-fonts-3/">http://www.w3.org/TR/css-fonts-3/</a>
jdaggett@484 133
jdaggett@890 134 <dt>Latest editor's draft:
jdaggett@890 135
jdaggett@890 136 <dd><a
jdaggett@8031 137 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
jdaggett@7488 138 (<a
jdaggett@8031 139 href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
jdaggett@7488 140 log</a>)
jdaggett@890 141
jdaggett@4624 142 <dt>Previous version:
jdaggett@890 143
jdaggett@890 144 <dd><a
jdaggett@8699 145 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/</a>
jdaggett@4624 146
jdaggett@4624 147 <dt>Issues List:
jdaggett@4624 148
jdaggett@4624 149 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
jdaggett@4624 150 issues in Tracker</a>
jdaggett@2556 151
jdaggett@2556 152 <dd><a
jdaggett@6648 153 href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Fonts&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">CSS3
jdaggett@4624 154 Fonts issues in Bugzilla</a>
jdaggett@4624 155
jdaggett@8031 156 <dt>Discussion:
jdaggett@8031 157
jdaggett@8031 158 <dd><a
jdaggett@8031 159 href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
jdaggett@8031 160 with subject line “<kbd>[css-fonts] <var>… message topic
jdaggett@8031 161 …</var></kbd>” (<a
jdaggett@8031 162 href="http://lists.w3.org/Archives/Public/www-style/"
jdaggett@8031 163 rel=discussion>archives</a>)
jdaggett@890 164
jdaggett@890 165 <dt>Editor:
jdaggett@484 166
jdaggett@497 167 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
jdaggett@484 168 </dl>
jdaggett@484 169 <!--begin-copyright-->
jdaggett@484 170 <p class=copyright><a
jdaggett@484 171 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
jdaggett@7179 172 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
jdaggett@5530 173 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
jdaggett@5530 174 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
jdaggett@5530 175 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
jdaggett@1662 176 title="European Research Consortium for Informatics and
jdaggett@7244 177 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
jdaggett@7244 178 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
jdaggett@7244 179 <a
jdaggett@484 180 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
jdaggett@484 181 <a
jdaggett@484 182 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
jdaggett@484 183 and <a
jdaggett@484 184 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
jdaggett@484 185 use</a> rules apply.</p>
jdaggett@484 186 <!--end-copyright-->
jdaggett@484 187 <hr title="Separator for header">
jdaggett@484 188 </div>
jdaggett@525 189
jdaggett@484 190 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
jdaggett@484 191
jdaggett@890 192 <p>This CSS3 module describes how font properties are specified and how
jdaggett@890 193 font resources are loaded dynamically. The contents of this specification
jdaggett@1244 194 are a consolidation of content previously divided into <a
jdaggett@3538 195 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
jdaggett@3538 196 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
jdaggett@7521 197 Web Fonts</a> modules. The description of font load events was moved into
jdaggett@8646 198 the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
jdaggett@8646 199 Events</a> module.
jdaggett@484 200
jdaggett@484 201 <h2 class="no-num no-toc" id=status>Status of this document</h2>
jdaggett@484 202 <!--begin-status-->
jdaggett@484 203
jdaggett@484 204 <p>This is a public copy of the editors' draft. It is provided for
jdaggett@484 205 discussion only and may change at any moment. Its publication here does
jdaggett@484 206 not imply endorsement of its contents by W3C. Don't cite this document
jdaggett@484 207 other than as work in progress.
jdaggett@484 208
jdaggett@484 209 <p>The (<a
jdaggett@484 210 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
jdaggett@1662 211 mailing list <a
jdaggett@1662 212 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
jdaggett@1662 213 www-style@w3.org</a> (see <a
jdaggett@1662 214 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
jdaggett@1662 215 discussion of this specification. When sending e-mail, please put the text
jdaggett@1662 216 “css3-fonts” in the subject, preferably like this:
jdaggett@1148 217 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
jdaggett@484 218
jdaggett@8031 219 <p>This document was produced by the <a
jdaggett@8031 220 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
jdaggett@8031 221 the <a href="http://www.w3.org/Style/">Style Activity</a>).
jdaggett@484 222
jdaggett@484 223 <p>This document was produced by a group operating under the <a
jdaggett@8031 224 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
jdaggett@8031 225 2004 W3C Patent Policy</a>. W3C maintains a <a
jdaggett@8031 226 href="http://www.w3.org/2004/01/pp-impl/32061/status"
jdaggett@484 227 rel=disclosure>public list of any patent disclosures</a> made in
jdaggett@484 228 connection with the deliverables of the group; that page also includes
jdaggett@484 229 instructions for disclosing a patent. An individual who has actual
jdaggett@484 230 knowledge of a patent which the individual believes contains <a
jdaggett@8031 231 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
jdaggett@484 232 Claim(s)</a> must disclose the information in accordance with <a
jdaggett@8031 233 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
jdaggett@8031 234 6 of the W3C Patent Policy</a>.</p>
jdaggett@484 235 <!--end-status-->
jdaggett@8385 236
jdaggett@8385 237 <h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
jdaggett@8385 238
jdaggett@8385 239 <p>The following features are at risk and may be removed when exiting CR:
jdaggett@8385 240
jdaggett@8385 241 <ul>
jdaggett@8386 242 <li>fallback handling for text decoration in superscript/subscript variant
jdaggett@8385 243 glyphs (‘<a href="#propdef-font-variant-position"><code
jdaggett@8385 244 class=property>font-variant-position</code></a>’)
jdaggett@8385 245
jdaggett@8385 246 <li>‘<a href="#propdef-font-language-override"><code
jdaggett@8385 247 class=property>font-language-override</code></a>’ property
jdaggett@8385 248 </ul>
jdaggett@8699 249 <!--
jdaggett@8699 250 <p>This draft is a <strong>Last Call Working Draft</strong>.
jdaggett@8699 251 Please send comments to the
jdaggett@8699 252 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style mailing list</a>
jdaggett@8699 253 as described above. The <strong>deadline for comments</strong>
jdaggett@8699 254 is six weeks after the date of publication in the header, 22 August 2013.</p>
jdaggett@8699 255 -->
jdaggett@2472 256
jdaggett@484 257 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
jdaggett@484 258 <!--begin-toc-->
jdaggett@484 259
jdaggett@484 260 <ul class=toc>
jdaggett@890 261 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
jdaggett@890 262
jdaggett@1244 263 <li><a href="#typography-background"><span class=secno>2 </span>Typography
jdaggett@545 264 Background</a>
jdaggett@545 265
jdaggett@6699 266 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
jdaggett@6699 267 Properties</a>
jdaggett@484 268 <ul class=toc>
jdaggett@1662 269 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
jdaggett@1662 270 family: the font-family property</a>
jdaggett@514 271 <ul class=toc>
jdaggett@1244 272 <li><a href="#generic-font-families"><span class=secno>3.1.1
jdaggett@1244 273 </span>Generic font families</a>
jdaggett@514 274 </ul>
jdaggett@484 275
jdaggett@1662 276 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
jdaggett@1662 277 weight: the font-weight property</a>
jdaggett@1662 278
jdaggett@1662 279 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
jdaggett@1662 280 width: the font-stretch property</a>
jdaggett@1662 281
jdaggett@1662 282 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
jdaggett@1662 283 the font-style property</a>
jdaggett@1662 284
jdaggett@1662 285 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
jdaggett@1662 286 the font-size property</a>
jdaggett@1662 287
jdaggett@1662 288 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
jdaggett@1662 289 </span>Relative sizing: the font-size-adjust property</a>
jdaggett@1662 290
jdaggett@1662 291 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
jdaggett@1662 292 property: the font property</a>
jdaggett@2457 293
jdaggett@2487 294 <li><a href="#font-synthesis-prop"><span class=secno>3.8
jdaggett@2487 295 </span>Controlling synthetic faces: the font-synthesis property</a>
jdaggett@484 296 </ul>
jdaggett@484 297
jdaggett@890 298 <li><a href="#font-resources"><span class=secno>4 </span>Font
jdaggett@6699 299 Resources</a>
jdaggett@512 300 <ul class=toc>
jdaggett@1662 301 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
jdaggett@7096 302 <code>@font-face</code> rule</a>
jdaggett@1244 303
jdaggett@1662 304 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
jdaggett@1662 305 family: the font-family descriptor</a>
jdaggett@1662 306
jdaggett@1662 307 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
jdaggett@1662 308 src descriptor</a>
jdaggett@1662 309
jdaggett@1662 310 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
jdaggett@1662 311 descriptors: the font-style, font-weight, font-stretch descriptors</a>
jdaggett@1662 312
jdaggett@1662 313 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
jdaggett@1662 314 range: the unicode-range descriptor</a>
jdaggett@1662 315
jdaggett@8225 316 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
jdaggett@8225 317 character ranges to define composite fonts</a>
jdaggett@8225 318
jdaggett@8225 319 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
jdaggett@1732 320 features: the font-variant and font-feature-settings descriptors</a>
jdaggett@2563 321
jdaggett@8225 322 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
jdaggett@2563 323 loading guidelines</a>
jdaggett@2737 324
jdaggett@8863 325 <li><a href="#font-fetching-requirements"><span class=secno>4.9
jdaggett@8863 326 </span>Font fetching requirements</a>
jdaggett@512 327 </ul>
jdaggett@484 328
jdaggett@1244 329 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
jdaggett@6699 330 Matching Algorithm</a>
jdaggett@2457 331 <ul class=toc>
jdaggett@7309 332 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
jdaggett@7309 333 sensitivity of font family names</a>
jdaggett@7309 334
jdaggett@7309 335 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
jdaggett@2457 336 font styles</a>
jdaggett@2457 337
jdaggett@7309 338 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
jdaggett@6701 339 matching</a>
jdaggett@6701 340
jdaggett@7309 341 <li><a href="#char-handling-issues"><span class=secno>5.4
jdaggett@2457 342 </span>Character handling issues</a>
jdaggett@2509 343
jdaggett@7309 344 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
jdaggett@2509 345 matching changes since CSS 2.1</a>
jdaggett@6701 346
jdaggett@7309 347 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
jdaggett@6701 348 matching examples</a>
jdaggett@2457 349 </ul>
jdaggett@1244 350
jdaggett@6699 351 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
jdaggett@6699 352 Properties</a>
jdaggett@1662 353 <ul class=toc>
jdaggett@1856 354 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
jdaggett@1856 355 </span>Glyph selection and positioning</a>
jdaggett@1856 356
jdaggett@1856 357 <li><a href="#language-specific-support"><span class=secno>6.2
jdaggett@1856 358 </span>Language-specific display</a>
jdaggett@1856 359
jdaggett@1856 360 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
jdaggett@1662 361 the font-kerning property</a>
jdaggett@1662 362
jdaggett@6176 363 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
jdaggett@6176 364 </span>Ligatures: the font-variant-ligatures property</a>
jdaggett@6176 365
jdaggett@6176 366 <li><a href="#font-variant-position-prop"><span class=secno>6.5
jdaggett@3638 367 </span>Subscript and superscript forms: the font-variant-position
jdaggett@3638 368 property</a>
jdaggett@1856 369
jdaggett@2118 370 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
jdaggett@2118 371 </span>Capitalization: the font-variant-caps property</a>
jdaggett@2118 372
jdaggett@2118 373 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
jdaggett@2118 374 </span>Numerical formatting: the font-variant-numeric property</a>
jdaggett@2118 375
jdaggett@2118 376 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
jdaggett@1662 377 </span>Alternates and swashes: the font-variant-alternates property</a>
jdaggett@1662 378
jdaggett@1662 379
jdaggett@2472 380 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
jdaggett@7096 381 font specific alternates: the <code>@font-feature-values</code>
jdaggett@7096 382 rule</a>
jdaggett@8356 383 <ul class=toc>
jdaggett@8356 384 <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
jdaggett@8356 385 syntax</a>
jdaggett@8356 386
jdaggett@8356 387 <li><a href="#multi-valued-feature-value-definitions"><span
jdaggett@8356 388 class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
jdaggett@8356 389 </ul>
jdaggett@2118 390
jdaggett@2118 391 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
jdaggett@1662 392 </span>East Asian text rendering: the font-variant-east-asian
jdaggett@1662 393 property</a>
jdaggett@1662 394
jdaggett@2118 395 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
jdaggett@1662 396 shorthand for font rendering: the font-variant property</a>
jdaggett@1662 397
jdaggett@2118 398 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
jdaggett@2509 399 </span>Low-level font feature settings control: the
jdaggett@2509 400 font-feature-settings property</a>
jdaggett@1662 401
jdaggett@2118 402 <li><a href="#font-language-override-prop"><span class=secno>6.13
jdaggett@1732 403 </span>Font language override: the font-language-override property</a>
jdaggett@1662 404 </ul>
jdaggett@1662 405
jdaggett@6176 406 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
jdaggett@6699 407 Feature Resolution </a>
jdaggett@6699 408 <ul class=toc>
jdaggett@6699 409 <li><a href="#default-features"><span class=secno>7.1 </span>Default
jdaggett@6699 410 features</a>
jdaggett@6699 411
jdaggett@6699 412 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
jdaggett@6699 413 precedence</a>
jdaggett@6699 414
jdaggett@6699 415 <li><a href="#feature-precedence-examples"><span class=secno>7.3
jdaggett@6699 416 </span>Feature precedence examples</a>
jdaggett@6699 417 </ul>
jdaggett@6699 418
jdaggett@7021 419 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
jdaggett@7021 420 <ul class=toc>
jdaggett@7021 421 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
jdaggett@7021 422 <code>CSSFontFaceRule</code> interface</a>
jdaggett@7021 423
jdaggett@7021 424 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
jdaggett@7021 425 <code>CSSFontFeatureValuesRule</code> interface</a>
jdaggett@7021 426 </ul>
jdaggett@7021 427
jdaggett@2737 428 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
jdaggett@1662 429 platform font properties to CSS properties</a>
jdaggett@1662 430
jdaggett@2472 431 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
jdaggett@2472 432 <ul class=toc>
jdaggett@8699 433 <li class=no-num><a href="#recent-changes"> Changes from the July 2013
jdaggett@8699 434 CSS3 Fonts Last Call Working Draft</a>
jdaggett@2472 435 </ul>
jdaggett@2472 436
jdaggett@529 437 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
jdaggett@529 438
jdaggett@7242 439 <li class=no-num><a href="#conformance"> Conformance</a>
jdaggett@7242 440 <ul class=toc>
jdaggett@7242 441 <li class=no-num><a href="#conventions"> Document Conventions</a>
jdaggett@7242 442
jdaggett@7242 443 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
jdaggett@7242 444
jdaggett@7242 445
jdaggett@7242 446 <li class=no-num><a href="#partial"> Partial Implementations</a>
jdaggett@7242 447
jdaggett@7242 448 <li class=no-num><a href="#experimental"> Experimental
jdaggett@7242 449 Implementations</a>
jdaggett@7242 450
jdaggett@7242 451 <li class=no-num><a href="#testing"> Non-Experimental
jdaggett@7242 452 Implementations</a>
jdaggett@7242 453 </ul>
jdaggett@7242 454
jdaggett@484 455 <li class=no-num><a href="#references">References</a>
jdaggett@484 456 <ul class=toc>
jdaggett@1662 457 <li class=no-num><a href="#normative-references">Normative
jdaggett@1662 458 References</a>
jdaggett@1662 459
jdaggett@1662 460 <li class=no-num><a href="#other-references">Other References</a>
jdaggett@484 461 </ul>
jdaggett@484 462
jdaggett@484 463 <li class=no-num><a href="#index">Index</a>
jdaggett@484 464
jdaggett@484 465 <li class=no-num><a href="#property-index">Property index</a>
jdaggett@484 466 </ul>
jdaggett@484 467 <!--end-toc-->
jdaggett@484 468
jdaggett@890 469 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
jdaggett@545 470
jdaggett@1148 471 <p>A font provides a resource containing the visual representation of
jdaggett@1662 472 characters. At the simplest level it contains information that maps
jdaggett@1662 473 character codes to shapes (called glyphs) that represent these characters.
jdaggett@1662 474 Fonts sharing a common design style are commonly grouped into font
jdaggett@1662 475 families classified by a set of standard font properties. Within a family,
jdaggett@1662 476 the shape displayed for a given character can vary by stroke weight, slant
jdaggett@7311 477 or relative width, among others. An individual font face is described by a
jdaggett@1662 478 unique combination of these properties. For a given range of text, CSS
jdaggett@1662 479 font properties are used to select a font family and a specific font face
jdaggett@1662 480 within that family to be used when rendering that text. As a simple
jdaggett@1662 481 example, to use the bold form of Helvetica one could use:
jdaggett@1148 482
jdaggett@8277 483 <pre>body {
jdaggett@8277 484 font-family: Helvetica;
jdaggett@8277 485 font-weight: bold;
jdaggett@1148 486 }</pre>
jdaggett@1148 487
jdaggett@7311 488 <p>Font resources may be installed locally on the system on which a user
jdaggett@7311 489 agent is running or downloadable. For local font resources descriptive
jdaggett@1148 490 information can be obtained directly from the font resource. For
jdaggett@1148 491 downloadable font resources (sometimes referred to as web fonts), the
jdaggett@1148 492 descriptive information is included with the reference to the font
jdaggett@1148 493 resource.
jdaggett@1148 494
jdaggett@1148 495 <p>Families of fonts typically don't contain a single face for each
jdaggett@1148 496 possible variation of font properties. The CSS font selection mechanism
jdaggett@7311 497 describes how to match a given set of CSS font properties to a single font
jdaggett@1148 498 face.
jdaggett@890 499
jdaggett@1244 500 <h2 id=typography-background><span class=secno>2 </span>Typography
jdaggett@1244 501 Background</h2>
jdaggett@890 502
jdaggett@7311 503 <p><em>This section is non-normative.</em>
jdaggett@7311 504
jdaggett@7311 505 <p> Typographic traditions vary across the globe, so there is no unique way
jdaggett@890 506 to classify all fonts across languages and cultures. For even common Latin
jdaggett@890 507 letters, wide variations are possible:
jdaggett@497 508
jdaggett@1150 509 <div class=figure><img alt="variations in glyphs for a single character"
jdaggett@1150 510 src=aaaaaa.png>
jdaggett@890 511 <p class=caption>One character, many glyph variations
jdaggett@498 512 </div>
jdaggett@497 513
jdaggett@497 514 <p>Differences in the anatomy of letterforms is one way to distinguish
jdaggett@497 515 fonts. For Latin fonts, flourishes at the ends of a character's main
jdaggett@497 516 strokes, or serifs, can distinguish a font from those without. Similar
jdaggett@534 517 comparisons exist in non-Latin fonts between fonts with tapered strokes
jdaggett@534 518 and those using primarily uniform strokes:
jdaggett@497 519
jdaggett@1150 520 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
jdaggett@890 521 <p class=caption>Letterforms with and without serifs
jdaggett@534 522 </div>
jdaggett@534 523
jdaggett@1150 524 <div class=figure><img alt="serif vs. non-serifs for japanese"
jdaggett@1150 525 src=minchovsgothic.png>
jdaggett@890 526 <p class=caption>Similar groupings for Japanese typefaces
jdaggett@498 527 </div>
jdaggett@497 528
jdaggett@497 529 <p>Fonts contain letterforms and the data needed to map characters to these
jdaggett@7311 530 letterforms. Often this may be a simple one-to-one mapping, but more
jdaggett@497 531 complex mappings are also possible. The use of combining diacritic marks
jdaggett@497 532 creates many variations for an underlying letterform:
jdaggett@497 533
jdaggett@1150 534 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
jdaggett@890 535 <p class=caption>Variations with diacritic marks
jdaggett@498 536 </div>
jdaggett@525 537
jdaggett@497 538 <p>A sequence of characters can be represented by a single glyph known as a
jdaggett@497 539 ligature:
jdaggett@497 540
jdaggett@1150 541 <div class=figure><img alt="example of a fi ligature"
jdaggett@1150 542 src=final-ligature.png>
jdaggett@890 543 <p class=caption>Ligature example
jdaggett@498 544 </div>
jdaggett@497 545
jdaggett@7311 546 <p>Visual transformations based on textual context are often stylistic
jdaggett@7311 547 option in European languages. They are required to correctly render
jdaggett@7311 548 languages like Arabic, the lam and alef characters below <em>must</em> be
jdaggett@7311 549 combined when they exist in sequence:
jdaggett@497 550
jdaggett@1150 551 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
jdaggett@890 552 <p class=caption>Required Arabic ligature
jdaggett@498 553 </div>
jdaggett@497 554
jdaggett@498 555 <p>The relative complexity of these shaping transformations requires
jdaggett@498 556 additional data within the font.
jdaggett@497 557
jdaggett@497 558 <p>Sets of font faces with various stylistic variations are often grouped
jdaggett@512 559 together into font families. In the simplest case a regular face is
jdaggett@7311 560 supplemented with bold and italic faces, but much more extensive groupings
jdaggett@7311 561 are possible. Variations in the thickness of letterform strokes, the <dfn
jdaggett@7311 562 id=weight>weight</dfn>, and the overall proportions of the letterform, the
jdaggett@7311 563 <dfn id=width>width</dfn>, are most common. In the example below, each
jdaggett@7311 564 letter uses a different font face within the Univers font family. The
jdaggett@7311 565 width used increases from top to bottom and the weight increases from left
jdaggett@7311 566 to right:
jdaggett@497 567
jdaggett@1150 568 <div class=figure><img alt="various width and weight variations within a
jdaggett@1150 569 single family" src=weightwidthvariations.png>
jdaggett@890 570 <p class=caption>Weight and width variations within a single font family
jdaggett@498 571 </div>
jdaggett@497 572
jdaggett@545 573 <p>Creating fonts that support multiple scripts is a difficult task;
jdaggett@1148 574 designers need to understand the cultural traditions surrounding the use
jdaggett@1148 575 of type in different scripts and come up with letterforms that somehow
jdaggett@1148 576 share a common theme. Many languages often share a common script and each
jdaggett@7311 577 of these languages may have noticeable stylistic differences. For example,
jdaggett@7311 578 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
jdaggett@7311 579 many languages, not just Russian.
jdaggett@518 580
jdaggett@8225 581 <p>The <a href="#character-map"><em>character map</em></a> of a font
jdaggett@8225 582 defines the mapping of characters to glyphs for that font. If a document
jdaggett@8225 583 contains characters not supported by the <a href="#character-map"><em
jdaggett@8225 584 title="character map">character maps</em></a> of the fonts contained in a
jdaggett@8363 585 font family list, a user agent may use a <a
jdaggett@8363 586 href="#system-font-fallback"><em>system font fallback</em></a> procedure
jdaggett@8363 587 to locate an appropriate font that does. If no appropriate font can be
jdaggett@8363 588 found, some form of "missing glyph" character will be rendered by the user
jdaggett@8363 589 agent. System fallback can occur when the specified list of font families
jdaggett@8363 590 does not include a font that supports a given character.
jdaggett@8225 591
jdaggett@8225 592 <p>Although the <a href="#character-map"><em>character map</em></a> of a
jdaggett@8225 593 font maps a given character to a glyph for that character, modern font
jdaggett@8225 594 technologies such as OpenType and AAT (Apple Advanced Typography) provide
jdaggett@8225 595 ways of mapping a character to different glyphs based upon feature
jdaggett@8225 596 settings. Fonts in these formats allow these features to be embedded in
jdaggett@8225 597 the font itself and controlled by applications. Common typographic
jdaggett@8225 598 features which can be specified this way include ligatures, swashes,
jdaggett@8225 599 contextual alternates, proportional and tabular figures, and automatic
jdaggett@8225 600 fractions, to list just a few. For a visual overview of OpenType features,
jdaggett@8225 601 see the <a href="#OPENTYPE-FONT-GUIDE"
jdaggett@6659 602 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
jdaggett@1662 603
jdaggett@6699 604 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
jdaggett@512 605
jdaggett@512 606 <p>The particular font face used to render a character is determined by the
jdaggett@515 607 font family and other font properties that apply to a given element. This
jdaggett@515 608 structure allows settings to be varied independent of each other.</p>
jdaggett@512 609 <!-- prop: font-family -->
jdaggett@484 610
jdaggett@1662 611 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
jdaggett@1662 612 href="#propdef-font-family">font-family</a> property</h3>
jdaggett@1662 613
jdaggett@8225 614 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
jdaggett@484 615 <tbody>
jdaggett@484 616 <tr>
jdaggett@484 617 <td>Name:
jdaggett@484 618
jdaggett@8278 619 <td><dfn id=propdef-font-family
jdaggett@8278 620 title="font-family!!property">font-family</dfn>
jdaggett@484 621
jdaggett@484 622 <tr>
jdaggett@484 623 <td>Value:
jdaggett@484 624
jdaggett@8225 625 <td>[ <a href="#family-name-value"><var>&lt;family-name&gt;</var></a> |
jdaggett@8225 626 <a href="#generic-family-value"><var>&lt;generic-family&gt;</var></a> ]
jdaggett@8225 627 #
jdaggett@484 628
jdaggett@484 629 <tr>
jdaggett@484 630 <td>Initial:
jdaggett@484 631
jdaggett@484 632 <td>depends on user agent
jdaggett@484 633
jdaggett@484 634 <tr>
jdaggett@484 635 <td>Applies to:
jdaggett@484 636
jdaggett@484 637 <td>all elements
jdaggett@484 638
jdaggett@484 639 <tr>
jdaggett@484 640 <td>Inherited:
jdaggett@484 641
jdaggett@484 642 <td>yes
jdaggett@484 643
jdaggett@484 644 <tr>
jdaggett@484 645 <td>Percentages:
jdaggett@484 646
jdaggett@484 647 <td>N/A
jdaggett@484 648
jdaggett@484 649 <tr>
jdaggett@484 650 <td>Media:
jdaggett@484 651
jdaggett@484 652 <td>visual
jdaggett@484 653
jdaggett@484 654 <tr>
jdaggett@1148 655 <td>Computed value:
jdaggett@484 656
jdaggett@484 657 <td>as specified
jdaggett@7377 658
jdaggett@7377 659 <tr>
jdaggett@7377 660 <td>Animatable:
jdaggett@7377 661
jdaggett@7377 662 <td>no
jdaggett@484 663 </table>
jdaggett@484 664
jdaggett@514 665 <p>This property specifies a prioritized list of font family names or
jdaggett@6694 666 generic family names. A font family defines a set of faces that vary in
jdaggett@6694 667 weight, width or slope. CSS uses the combination of a family name with
jdaggett@6694 668 other style attributes to select an individual face. Using this selection
jdaggett@6694 669 mechanism, rather than selecting a face via the style name as is often
jdaggett@6694 670 done in design applications, allows some degree of regularity in textual
jdaggett@6694 671 display when fallback occurs.
jdaggett@6694 672
jdaggett@6694 673 <p class=note>Designers should note that the CSS definition of font
jdaggett@6694 674 attributes used for selection are explicitly not intended to define a font
jdaggett@6694 675 taxonomy. A type designer's idea of a family may often extend to a set of
jdaggett@6694 676 faces that vary along axes other than just the standard axes of weight,
jdaggett@6694 677 width and slope. A family may extend to include both a set of serif faces
jdaggett@6694 678 and a set of sans-serif faces or vary along axes that are unique to that
jdaggett@6694 679 family. The CSS font selection mechanism merely provides a way to
jdaggett@6694 680 determine the “closest” substitute when substitution is necessary.
jdaggett@6694 681
jdaggett@6694 682 <p>Unlike other CSS properties, component values are a comma-separated list
jdaggett@6694 683 indicating alternatives. A user agent iterates through the list of family
jdaggett@6694 684 names until it matches an available font that contains a glyph for the
jdaggett@6694 685 character to be rendered. This allows for differences in available fonts
jdaggett@6694 686 across platforms and for differences in the range of characters supported
jdaggett@6694 687 by individual fonts.
jdaggett@514 688
jdaggett@514 689 <p>A font family name only specifies a name given to a set of font faces,
jdaggett@8177 690 it does not specify an individual face. For example, given the
jdaggett@8177 691 availability of the fonts below, Futura would match but Futura Medium
jdaggett@8177 692 would not:
jdaggett@514 693
jdaggett@1150 694 <div class=figure><img alt="family and face names"
jdaggett@1150 695 src=familyvsfacename.png>
jdaggett@890 696 <p class=caption>Family and individual face names
jdaggett@514 697 </div>
jdaggett@514 698
jdaggett@514 699 <p>Consider the example below:
jdaggett@512 700
jdaggett@512 701 <div class=example>
jdaggett@8277 702 <pre>body {
jdaggett@8277 703 font-family: Helvetica, Verdana, sans-serif;
jdaggett@514 704 }</pre>
jdaggett@1758 705
jdaggett@1758 706 <p>If Helvetica is available it will be used when rendering. If neither
jdaggett@1758 707 Helvetica nor Verdana is present, then the user-agent-defined sans serif
jdaggett@1758 708 font will be used.</p>
jdaggett@512 709 </div>
jdaggett@512 710
jdaggett@514 711 <p>There are two types of font family names:
jdaggett@512 712
jdaggett@512 713 <dl>
jdaggett@8225 714 <dt><dfn id=family-name-value><var>&lt;family-name&gt;</var></dfn>
jdaggett@514 715
jdaggett@514 716 <dd>The name of a font family of choice such as Helvetica or Verdana in
jdaggett@2457 717 the previous example.
jdaggett@514 718
jdaggett@8225 719 <dt><dfn id=generic-family-value><var>&lt;generic-family&gt;</var></dfn>
jdaggett@514 720
jdaggett@4624 721 <dd> The following generic family keywords are defined: ‘<a
jdaggett@4624 722 href="#serif"><code class=property>serif</code></a>’, ‘<a
jdaggett@4624 723 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
jdaggett@4624 724 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
jdaggett@4624 725 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
jdaggett@4624 726 href="#monospace"><code class=property>monospace</code></a>’. These
jdaggett@1148 727 keywords can be used as a general fallback mechanism when an author's
jdaggett@1758 728 desired font choices are not available. As keywords, they must not be
jdaggett@1148 729 quoted. Authors are encouraged to append a generic font family as a last
jdaggett@1148 730 alternative for improved robustness.
jdaggett@512 731 </dl>
jdaggett@512 732
jdaggett@8272 733 <p>Font family names other than generic families must either be given
jdaggett@8272 734 quoted as <a
jdaggett@8699 735 href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or
jdaggett@8699 736 unquoted as a sequence of one or more <a
bert@8683 737 href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
jdaggett@2457 738 This means most punctuation characters and digits at the start of each
jdaggett@2457 739 token must be escaped in unquoted font family names.
jdaggett@2457 740
jdaggett@7377 741 <p>To illustrate this, the following declarations are invalid:
jdaggett@2457 742
jdaggett@2457 743 <pre>
jdaggett@2457 744 font-family: Red/Black, sans-serif;
jdaggett@2457 745 font-family: "Lucida" Grande, sans-serif;
jdaggett@2457 746 font-family: Ahem!, sans-serif;
jdaggett@2457 747 font-family: test@foo, sans-serif;
jdaggett@2457 748 font-family: #POUND, sans-serif;
jdaggett@2457 749 font-family: Hawaii 5-0, sans-serif;
jdaggett@2457 750 </pre>
jdaggett@2457 751
jdaggett@2457 752 <p>If a sequence of identifiers is given as a font family name, the
jdaggett@2457 753 computed value is the name converted to a string by joining all the
jdaggett@2457 754 identifiers in the sequence by single spaces.
jdaggett@2457 755
jdaggett@2457 756 <p>To avoid mistakes in escaping, it is recommended to quote font family
jdaggett@2457 757 names that contain white space, digits, or punctuation characters other
jdaggett@2457 758 than hyphens:
jdaggett@2457 759
jdaggett@2457 760 <pre>
jdaggett@2457 761 body { font-family: "New Century Schoolbook", serif }
jdaggett@2457 762
jdaggett@2457 763 &lt;BODY STYLE="font-family: '21st Century', fantasy">
jdaggett@2457 764 </pre>
jdaggett@2457 765
jdaggett@2457 766 <p>Font family <em>names</em> that happen to be the same as a keyword value
jdaggett@4624 767 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
jdaggett@4624 768 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
jdaggett@4624 769 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
jdaggett@4624 770 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
jdaggett@4624 771 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
jdaggett@4624 772 class=property>cursive</code></a>’) must be quoted to prevent confusion
jdaggett@2457 773 with the keywords with the same names. The keywords ‘<code
jdaggett@2457 774 class=property>initial</code>’ and ‘<code
jdaggett@2457 775 class=property>default</code>’ are reserved for future use and must also
jdaggett@2457 776 be quoted when used as font names. UAs must not consider these keywords as
jdaggett@8225 777 matching the <a
jdaggett@8225 778 href="#family-name-value"><var>&lt;family-name&gt;</var></a> type.
jdaggett@2457 779
jdaggett@6694 780 <p>The precise way a set of fonts are grouped into font families varies
jdaggett@6694 781 depending upon the platform font management API's. The Windows GDI API
jdaggett@6694 782 only allows four faces to be grouped into a family while the DirectWrite
jdaggett@6694 783 API and API's on OSX and other platforms support font families with a
jdaggett@6695 784 variety of weights, widths and slopes (see <a
jdaggett@6694 785 href="#platform-props-to-css">Appendix A</a> for more details).
jdaggett@6694 786
jdaggett@2457 787 <p>Some font formats allow fonts to carry multiple localizations of the
jdaggett@2457 788 family name. User agents must recognize and correctly match all of these
jdaggett@2457 789 names independent of the underlying platform localization, system API used
jdaggett@2457 790 or document encoding:
jdaggett@2457 791
jdaggett@2457 792 <div class=figure><img alt="examples of localized family names"
jdaggett@2457 793 src=localizedfamilynames.png>
jdaggett@2457 794 <p class=caption>Localized family names
jdaggett@2457 795 </div>
jdaggett@2457 796
jdaggett@1244 797 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
jdaggett@1244 798 families</h4>
jdaggett@514 799
jdaggett@518 800 <p>All five generic font families are defined to exist in all CSS
jdaggett@518 801 implementations (they need not necessarily map to five distinct actual
jdaggett@518 802 fonts). User agents should provide reasonable default choices for the
jdaggett@518 803 generic font families, which express the characteristics of each family as
jdaggett@518 804 well as possible within the limits allowed by the underlying technology.
jdaggett@518 805 User agents are encouraged to allow users to select alternative choices
jdaggett@514 806 for the generic fonts.
jdaggett@514 807
jdaggett@890 808 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
jdaggett@890 809 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
jdaggett@514 810
jdaggett@8178 811 <p>Serif fonts represent the formal text style for a script. This often
jdaggett@8178 812 means but is not limited to glyphs that have finishing strokes, flared or
jdaggett@8178 813 tapering ends, or have actual serifed endings (including slab serifs).
jdaggett@8178 814 Serif fonts are typically proportionately-spaced. They often display a
jdaggett@8178 815 greater variation between thick and thin strokes than fonts from the ‘<a
jdaggett@8178 816 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
jdaggett@8178 817 font family. CSS uses the term ‘<a href="#serif"><code
jdaggett@8178 818 class=property>serif</code></a>’ to apply to a font for any script,
jdaggett@8178 819 although other names may be more familiar for particular scripts, such as
jdaggett@8178 820 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
jdaggett@8178 821 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
jdaggett@8178 822 class=property>serif</code></a>’ more due to its typographic role rather
jdaggett@8178 823 than its actual design style. Any font that is so described may be used to
jdaggett@4624 824 represent the generic ‘<a href="#serif"><code
jdaggett@4624 825 class=property>serif</code></a>’ family.
jdaggett@514 826
jdaggett@1150 827 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
jdaggett@890 828 <p class=caption>Sample serif fonts
jdaggett@514 829 </div>
jdaggett@514 830
jdaggett@890 831 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
jdaggett@890 832 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
jdaggett@890 833 id=sans-serif>sans-serif</dfn></a></span></h5>
jdaggett@514 834
jdaggett@8178 835 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
jdaggett@8178 836 low contrast (vertical and horizontal stems have the close to the same
jdaggett@8178 837 thickness) and have stroke endings that are plain -- without any flaring,
jdaggett@8178 838 cross stroke, or other ornamentation. Sans-serif fonts are typically
jdaggett@8178 839 proportionately-spaced. They often have little variation between thick and
jdaggett@8178 840 thin strokes, compared to fonts from the ‘<a href="#serif"><code
jdaggett@4624 841 class=property>serif</code></a>’ family. CSS uses the term ‘<a
jdaggett@4624 842 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
jdaggett@4624 843 to a font for any script, although other names may be more familiar for
jdaggett@3041 844 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
jdaggett@1148 845 (Korean). Any font that is so described may be used to represent the
jdaggett@4624 846 generic ‘<a href="#sans-serif"><code
jdaggett@4624 847 class=property>sans-serif</code></a>’ family.
jdaggett@518 848
jdaggett@1150 849 <div class=figure><img alt="sample sans-serif fonts"
jdaggett@1150 850 src=sansserifexamples.png>
jdaggett@890 851 <p class=caption>Sample sans-serif fonts
jdaggett@514 852 </div>
jdaggett@514 853
jdaggett@890 854 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
jdaggett@545 855 title="cursive, definition of"> <a name=cursive-def><dfn
jdaggett@890 856 id=cursive>cursive</dfn></a></span></h5>
jdaggett@545 857
jdaggett@8178 858 <p>Glyphs in cursive fonts generally use a more informal script style, and
jdaggett@8178 859 the result looks more like handwritten pen or brush writing than printed
jdaggett@8178 860 letterwork. CSS uses the term ‘<a href="#cursive"><code
jdaggett@8178 861 class=property>cursive</code></a>’ to apply to a font for any script,
jdaggett@8178 862 although other names such as Chancery, Brush, Swing and Script are also
jdaggett@8178 863 used in font names.
jdaggett@514 864
jdaggett@1150 865 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
jdaggett@890 866 <p class=caption>Sample cursive fonts
jdaggett@514 867 </div>
jdaggett@514 868
jdaggett@890 869 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
jdaggett@545 870 title="fantasy, definition of"> <a name=fantasy-def><dfn
jdaggett@890 871 id=fantasy>fantasy</dfn></a></span></h5>
jdaggett@514 872
jdaggett@8178 873 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
jdaggett@8178 874 playful representations of characters. These do not include Pi or Picture
jdaggett@8178 875 fonts which do not represent actual characters.
jdaggett@514 876
jdaggett@1150 877 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
jdaggett@890 878 <p class=caption>Sample fantasy fonts
jdaggett@514 879 </div>
jdaggett@514 880
jdaggett@890 881 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
jdaggett@545 882 title="monospace, definition of"> <a name=monospace-def><dfn
jdaggett@890 883 id=monospace>monospace</dfn></a></span></h5>
jdaggett@514 884
jdaggett@514 885 <p>The sole criterion of a monospace font is that all glyphs have the same
jdaggett@518 886 fixed width. This is often used to render samples of computer code.
jdaggett@514 887
jdaggett@1150 888 <div class=figure><img alt="sample monospace fonts"
jdaggett@1150 889 src=monospaceexamples.png>
jdaggett@890 890 <p class=caption>Sample monospace fonts
jdaggett@514 891 </div>
jdaggett@512 892 <!-- prop: font-weight -->
jdaggett@512 893
jdaggett@1662 894 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
jdaggett@1662 895 href="#propdef-font-weight">font-weight</a> property</h3>
jdaggett@1662 896
jdaggett@4624 897 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
jdaggett@484 898 <tbody>
jdaggett@484 899 <tr>
jdaggett@484 900 <td>Name:
jdaggett@484 901
jdaggett@8278 902 <td><dfn id=propdef-font-weight
jdaggett@8278 903 title="font-weight!!property">font-weight</dfn>
jdaggett@484 904
jdaggett@484 905 <tr>
jdaggett@484 906 <td>Value:
jdaggett@484 907
jdaggett@8278 908 <td><a href="#font-weight-normal-value"
jdaggett@8278 909 title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
jdaggett@8278 910 href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
jdaggett@8278 911 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 912 values">100</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 913 title="100...900 weight values">200</a> | <a
jdaggett@8278 914 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 915 values">300</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 916 title="100...900 weight values">400</a> | <a
jdaggett@8278 917 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 918 values">500</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 919 title="100...900 weight values">600</a> | <a
jdaggett@8278 920 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 921 values">700</a> | <a href="#font-weight-numeric-values"
jdaggett@8278 922 title="100...900 weight values">800</a> | <a
jdaggett@8278 923 href="#font-weight-numeric-values" title="100...900 weight
jdaggett@8278 924 values">900</a>
jdaggett@484 925
jdaggett@484 926 <tr>
jdaggett@484 927 <td>Initial:
jdaggett@484 928
jdaggett@484 929 <td>normal
jdaggett@484 930
jdaggett@484 931 <tr>
jdaggett@484 932 <td>Applies to:
jdaggett@484 933
jdaggett@484 934 <td>all elements
jdaggett@484 935
jdaggett@484 936 <tr>
jdaggett@484 937 <td>Inherited:
jdaggett@484 938
jdaggett@484 939 <td>yes
jdaggett@484 940
jdaggett@484 941 <tr>
jdaggett@484 942 <td>Percentages:
jdaggett@484 943
jdaggett@484 944 <td>N/A
jdaggett@484 945
jdaggett@484 946 <tr>
jdaggett@484 947 <td>Media:
jdaggett@484 948
jdaggett@484 949 <td>visual
jdaggett@484 950
jdaggett@484 951 <tr>
jdaggett@1148 952 <td>Computed value:
jdaggett@484 953
jdaggett@8177 954 <td>numeric weight value (see description)
jdaggett@7377 955
jdaggett@7377 956 <tr>
jdaggett@7377 957 <td>Animatable:
jdaggett@7377 958
jdaggett@7377 959 <td>as <a
jdaggett@7377 960 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
jdaggett@7377 961 weight</a>
jdaggett@484 962 </table>
jdaggett@484 963
jdaggett@8278 964 <p>The <a href="#propdef-font-weight"
jdaggett@8278 965 title="font-weight!!property">‘<code
jdaggett@8278 966 class=property>font-weight</code>’</a> property specifies the weight of
jdaggett@8278 967 glyphs in the font, their degree of blackness or stroke thickness.
jdaggett@531 968
jdaggett@531 969 <p>Values have the following meanings:
jdaggett@512 970
jdaggett@512 971 <dl>
jdaggett@8278 972 <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
jdaggett@8278 973 to 900</dfn>
jdaggett@512 974
jdaggett@512 975 <dd>These values form an ordered sequence, where each number indicates a
jdaggett@514 976 weight that is at least as dark as its predecessor. These roughly
jdaggett@514 977 correspond to the commonly used weight names below:
jdaggett@512 978 </dl>
jdaggett@512 979
jdaggett@512 980 <ul>
jdaggett@512 981 <li>100 - Thin
jdaggett@512 982
jdaggett@518 983 <li>200 - Extra Light (Ultra Light)
jdaggett@512 984
jdaggett@512 985 <li>300 - Light
jdaggett@512 986
jdaggett@512 987 <li>400 - Normal
jdaggett@512 988
jdaggett@512 989 <li>500 - Medium
jdaggett@512 990
jdaggett@518 991 <li>600 - Semi Bold (Demi Bold)
jdaggett@512 992
jdaggett@512 993 <li>700 - Bold
jdaggett@512 994
jdaggett@518 995 <li>800 - Extra Bold (Ultra Bold)
jdaggett@512 996
jdaggett@512 997 <li>900 - Black (Heavy)
jdaggett@512 998 </ul>
jdaggett@512 999
jdaggett@512 1000 <dl>
jdaggett@8278 1001 <dt><dfn id=font-weight-normal-value
jdaggett@8278 1002 title="normal!!font-weight">normal</dfn>
jdaggett@512 1003
jdaggett@1148 1004 <dd>Same as ‘<code class=css>400</code>’.
jdaggett@512 1005
jdaggett@8278 1006 <dt><dfn id=bold>bold</dfn>
jdaggett@512 1007
jdaggett@1148 1008 <dd>Same as ‘<code class=css>700</code>’.
jdaggett@512 1009
jdaggett@8278 1010 <dt><dfn id=bolder>bolder</dfn>
jdaggett@512 1011
jdaggett@8177 1012 <dd>Specifies a bolder weight than the inherited value.
jdaggett@512 1013
jdaggett@8278 1014 <dt><dfn id=lighter>lighter</dfn>
jdaggett@512 1015
jdaggett@8177 1016 <dd>Specifies a lighter weight than the inherited value.
jdaggett@512 1017 </dl>
jdaggett@512 1018
jdaggett@8177 1019 <p>Font formats that use a scale other than a nine-step scale should map
jdaggett@531 1020 their scale onto the CSS scale so that 400 roughly corresponds with a face
jdaggett@531 1021 that would be labeled as Regular, Book, Roman and 700 roughly matches a
jdaggett@531 1022 face that would be labeled as Bold. Or weights may be inferred from the
jdaggett@531 1023 style names, ones that correspond roughly with the scale above. The scale
jdaggett@1662 1024 is relative, so a face with a larger weight value must never appear
jdaggett@1148 1025 lighter. If style names are used to infer weights, care should be taken to
jdaggett@1148 1026 handle variations in style names across locales.
jdaggett@531 1027
jdaggett@531 1028 <p>Quite often there are only a few weights available for a particular font
jdaggett@534 1029 family. When a weight is specified for which no face exists, a face with a
jdaggett@534 1030 nearby weight is used. In general, bold weights map to faces with heavier
jdaggett@1269 1031 weights and light weights map to faces with lighter weights (see the <a
jdaggett@1269 1032 href="#font-matching-algorithm">font matching section below</a> for a
jdaggett@1269 1033 precise definition). The examples here illustrate which face is used for
jdaggett@1269 1034 different weights, grey indicates a face for that weight does not exist so
jdaggett@1269 1035 a face with a nearby weight is used:
jdaggett@532 1036
jdaggett@1150 1037 <div class=figure><img alt="weight mappings for a family with 400, 700 and
jdaggett@1150 1038 900 weights" src=optimaweights.png>
jdaggett@532 1039 <p class=caption>Weight mappings for a font family with 400, 700 and 900
jdaggett@890 1040 weight faces
jdaggett@518 1041 </div>
jdaggett@518 1042
jdaggett@1150 1043 <div class=figure><img alt="weight mappings for a family with 300, 600
jdaggett@1150 1044 weights" src=hiraginoweights.png>
jdaggett@532 1045 <p class=caption>Weight mappings for a font family with 300 and 600 weight
jdaggett@890 1046 faces
jdaggett@531 1047 </div>
jdaggett@518 1048
jdaggett@2487 1049 <p>Although the practice is not well-loved by typographers, bold faces are
jdaggett@2487 1050 often synthesized by user agents for faces that lack actual bold faces.
jdaggett@2487 1051 For the purposes of style matching, these faces must be treated as if they
jdaggett@8177 1052 exist within the family. Authors can explicitly avoid this behavior by
jdaggett@8177 1053 using the ‘<a href="#propdef-font-synthesis"><code
jdaggett@8177 1054 class=property>font-synthesis</code></a>’ property.
jdaggett@8177 1055
jdaggett@8278 1056 <p>Specified values of ‘<a href="#bolder"><code
jdaggett@8278 1057 class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
jdaggett@8278 1058 class=property>lighter</code></a>’ indicate weights relative to the
jdaggett@8177 1059 weight of the parent element. The computed weight is calculated based on
jdaggett@8278 1060 the inherited <a href="#propdef-font-weight"
jdaggett@8278 1061 title="font-weight!!property">‘<code
jdaggett@8278 1062 class=property>font-weight</code>’</a> value using the chart below.
jdaggett@1148 1063
jdaggett@6651 1064 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
jdaggett@1148 1065 <thead>
jdaggett@1148 1066 <tr>
jdaggett@6651 1067 <th>Inherited value
jdaggett@6651 1068
jdaggett@6651 1069 <th>bolder
jdaggett@6651 1070
jdaggett@6651 1071 <th>lighter
jdaggett@1148 1072
jdaggett@1148 1073 <tbody>
jdaggett@1148 1074 <tr>
jdaggett@1244 1075 <th>100
jdaggett@1148 1076
jdaggett@1148 1077 <td>400
jdaggett@1148 1078
jdaggett@1148 1079 <td>100
jdaggett@1148 1080
jdaggett@1148 1081 <tr>
jdaggett@1244 1082 <th>200
jdaggett@1148 1083
jdaggett@1148 1084 <td>400
jdaggett@1148 1085
jdaggett@1148 1086 <td>100
jdaggett@1148 1087
jdaggett@1148 1088 <tr>
jdaggett@1244 1089 <th>300
jdaggett@1148 1090
jdaggett@1148 1091 <td>400
jdaggett@1148 1092
jdaggett@1148 1093 <td>100
jdaggett@1148 1094
jdaggett@1148 1095 <tr>
jdaggett@1244 1096 <th>400
jdaggett@1148 1097
jdaggett@1148 1098 <td>700
jdaggett@1148 1099
jdaggett@1148 1100 <td>100
jdaggett@1148 1101
jdaggett@1148 1102 <tr>
jdaggett@1244 1103 <th>500
jdaggett@1148 1104
jdaggett@1148 1105 <td>700
jdaggett@1148 1106
jdaggett@1148 1107 <td>100
jdaggett@1148 1108
jdaggett@1148 1109 <tr>
jdaggett@1244 1110 <th>600
jdaggett@1148 1111
jdaggett@1148 1112 <td>900
jdaggett@1148 1113
jdaggett@1148 1114 <td>400
jdaggett@1148 1115
jdaggett@1148 1116 <tr>
jdaggett@1244 1117 <th>700
jdaggett@1148 1118
jdaggett@1148 1119 <td>900
jdaggett@1148 1120
jdaggett@1148 1121 <td>400
jdaggett@1148 1122
jdaggett@1148 1123 <tr>
jdaggett@1244 1124 <th>800
jdaggett@1148 1125
jdaggett@1148 1126 <td>900
jdaggett@1148 1127
jdaggett@1148 1128 <td>700
jdaggett@1148 1129
jdaggett@1148 1130 <tr>
jdaggett@1244 1131 <th>900
jdaggett@1148 1132
jdaggett@1148 1133 <td>900
jdaggett@1148 1134
jdaggett@1148 1135 <td>700
jdaggett@1148 1136 </table>
jdaggett@1148 1137
jdaggett@1148 1138 <p>The table above is equivalent to selecting the next relative bolder or
jdaggett@1148 1139 lighter face, given a font family containing normal and bold faces along
jdaggett@1148 1140 with a thin and a heavy face. Authors who desire finer control over the
jdaggett@8177 1141 exact weight values used for a given element may use numerical values
jdaggett@1148 1142 instead of relative weights.</p>
jdaggett@512 1143 <!-- prop: font-stretch -->
jdaggett@512 1144
jdaggett@1662 1145 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
jdaggett@1662 1146 href="#propdef-font-stretch">font-stretch</a> property</h3>
jdaggett@1662 1147
jdaggett@8278 1148 <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
jdaggett@484 1149 <tbody>
jdaggett@484 1150 <tr>
jdaggett@484 1151 <td>Name:
jdaggett@484 1152
jdaggett@8278 1153 <td><dfn id=propdef-font-stretch
jdaggett@8278 1154 title="font-stretch!!property">font-stretch</dfn>
jdaggett@484 1155
jdaggett@484 1156 <tr>
jdaggett@484 1157 <td>Value:
jdaggett@484 1158
jdaggett@8278 1159 <td> <a href="#font-stretch-normal-value"
jdaggett@8278 1160 title="normal!!font-stretch">normal</a> | <a
jdaggett@8278 1161 href="#ultra-condensed">ultra-condensed</a> | <a
jdaggett@8278 1162 href="#extra-condensed">extra-condensed</a> | <a
jdaggett@8278 1163 href="#condensed">condensed</a> | <a
jdaggett@8278 1164 href="#semi-condensed-">semi-condensed</a> | <a
jdaggett@8278 1165 href="#semi-expanded">semi-expanded</a> | <a
jdaggett@8278 1166 href="#expanded">expanded</a> | <a
jdaggett@8278 1167 href="#extra-expanded">extra-expanded</a> | <a
jdaggett@8278 1168 href="#ultra-expanded">ultra-expanded</a>
jdaggett@484 1169
jdaggett@484 1170 <tr>
jdaggett@484 1171 <td>Initial:
jdaggett@484 1172
jdaggett@484 1173 <td>normal
jdaggett@484 1174
jdaggett@484 1175 <tr>
jdaggett@484 1176 <td>Applies to:
jdaggett@484 1177
jdaggett@484 1178 <td>all elements
jdaggett@484 1179
jdaggett@484 1180 <tr>
jdaggett@484 1181 <td>Inherited:
jdaggett@484 1182
jdaggett@484 1183 <td>yes
jdaggett@484 1184
jdaggett@484 1185 <tr>
jdaggett@484 1186 <td>Percentages:
jdaggett@484 1187
jdaggett@484 1188 <td>N/A
jdaggett@484 1189
jdaggett@484 1190 <tr>
jdaggett@484 1191 <td>Media:
jdaggett@484 1192
jdaggett@484 1193 <td>visual
jdaggett@484 1194
jdaggett@484 1195 <tr>
jdaggett@1148 1196 <td>Computed value:
jdaggett@484 1197
jdaggett@484 1198 <td>as specified
jdaggett@7377 1199
jdaggett@7377 1200 <tr>
jdaggett@7377 1201 <td>Animatable:
jdaggett@7377 1202
jdaggett@7377 1203 <td>as <a href="#font-stretch-animation">font stretch</a>
jdaggett@484 1204 </table>
jdaggett@484 1205
jdaggett@8278 1206 <p>The <a href="#propdef-font-stretch"
jdaggett@8278 1207 title="font-stretch!!property">‘<code
jdaggett@8278 1208 class=property>font-stretch</code>’</a> property selects a normal,
jdaggett@8278 1209 condensed, or expanded face from a font family. Absolute keyword values
jdaggett@8278 1210 have the following ordering, from narrowest to widest:
jdaggett@512 1211
jdaggett@512 1212 <ul>
jdaggett@8278 1213 <li><dfn id=ultra-condensed>ultra-condensed</dfn>
jdaggett@8278 1214
jdaggett@8278 1215 <li><dfn id=extra-condensed>extra-condensed</dfn>
jdaggett@8278 1216
jdaggett@8278 1217 <li><dfn id=condensed>condensed</dfn>
jdaggett@8278 1218
jdaggett@8278 1219 <li><dfn id=semi-condensed->semi-condensed </dfn>
jdaggett@8278 1220
jdaggett@8278 1221 <li><dfn id=font-stretch-normal-value
jdaggett@8278 1222 title="normal!!font-stretch">normal</dfn>
jdaggett@8278 1223
jdaggett@8278 1224 <li><dfn id=semi-expanded>semi-expanded</dfn>
jdaggett@8278 1225
jdaggett@8278 1226 <li><dfn id=expanded>expanded</dfn>
jdaggett@8278 1227
jdaggett@8278 1228 <li><dfn id=extra-expanded>extra-expanded</dfn>
jdaggett@8278 1229
jdaggett@8278 1230 <li><dfn id=ultra-expanded>ultra-expanded</dfn>
jdaggett@512 1231 </ul>
jdaggett@512 1232
jdaggett@8197 1233 <p>When a face does not exist for a given width, normal or condensed values
jdaggett@8197 1234 map to a narrower face, otherwise a wider face. Conversely, expanded
jdaggett@8197 1235 values map to a wider face, otherwise a narrower face. The figure below
jdaggett@8197 1236 shows how the nine font-stretch property settings affect font selection
jdaggett@8197 1237 for font family containing a variety of widths, grey indicates a width for
jdaggett@8197 1238 which no face exists and a different width is substituted:
jdaggett@1148 1239
jdaggett@1150 1240 <div class=figure><img alt="width mappings for a family with condensed,
jdaggett@1150 1241 normal and expanded faces" src=universwidths.png>
jdaggett@1148 1242 <p class=caption>Width mappings for a font family with condensed, normal
jdaggett@1148 1243 and expanded width faces
jdaggett@1148 1244 </div>
jdaggett@7377 1245
jdaggett@7377 1246 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
jdaggett@7377 1247 interpolated in discrete steps. The interpolation happens as though the
jdaggett@7377 1248 ordered values are equally spaced real numbers. The interpolation result
jdaggett@7377 1249 is rounded to the nearest value, with values exactly halfway between two
jdaggett@7377 1250 values rounded towards the later value in the list above.</p>
jdaggett@512 1251 <!-- prop: font-style -->
jdaggett@512 1252
jdaggett@1662 1253 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
jdaggett@1662 1254 href="#propdef-font-style">font-style</a> property</h3>
jdaggett@1662 1255
jdaggett@4624 1256 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
jdaggett@484 1257 <tbody>
jdaggett@484 1258 <tr>
jdaggett@484 1259 <td>Name:
jdaggett@484 1260
jdaggett@8278 1261 <td><dfn id=propdef-font-style
jdaggett@8278 1262 title="font-style!!property">font-style</dfn>
jdaggett@484 1263
jdaggett@484 1264 <tr>
jdaggett@484 1265 <td>Value:
jdaggett@484 1266
jdaggett@8278 1267 <td><a href="#font-style-normal-value"
jdaggett@8278 1268 title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
jdaggett@8278 1269 <a href="#oblique">oblique</a>
jdaggett@484 1270
jdaggett@484 1271 <tr>
jdaggett@484 1272 <td>Initial:
jdaggett@484 1273
jdaggett@484 1274 <td>normal
jdaggett@484 1275
jdaggett@484 1276 <tr>
jdaggett@484 1277 <td>Applies to:
jdaggett@484 1278
jdaggett@484 1279 <td>all elements
jdaggett@484 1280
jdaggett@484 1281 <tr>
jdaggett@484 1282 <td>Inherited:
jdaggett@484 1283
jdaggett@484 1284 <td>yes
jdaggett@484 1285
jdaggett@484 1286 <tr>
jdaggett@484 1287 <td>Percentages:
jdaggett@484 1288
jdaggett@484 1289 <td>N/A
jdaggett@484 1290
jdaggett@484 1291 <tr>
jdaggett@484 1292 <td>Media:
jdaggett@484 1293
jdaggett@484 1294 <td>visual
jdaggett@484 1295
jdaggett@484 1296 <tr>
jdaggett@1148 1297 <td>Computed value:
jdaggett@484 1298
jdaggett@484 1299 <td>as specified
jdaggett@7377 1300
jdaggett@7377 1301 <tr>
jdaggett@7377 1302 <td>Animatable:
jdaggett@7377 1303
jdaggett@7377 1304 <td>no
jdaggett@484 1305 </table>
jdaggett@484 1306
jdaggett@8278 1307 <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
jdaggett@8278 1308 class=property>font-style</code>’</a> property allows italic or oblique
jdaggett@8278 1309 faces to be selected. Italic forms are generally cursive in nature while
jdaggett@8278 1310 oblique faces are typically sloped versions of the regular face. Oblique
jdaggett@8278 1311 faces can be simulated by artificially sloping the glyphs of the regular
jdaggett@8278 1312 face. Compare the artificially sloped renderings of Palatino ‘<code
jdaggett@2556 1313 class=property>a</code>’ and Baskerville ‘<code
jdaggett@1148 1314 class=property>N</code>’ in grey with the actual italic versions:
jdaggett@518 1315
jdaggett@1150 1316 <div class=figure><img alt="artificial sloping vs. real italics"
jdaggett@1150 1317 src=realvsfakeitalics.png>
jdaggett@890 1318 <p class=caption>Artificial sloping versus real italics
jdaggett@512 1319 </div>
jdaggett@518 1320
jdaggett@8278 1321 <p>Values have the following meanings:
jdaggett@8278 1322
jdaggett@8278 1323 <dl>
jdaggett@8278 1324 <dt><dfn id=font-style-normal-value
jdaggett@8278 1325 title="normal!!font-style">normal</dfn>
jdaggett@8278 1326
jdaggett@8278 1327 <dd>selects a face that is classified as a normal face, one that is
jdaggett@8278 1328 neither italic or obliqued
jdaggett@8278 1329
jdaggett@8278 1330 <dt><dfn id=italic>italic</dfn>
jdaggett@8278 1331
jdaggett@8278 1332 <dd>selects a font that is labeled as an italic face, or an oblique face
jdaggett@8278 1333 if one is not
jdaggett@8278 1334
jdaggett@8278 1335 <dt><dfn id=oblique>oblique</dfn>
jdaggett@8278 1336
jdaggett@8278 1337 <dd>selects a font that is labeled as an oblique face, or an italic face
jdaggett@8278 1338 if one is not
jdaggett@8278 1339 </dl>
jdaggett@8278 1340
jdaggett@8278 1341 <p>If no italic or oblique face is available, oblique faces can be
jdaggett@8363 1342 synthesized by rendering non-obliqued faces with an artificial obliquing
jdaggett@8363 1343 operation. The use of these artificially obliqued faces can be disabled
jdaggett@8363 1344 using the ‘<a href="#propdef-font-synthesis"><code
jdaggett@8363 1345 class=property>font-synthesis</code></a>’ property. The details of the
jdaggett@8363 1346 obliquing operation are not explicitly defined.</p>
jdaggett@8363 1347 <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
jdaggett@518 1348
jdaggett@518 1349 <p>Many scripts lack the tradition of mixing a cursive form within text
jdaggett@518 1350 rendered with a normal face. Chinese, Japanese and Korean fonts almost
jdaggett@518 1351 always lack italic or oblique faces. Fonts that support a mixture of
jdaggett@518 1352 scripts will sometimes omit specific scripts such as Arabic from the set
jdaggett@518 1353 of glyphs supported in the italic face. User agents should be careful
jdaggett@8225 1354 about making <a href="#character-map"><em>character map</em></a>
jdaggett@8363 1355 assumptions across faces when implementing support for <a
jdaggett@8363 1356 href="#system-font-fallback"><em>system font fallback</em></a>.</p>
jdaggett@1662 1357 <!-- prop: font-size -->
jdaggett@1662 1358
jdaggett@1662 1359 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
jdaggett@1662 1360 href="#propdef-font-size">font-size</a> property</h3>
jdaggett@1662 1361
jdaggett@8225 1362 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
jdaggett@484 1363 <tbody>
jdaggett@484 1364 <tr>
jdaggett@484 1365 <td>Name:
jdaggett@484 1366
jdaggett@1662 1367 <td><dfn id=propdef-font-size>font-size</dfn>
jdaggett@484 1368
jdaggett@484 1369 <tr>
jdaggett@484 1370 <td>Value:
jdaggett@484 1371
jdaggett@8225 1372 <td><a href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a>
jdaggett@8225 1373 | <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a> |
jdaggett@8225 1374 <a href="#length-size-value"><var>&lt;length&gt;</var></a> | <a
jdaggett@8225 1375 href="#percentage-size-value"><var>&lt;percentage&gt;</var></a>
jdaggett@484 1376
jdaggett@484 1377 <tr>
jdaggett@484 1378 <td>Initial:
jdaggett@484 1379
jdaggett@484 1380 <td>medium
jdaggett@484 1381
jdaggett@484 1382 <tr>
jdaggett@484 1383 <td>Applies to:
jdaggett@484 1384
jdaggett@484 1385 <td>all elements
jdaggett@484 1386
jdaggett@484 1387 <tr>
jdaggett@484 1388 <td>Inherited:
jdaggett@484 1389
jdaggett@484 1390 <td>yes
jdaggett@484 1391
jdaggett@484 1392 <tr>
jdaggett@484 1393 <td>Percentages:
jdaggett@484 1394
jdaggett@484 1395 <td>refer to parent element's font size
jdaggett@484 1396
jdaggett@484 1397 <tr>
jdaggett@484 1398 <td>Media:
jdaggett@484 1399
jdaggett@484 1400 <td>visual
jdaggett@484 1401
jdaggett@484 1402 <tr>
jdaggett@1148 1403 <td>Computed value:
jdaggett@484 1404
jdaggett@484 1405 <td>absolute length
jdaggett@7377 1406
jdaggett@7377 1407 <tr>
jdaggett@7377 1408 <td>Animatable:
jdaggett@7377 1409
jdaggett@7377 1410 <td>as <a
jdaggett@7377 1411 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
jdaggett@484 1412 </table>
jdaggett@484 1413
jdaggett@512 1414 <p>This property indicates the desired height of glyphs from the font. For
jdaggett@512 1415 scalable fonts, the font-size is a scale factor applied to the EM unit of
jdaggett@512 1416 the font. (Note that certain glyphs may bleed outside their EM box.) For
jdaggett@512 1417 non-scalable fonts, the font-size is converted into absolute units and
jdaggett@512 1418 matched against the declared font-size of the font, using the same
jdaggett@512 1419 absolute coordinate space for both of the matched values. Values have the
jdaggett@512 1420 following meanings:
jdaggett@512 1421
jdaggett@512 1422 <dl>
jdaggett@8225 1423 <dt><dfn id=absolute-size-value><var>&lt;absolute-size&gt;</var></dfn>
jdaggett@8225 1424
jdaggett@8225 1425 <dd> An <a
jdaggett@8225 1426 href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a> keyword
jdaggett@8225 1427 refers to an entry in a table of font sizes computed and kept by the user
jdaggett@8225 1428 agent. Possible values are:
jdaggett@512 1429 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
jdaggett@512 1430
jdaggett@8225 1431 <dt><dfn id=relative-size-value><var>&lt;relative-size&gt;</var></dfn>
jdaggett@8225 1432
jdaggett@8225 1433 <dd> A <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a>
jdaggett@8225 1434 keyword is interpreted relative to the table of font sizes and the
jdaggett@8225 1435 computed ‘<a href="#propdef-font-size"><code
jdaggett@8225 1436 class=property>font-size</code></a>’ of the parent element. Possible
jdaggett@8225 1437 values are:
jdaggett@890 1438 <p> [ larger | smaller ]
jdaggett@890 1439
jdaggett@1148 1440 <p> For example, if the parent element has a font size of ‘<code
jdaggett@1148 1441 class=property>medium</code>’, a value of ‘<code
jdaggett@1148 1442 class=property>larger</code>’ will make the font size of the current
jdaggett@1148 1443 element be ‘<code class=property>large</code>’. If the parent
jdaggett@1148 1444 element's size is not close to a table entry, the user agent is free to
jdaggett@1148 1445 interpolate between table entries or round off to the closest one. The
jdaggett@1148 1446 user agent may have to extrapolate table values if the numerical value
jdaggett@1148 1447 goes beyond the keywords.
jdaggett@512 1448
jdaggett@8225 1449 <dt><dfn id=length-size-value><var>&lt;length&gt;</var></dfn>
jdaggett@512 1450
jdaggett@8187 1451 <dd>A length value specifies an absolute font size (independent of the
jdaggett@8187 1452 user agent's font table). Negative lengths are illegal.
jdaggett@512 1453
jdaggett@8225 1454 <dt><dfn id=percentage-size-value><var>&lt;percentage&gt;</var></dfn>
jdaggett@512 1455
jdaggett@512 1456 <dd>A percentage value specifies an absolute font size relative to the
jdaggett@512 1457 parent element's font size. Use of percentage values, or values in
jdaggett@1148 1458 ‘<code class=property>em</code>’s, leads to more robust and
jdaggett@512 1459 cascadable style sheets.
jdaggett@512 1460 </dl>
jdaggett@512 1461
jdaggett@8187 1462 <p>The following table provides user agent guidelines for the absolute-size
jdaggett@8187 1463 scaling factor and their mapping to HTML heading and absolute font-sizes.
jdaggett@8187 1464 The ‘<code class=property>medium</code>’ value is used as the
jdaggett@8187 1465 reference middle value. The user agent may fine-tune these values for
jdaggett@8187 1466 different fonts or different types of display devices.
jdaggett@1244 1467
jdaggett@1244 1468 <table class=data>
jdaggett@1152 1469 <thead>
jdaggett@1152 1470 <tr>
jdaggett@1152 1471 <th>CSS absolute-size values
jdaggett@1152 1472
jdaggett@1152 1473 <th>xx-small
jdaggett@1152 1474
jdaggett@1152 1475 <th>x-small
jdaggett@1152 1476
jdaggett@1152 1477 <th>small
jdaggett@1152 1478
jdaggett@1152 1479 <th>medium
jdaggett@1152 1480
jdaggett@1152 1481 <th>large
jdaggett@1152 1482
jdaggett@1152 1483 <th>x-large
jdaggett@1152 1484
jdaggett@1152 1485 <th>xx-large
jdaggett@1152 1486
jdaggett@1152 1487 <th> 
jdaggett@1152 1488
jdaggett@512 1489 <tbody>
jdaggett@512 1490 <tr>
jdaggett@1152 1491 <th>scaling factor
jdaggett@1152 1492
jdaggett@1152 1493 <td>3/5
jdaggett@1152 1494
jdaggett@1152 1495 <td>3/4
jdaggett@1152 1496
jdaggett@1152 1497 <td>8/9
jdaggett@1152 1498
jdaggett@1152 1499 <td>1
jdaggett@1152 1500
jdaggett@1152 1501 <td>6/5
jdaggett@1152 1502
jdaggett@1152 1503 <td>3/2
jdaggett@1152 1504
jdaggett@1152 1505 <td>2/1
jdaggett@1152 1506
jdaggett@1152 1507 <td>3/1
jdaggett@512 1508
jdaggett@512 1509 <tr>
jdaggett@8187 1510 <th>HTML headings
jdaggett@1152 1511
jdaggett@1152 1512 <td>h6
jdaggett@1152 1513
jdaggett@1152 1514 <td> 
jdaggett@1152 1515
jdaggett@1152 1516 <td>h5
jdaggett@1152 1517
jdaggett@1152 1518 <td>h4
jdaggett@1152 1519
jdaggett@1152 1520 <td>h3
jdaggett@1152 1521
jdaggett@1152 1522 <td>h2
jdaggett@1152 1523
jdaggett@1152 1524 <td>h1
jdaggett@1152 1525
jdaggett@1152 1526 <td> 
jdaggett@512 1527
jdaggett@512 1528 <tr>
jdaggett@8187 1529 <th>HTML font sizes
jdaggett@1152 1530
jdaggett@1152 1531 <td>1
jdaggett@1152 1532
jdaggett@1152 1533 <td> 
jdaggett@1152 1534
jdaggett@1152 1535 <td>2
jdaggett@1152 1536
jdaggett@1152 1537 <td>3
jdaggett@1152 1538
jdaggett@1152 1539 <td>4
jdaggett@1152 1540
jdaggett@1152 1541 <td>5
jdaggett@1152 1542
jdaggett@1152 1543 <td>6
jdaggett@1152 1544
jdaggett@1152 1545 <td>7
jdaggett@512 1546 </table>
jdaggett@512 1547
jdaggett@512 1548 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
jdaggett@512 1549 applying these guidelines should nevertheless avoid creating font-size
jdaggett@8272 1550 resulting in less than 9 device pixels per EM unit on a computer
jdaggett@8272 1551 display.</em>
jdaggett@512 1552
jdaggett@512 1553 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
jdaggett@512 1554 factor between adjacent indexes was 1.5 which user experience proved to be
jdaggett@512 1555 too large. In CSS2, the suggested scaling factor for computer screen
jdaggett@512 1556 between adjacent indexes was 1.2 which still created issues for the small
jdaggett@512 1557 sizes. The new scaling factor varies between each index to provide a
jdaggett@512 1558 better readability.</em>
jdaggett@512 1559
jdaggett@6659 1560 <p>The actual value of this property may differ from the computed value due
jdaggett@6659 1561 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
jdaggett@4624 1562 class=property>font-size-adjust</code></a>’ and the unavailability of
jdaggett@4624 1563 certain font sizes.
jdaggett@512 1564
jdaggett@512 1565 <p>Child elements inherit the computed <a class=noxref
jdaggett@6659 1566 href="#font-size-prop"> <span class=property>‘<code
jdaggett@1148 1567 class=property>font-size</code>’</span></a> value (otherwise, the effect
jdaggett@2556 1568 of <a class=noxref href="#font-size-adjust-prop"><span
jdaggett@2556 1569 class=property>‘<code
jdaggett@1148 1570 class=property>font-size-adjust</code>’</span></a> would compound).
jdaggett@512 1571
jdaggett@512 1572 <div class=example>
jdaggett@8699 1573 <p style="display:none">Example(s):</p>
jdaggett@890 1574
jdaggett@512 1575 <pre>p { font-size: 12pt; }
jdaggett@512 1576 blockquote { font-size: larger }
jdaggett@512 1577 em { font-size: 150% }
jdaggett@512 1578 em { font-size: 1.5em }
jdaggett@512 1579 </pre>
jdaggett@512 1580 </div>
jdaggett@512 1581 <!-- prop: font-size-adjust -->
jdaggett@512 1582
jdaggett@1662 1583 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
jdaggett@1662 1584 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
jdaggett@1662 1585
jdaggett@6659 1586 <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
jdaggett@484 1587 <tbody>
jdaggett@484 1588 <tr>
jdaggett@484 1589 <td>Name:
jdaggett@484 1590
jdaggett@1662 1591 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
jdaggett@484 1592
jdaggett@484 1593 <tr>
jdaggett@484 1594 <td>Value:
jdaggett@484 1595
jdaggett@8278 1596 <td><a href="#font-size-adjust-none-value"
jdaggett@8278 1597 title="none!!font-size-adjust">none</a> | <a
jdaggett@8278 1598 href="#font-size-adjust-auto-value"
jdaggett@8278 1599 title="auto!!font-size-adjust">auto</a> | <a
jdaggett@8225 1600 href="#aspect-ratio-value"><var>&lt;number&gt;</var></a>
jdaggett@484 1601
jdaggett@484 1602 <tr>
jdaggett@484 1603 <td>Initial:
jdaggett@484 1604
jdaggett@484 1605 <td>none
jdaggett@484 1606
jdaggett@484 1607 <tr>
jdaggett@484 1608 <td>Applies to:
jdaggett@484 1609
jdaggett@484 1610 <td>all elements
jdaggett@484 1611
jdaggett@484 1612 <tr>
jdaggett@484 1613 <td>Inherited:
jdaggett@484 1614
jdaggett@484 1615 <td>yes
jdaggett@484 1616
jdaggett@484 1617 <tr>
jdaggett@484 1618 <td>Percentages:
jdaggett@484 1619
jdaggett@554 1620 <td>N/A
jdaggett@484 1621
jdaggett@484 1622 <tr>
jdaggett@484 1623 <td>Media:
jdaggett@484 1624
jdaggett@484 1625 <td>visual
jdaggett@484 1626
jdaggett@484 1627 <tr>
jdaggett@1148 1628 <td>Computed value:
jdaggett@484 1629
jdaggett@554 1630 <td>as specified
jdaggett@7377 1631
jdaggett@7377 1632 <tr>
jdaggett@7377 1633 <td>Animatable:
jdaggett@7377 1634
jdaggett@7377 1635 <td>as <a
jdaggett@7377 1636 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
jdaggett@484 1637 </table>
jdaggett@484 1638
jdaggett@555 1639 <p>For any given font size, the apparent size and legibility of text varies
jdaggett@555 1640 across fonts. For scripts such as Latin or Cyrillic that distinguish
jdaggett@555 1641 between upper and lowercase letters, the relative height of lowercase
jdaggett@555 1642 letters compared to their uppercase counterparts is a determining factor
jdaggett@555 1643 of legibility. This is commonly referred to as the <a class=index-def
jdaggett@4624 1644 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
jdaggett@4624 1645 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
jdaggett@4624 1646 the x-height of a font divided by the font size.
jdaggett@555 1647
jdaggett@555 1648 <p>In situations where font fallback occurs, fallback fonts may not share
jdaggett@555 1649 the same aspect ratio as the desired font family and will thus appear less
jdaggett@555 1650 readable. The font-size-adjust property is a way to preserve the
jdaggett@547 1651 readability of text when font fallback occurs. It does this by adjusting
jdaggett@1662 1652 the font-size so that the x-height is the same regardless of the font
jdaggett@555 1653 used.
jdaggett@547 1654
jdaggett@547 1655 <div class=example>
jdaggett@547 1656 <p>The style defined below defines Verdana as the desired font family, but
jdaggett@547 1657 if Verdana is not available Futura or Times will be used.</p>
jdaggett@547 1658
jdaggett@8277 1659 <pre>p {
jdaggett@8277 1660 font-family: Verdana, Futura, Times;
jdaggett@547 1661 }
jdaggett@547 1662
jdaggett@547 1663 &lt;p>Lorem ipsum dolor sit amet, ...&lt;/p>
jdaggett@547 1664 </pre>
jdaggett@547 1665
jdaggett@547 1666 <p>Verdana has a relatively high aspect ratio, lowercase letters are
jdaggett@547 1667 relatively tall compared to uppercase letters, so at small sizes text
jdaggett@547 1668 appears legible. Times has a lower aspect ratio and so if fallback
jdaggett@547 1669 occurs, the text will be less legible at small sizes than Verdana.</p>
jdaggett@547 1670 </div>
jdaggett@547 1671
jdaggett@547 1672 <p>How text rendered in each of these fonts compares is shown below, the
jdaggett@547 1673 columns show text rendered in Verdana, Futura and Times. The same
jdaggett@547 1674 font-size value is used across cells within each row and red lines are
jdaggett@547 1675 included to show the differences in x-height. In the upper half each row
jdaggett@547 1676 is rendered in the same font-size value. The same is true for the lower
jdaggett@547 1677 half but in this half the font-size-adjust property is also set so that
jdaggett@2462 1678 the actual font size is adjusted to preserve the x-height across each row.
jdaggett@547 1679 Note how small text remains relatively legible across each row in the
jdaggett@547 1680 lower half.
jdaggett@547 1681
jdaggett@1150 1682 <div class=figure><img alt="text with and without font-size-adjust"
jdaggett@1150 1683 src=fontsizeadjust.png>
jdaggett@890 1684 <p class=caption>Text with and without the use of font-size-adjust
jdaggett@547 1685 </div>
jdaggett@512 1686
jdaggett@8640 1687 <p>This property allows authors to specify an <a
jdaggett@8640 1688 href="#aspect-value"><i>aspect value</i></a> for an element that will
jdaggett@8640 1689 effectively preserve the x-height of the first choice font, whether it is
jdaggett@8640 1690 substituted or not. Values have the following meanings:
jdaggett@512 1691
jdaggett@512 1692 <dl>
jdaggett@8278 1693 <dt><dfn id=font-size-adjust-none-value
jdaggett@8278 1694 title="none!!font-size-adjust">none</dfn>
jdaggett@512 1695
jdaggett@512 1696 <dd>Do not preserve the font's x-height.
jdaggett@512 1697
jdaggett@8278 1698 <dt><dfn id=font-size-adjust-auto-value
jdaggett@8278 1699 title="auto!!font-size-adjust">auto</dfn>
jdaggett@6659 1700
jdaggett@8640 1701 <dd>Behaves just like &lt;number>, except the number used is the <a
jdaggett@8640 1702 href="#aspect-value"><i>aspect value</i></a> calculated by user agents
jdaggett@8640 1703 for the first font in the list of fonts defined for the initial value of
jdaggett@8640 1704 the <a href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1705 class=property>font-family</code>’</a> property. Effectively this is
jdaggett@8930 1706 the default font used for basic Latin text when <a
jdaggett@8930 1707 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8930 1708 class=property>font-family</code>’</a> is not otherwise specified. It
jdaggett@8930 1709 does not vary based on document content and it is not calculated based on
jdaggett@8930 1710 the computed value of <a href="#propdef-font-family"
jdaggett@8278 1711 title="font-family!!property">‘<code
jdaggett@8930 1712 class=property>font-family</code>’</a> for a given element.
jdaggett@8930 1713 <p class=note>Authors can use this value to specify that font size should
jdaggett@8930 1714 be normalized across fonts based on the x-height without the need to
jdaggett@8930 1715 specify the aspect value explicitly.</p>
jdaggett@6659 1716
jdaggett@8225 1717 <dt><dfn id=aspect-ratio-value><var>&lt;number&gt;</var></dfn>
jdaggett@512 1718
jdaggett@8640 1719 <dd>Specifies the <a href="#aspect-value"><i>aspect value</i></a> used in
jdaggett@8640 1720 the calculation below to calculate the adjusted font size:
jdaggett@8277 1721 <pre>c = ( a / a' ) s
jdaggett@512 1722 </pre>
jdaggett@512 1723
jdaggett@512 1724 <p>where:</p>
jdaggett@512 1725
jdaggett@554 1726 <pre>s = font-size value
jdaggett@8640 1727 a = <a href="#aspect-value"><i>aspect value</i></a> as specified by the font-size-adjust property
jdaggett@8640 1728 a' = <a href="#aspect-value"><i>aspect value</i></a> of actual font
jdaggett@554 1729 c = adjusted font-size to use
jdaggett@512 1730 </pre>
jdaggett@554 1731
jdaggett@554 1732 <p>This value applies to any font that is selected but in typical usage
jdaggett@8640 1733 it should be based on the <a href="#aspect-value"><i>aspect
jdaggett@8640 1734 value</i></a> of the first font in the font-family list. If this is
jdaggett@8640 1735 specified accurately, the <tt>(a/a')</tt> term in the formula above is
jdaggett@8640 1736 effectively 1 for the first font and no adjustment occurs. If the value
jdaggett@8640 1737 is specified inaccurately, text rendered using the first font in the
jdaggett@8640 1738 family list will display differently in older user agents that don't
jdaggett@8640 1739 support font-size-adjust.</p>
jdaggett@512 1740 </dl>
jdaggett@512 1741
jdaggett@8640 1742 <p>The value of ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8640 1743 class=property>font-size-adjust</code></a>’ affects the size of relative
jdaggett@8640 1744 units that are based on font metrics of the <a
jdaggett@8640 1745 href="#first-available-font"><i>first available font</i></a> such as
jdaggett@8640 1746 <code>ex</code> and <code>ch</code> but does not affect the size of
jdaggett@8640 1747 <code>em</code> units.
jdaggett@8640 1748
jdaggett@8640 1749 <p>Authors can calculate the <a href="#aspect-value"><i>aspect
jdaggett@8640 1750 value</i></a> for a given font by comparing spans with the same content
jdaggett@8640 1751 but different font-size-adjust properties. If the same font-size is used,
jdaggett@8640 1752 the spans will match when the font-size-adjust value is accurate for the
jdaggett@8640 1753 given font.
jdaggett@554 1754
jdaggett@554 1755 <div class=example>
jdaggett@8640 1756 <p>Two spans with borders are used to determine the <a
jdaggett@8640 1757 href="#aspect-value"><i>aspect value</i></a> of a font. The font-size is
jdaggett@8640 1758 the same for both spans but the font-size-adjust property is specified
jdaggett@8640 1759 only for the right span. Starting with a value of 0.5, the aspect value
jdaggett@8640 1760 can be adjusted until the borders around the two letters line up.</p>
jdaggett@554 1761
jdaggett@554 1762 <pre>p {
jdaggett@554 1763 font-family: Futura;
jdaggett@554 1764 font-size: 500px;
jdaggett@554 1765 }
jdaggett@554 1766
jdaggett@554 1767 span {
jdaggett@554 1768 border: solid 1px red;
jdaggett@554 1769 }
jdaggett@554 1770
jdaggett@554 1771 .adjust {
jdaggett@554 1772 font-size-adjust: 0.5;
jdaggett@554 1773 }
jdaggett@554 1774
jdaggett@554 1775 &lt;p>&lt;span>b&lt;/span>&lt;span class="adjust">b&lt;/span>&lt;/p>
jdaggett@554 1776 </pre>
jdaggett@554 1777
jdaggett@8640 1778 <div class=figure><img alt="Futura with an <i>aspect value</i> of 0.5"
jdaggett@1150 1779 src=beforefontsizeadjust.png>
jdaggett@8640 1780 <p class=caption>Futura with an <a href="#aspect-value"><i>aspect
jdaggett@8640 1781 value</i></a> of 0.5
jdaggett@554 1782 </div>
jdaggett@554 1783
jdaggett@554 1784 <p>The box on the right is a bit bigger than the one on the left, so the
jdaggett@8640 1785 <a href="#aspect-value"><i>aspect value</i></a> of this font is something
jdaggett@8640 1786 less than 0.5. Adjust the value until the boxes align.</p>
jdaggett@554 1787 </div>
jdaggett@512 1788 <!-- prop: font -->
jdaggett@512 1789
jdaggett@1662 1790 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
jdaggett@1662 1791 <a href="#propdef-font">font</a> property</h3>
jdaggett@1662 1792
jdaggett@8225 1793 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
jdaggett@484 1794 <tbody>
jdaggett@484 1795 <tr>
jdaggett@484 1796 <td>Name:
jdaggett@484 1797
jdaggett@1662 1798 <td><dfn id=propdef-font>font</dfn>
jdaggett@484 1799
jdaggett@484 1800 <tr>
jdaggett@484 1801 <td>Value:
jdaggett@484 1802
jdaggett@8278 1803 <td>[ [ <var>&lt;<a href="#propdef-font-style"
jdaggett@8278 1804 title="font-style!!property">‘<code
jdaggett@8278 1805 class=property>font-style</code>’</a>&gt;</var> || <a
jdaggett@8225 1806 href="#font-variant-css21-values"><var>&lt;font-variant-css21&gt;</var></a>
jdaggett@8278 1807 || <var>&lt;<a href="#propdef-font-weight"
jdaggett@8278 1808 title="font-weight!!property">‘<code
jdaggett@8278 1809 class=property>font-weight</code>’</a>&gt;</var> || <var>&lt;<a
jdaggett@8278 1810 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
jdaggett@8278 1811 class=property>font-stretch</code>’</a></var> ]? <var>&lt;‘<a
jdaggett@8225 1812 href="#propdef-font-size"><code
jdaggett@8225 1813 class=property>font-size</code></a>’&gt;</var> [ / <var>&lt;‘<code
jdaggett@8278 1814 class=property>line-height</code>’&gt;</var> ]? <var>&lt;<a
jdaggett@8278 1815 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1816 class=property>font-family</code>’</a>&gt;</var> ] | caption | icon |
jdaggett@8225 1817 menu | message-box | small-caption | status-bar
jdaggett@484 1818
jdaggett@484 1819 <tr>
jdaggett@484 1820 <td>Initial:
jdaggett@484 1821
jdaggett@484 1822 <td>see individual properties
jdaggett@484 1823
jdaggett@484 1824 <tr>
jdaggett@484 1825 <td>Applies to:
jdaggett@484 1826
jdaggett@484 1827 <td>all elements
jdaggett@484 1828
jdaggett@484 1829 <tr>
jdaggett@484 1830 <td>Inherited:
jdaggett@484 1831
jdaggett@484 1832 <td>yes
jdaggett@484 1833
jdaggett@484 1834 <tr>
jdaggett@484 1835 <td>Percentages:
jdaggett@484 1836
jdaggett@484 1837 <td>see individual properties
jdaggett@484 1838
jdaggett@484 1839 <tr>
jdaggett@484 1840 <td>Media:
jdaggett@484 1841
jdaggett@484 1842 <td>visual
jdaggett@484 1843
jdaggett@484 1844 <tr>
jdaggett@1148 1845 <td>Computed value:
jdaggett@484 1846
jdaggett@484 1847 <td>see individual properties
jdaggett@7377 1848
jdaggett@7377 1849 <tr>
jdaggett@7377 1850 <td>Animatable:
jdaggett@7377 1851
jdaggett@7377 1852 <td>see individual properties
jdaggett@484 1853 </table>
jdaggett@1732 1854
jdaggett@4624 1855 <p>The <span class=property>‘<a href="#propdef-font"><code
jdaggett@4624 1856 class=property>font</code></a>’</span> property is, except as described
jdaggett@8278 1857 below, a shorthand property for setting <a href="#propdef-font-style"
jdaggett@8278 1858 title="font-style!!property">‘<code
jdaggett@8278 1859 class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
jdaggett@8278 1860 title="font-variant!!property">‘<code
jdaggett@8278 1861 class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
jdaggett@8278 1862 title="font-weight!!property">‘<code
jdaggett@8278 1863 class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
jdaggett@8278 1864 title="font-stretch!!property">‘<code
jdaggett@8278 1865 class=property>font-stretch</code>’</a>, <span class=property>‘<a
jdaggett@8278 1866 href="#propdef-font-size"><code
jdaggett@8278 1867 class=property>font-size</code></a>’</span>, <a class=property
jdaggett@8278 1868 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8278 1869 class=property>line-height</code>’</a>, <a href="#propdef-font-family"
jdaggett@8278 1870 title="font-family!!property">‘<code
jdaggett@8278 1871 class=property>font-family</code>’</a> at the same place in the
jdaggett@8278 1872 stylesheet. Values for the <a href="#propdef-font-variant"
jdaggett@8278 1873 title="font-variant!!property">‘<code
jdaggett@8278 1874 class=property>font-variant</code>’</a> property may also be included
jdaggett@8313 1875 but only those supported in CSS 2.1, none of the <a
jdaggett@8313 1876 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 1877 class=property>font-variant</code>’</a> values added in this
jdaggett@8313 1878 specification can be used in the <span class=property>‘<a
jdaggett@8278 1879 href="#propdef-font"><code class=property>font</code></a>’</span>
jdaggett@8278 1880 shorthand:
jdaggett@1732 1881
jdaggett@1732 1882 <pre
jdaggett@8225 1883 class=prod><dfn id=font-variant-css21-values><var>&lt;font-variant-css21&gt;</var></dfn> = [normal | small-caps]</pre>
jdaggett@1732 1884
jdaggett@1732 1885 <p>The syntax of this property is based on a traditional typographical
jdaggett@1732 1886 shorthand notation to set multiple properties related to fonts.
jdaggett@512 1887
jdaggett@8197 1888 <p>All subproperties of the ‘<a href="#propdef-font"><code
jdaggett@8197 1889 class=property>font</code></a>’ property are first reset to their
jdaggett@8197 1890 initial values, including those listed above plus <span
jdaggett@4624 1891 class=property>‘<a href="#propdef-font-size-adjust"><code
jdaggett@4624 1892 class=property>font-size-adjust</code></a>’</span>, <span
jdaggett@4624 1893 class=property>‘<a href="#propdef-font-kerning"><code
jdaggett@8278 1894 class=property>font-kerning</code></a>’</span>, subproperties of <a
jdaggett@8278 1895 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8278 1896 class=property>font-variant</code>’</a> and and <span>‘<a
jdaggett@8278 1897 href="#propdef-font-language-override"><code
jdaggett@8197 1898 class=property>font-language-override</code></a>’</span>. Then, those
jdaggett@8197 1899 properties that are given explicit values in the <span
jdaggett@8197 1900 class=property>‘<a href="#propdef-font"><code
jdaggett@4624 1901 class=property>font</code></a>’</span> shorthand are set to those
jdaggett@512 1902 values. For a definition of allowed and initial values, see the previously
jdaggett@512 1903 defined properties. For reasons of backwards compatibility, it is not
jdaggett@4624 1904 possible to set <span class=property>‘<a
jdaggett@7020 1905 href="#propdef-font-size-adjust"><code
jdaggett@7020 1906 class=property>font-size-adjust</code></a>’</span> to anything other
jdaggett@7020 1907 than its initial value using the <span class=property>‘<a
jdaggett@4624 1908 href="#propdef-font"><code class=property>font</code></a>’</span>
jdaggett@7020 1909 shorthand property; instead, use the individual property.
jdaggett@512 1910
jdaggett@512 1911 <div class=example>
jdaggett@8699 1912 <p style="display:none">Example(s):</p>
jdaggett@890 1913
jdaggett@512 1914 <pre>p { font: 12pt/14pt sans-serif }
jdaggett@512 1915 p { font: 80% sans-serif }
jdaggett@512 1916 p { font: x-large/110% &quot;new century schoolbook&quot;, serif }
jdaggett@512 1917 p { font: bold italic large Palatino, serif }
jdaggett@512 1918 p { font: normal small-caps 120%/120% fantasy }
jdaggett@7020 1919 p { font: condensed oblique 12pt &quot;Helvetica Neue&quot;, serif; }
jdaggett@512 1920 </pre>
jdaggett@512 1921
jdaggett@1148 1922 <p> In the second rule, the font size percentage value (‘<code
jdaggett@8187 1923 class=css>80%</code>’) refers to the computed ‘<a
jdaggett@8187 1924 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
jdaggett@8187 1925 the parent element. In the third rule, the line height percentage
jdaggett@8187 1926 (‘<code class=css>110%</code>’) refers to the font size of the
jdaggett@8187 1927 element itself.
jdaggett@512 1928
jdaggett@8278 1929 <p>The first three rules do not specify the <a
jdaggett@8278 1930 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8278 1931 class=property>font-variant</code>’</a> and <a
jdaggett@8278 1932 href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 1933 class=property>font-weight</code>’</a> explicitly, so these properties
jdaggett@8368 1934 receive their initial values (<span title="normal value">‘<code
jdaggett@8368 1935 class=property>normal</code>’</span>). Notice that the font family name
jdaggett@8279 1936 "new century schoolbook", which contains spaces, is enclosed in quotes.
jdaggett@8279 1937 The fourth rule sets the <a href="#propdef-font-weight"
jdaggett@8279 1938 title="font-weight!!property">‘<code
jdaggett@8278 1939 class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
jdaggett@8278 1940 class=property>bold</code></a>’, the <a href="#propdef-font-style"
jdaggett@8278 1941 title="font-style!!property">‘<code
jdaggett@8278 1942 class=property>font-style</code>’</a> to ‘<a href="#italic"><code
jdaggett@8278 1943 class=property>italic</code></a>’, and implicitly sets <a
jdaggett@8278 1944 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8368 1945 class=property>font-variant</code>’</a> to <a
jdaggett@8368 1946 href="#font-variant-normal-value" title="normal!!font-variant">‘<code
jdaggett@8368 1947 class=property>normal</code>’</a>.
jdaggett@8278 1948
jdaggett@8278 1949 <p> The fifth rule sets the <a href="#propdef-font-variant"
jdaggett@8278 1950 title="font-variant!!property">‘<code
jdaggett@8278 1951 class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
jdaggett@8278 1952 class=property>small-caps</code></a>’), the <span class=property>‘<a
jdaggett@8278 1953 href="#propdef-font-size"><code
jdaggett@4624 1954 class=property>font-size</code></a>’</span> (120% of the parent's font
jdaggett@8278 1955 size), the <a class=property
jdaggett@8278 1956 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
jdaggett@8278 1957 class=property>line-height</code>’</a> (120% of the font size) and the
jdaggett@8278 1958 <a href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1959 class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
jdaggett@8368 1960 class=property>fantasy</code></a>’). It follows that the keyword <span
jdaggett@8368 1961 title="normal value">‘<code class=property>normal</code>’</span>
jdaggett@8368 1962 applies to the two remaining properties: <a href="#propdef-font-style"
jdaggett@8278 1963 title="font-style!!property">‘<code
jdaggett@8278 1964 class=property>font-style</code>’</a> and <a
jdaggett@8278 1965 href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 1966 class=property>font-weight</code>’</a>.
jdaggett@8278 1967
jdaggett@8278 1968 <p>The sixth rule sets the <a href="#propdef-font-style"
jdaggett@8278 1969 title="font-style!!property">‘<code
jdaggett@8278 1970 class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
jdaggett@8278 1971 title="font-stretch!!property">‘<code
jdaggett@8278 1972 class=property>font-stretch</code>’</a>, <span class=property>‘<a
jdaggett@8278 1973 href="#propdef-font-size"><code
jdaggett@8278 1974 class=property>font-size</code></a>’</span>, and <a
jdaggett@8278 1975 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 1976 class=property>font-family</code>’</a>, the other font properties being
jdaggett@8278 1977 set to their initial values.
jdaggett@512 1978 </div>
jdaggett@512 1979
jdaggett@8278 1980 <p>Since the <a href="#propdef-font-stretch"
jdaggett@8278 1981 title="font-stretch!!property">‘<code
jdaggett@8278 1982 class=property>font-stretch</code>’</a> property was not defined in CSS
jdaggett@8278 1983 2.1, when using <a href="#propdef-font-stretch"
jdaggett@8278 1984 title="font-stretch!!property">‘<code
jdaggett@8278 1985 class=property>font-stretch</code>’</a> values within ‘<a
jdaggett@7020 1986 href="#propdef-font"><code class=property>font</code></a>’ rules,
jdaggett@7020 1987 authors should include a extra version compatible with older user agents:
jdaggett@7020 1988
jdaggett@7020 1989 <pre>p {
jdaggett@7020 1990 font: 80% sans-serif; /* for older user agents */
jdaggett@7020 1991 font: condensed 80% sans-serif;
jdaggett@7020 1992 }</pre>
jdaggett@7020 1993
jdaggett@1662 1994 <p>The following values refer to system fonts:
jdaggett@512 1995
jdaggett@512 1996 <dl>
jdaggett@512 1997 <dt><strong>caption</strong>
jdaggett@512 1998
jdaggett@512 1999 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
jdaggett@512 2000 etc.).
jdaggett@512 2001
jdaggett@512 2002 <dt><strong>icon</strong>
jdaggett@512 2003
jdaggett@512 2004 <dd>The font used to label icons.
jdaggett@512 2005
jdaggett@512 2006 <dt><strong>menu</strong>
jdaggett@512 2007
jdaggett@512 2008 <dd>The font used in menus (e.g., dropdown menus and menu lists).
jdaggett@512 2009
jdaggett@512 2010 <dt><strong>message-box</strong>
jdaggett@512 2011
jdaggett@512 2012 <dd>The font used in dialog boxes.
jdaggett@512 2013
jdaggett@512 2014 <dt><strong>small-caption</strong>
jdaggett@512 2015
jdaggett@512 2016 <dd>The font used for labeling small controls.
jdaggett@512 2017
jdaggett@512 2018 <dt><strong>status-bar</strong>
jdaggett@512 2019
jdaggett@512 2020 <dd>The font used in window status bars.
jdaggett@512 2021 </dl>
jdaggett@512 2022
jdaggett@512 2023 <p>System fonts may only be set as a whole; that is, the font family, size,
jdaggett@1662 2024 weight, style, etc. are all set at the same time. These values may then be
jdaggett@512 2025 altered individually if desired. If no font with the indicated
jdaggett@512 2026 characteristics exists on a given platform, the user agent should either
jdaggett@1148 2027 intelligently substitute (e.g., a smaller version of the ‘<code
jdaggett@1148 2028 class=property>caption</code>’ font might be used for the ‘<code
jdaggett@7242 2029 class=property>small-caption</code>’ font), or substitute a user agent
jdaggett@1148 2030 default font. As for regular fonts, if, for a system font, any of the
jdaggett@1148 2031 individual properties are not part of the operating system's available
jdaggett@1148 2032 user preferences, those properties should be set to their initial values.
jdaggett@512 2033
jdaggett@1662 2034 <p>That is why this property is "almost" a shorthand property: system fonts
jdaggett@8278 2035 can only be specified with this property, not with <a
jdaggett@8278 2036 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 2037 class=property>font-family</code>’</a> itself, so <span
jdaggett@4624 2038 class=property>‘<a href="#propdef-font"><code
jdaggett@4624 2039 class=property>font</code></a>’</span> allows authors to do more than
jdaggett@4624 2040 the sum of its subproperties. However, the individual properties such as
jdaggett@8278 2041 <a href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 2042 class=property>font-weight</code>’</a> are still given values taken from
jdaggett@8278 2043 the system font, which can be independently varied.
jdaggett@512 2044
jdaggett@7235 2045 <p>Note that the keywords used for the system fonts listed above are only
jdaggett@7235 2046 treated as keywords when they occur in the initial position, in other
jdaggett@7235 2047 positions the same string is treated as part of the font family name:
jdaggett@7235 2048
jdaggett@7235 2049 <pre> font: menu; /* use the font settings for system menus */
jdaggett@7235 2050 font: large menu; /* use a font family named "menu" */</pre>
jdaggett@7235 2051
jdaggett@512 2052 <div class=example>
jdaggett@8699 2053 <p style="display:none">Example(s):</p>
jdaggett@890 2054
jdaggett@512 2055 <pre>button { font: 300 italic 1.3em/1.7em &quot;FB Armada&quot;, sans-serif }
jdaggett@512 2056 button p { font: menu }
jdaggett@512 2057 button p em { font-weight: bolder }
jdaggett@512 2058 </pre>
jdaggett@512 2059
jdaggett@512 2060 <p>If the font used for dropdown menus on a particular system happened to
jdaggett@512 2061 be, for example, 9-point Charcoal, with a weight of 600, then P elements
jdaggett@512 2062 that were descendants of BUTTON would be displayed as if this rule were
jdaggett@890 2063 in effect:
jdaggett@512 2064
jdaggett@512 2065 <pre>button p { font: 600 9pt Charcoal }
jdaggett@512 2066 </pre>
jdaggett@512 2067
jdaggett@4624 2068 <p>Because the <span class=property>‘<a href="#propdef-font"><code
jdaggett@4624 2069 class=property>font</code></a>’</span> shorthand resets to its initial
jdaggett@4624 2070 value any property not explicitly given a value, this has the same effect
jdaggett@4624 2071 as this declaration:
jdaggett@512 2072
jdaggett@512 2073 <pre>button p {
jdaggett@512 2074 font-style: normal;
jdaggett@512 2075 font-variant: normal;
jdaggett@512 2076 font-weight: 600;
jdaggett@512 2077 font-size: 9pt;
jdaggett@512 2078 line-height: normal;
jdaggett@512 2079 font-family: Charcoal
jdaggett@8277 2080 }
jdaggett@512 2081 </pre>
jdaggett@512 2082 </div>
jdaggett@2487 2083 <!-- prop: font-synthesis -->
jdaggett@2487 2084
jdaggett@2487 2085 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
jdaggett@2487 2086 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
jdaggett@2487 2087 property</h3>
jdaggett@2487 2088
jdaggett@4624 2089 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
jdaggett@2457 2090 <tbody>
jdaggett@2457 2091 <tr>
jdaggett@2457 2092 <td>Name:
jdaggett@2457 2093
jdaggett@2487 2094 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
jdaggett@2457 2095
jdaggett@2457 2096 <tr>
jdaggett@2457 2097 <td>Value:
jdaggett@2457 2098
jdaggett@2487 2099 <td>none | [ weight || style ]
jdaggett@2457 2100
jdaggett@2457 2101 <tr>
jdaggett@2457 2102 <td>Initial:
jdaggett@2457 2103
jdaggett@2487 2104 <td>weight style
jdaggett@2457 2105
jdaggett@2457 2106 <tr>
jdaggett@2457 2107 <td>Applies to:
jdaggett@2457 2108
jdaggett@2457 2109 <td>all elements
jdaggett@2457 2110
jdaggett@2457 2111 <tr>
jdaggett@2457 2112 <td>Inherited:
jdaggett@2457 2113
jdaggett@2457 2114 <td>yes
jdaggett@2457 2115
jdaggett@2457 2116 <tr>
jdaggett@2457 2117 <td>Percentages:
jdaggett@2457 2118
jdaggett@2457 2119 <td>N/A
jdaggett@2457 2120
jdaggett@2457 2121 <tr>
jdaggett@2457 2122 <td>Media:
jdaggett@2457 2123
jdaggett@2457 2124 <td>visual
jdaggett@2457 2125
jdaggett@2457 2126 <tr>
jdaggett@2457 2127 <td>Computed value:
jdaggett@2457 2128
jdaggett@2457 2129 <td>as specified
jdaggett@7377 2130
jdaggett@7377 2131 <tr>
jdaggett@7377 2132 <td>Animatable:
jdaggett@7377 2133
jdaggett@7377 2134 <td>no
jdaggett@2457 2135 </table>
jdaggett@2457 2136
jdaggett@2487 2137 <p>This property controls whether user agents are allowed to synthesize
jdaggett@2487 2138 bold or oblique font faces when a font family lacks bold or italic faces.
jdaggett@7311 2139 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
jdaggett@7311 2140 specified, user agents must not synthesize bold faces and if ‘<code
jdaggett@2487 2141 class=property>style</code>’ is not specified user agents must not
jdaggett@8278 2142 synthesize italic faces. A value of ‘<code class=property>none</code>’
jdaggett@8278 2143 disallows all synthetic faces.
jdaggett@2457 2144
jdaggett@2457 2145 <div class=example>
jdaggett@2488 2146 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
jdaggett@2457 2147
jdaggett@2487 2148 <pre>*:lang(ar) { font-synthesis: none; }
jdaggett@2457 2149 </pre>
jdaggett@2457 2150 </div>
jdaggett@512 2151
jdaggett@6699 2152 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
jdaggett@545 2153
jdaggett@8311 2154 <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
jdaggett@8311 2155 id=at-font-face-rule style="font-weight: inherit; font-style:
jdaggett@8311 2156 inherit"><code>@font-face</code></dfn> rule</h3>
jdaggett@8311 2157
jdaggett@8311 2158 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
jdaggett@8311 2159 for linking to fonts that are automatically fetched and activated when
jdaggett@8311 2160 needed. This allows authors to select a font that closely matches the
jdaggett@8311 2161 design goals for a given page rather than limiting the font choice to a
jdaggett@8311 2162 set of fonts available on all platforms. A set of font descriptors define
jdaggett@8311 2163 the location of a font resource, either locally or externally, along with
jdaggett@8311 2164 the style characteristics of an individual face. Multiple <a
jdaggett@8311 2165 href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
jdaggett@8311 2166 construct font families with a variety of faces. Using CSS font matching
jdaggett@8311 2167 rules, a user agent can selectively download only those faces that are
jdaggett@8311 2168 needed for a given piece of text.
jdaggett@8311 2169
jdaggett@8311 2170 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
jdaggett@8311 2171 consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2172 at-keyword followed by a block of descriptor declarations. In terms of the
jdaggett@8311 2173 grammar, this specification defines the following productions:
jdaggett@8031 2174
jdaggett@8031 2175 <pre><dfn id=fontfacerule>font_face_rule</dfn>
jdaggett@8225 2176 : <a href="#fontfacesym"><i>FONT_FACE_SYM</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* '{' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#descriptordeclaration"><i>descriptor_declaration</i></a>? [ ';' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#descriptordeclaration"><i>descriptor_declaration</i></a>? ]* '}' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8031 2177 ;
jdaggett@8031 2178
jdaggett@8031 2179 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
jdaggett@8225 2180 : <a href="http://www.w3.org/TR/CSS21/grammar.html#grammar"><i>property</i></a> ':' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/grammar.html#grammar"><i>expr</i></a>
jdaggett@8031 2181 ;</pre>
jdaggett@8031 2182
jdaggett@8032 2183 <p>The following new definitions are introduced:
jdaggett@8032 2184
jdaggett@8032 2185 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
jdaggett@8032 2186 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
jdaggett@8032 2187
jdaggett@8032 2188 <p>The following new token is introduced:
jdaggett@8032 2189
jdaggett@8225 2190 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
jdaggett@8032 2191
jdaggett@8311 2192 <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
jdaggett@8311 2193 specifies a value for every font descriptor, either implicitly or
jdaggett@8311 2194 explicitly. Those not given explicit values in the rule take the initial
jdaggett@8311 2195 value listed with each descriptor in this specification. These descriptors
jdaggett@8311 2196 apply solely within the context of the <a
jdaggett@8311 2197 href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
jdaggett@8311 2198 are defined, and do not apply to document language elements. There is no
jdaggett@8311 2199 notion of which elements the descriptors apply to or whether the values
jdaggett@8311 2200 are inherited by child elements. When a given descriptor occurs multiple
jdaggett@8311 2201 times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2202 rule, only the last descriptor declaration is used and all prior
jdaggett@8311 2203 declarations for that descriptor are ignored.
jdaggett@512 2204
jdaggett@525 2205 <div class=example>
jdaggett@525 2206 <p>To use a downloadable font called Gentium:</p>
jdaggett@512 2207
jdaggett@512 2208 <pre>
jdaggett@525 2209 @font-face {
jdaggett@525 2210 font-family: Gentium;
jdaggett@8860 2211 src: url(http://example.com/fonts/Gentium.woff);
jdaggett@525 2212 }
jdaggett@525 2213
jdaggett@525 2214 p { font-family: Gentium, serif; }
jdaggett@512 2215 </pre>
jdaggett@512 2216
jdaggett@573 2217 <p>The user agent will download Gentium and use it when rendering text
jdaggett@573 2218 within paragraph elements. If for some reason the site serving the font
jdaggett@573 2219 is unavailable, the default serif font will be used.</p>
jdaggett@512 2220 </div>
jdaggett@512 2221
jdaggett@8311 2222 <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2223 rules define a set of fonts available for use within the documents that
jdaggett@8311 2224 contain these rules. When font matching is done, fonts defined using these
jdaggett@8311 2225 rules are considered before other available fonts on a system.
jdaggett@8198 2226
jdaggett@8198 2227 <p>Downloaded fonts are only available to documents that reference them.
jdaggett@8198 2228 The process of activating these fonts must not make them available to
jdaggett@2472 2229 other applications or to documents that don't directly link to the same
jdaggett@2556 2230 font. User agent implementers might consider it convenient to use
jdaggett@2472 2231 downloaded fonts when rendering characters in other documents for which no
jdaggett@8363 2232 other available font exists as part of the <a
jdaggett@8363 2233 href="#system-font-fallback"><em>system font fallback</em></a> procedure.
jdaggett@8198 2234 However, this would cause a security leak since the contents of one page
jdaggett@8198 2235 would be able to affect other pages, something an attacker could use as an
jdaggett@8198 2236 attack vector. These restrictions do not affect caching behavior, fonts
jdaggett@8198 2237 are cached the same way other web resources are cached.
jdaggett@8198 2238
jdaggett@8198 2239 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
jdaggett@8198 2240 properties in a declaration block, declarations of any descriptors that
jdaggett@8311 2241 are not supported by the user agent must be ignored. <a
jdaggett@8311 2242 href="#at-font-face-rule"><code>@font-face</code></a> rules require a
jdaggett@8311 2243 font-family and src descriptor; if either of these are missing, the <a
jdaggett@8311 2244 href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
jdaggett@8311 2245 must be ignored entirely.
jdaggett@1244 2246
jdaggett@1244 2247 <p>In cases where user agents have limited platform resources or implement
jdaggett@8311 2248 the ability to disable downloadable font resources, <a
jdaggett@8311 2249 href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
jdaggett@8311 2250 ignored; the behavior of individual descriptors as defined in this
jdaggett@8311 2251 specification should not be altered.
jdaggett@1662 2252
jdaggett@1662 2253 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
jdaggett@1662 2254 href="#descdef-font-family">font-family</a> descriptor</h3>
jdaggett@512 2255
jdaggett@512 2256 <table class=descdef>
jdaggett@512 2257 <tbody>
jdaggett@512 2258 <tr>
jdaggett@512 2259 <td>Name:
jdaggett@512 2260
jdaggett@8278 2261 <td><dfn id=descdef-font-family
jdaggett@8278 2262 title="font-family!!descriptor">font-family</dfn>
jdaggett@512 2263
jdaggett@512 2264 <tr>
jdaggett@512 2265 <td>Value:
jdaggett@512 2266
jdaggett@8225 2267 <td><a href="#family-name-value"><var>&lt;family-name&gt;</var></a>
jdaggett@890 2268
jdaggett@890 2269 <tr>
jdaggett@890 2270 <td><em>Initial:</em>
jdaggett@890 2271
jdaggett@890 2272 <td>N/A
jdaggett@512 2273 </table>
jdaggett@512 2274
jdaggett@525 2275 <p>This descriptor defines the font family name that will be used in all
jdaggett@8311 2276 CSS font family name matching. It is required for the <a
jdaggett@8311 2277 href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
jdaggett@8311 2278 overrides the font family names contained in the underlying font data. If
jdaggett@8311 2279 the font family name is the same as a font family available in a given
jdaggett@8311 2280 user's environment, it effectively hides the underlying font for documents
jdaggett@8311 2281 that use the stylesheet. This permits a web author to freely choose
jdaggett@8311 2282 font-family names without worrying about conflicts with font family names
jdaggett@8311 2283 present in a given user's environment. Likewise, platform substitutions
jdaggett@8311 2284 for a given font family name must not be used.
jdaggett@1244 2285
jdaggett@1662 2286 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
jdaggett@1662 2287 href="#descdef-src">src</a> descriptor</h3>
jdaggett@512 2288
jdaggett@512 2289 <table class=descdef>
jdaggett@512 2290 <tbody>
jdaggett@512 2291 <tr>
jdaggett@512 2292 <td>Name:
jdaggett@512 2293
jdaggett@1662 2294 <td><dfn id=descdef-src>src</dfn>
jdaggett@512 2295
jdaggett@512 2296 <tr>
jdaggett@512 2297 <td>Value:
jdaggett@512 2298
jdaggett@8225 2299 <td>[ &lt;url> [format(&lt;string> #)]? | <a
jdaggett@8225 2300 href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> ] #
jdaggett@890 2301
jdaggett@890 2302 <tr>
jdaggett@890 2303 <td><em>Initial:</em>
jdaggett@890 2304
jdaggett@890 2305 <td>N/A
jdaggett@512 2306 </table>
jdaggett@512 2307
jdaggett@899 2308 <p>This descriptor specifies the resource containing font data. It is
jdaggett@8311 2309 required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2310 rule to be valid. Its value is a prioritized, comma-separated list of
jdaggett@8311 2311 external references or locally-installed font face names. When a font is
jdaggett@8311 2312 needed the user agent iterates over the set of references listed, using
jdaggett@8311 2313 the first one it can successfully activate. Fonts containing invalid data
jdaggett@8311 2314 or local font faces that are not found are ignored and the user agent
jdaggett@8311 2315 loads the next font in the list.
jdaggett@8272 2316
jdaggett@8272 2317 <p>As with other URLs in CSS, the URL may be relative, in which case it is
jdaggett@8311 2318 resolved relative to the location of the style sheet containing the <a
jdaggett@8311 2319 href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
jdaggett@8311 2320 SVG fonts, the URL points to an element within a document containing SVG
jdaggett@8311 2321 font definitions. If the element reference is omitted, a reference to the
jdaggett@8311 2322 first defined font is implied. Similarly, font container formats that can
jdaggett@7096 2323 contain more than one font must load one and only one of the fonts for a
jdaggett@8311 2324 given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@8311 2325 Fragment identifiers are used to indicate which font to load. If a
jdaggett@8311 2326 container format lacks a defined fragment identifier scheme,
jdaggett@8311 2327 implementations should use a simple 1-based indexing scheme (e.g.
jdaggett@8311 2328 "font-collection#1" for the first font, "font-collection#2" for the second
jdaggett@8311 2329 font).
jdaggett@1244 2330
jdaggett@2527 2331 <pre>
jdaggett@8860 2332 src: url(fonts/simple.woff); /* load simple.woff relative to stylesheet location */
jdaggett@8860 2333 src: url(/fonts/simple.woff); /* load simple.woff from absolute location */
jdaggett@8860 2334 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
jdaggett@2527 2335 </pre>
jdaggett@2527 2336
jdaggett@8198 2337 <p>External references consist of a URL, followed by an optional hint
jdaggett@8198 2338 describing the format of the font resource referenced by that URL. The
jdaggett@2527 2339 format hint contains a comma-separated list of format strings that denote
jdaggett@2527 2340 well-known font formats. Conformant user agents must skip downloading a
jdaggett@2527 2341 font resource if the format hints indicate only unsupported or unknown
jdaggett@2527 2342 font formats. If no format hints are supplied, the user agent should
jdaggett@2527 2343 download the font resource.
jdaggett@2527 2344
jdaggett@2527 2345 <pre>
jdaggett@2527 2346 /* load WOFF font if possible, otherwise use OpenType font */
jdaggett@2527 2347 @font-face {
jdaggett@2527 2348 font-family: bodytext;
jdaggett@2527 2349 src: url(ideal-sans-serif.woff) format("woff"),
jdaggett@2527 2350 url(basic-sans-serif.ttf) format("opentype");
jdaggett@2527 2351 }
jdaggett@2527 2352 </pre>
jdaggett@2527 2353
jdaggett@2527 2354 <p>Format strings defined by this specification:
jdaggett@2527 2355
jdaggett@2527 2356 <table class=data id=fontformats>
jdaggett@2527 2357 <thead>
jdaggett@2527 2358 <tr>
jdaggett@2527 2359 <th>String
jdaggett@2527 2360
jdaggett@2527 2361 <th>Font Format
jdaggett@2527 2362
jdaggett@2527 2363 <th>Common extensions
jdaggett@2527 2364
jdaggett@2527 2365 <tbody>
jdaggett@2527 2366 <tr>
jdaggett@2527 2367 <th>"woff"
jdaggett@2527 2368
jdaggett@4624 2369 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
jdaggett@2527 2370
jdaggett@2527 2371 <td>.woff
jdaggett@2527 2372
jdaggett@2527 2373 <tr>
jdaggett@2527 2374 <th>"truetype"
jdaggett@2527 2375
jdaggett@4624 2376 <td><a
jdaggett@4624 2377 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
jdaggett@2527 2378
jdaggett@2527 2379 <td>.ttf
jdaggett@2527 2380
jdaggett@2527 2381 <tr>
jdaggett@2527 2382 <th>"opentype"
jdaggett@2527 2383
jdaggett@4624 2384 <td><a
jdaggett@4624 2385 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
jdaggett@2527 2386
jdaggett@2527 2387 <td>.ttf, .otf
jdaggett@2527 2388
jdaggett@2527 2389 <tr>
jdaggett@2527 2390 <th>"embedded-opentype"
jdaggett@2527 2391
jdaggett@4624 2392 <td><a
jdaggett@4624 2393 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
jdaggett@4624 2394 OpenType</a>
jdaggett@2527 2395
jdaggett@2527 2396 <td>.eot
jdaggett@2527 2397
jdaggett@2527 2398 <tr>
jdaggett@2527 2399 <th>"svg"
jdaggett@2527 2400
jdaggett@4624 2401 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
jdaggett@2527 2402
jdaggett@2527 2403 <td>.svg, .svgz
jdaggett@2527 2404 </table>
jdaggett@2527 2405
jdaggett@2527 2406 <p>Given the overlap in common usage between TrueType and OpenType, the
jdaggett@2527 2407 format hints "truetype" and "opentype" must be considered as synonymous; a
jdaggett@2527 2408 format hint of "opentype" does not imply that the font contains Postscript
jdaggett@2527 2409 CFF style glyph data or that it contains OpenType layout information (see
jdaggett@7377 2410 <a href="#platform-props-to-css">Appendix A</a> for more background on
jdaggett@7377 2411 this).
jdaggett@2527 2412
jdaggett@2527 2413 <p>When authors would prefer to use a locally available copy of a given
jdaggett@8198 2414 font and download it if it's not, <code>local()</code> can be used. The
jdaggett@8225 2415 locally-installed <dfn
jdaggett@8225 2416 id=font-face-name-value><var>&lt;font-face-name&gt;</var></dfn> argument
jdaggett@8272 2417 to <code>local()</code> is a format-specific string that uniquely
jdaggett@8272 2418 identifies a single font face within a larger family. The syntax for a <a
jdaggett@8225 2419 href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> is a
jdaggett@8241 2420 unique font face name enclosed by "local(" and ")". The name can
jdaggett@8241 2421 optionally be enclosed in quotes. If unquoted, the unquoted font family
jdaggett@8241 2422 name processing conventions apply; the name must be a sequence of
jdaggett@8241 2423 identifiers separated by whitespace which is converted to a string by
jdaggett@8241 2424 joining the identifiers together separated by a single space.
jdaggett@2527 2425
jdaggett@2527 2426 <pre>
jdaggett@2527 2427 /* regular face of Gentium */
jdaggett@573 2428 @font-face {
jdaggett@2527 2429 font-family: MyGentium;
jdaggett@8860 2430 src: local(Gentium), /* use locally available Gentium */
jdaggett@8860 2431 url(Gentium.woff); /* otherwise, download it */
jdaggett@573 2432 }
jdaggett@573 2433 </pre>
jdaggett@573 2434
jdaggett@8241 2435 <p>For OpenType and TrueType fonts, this string is used to match only the
jdaggett@8241 2436 Postscript name or the full font name in the name table of locally
jdaggett@8241 2437 available fonts. Which type of name is used varies by platform and font,
jdaggett@8241 2438 so authors should include both of these names to assure proper matching
jdaggett@8241 2439 across platforms. Platform substitutions for a given font name must not be
jdaggett@8241 2440 used.
jdaggett@2527 2441
jdaggett@2527 2442 <pre>
jdaggett@2527 2443 /* bold face of Gentium */
jdaggett@2527 2444 @font-face {
jdaggett@2527 2445 font-family: MyGentium;
jdaggett@8860 2446 src: local(Gentium Bold), /* full font name */
jdaggett@8860 2447 local(Gentium-Bold), /* Postscript name */
jdaggett@8860 2448 url(GentiumBold.woff); /* otherwise, download it */
jdaggett@2527 2449 font-weight: bold;
jdaggett@2527 2450 }
jdaggett@2527 2451 </pre>
jdaggett@2527 2452
jdaggett@8311 2453 <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
jdaggett@8311 2454 specifies the characteristics of a single font within a family, the unique
jdaggett@8311 2455 name used with <code>local()</code> specifies a single font, not an entire
jdaggett@8311 2456 font family. Defined in terms of OpenType font data, the Postscript name
jdaggett@8311 2457 is found in the font's <a
jdaggett@2527 2458 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
jdaggett@2527 2459 in the name record with nameID = 6 (see <a href="#OPENTYPE"
jdaggett@2556 2460 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
jdaggett@2527 2461 Postscript name is the commonly used key for all fonts on OSX and for
jdaggett@2527 2462 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
jdaggett@2527 2463 used as a unique key for fonts with TrueType glyphs on Windows.
jdaggett@2527 2464
jdaggett@2527 2465 <p>For OpenType fonts with multiple localizations of the full font name,
jdaggett@2527 2466 the US English version is used (language ID = 0x409 for Windows and
jdaggett@2527 2467 language ID = 0 for Macintosh) or the first localization when a US English
jdaggett@2527 2468 full font name is not available (the OpenType specification recommends
jdaggett@2527 2469 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
jdaggett@2527 2470 fonts minimally include US English names</a>). User agents that also match
jdaggett@2527 2471 other full font names, e.g. matching the Dutch name when the current
jdaggett@2527 2472 system locale is set to Dutch, are considered non-conformant. This is done
jdaggett@2527 2473 not to prefer English but to avoid matching inconsistencies across font
jdaggett@2527 2474 versions and OS localizations, since font style names (e.g. "Bold") are
jdaggett@2527 2475 frequently localized into many languages and the set of localizations
jdaggett@2527 2476 available varies widely across platform and font version. User agents that
jdaggett@2527 2477 match a concatenation of family name (nameID = 1) with style name (nameID
jdaggett@2527 2478 = 2) are considered non-conformant.
jdaggett@2527 2479
jdaggett@2527 2480 <p>This also allows for referencing faces that belong to larger families
jdaggett@2527 2481 that cannot otherwise be referenced.
jdaggett@2527 2482
jdaggett@2527 2483 <div class=example>
jdaggett@525 2484 <p>Use a local font or reference an SVG font in another document:</p>
jdaggett@525 2485
jdaggett@525 2486 <pre>
jdaggett@525 2487 @font-face {
jdaggett@525 2488 font-family: Headline;
jdaggett@8277 2489 src: local(Futura-Medium),
jdaggett@1148 2490 url(fonts.svg#MyGeometricModern) format("svg");
jdaggett@525 2491 }
jdaggett@525 2492 </pre>
jdaggett@525 2493
jdaggett@525 2494 <p>Create an alias for local Japanese fonts on different platforms:</p>
jdaggett@525 2495
jdaggett@525 2496 <pre>
jdaggett@525 2497 @font-face {
jdaggett@2527 2498 font-family: jpgothic;
jdaggett@525 2499 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
jdaggett@525 2500 }
jdaggett@525 2501 </pre>
jdaggett@525 2502
jdaggett@525 2503 <p>Reference a font face that cannot be matched within a larger family:</p>
jdaggett@525 2504
jdaggett@525 2505 <pre>
jdaggett@525 2506 @font-face {
jdaggett@525 2507 font-family: Hoefler Text Ornaments;
jdaggett@525 2508 /* has the same font properties as Hoefler Text Regular */
jdaggett@8277 2509 src: local(HoeflerText-Ornaments);
jdaggett@525 2510 }
jdaggett@525 2511 </pre>
jdaggett@2527 2512
jdaggett@8198 2513 <p>Since localized fullnames never match, a document with the header style
jdaggett@8198 2514 rules below would always render using the default serif font, regardless
jdaggett@8198 2515 whether a particular system locale parameter is set to Finnish or not:</p>
jdaggett@1662 2516
jdaggett@1662 2517 <pre>
jdaggett@1662 2518 @font-face {
jdaggett@1662 2519 font-family: SectionHeader;
jdaggett@6653 2520 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
jdaggett@1662 2521 font-weight: bold;
jdaggett@1662 2522 }
jdaggett@1662 2523
jdaggett@1662 2524 h2 { font-family: SectionHeader, serif; }
jdaggett@1662 2525 </pre>
jdaggett@1662 2526
jdaggett@8198 2527 <p>A conformant user agent would never load the font ‘<code
jdaggett@1662 2528 class=css>gentium.eot</code>’ in the example below, since it is
jdaggett@4624 2529 included in the first definition of the ‘<a href="#descdef-src"><code
jdaggett@4624 2530 class=property>src</code></a>’ descriptor which is overridden by the
jdaggett@8311 2531 second definition in the same <a
jdaggett@8311 2532 href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
jdaggett@1662 2533
jdaggett@1662 2534 <pre>
jdaggett@1662 2535 @font-face {
jdaggett@1662 2536 font-family: MainText;
jdaggett@8860 2537 src: url(gentium.eot); /* for use with older user agents */
jdaggett@8860 2538 src: local("Gentium"), url(gentium.woff); /* Overrides src definition */
jdaggett@1662 2539 }
jdaggett@1662 2540 </pre>
jdaggett@1662 2541 </div>
jdaggett@1662 2542
jdaggett@1662 2543 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
jdaggett@1662 2544 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
jdaggett@1662 2545 href="#descdef-font-weight">font-weight</a>, <a
jdaggett@1662 2546 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
jdaggett@518 2547
jdaggett@518 2548 <table class=descdef>
jdaggett@518 2549 <tbody>
jdaggett@518 2550 <tr>
jdaggett@518 2551 <td>Name:
jdaggett@518 2552
jdaggett@8278 2553 <td><dfn id=descdef-font-style
jdaggett@8278 2554 title="font-style!!descriptor">font-style</dfn>
jdaggett@518 2555
jdaggett@518 2556 <tr>
jdaggett@518 2557 <td>Value:
jdaggett@518 2558
jdaggett@545 2559 <td>normal | italic | oblique
jdaggett@890 2560
jdaggett@890 2561 <tr>
jdaggett@890 2562 <td><em>Initial:</em>
jdaggett@890 2563
jdaggett@890 2564 <td>normal
jdaggett@518 2565 </table>
jdaggett@518 2566
jdaggett@518 2567 <table class=descdef>
jdaggett@518 2568 <tbody>
jdaggett@518 2569 <tr>
jdaggett@518 2570 <td>Name:
jdaggett@518 2571
jdaggett@8278 2572 <td><dfn id=descdef-font-weight
jdaggett@8278 2573 title="font-weight!!descriptor">font-weight</dfn>
jdaggett@518 2574
jdaggett@518 2575 <tr>
jdaggett@518 2576 <td>Value:
jdaggett@518 2577
jdaggett@545 2578 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
jdaggett@890 2579
jdaggett@890 2580 <tr>
jdaggett@890 2581 <td><em>Initial:</em>
jdaggett@890 2582
jdaggett@890 2583 <td>normal
jdaggett@518 2584 </table>
jdaggett@518 2585
jdaggett@518 2586 <table class=descdef>
jdaggett@518 2587 <tbody>
jdaggett@518 2588 <tr>
jdaggett@518 2589 <td>Name:
jdaggett@518 2590
jdaggett@8278 2591 <td><dfn id=descdef-font-stretch
jdaggett@8278 2592 title="font-stretch!!descriptor">font-stretch</dfn>
jdaggett@518 2593
jdaggett@518 2594 <tr>
jdaggett@518 2595 <td>Value:
jdaggett@518 2596
jdaggett@545 2597 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@518 2598 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@525 2599 ultra-expanded
jdaggett@890 2600
jdaggett@890 2601 <tr>
jdaggett@890 2602 <td><em>Initial:</em>
jdaggett@890 2603
jdaggett@890 2604 <td>normal
jdaggett@518 2605 </table>
jdaggett@518 2606
jdaggett@573 2607 <p>These descriptors define the characteristics of a font face and are used
jdaggett@573 2608 in the process of matching styles to specific faces. For a font family
jdaggett@8311 2609 defined with several <a
jdaggett@8311 2610 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
jdaggett@8311 2611 can either download all faces in the family or use these descriptors to
jdaggett@8311 2612 selectively download font faces that match actual styles used in document.
jdaggett@8311 2613 The values for these descriptors are the same as those for the
jdaggett@8311 2614 corresponding font properties except that relative keywords are not
jdaggett@8311 2615 allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
jdaggett@8311 2616 and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
jdaggett@8311 2617 these descriptors are omitted, initial values are assumed.
jdaggett@890 2618
jdaggett@890 2619 <p>The value for these font face style attributes is used in place of the
jdaggett@890 2620 style implied by the underlying font data. This allows authors to combine
jdaggett@890 2621 faces in flexible combinations, even in situations where the original font
jdaggett@890 2622 data was arranged differently. User agents that implement synthetic
jdaggett@8272 2623 bolding and obliquing must only apply synthetic styling in cases where the
jdaggett@8272 2624 font descriptors imply this is needed, rather than based on the style
jdaggett@890 2625 attributes implied by the font data.
jdaggett@573 2626
jdaggett@1662 2627 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
jdaggett@1662 2628 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
jdaggett@518 2629
jdaggett@518 2630 <table class=descdef>
jdaggett@518 2631 <tbody>
jdaggett@518 2632 <tr>
jdaggett@518 2633 <td>Name:
jdaggett@518 2634
jdaggett@1662 2635 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
jdaggett@518 2636
jdaggett@518 2637 <tr>
jdaggett@518 2638 <td>Value:
jdaggett@518 2639
jdaggett@8225 2640 <td><a href="#urange-value"><var>&lt;urange&gt;</var></a> #
jdaggett@890 2641
jdaggett@890 2642 <tr>
jdaggett@890 2643 <td><em>Initial:</em>
jdaggett@890 2644
jdaggett@1148 2645 <td>U+0-10FFFF
jdaggett@518 2646 </table>
jdaggett@518 2647
jdaggett@8213 2648 <p>This descriptor defines the set of Unicode codepoints that may be
jdaggett@8213 2649 supported by the font face for which it is declared. The descriptor value
jdaggett@8225 2650 is a comma-delimited list of Unicode range (<a
jdaggett@8225 2651 href="#urange-value"><var>&lt;urange&gt;</var></a>) values. The union of
jdaggett@8225 2652 these ranges defines the set of codepoints that serves as a hint for user
jdaggett@8225 2653 agents when deciding whether or not to download a font resource for a
jdaggett@8225 2654 given text run.
jdaggett@8225 2655
jdaggett@8225 2656 <p>Each <dfn id=urange-value><var>&lt;urange&gt;</var></dfn> value is a <a
jdaggett@8225 2657 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
jdaggett@8225 2658 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
jdaggett@8225 2659 "U+" or "u+" prefix followed by a codepoint range in one of the three
jdaggett@8241 2660 forms listed below. Ranges that do not fit one of the these forms are
jdaggett@8241 2661 invalid and cause the declaration to be ignored.
jdaggett@8241 2662
jdaggett@8241 2663 <dl>
jdaggett@8241 2664 <dt>single codepoint (e.g. U+416)
jdaggett@8241 2665
jdaggett@8241 2666 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
jdaggett@8241 2667 digits
jdaggett@8241 2668
jdaggett@8246 2669 <dt>interval range (e.g. U+400-4ff)
jdaggett@8241 2670
jdaggett@8241 2671 <dd>represented as two hyphen-separated valid Unicode codepoints
jdaggett@8241 2672 indicating the inclusive start and end codepoints of a range
jdaggett@8241 2673
jdaggett@8246 2674 <dt>wildcard range (e.g. U+4??)
jdaggett@8241 2675
jdaggett@8241 2676 <dd>defined by the set of codepoints implied when trailing ‘<code
jdaggett@8246 2677 class=css>?</code>’ characters signify any hexadeximal digit
jdaggett@8241 2678 </dl>
jdaggett@573 2679
jdaggett@8213 2680 <p>Individual codepoints are written using hexadecimal values that
jdaggett@8213 2681 correspond to <a href="http://www.unicode.org/charts/">Unicode character
jdaggett@8225 2682 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
jdaggett@8225 2683 inclusive. Digit values of codepoints are ASCII case-insensitive. For
jdaggett@8360 2684 interval ranges, the start and end codepoints are valid Unicode values and
jdaggett@8360 2685 the end codepoint is greater than or equal to the start codepoint.
jdaggett@8225 2686
jdaggett@8225 2687 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
jdaggett@8225 2688 "U+???") are valid and equivalent to a wildcard range with an initial zero
jdaggett@8225 2689 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
jdaggett@8225 2690 the range of valid Unicode codepoints are invalid. Because of this, the
jdaggett@8225 2691 maximum number of trailing ‘<code class=css>?</code>’ wildcard
jdaggett@8272 2692 characters is five, even though the <a
jdaggett@8225 2693 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
jdaggett@8225 2694 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
jdaggett@8213 2695
jdaggett@8213 2696 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
jdaggett@8213 2697 href="#descdef-unicode-range"><code
jdaggett@8213 2698 class=property>unicode-range</code></a>’ descriptor declaration, ranges
jdaggett@8241 2699 may overlap. The union of these ranges defines the set of codepoints for
jdaggett@8241 2700 which the corresponding font may be used. User agents must not download or
jdaggett@8241 2701 use the font for codepoints outside this set. User agents may normalize
jdaggett@8241 2702 the list of ranges into a list that is different but represents the same
jdaggett@8241 2703 set of codepoints.
jdaggett@8213 2704
jdaggett@8272 2705 <p>The associated font might not contain glyphs for the entire set of
jdaggett@8213 2706 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
jdaggett@8213 2707 class=property>unicode-range</code></a>’ descriptor. When the font is
jdaggett@8391 2708 used, the <dfn id=effective-character-map>effective character map</dfn> is
jdaggett@8225 2709 the intersection of the codepoints defined by ‘<a
jdaggett@8225 2710 href="#descdef-unicode-range"><code
jdaggett@8225 2711 class=property>unicode-range</code></a>’ with the font's <a
jdaggett@8225 2712 href="#character-map"><em>character map</em></a>. This allows authors to
jdaggett@8225 2713 define supported ranges in terms of broad ranges without worrying about
jdaggett@8225 2714 the precise codepoint ranges supported by the underlying font.
jdaggett@8225 2715
jdaggett@8225 2716 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
jdaggett@8225 2717 to define composite fonts</h3>
jdaggett@8225 2718
jdaggett@8311 2719 <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
jdaggett@8311 2720 with different unicode ranges for the same family and style descriptor
jdaggett@8311 2721 values can be used to create composite fonts that mix the glyphs from
jdaggett@8311 2722 different fonts for different scripts. This can be used to combine fonts
jdaggett@8311 2723 that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
jdaggett@8311 2724 or it can be used by authors as a way of segmenting a font into fonts for
jdaggett@8311 2725 commonly used characters and less frequently used characters. Since the
jdaggett@8311 2726 user agent will only pull down the fonts it needs this helps reduce page
jdaggett@8311 2727 bandwidth.
jdaggett@8311 2728
jdaggett@8311 2729 <p>If the unicode ranges overlap for a set of <a
jdaggett@8311 2730 href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
jdaggett@8311 2731 family and style descriptor values, the rules are ordered in the reverse
jdaggett@8311 2732 order they were defined; the last rule defined is the first to be checked
jdaggett@8311 2733 for a given character.
jdaggett@890 2734
jdaggett@890 2735 <p>Example ranges for specific languages or characters:
jdaggett@518 2736
jdaggett@518 2737 <dl>
jdaggett@529 2738 <dt>unicode-range: U+A5;
jdaggett@529 2739
jdaggett@1149 2740 <dd>a single code point, the yen/yuan symbol
jdaggett@529 2741
jdaggett@1148 2742 <dt>unicode-range: U+0-7F;
jdaggett@1148 2743
jdaggett@1148 2744 <dd>code range for basic ASCII characters
jdaggett@1148 2745
jdaggett@529 2746 <dt>unicode-range: U+590-5ff;
jdaggett@529 2747
jdaggett@529 2748 <dd>code range for Hebrew characters
jdaggett@529 2749
jdaggett@529 2750 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
jdaggett@529 2751
jdaggett@529 2752 <dd>code range for Japanese kanji, hiragana and katakana characters plus
jdaggett@529 2753 yen/yuan symbol
jdaggett@518 2754 </dl>
jdaggett@518 2755
jdaggett@529 2756 <div class=example>
jdaggett@531 2757 <p>The BBC provides news services in a wide variety of languages, many
jdaggett@8311 2758 that are not well supported across all platforms. Using an <a
jdaggett@8311 2759 href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
jdaggett@8311 2760 provide a font for any of these languages, as it already does via a
jdaggett@8311 2761 manual font download.</p>
jdaggett@531 2762
jdaggett@531 2763 <pre>
jdaggett@531 2764 @font-face {
jdaggett@531 2765 font-family: BBCBengali;
jdaggett@8860 2766 src: url(fonts/BBCBengali.woff) format("woff");
jdaggett@531 2767 unicode-range: U+00-FF, U+980-9FF;
jdaggett@531 2768 }
jdaggett@531 2769 </pre>
jdaggett@529 2770 </div>
jdaggett@529 2771
jdaggett@529 2772 <div class=example>
jdaggett@531 2773 <p>Technical documents often require a wide range of symbols. The STIX
jdaggett@531 2774 Fonts project is one project aimed at providing fonts to support a wide
jdaggett@531 2775 range of technical typesetting in a standardized way. The example below
jdaggett@531 2776 shows the use of a font that provides glyphs for many of the mathematical
jdaggett@531 2777 and technical symbol ranges within Unicode:</p>
jdaggett@531 2778
jdaggett@531 2779 <pre>
jdaggett@531 2780 @font-face {
jdaggett@531 2781 font-family: STIXGeneral;
jdaggett@531 2782 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
jdaggett@531 2783 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
jdaggett@531 2784 }
jdaggett@531 2785 </pre>
jdaggett@529 2786 </div>
jdaggett@529 2787
jdaggett@529 2788 <div class=example>
jdaggett@529 2789 <p>This example shows how an author can override the glyphs used for Latin
jdaggett@529 2790 characters in a Japanese font with glyphs from a different font. The
jdaggett@529 2791 first rule specifies no range so it defaults to the entire range. The
jdaggett@529 2792 range specified in the second rule overlaps but takes precedence because
jdaggett@529 2793 it is defined later.</p>
jdaggett@529 2794
jdaggett@529 2795 <pre>
jdaggett@529 2796 @font-face {
jdaggett@529 2797 font-family: JapaneseWithGentium;
jdaggett@529 2798 src: local(MSMincho);
jdaggett@529 2799 /* no range specified, defaults to entire range */
jdaggett@529 2800 }
jdaggett@529 2801
jdaggett@529 2802 @font-face {
jdaggett@529 2803 font-family: JapaneseWithGentium;
jdaggett@8860 2804 src: url(../fonts/Gentium.woff);
jdaggett@529 2805 unicode-range: U+0-2FF;
jdaggett@529 2806 }
jdaggett@529 2807 </pre>
jdaggett@529 2808 </div>
jdaggett@1148 2809
jdaggett@1148 2810 <div class=example>
jdaggett@1148 2811 <p>Consider a family constructed to optimize bandwidth by separating out
jdaggett@1148 2812 Latin, Japanese and other characters into different font files:</p>
jdaggett@1148 2813
jdaggett@1148 2814 <pre>
jdaggett@1148 2815 /* fallback font - size: 4.5MB */
jdaggett@1148 2816 @font-face {
jdaggett@1148 2817 font-family: DroidSans;
jdaggett@8860 2818 src: url(DroidSansFallback.woff);
jdaggett@1148 2819 /* no range specified, defaults to entire range */
jdaggett@1148 2820 }
jdaggett@1148 2821
jdaggett@1148 2822 /* Japanese glyphs - size: 1.2MB */
jdaggett@1148 2823 @font-face {
jdaggett@1148 2824 font-family: DroidSans;
jdaggett@8860 2825 src: url(DroidSansJapanese.woff);
jdaggett@1148 2826 unicode-range: U+3000-9FFF, U+ff??;
jdaggett@1148 2827 }
jdaggett@1148 2828
jdaggett@8277 2829 /* Latin, Greek, Cyrillic along with some
jdaggett@1148 2830 punctuation and symbols - size: 190KB */
jdaggett@1148 2831 @font-face {
jdaggett@1148 2832 font-family: DroidSans;
jdaggett@8860 2833 src: url(DroidSans.woff);
jdaggett@1148 2834 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
jdaggett@1148 2835 }
jdaggett@1148 2836 </pre>
jdaggett@1148 2837
jdaggett@1148 2838 <p>For simple Latin text, only the font for Latin characters is
jdaggett@1148 2839 downloaded:</p>
jdaggett@1148 2840
jdaggett@1148 2841 <pre>
jdaggett@1148 2842 body { font-family: DroidSans; }
jdaggett@1148 2843
jdaggett@1148 2844 &lt;p>This is that&lt;/p>
jdaggett@1148 2845 </pre>
jdaggett@1148 2846
jdaggett@1148 2847 <p>In this case the user agent first checks the unicode-range for the font
jdaggett@8860 2848 containing Latin characters (DroidSans.woff). Since all the characters
jdaggett@1148 2849 above are in the range U+0-5FF, the user agent downloads the font and
jdaggett@1148 2850 renders the text with that font.</p>
jdaggett@1148 2851
jdaggett@1148 2852 <p>Next, consider text that makes use of an arrow character (⇨):</p>
jdaggett@1148 2853
jdaggett@1148 2854 <pre>
jdaggett@1148 2855 &lt;p>This &amp;#x21e8; that&lt;p>
jdaggett@1148 2856 </pre>
jdaggett@1148 2857
jdaggett@1148 2858 <p>The user agent again first checks the unicode-range of the font
jdaggett@1149 2859 containing Latin characters. Since U+2000-2300 includes the arrow code
jdaggett@1149 2860 point (U+21E8), the user agent downloads the font. For this character
jdaggett@1148 2861 however the Latin font does not have a matching glyph, so the effective
jdaggett@1149 2862 unicode-range used for font matching excludes this code point. Next, the
jdaggett@1148 2863 user agent evaluates the Japanese font. The unicode-range for the
jdaggett@1148 2864 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
jdaggett@1662 2865 user agent does not download the Japanese font. Next the fallback font is
jdaggett@8311 2866 considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2867 rule for the fallback font does not define unicode-range so its value
jdaggett@8311 2868 defaults to the range of all Unicode code points. The fallback font is
jdaggett@8311 2869 downloaded and used to render the arrow character.</p>
jdaggett@1148 2870 </div>
jdaggett@890 2871
jdaggett@8225 2872 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
jdaggett@1662 2873 href="#descdef-font-variant">font-variant</a> and <a
jdaggett@1662 2874 href="#descdef-font-feature-settings">font-feature-settings</a>
jdaggett@1662 2875 descriptors</h3>
jdaggett@1662 2876
jdaggett@1662 2877 <table class=descdef>
jdaggett@1662 2878 <tbody>
jdaggett@1662 2879 <tr>
jdaggett@1662 2880 <td>Name:
jdaggett@1662 2881
jdaggett@8278 2882 <td><dfn id=descdef-font-variant
jdaggett@8278 2883 title="font-variant!!descriptor">font-variant</dfn>
jdaggett@1662 2884
jdaggett@1662 2885 <tr>
jdaggett@1662 2886 <td>Value:
jdaggett@1662 2887
jdaggett@8278 2888 <td><a href="#font-variant-normal-value"
jdaggett@8278 2889 title="normal!!font-variant">normal</a> | <a
jdaggett@8278 2890 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
jdaggett@8278 2891 <a href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a>
jdaggett@8278 2892 || <a
jdaggett@8225 2893 href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
jdaggett@8225 2894 || <a
jdaggett@8225 2895 href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
jdaggett@8225 2896 || <a
jdaggett@8225 2897 href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
jdaggett@8225 2898 || <a href="#stylistic"><var
jdaggett@8225 2899 title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 2900 href="#historical-forms"><var>historical-forms</var></a> || <a
jdaggett@8225 2901 href="#styleset"><var
jdaggett@8225 2902 title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
jdaggett@8225 2903 href="#character-variant"><var
jdaggett@8225 2904 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 2905 #)</var></a> || <a href="#swash"><var
jdaggett@8225 2906 title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 2907 href="#ornaments"><var
jdaggett@8225 2908 title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 2909 href="#annotation"><var
jdaggett@8225 2910 title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
jdaggett@8225 2911 <a href="#small-caps"><i>small-caps</i></a> | <a
jdaggett@8225 2912 href="#all-small-caps"><i>all-small-caps</i></a> | <a
jdaggett@8225 2913 href="#petite-caps"><i>petite-caps</i></a> | <a
jdaggett@8225 2914 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
jdaggett@8225 2915 href="#unicase"><i>unicase</i></a> | <a
jdaggett@8225 2916 href="#titling-caps"><i>titling-caps</i></a> ] || <a
jdaggett@8225 2917 href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
jdaggett@8225 2918 || <a
jdaggett@8225 2919 href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
jdaggett@8225 2920 || <a
jdaggett@8225 2921 href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
jdaggett@8225 2922 || <a href="#ordinal"><i>ordinal</i></a> || <a
jdaggett@8225 2923 href="#slashed-zero"><i>slashed-zero</i></a> || <a
jdaggett@8225 2924 href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
jdaggett@8225 2925 || <a
jdaggett@8225 2926 href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
jdaggett@8225 2927 || <a href="#ruby"><i>ruby</i></a> ]
jdaggett@1662 2928
jdaggett@1662 2929 <tr>
jdaggett@1662 2930 <td><em>Initial:</em>
jdaggett@1662 2931
jdaggett@1662 2932 <td>normal
jdaggett@1662 2933 </table>
jdaggett@1662 2934
jdaggett@1662 2935 <table class=descdef>
jdaggett@1662 2936 <tbody>
jdaggett@1662 2937 <tr>
jdaggett@1662 2938 <td>Name:
jdaggett@1662 2939
jdaggett@8278 2940 <td><dfn id=descdef-font-feature-settings
jdaggett@8278 2941 title="font-feature-settings!!descriptor">font-feature-settings</dfn>
jdaggett@1662 2942
jdaggett@1662 2943 <tr>
jdaggett@1662 2944 <td>Value:
jdaggett@1662 2945
jdaggett@8278 2946 <td><a href="#font-feature-settings-normal-value"
jdaggett@8278 2947 title="normal!!font-feature-settings">normal</a> | <a
jdaggett@8225 2948 href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
jdaggett@1662 2949
jdaggett@1662 2950 <tr>
jdaggett@1662 2951 <td><em>Initial:</em>
jdaggett@1662 2952
jdaggett@1662 2953 <td>normal
jdaggett@1662 2954 </table>
jdaggett@1662 2955
jdaggett@8213 2956 <p>These descriptors define initial settings that apply when the font
jdaggett@8311 2957 defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 2958 rule is rendered. They do not affect font selection. Values are identical
jdaggett@8311 2959 to those defined for the corresponding <a href="#propdef-font-variant"
jdaggett@8278 2960 title="font-variant!!property">‘<code
jdaggett@8279 2961 class=property>font-variant</code>’</a> and <a
jdaggett@8279 2962 href="#propdef-font-feature-settings"
jdaggett@8279 2963 title="font-feature-settings!!property">‘<code
jdaggett@8279 2964 class=property>font-feature-settings</code>’</a> properties defined
jdaggett@8279 2965 below except that the value ‘<code class=property>inherit</code>’ is
jdaggett@8279 2966 omitted. When multiple font feature descriptors or properties are used,
jdaggett@8279 2967 the cumulative effect on text rendering is detailed in the section <a
jdaggett@8031 2968 href="#font-feature-resolution">Font Feature Resolution</a> below. In
jdaggett@8278 2969 cases where specific values define synthesized fallback for certain <a
jdaggett@8278 2970 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8278 2971 class=property>font-variant</code>’</a> subproperties, the same
jdaggett@8031 2972 synthesized fallback applies when used within those values are used with
jdaggett@8278 2973 the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
jdaggett@8031 2974 class=property>font-variant</code>’</a> descriptor.
jdaggett@1662 2975
jdaggett@8225 2976 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
jdaggett@2563 2977 guidelines</h3>
jdaggett@2563 2978
jdaggett@8311 2979 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
jdaggett@8311 2980 designed to allow lazy loading of font resources that are only downloaded
jdaggett@8311 2981 when used within a document. A stylesheet can include <a
jdaggett@8311 2982 href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
jdaggett@8311 2983 of fonts of which only a select set are used; user agents must only
jdaggett@8311 2984 download those fonts that are referred to within the style rules
jdaggett@8311 2985 applicable to a given page. User agents that download all fonts defined in
jdaggett@8311 2986 <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
jdaggett@8311 2987 considering whether those fonts are in fact used within a page are
jdaggett@8311 2988 considered non-conformant. In cases where a font might be downloaded in
jdaggett@8360 2989 character fallback cases, user agents may download a font if it's
jdaggett@8360 2990 contained within the computed value of <a href="#propdef-font-family"
jdaggett@8360 2991 title="font-family!!property">‘<code
jdaggett@8360 2992 class=property>font-family</code>’</a> for a given text run.
jdaggett@2563 2993
jdaggett@2563 2994 <pre>
jdaggett@2563 2995 @font-face {
jdaggett@2563 2996 font-family: GeometricModern;
jdaggett@8860 2997 src: url(font.woff);
jdaggett@2563 2998 }
jdaggett@2563 2999
jdaggett@2563 3000 p {
jdaggett@2563 3001 /* font will be downloaded for pages with p elements */
jdaggett@2563 3002 font-family: GeometricModern, sans-serif;
jdaggett@2563 3003 }
jdaggett@2563 3004
jdaggett@2563 3005 h2 {
jdaggett@2563 3006 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
jdaggett@2563 3007 font-family: Futura, GeometricModern, sans-serif;
jdaggett@2563 3008 }
jdaggett@2563 3009 </pre>
jdaggett@2563 3010
jdaggett@2563 3011 <p>In cases where textual content is loaded before downloadable fonts are
jdaggett@2563 3012 available, user agents may render text as it would be rendered if
jdaggett@2563 3013 downloadable font resources are not available or they may render text
jdaggett@2563 3014 transparently with fallback fonts to avoid a flash of text using a
jdaggett@2563 3015 fallback font. In cases where the font download fails user agents must
jdaggett@2563 3016 display text, simply leaving transparent text is considered non-conformant
jdaggett@2563 3017 behavior. Authors are advised to use fallback fonts in their font lists
jdaggett@8431 3018 that closely match the metrics of the downloadable fonts to avoid large
jdaggett@8431 3019 page reflows where possible.
jdaggett@2563 3020
jdaggett@8863 3021 <p><a id=same-origin-restriction> </a><a
jdaggett@8863 3022 id=allowing-cross-origin-font-loading> </a>
jdaggett@8863 3023
jdaggett@8863 3024 <h3 id=font-fetching-requirements><span class=secno>4.9 </span>Font
jdaggett@8863 3025 fetching requirements</h3>
jdaggett@7253 3026 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
jdaggett@7253 3027 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
jdaggett@7253 3028 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
jdaggett@7253 3029 -->
jdaggett@2740 3030
jdaggett@8640 3031 <p>For font loads, user agents must use the <a
jdaggett@8640 3032 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
jdaggett@8640 3033 CORS-enabled fetch</a> method defined by the <a href="#HTML5"
jdaggett@8640 3034 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification for URL's
jdaggett@8640 3035 defined within @font-face rules. When fetching, user agents must use
jdaggett@8640 3036 "Anonymous" mode, set the referrer source to the stylesheet's URL and set
jdaggett@8640 3037 the origin to the URL of the containing document.
jdaggett@2737 3038
jdaggett@8863 3039 <p class=note>The implications of this for authors are that fonts will
jdaggett@8863 3040 typically not be loaded cross-origin unless authors specifically takes
jdaggett@8863 3041 steps to permit cross-origin loads. Sites can explicitly allow cross-site
jdaggett@8863 3042 loading of font data using the <code>Access-Control-Allow-Origin</code>
jdaggett@8863 3043 HTTP header. For other schemes, no explicit mechanism to allow
jdaggett@8864 3044 cross-origin loading, beyond what is permitted by the <a
jdaggett@8863 3045 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
jdaggett@8864 3046 CORS-enabled fetch</a> method, is defined or required.
jdaggett@8863 3047
jdaggett@8872 3048 <div class=example> For the examples given below, assume that a document is
jdaggett@8872 3049 located at <code>http://example.com/page.html</code> and all URL's link to
jdaggett@8872 3050 valid font resources supported by the user agent. Fonts defined with the
jdaggett@8872 3051 ‘<a href="#descdef-src"><code class=property>src</code></a>’
jdaggett@8872 3052 descriptor values below will be loaded:
jdaggett@8872 3053 <pre>/* same origin (i.e. domain, scheme, port match document) */
jdaggett@8872 3054 src: url(fonts/simple.woff);
jdaggett@8872 3055 src: url(//fonts/simple.woff);
jdaggett@8872 3056
jdaggett@8872 3057 /* data url's with no redirects are treated as same origin */
jdaggett@8872 3058 src: url("data:application/font-woff;base64,...");
jdaggett@8872 3059
jdaggett@8872 3060 /* cross origin, different domain */
jdaggett@8872 3061 /* Access-Control-Allow-Origin response header set to '*' */
jdaggett@8872 3062 src: url(http://another.example.com/fonts/simple.woff);
jdaggett@8872 3063 </pre>
jdaggett@8872 3064 Fonts defined with the ‘<a href="#descdef-src"><code
jdaggett@8872 3065 class=property>src</code></a>’ descriptor values below will fail to
jdaggett@8872 3066 load:
jdaggett@8872 3067 <pre>/* cross origin, different scheme */
jdaggett@8872 3068 /* no Access-Control-xxx headers in response */
jdaggett@8872 3069 src: url(https://example.com/fonts/simple.woff);
jdaggett@8872 3070
jdaggett@8872 3071 /* cross origin, different domain */
jdaggett@8872 3072 /* no Access-Control-xxx headers in response */
jdaggett@8872 3073 src: url(http://another.example.com/fonts/simple.woff);
jdaggett@8872 3074 </pre>
jdaggett@8872 3075 </div>
jdaggett@8872 3076
jdaggett@6699 3077 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
jdaggett@6699 3078 Algorithm</h2>
jdaggett@484 3079
jdaggett@2457 3080 <p>The algorithm below describes how fonts are associated with individual
jdaggett@2457 3081 runs of text. For each character in the run a font family is chosen and a
jdaggett@2457 3082 particular font face is selected containing a glyph for that character.
jdaggett@2457 3083
jdaggett@7309 3084 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
jdaggett@7309 3085 font family names</h3>
jdaggett@7309 3086
jdaggett@7309 3087 <p>As part of the font matching algorithm outlined below, user agents must
jdaggett@7309 3088 match font family names used in style rules with actual font family names
jdaggett@8391 3089 contained in fonts available in a given environment or with font family
jdaggett@8391 3090 names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8391 3091 rules. User agents must match these names case insensitively, using the
jdaggett@8391 3092 "Default Caseless Matching" algorithm outlined in the Unicode
jdaggett@8391 3093 specification <a href="#UNICODE6"
jdaggett@8391 3094 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
jdaggett@8391 3095 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
jdaggett@8391 3096 the algorithm must be applied without normalizing the strings involved and
jdaggett@8391 3097 without applying any language-specific tailorings. The case folding method
jdaggett@8391 3098 specified by this algorithm uses the case mappings with status field
jdaggett@8391 3099 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
jdaggett@8391 3100 in the CaseFolding.txt file of the Unicode Character Database.
jdaggett@7355 3101
jdaggett@7355 3102 <p class=note> For authors this means that font family names are matched
jdaggett@8272 3103 case insensitively, whether those names exist in a platform font or in the
jdaggett@8311 3104 <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
jdaggett@8311 3105 in a stylesheet. Authors should take care to ensure that names use a
jdaggett@8311 3106 character sequence consistent with the actual font family name,
jdaggett@8311 3107 particularly when using combining characters such as diacritical marks.
jdaggett@8311 3108 For example, a family name that contains an uppercase A (U+0041) followed
jdaggett@8311 3109 by a combining ring (U+030A) will <strong>not</strong> match a name that
jdaggett@8311 3110 looks identical but which uses the precomposed lowercase a-ring character
jdaggett@8311 3111 (U+00E5) instead of the combining sequence.
jdaggett@7309 3112
jdaggett@8391 3113 <p class=note> Implementors should take care to verify that a given
jdaggett@8391 3114 caseless string comparison implementation uses this precise algorithm and
jdaggett@8391 3115 not assume that a given platform string matching routine follows it, as
jdaggett@8391 3116 many of these have locale-specific behavior or use some level of string
jdaggett@8391 3117 normalization.
jdaggett@8391 3118
jdaggett@7309 3119 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
jdaggett@2457 3120 styles</h3>
jdaggett@2457 3121
jdaggett@8391 3122 <p>The procedure for choosing a font for a given character in a run of text
jdaggett@8391 3123 consists of iterating over the font families named by the <a
jdaggett@8391 3124 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8391 3125 class=property>font-family</code>’</a> property, selecting a font face
jdaggett@531 3126 with the appropriate style based on other font properties and then
jdaggett@8391 3127 determining whether a glyph exists for the given character. This is done
jdaggett@7311 3128 using the <dfn id=character-map>character map</dfn> of the font, data
jdaggett@8397 3129 which maps characters to the default glyph for that character. A font is
jdaggett@8397 3130 considered to <dfn id=support>support</dfn> a given character if (1) the
jdaggett@8397 3131 character is contained in the font's <a
jdaggett@8397 3132 href="#character-map"><em>character map</em></a> and (2) if required by
jdaggett@8397 3133 the containing script, shaping information is available for that
jdaggett@8397 3134 character.
jdaggett@8397 3135
jdaggett@8397 3136 <p>Some legacy fonts may include a given character in the <a
jdaggett@8397 3137 href="#character-map"><em>character map</em></a> but lack the shaping
jdaggett@8397 3138 information (e.g. <a
jdaggett@8397 3139 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
jdaggett@8397 3140 layout tables</a> or <a
jdaggett@8397 3141 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&amp;item_id=graphite_techAbout">Graphite
jdaggett@8397 3142 tables</a>) necessary for correctly rendering text runs containing that
jdaggett@8397 3143 character.
jdaggett@8397 3144
jdaggett@8397 3145 <p>Codepoint sequences consisting of a base character followed by a
jdaggett@8397 3146 sequence of combining characters are treated slightly differently, see the
jdaggett@8397 3147 section on <a href="#cluster-matching">cluster matching</a> below.
jdaggett@531 3148
jdaggett@7232 3149 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
jdaggett@7232 3150 given font family is defined to be the face that would be selected if all
jdaggett@7232 3151 font style properties were set to their initial value.
jdaggett@7232 3152
jdaggett@531 3153 <ol id=fontmatchingalg>
jdaggett@2457 3154 <li>Using the computed font property values for a given element, the user
jdaggett@8391 3155 agent starts with the first family name specified by the <a
jdaggett@8391 3156 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8278 3157 class=property>font-family</code>’</a> property.
jdaggett@2457 3158
jdaggett@8391 3159 <li>If the family name is a generic family keyword, the user agent looks
jdaggett@8391 3160 up the appropriate font family name to be used. User agents may choose
jdaggett@8391 3161 the generic font family to use based on the language of the containing
jdaggett@8391 3162 element or the Unicode range of the character.
jdaggett@2457 3163
jdaggett@2457 3164 <li>For other family names, the user agent attempts to find the family
jdaggett@8311 3165 name among fonts defined via <a
jdaggett@8311 3166 href="#at-font-face-rule"><code>@font-face</code></a> rules and then
jdaggett@8391 3167 among available system fonts, matching names with a <a
jdaggett@8391 3168 href="#font-family-casing">case-insensitive comparison</a> as outlined in
jdaggett@8391 3169 the section above. On systems containing fonts with multiple localized
jdaggett@8391 3170 font family names, user agents must match any of these names independent
jdaggett@8391 3171 of the underlying system locale or platform API used. If the font
jdaggett@8391 3172 resources defined for a given face in an <a
jdaggett@8311 3173 href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
jdaggett@8311 3174 available or contain invalid font data, then the face should be treated
jdaggett@8311 3175 as not present in the family. If no faces are present for a family
jdaggett@8311 3176 defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 3177 rules, the family should be treated as missing; matching a platform font
jdaggett@8311 3178 with the same name must not occur in this case.
jdaggett@2457 3179
jdaggett@2457 3180 <li>If a font family match occurs, the user agent assembles the set of
jdaggett@6701 3181 font faces in that family and then narrows the set to a single face using
jdaggett@8391 3182 other font properties in the order given below. A group of faces defined
jdaggett@8391 3183 via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
jdaggett@8391 3184 identical font descriptor values but differing ‘<a
jdaggett@8391 3185 href="#descdef-unicode-range"><code
jdaggett@8391 3186 class=property>unicode-range</code></a>’ values are considered to be a
jdaggett@8391 3187 single <dfn id=composite-face>composite face</dfn> for this step:
jdaggett@2457 3188 <ol id=fontstylematchingalg>
jdaggett@8278 3189 <li><a href="#propdef-font-stretch"
jdaggett@8278 3190 title="font-stretch!!property">‘<code
jdaggett@8278 3191 class=property>font-stretch</code>’</a> is tried first. If the
jdaggett@8278 3192 matching set contains faces with width values matching the <a
jdaggett@8278 3193 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
jdaggett@8278 3194 class=property>font-stretch</code>’</a> value, faces with other width
jdaggett@4624 3195 values are removed from the matching set. If there is no face that
jdaggett@4624 3196 exactly matches the width value the nearest width is used instead. If
jdaggett@8278 3197 the value of <a href="#propdef-font-stretch"
jdaggett@8278 3198 title="font-stretch!!property">‘<code
jdaggett@8368 3199 class=property>font-stretch</code>’</a> is <a
jdaggett@8368 3200 href="#font-stretch-normal-value" title="normal!!font-stretch">‘<code
jdaggett@8368 3201 class=property>normal</code>’</a> or one of the condensed values,
jdaggett@8278 3202 narrower width values are checked first, then wider values. If the
jdaggett@8278 3203 value of <a href="#propdef-font-stretch"
jdaggett@8278 3204 title="font-stretch!!property">‘<code
jdaggett@8278 3205 class=property>font-stretch</code>’</a> is one of the expanded
jdaggett@4624 3206 values, wider values are checked first, followed by narrower values.
jdaggett@4624 3207 Once the closest matching width has been determined by this process,
jdaggett@4624 3208 faces with other widths are removed from the matching set.
jdaggett@4624 3209
jdaggett@8278 3210 <li><a href="#propdef-font-style" title="font-style!!property">‘<code
jdaggett@8278 3211 class=property>font-style</code>’</a> is tried next. If the value of
jdaggett@8278 3212 <a href="#propdef-font-style" title="font-style!!property">‘<code
jdaggett@8278 3213 class=property>font-style</code>’</a> is ‘<a href="#italic"><code
jdaggett@8278 3214 class=property>italic</code></a>’, italic faces are checked first,
jdaggett@8278 3215 then oblique, then normal faces. If the value is ‘<a
jdaggett@8278 3216 href="#oblique"><code class=property>oblique</code></a>’, oblique
jdaggett@8278 3217 faces are checked first, then italic faces and then normal faces. If
jdaggett@8368 3218 the value is <a href="#font-style-normal-value"
jdaggett@8368 3219 title="normal!!font-style">‘<code
jdaggett@8368 3220 class=property>normal</code>’</a>, normal faces are checked first,
jdaggett@8279 3221 then oblique faces, then italic faces. Faces with other style values
jdaggett@8279 3222 are excluded from the matching set. User agents are permitted to
jdaggett@8279 3223 distinguish between italic and oblique faces within platform font
jdaggett@8391 3224 families but this is not required, so all italic or oblique faces may
jdaggett@8391 3225 be treated as italic faces. However, within font families defined via
jdaggett@8391 3226 <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
jdaggett@8391 3227 and oblique faces must be distinguished using the value of the <a
jdaggett@8311 3228 href="#descdef-font-style" title="font-style!!descriptor">‘<code
jdaggett@8391 3229 class=property>font-style</code>’</a> descriptor. For families that
jdaggett@8391 3230 lack any italic or oblique faces, users agents may create artificial
jdaggett@8391 3231 oblique faces, if this is permitted by the value of the ‘<a
jdaggett@8391 3232 href="#propdef-font-synthesis"><code
jdaggett@8391 3233 class=property>font-synthesis</code></a>’ property.
jdaggett@8278 3234
jdaggett@8278 3235 <li><a href="#propdef-font-weight"
jdaggett@8278 3236 title="font-weight!!property">‘<code
jdaggett@8391 3237 class=property>font-weight</code>’</a> is matched next, so it will
jdaggett@8278 3238 always reduce the matching set to a single font face. If bolder/lighter
jdaggett@8278 3239 relative weights are used, the effective weight is calculated based on
jdaggett@8278 3240 the inherited weight value, as described in the definition of the <a
jdaggett@8278 3241 href="#propdef-font-weight" title="font-weight!!property">‘<code
jdaggett@8278 3242 class=property>font-weight</code>’</a> property. Given the desired
jdaggett@4624 3243 weight and the weights of faces in the matching set after the steps
jdaggett@4624 3244 above, if the desired weight is available that face matches. Otherwise,
jdaggett@4624 3245 a weight is chosen using the rules below:
jdaggett@531 3246 <ul>
jdaggett@531 3247 <li>If the desired weight is less than 400, weights below the desired
jdaggett@531 3248 weight are checked in descending order followed by weights above the
jdaggett@531 3249 desired weight in ascending order until a match is found.
jdaggett@531 3250
jdaggett@531 3251 <li>If the desired weight is greater than 500, weights above the
jdaggett@531 3252 desired weight are checked in ascending order followed by weights
jdaggett@531 3253 below the desired weight in descending order until a match is found.
jdaggett@531 3254
jdaggett@531 3255 <li>If the desired weight is 400, 500 is checked first and then the
jdaggett@531 3256 rule for desired weights less than 400 is used.
jdaggett@531 3257
jdaggett@531 3258 <li>If the desired weight is 500, 400 is checked first and then the
jdaggett@532 3259 rule for desired weights less than 400 is used.
jdaggett@531 3260 </ul>
jdaggett@531 3261
jdaggett@4624 3262 <li><span class=property>‘<a href="#propdef-font-size"><code
jdaggett@4624 3263 class=property>font-size</code></a>’</span> must be matched within a
jdaggett@4624 3264 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
jdaggett@4624 3265 are rounded to the nearest whole pixel, while the tolerance for
jdaggett@4624 3266 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
jdaggett@4624 3267 by ‘<code class=property>em</code>’ values in other properties, are
jdaggett@4624 3268 based on the <span class=property>‘<a href="#propdef-font-size"><code
jdaggett@4624 3269 class=property>font-size</code></a>’</span> value that is used, not
jdaggett@4624 3270 the one that is specified.
jdaggett@531 3271 </ol>
jdaggett@531 3272
jdaggett@7232 3273 <li>
jdaggett@8391 3274 <p>If the matched face is defined via <a
jdaggett@8391 3275 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
jdaggett@8391 3276 must use the procedure below to select a single font:
jdaggett@8391 3277
jdaggett@8391 3278 <ol>
jdaggett@8391 3279 <li>If the font resource has not been loaded and the range of characters
jdaggett@8391 3280 defined by the ‘<a href="#descdef-unicode-range"><code
jdaggett@8391 3281 class=property>unicode-range</code></a>’ descriptor value includes
jdaggett@8391 3282 the character in question, load the font.
jdaggett@8391 3283
jdaggett@8391 3284 <li>After downloading, if the <a
jdaggett@8391 3285 href="#effective-character-map"><em>effective character map</em></a>
jdaggett@8391 3286 supports the character in question, select that font.
jdaggett@8391 3287 </ol>
jdaggett@8391 3288
jdaggett@8391 3289 <p>When the matched face is a <a href="#composite-face"><em>composite
jdaggett@8391 3290 face</em></a>, user agents must use the procedure above on each of the
jdaggett@8391 3291 faces in the <a href="#composite-face"><em>composite face</em></a> in
jdaggett@8391 3292 reverse order of <a
jdaggett@8391 3293 href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
jdaggett@8391 3294
jdaggett@8391 3295 <p>While the download occurs, user agents may either wait until the font
jdaggett@8391 3296 is downloaded or render once with substituted font metrics and render
jdaggett@8391 3297 again once the font is downloaded.</p>
jdaggett@8391 3298
jdaggett@8391 3299 <li>
jdaggett@7232 3300 <p>If no matching face exists or the matched face does not contain a
jdaggett@7232 3301 glyph for the character to be rendered, the next family name is selected
jdaggett@8391 3302 and the previous three steps repeated. Glyphs from other faces in the
jdaggett@7232 3303 family are not considered. The only exception is that user agents may
jdaggett@8391 3304 optionally substitute a synthetically obliqued version of the <a
jdaggett@7232 3305 href="#default-face"><em>default face</em></a> if that face supports a
jdaggett@8391 3306 given glyph and synthesis of these faces is permitted by the value of
jdaggett@8391 3307 the ‘<a href="#propdef-font-synthesis"><code
jdaggett@8391 3308 class=property>font-synthesis</code></a>’ property. For example, a
jdaggett@8391 3309 synthetic italic version of the regular face may be used if the italic
jdaggett@8391 3310 face doesn't support glyphs for Arabic.</p>
jdaggett@7242 3311 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
jdaggett@7242 3312
jdaggett@531 3313
jdaggett@531 3314 <li>If there are no more font families to be evaluated and no matching
jdaggett@8363 3315 face has been found, then the user agent performs a <dfn
jdaggett@8363 3316 id=system-font-fallback>system font fallback</dfn> procedure to find the
jdaggett@8363 3317 best match for the character to be rendered. The result of this procedure
jdaggett@8363 3318 may vary across user agents.
jdaggett@531 3319
jdaggett@531 3320 <li>If a particular character cannot be displayed using any font, the user
jdaggett@531 3321 agent should indicate by some means that a character is not being
jdaggett@2457 3322 displayed, displaying either a symbolic representation of the missing
jdaggett@2457 3323 glyph (e.g. using a <a
jdaggett@2457 3324 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
jdaggett@2457 3325 Font</a>) or using the missing character glyph from a default font.
jdaggett@512 3326 </ol>
jdaggett@2457 3327
jdaggett@8430 3328 <p>Optimizations of this process are allowed provided that an
jdaggett@8430 3329 implementation behaves as if the algorithm had been followed exactly.
jdaggett@8430 3330 Matching occurs in a well-defined order to insure that the results are as
jdaggett@8430 3331 consistent as possible across user agents, given an identical set of
jdaggett@8430 3332 available fonts and rendering technology.
jdaggett@8430 3333
jdaggett@8431 3334 <p>The <dfn id=first-available-font>first available font</dfn>, used in the
jdaggett@8431 3335 definition of <a
jdaggett@8431 3336 href="http://www.w3.org/TR/css3-values/#font-relative-lengths"><em>font-relative
jdaggett@8431 3337 lengths</em></a> such as ‘<code class=property>ex</code>’ and ‘<code
jdaggett@8431 3338 class=property>ch</code>’, is defined to be the first available font
jdaggett@8431 3339 that would match any character given font families in the ‘<code
jdaggett@8431 3340 class=property>font-family</code>’ list (or a user agent's default font
jdaggett@8431 3341 if none are available).
jdaggett@8431 3342
jdaggett@7309 3343 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
jdaggett@6701 3344
jdaggett@8397 3345 <p>When text contains characters such as combining marks, ideally the base
jdaggett@8397 3346 character should be rendered using the same font as the mark, this assures
jdaggett@8397 3347 proper placement of the mark. For this reason, the font matching algorithm
jdaggett@8397 3348 for clusters is more specialized than the general case of matching a
jdaggett@8397 3349 single character by itself. For sequences containing variation selectors,
jdaggett@8397 3350 which indicate the precise glyph to be used for a given character, user
jdaggett@8397 3351 agents always attempt <a href="#system-font-fallback"><em>system font
jdaggett@8397 3352 fallback</em></a> to find the appropriate glyph before using the default
jdaggett@8397 3353 glyph of the base character.
jdaggett@8397 3354
jdaggett@8397 3355 <p>A sequence of codepoints containing combining mark or other modifiers is
jdaggett@8397 3356 termed a grapheme cluster (see <a href="#CSS3TEXT"
jdaggett@6701 3357 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
jdaggett@6701 3358 description). For a given cluster containing a base character, <em>b</em>
jdaggett@6701 3359 and a sequence of combining characters <em>c1, c2…</em>, the entire
jdaggett@6701 3360 cluster is matched using these steps:
jdaggett@6701 3361
jdaggett@6701 3362 <ol>
jdaggett@6701 3363 <li>For each family in the font list, a face is chosen using the style
jdaggett@6701 3364 selection rules defined in the previous section.
jdaggett@6701 3365 <ol>
jdaggett@7020 3366 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
jdaggett@7021 3367 completely supported by the font, select this font for the sequence.
jdaggett@6701 3368
jdaggett@6701 3369 <li>If a sequence of multiple codepoints is canonically equivalent to a
jdaggett@8397 3370 single character and the font <a href="#support"><em
jdaggett@8397 3371 title=support>supports</em></a> that character, select this font for
jdaggett@8397 3372 the sequence.
jdaggett@6701 3373 </ol>
jdaggett@6701 3374
jdaggett@6701 3375 <li>If no font was found in the font list in step 1:
jdaggett@6701 3376 <ol>
jdaggett@6701 3377 <li>If <em>c1</em> is a variation selector, system fallback must be used
jdaggett@8397 3378 to find a font that <a href="#support"><em
jdaggett@8397 3379 title=support>supports</em></a> the full sequence of <em>b + c1</em>.
jdaggett@8397 3380 If no font on the system <a href="#support"><em
jdaggett@8397 3381 title=support>supports</em></a> the full sequence, match the single
jdaggett@6701 3382 character <em>b</em> using the normal procedure for matching single
jdaggett@6701 3383 characters and ignore the variation selector. Note: a sequence with
jdaggett@8397 3384 more than one variation selector must be treated as an encoding error
jdaggett@8397 3385 and the trailing selectors must be ignored. <a href="#UNICODE6"
jdaggett@8397 3386 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>
jdaggett@6701 3387
jdaggett@6701 3388 <li>Otherwise, the user agent may optionally use system font fallback to
jdaggett@8397 3389 match a font that <a href="#support"><em
jdaggett@8397 3390 title=support>supports</em></a> the entire cluster.
jdaggett@6701 3391 </ol>
jdaggett@6701 3392
jdaggett@6701 3393 <li>If no font is found in step 2, use the matching sequence from step 1
jdaggett@8397 3394 to determine the longest sequence that is completely <a
jdaggett@8397 3395 href="#support"><em title=support>supported</em></a> by a font in the
jdaggett@8397 3396 font list and attempt to match the remaining combining characters
jdaggett@6701 3397 separately using the rules for single characters.
jdaggett@6701 3398 </ol>
jdaggett@6701 3399
jdaggett@7309 3400 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
jdaggett@2457 3401 issues</h3>
jdaggett@2457 3402
jdaggett@8430 3403 <p>CSS font matching is always performed on text runs containing Unicode
jdaggett@8430 3404 characters, so documents using legacy encodings are assumed to have been
jdaggett@7311 3405 transcoded before matching fonts. For fonts containing <a
jdaggett@7311 3406 href="#character-map"><em title="character map">character maps</em></a>
jdaggett@7311 3407 for both legacy encodings and Unicode, the contents of the legacy encoding
jdaggett@7311 3408 <a href="#character-map"><em>character map</em></a> must have no effect on
jdaggett@7311 3409 the results of the font matching process.
jdaggett@2461 3410
jdaggett@2461 3411 <p>The font matching process does not assume that text runs are in either
jdaggett@2461 3412 normalized or denormalized form (see <a href="#CHARMOD-NORM"
jdaggett@3042 3413 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
jdaggett@8430 3414 details). Fonts may only support precomposed forms and not the decomposed
jdaggett@8430 3415 sequence of base character plus combining marks. Authors should always
jdaggett@6701 3416 tailor their choice of fonts to their content, including whether that
jdaggett@6701 3417 content contains normalized or denormalized character streams.
jdaggett@2457 3418
jdaggett@8430 3419 <p>If a given character is a Private-Use Area Unicode codepoint, user
jdaggett@8430 3420 agents must only match font families named in the ‘<code
jdaggett@8430 3421 class=property>font-family</code>’ list that are not generic families.
jdaggett@8430 3422 If none of the families named in the ‘<code
jdaggett@8430 3423 class=property>font-family</code>’ list contain a glyph for that
jdaggett@8430 3424 codepoint, user agents must display some form of missing glyph symbol for
jdaggett@8430 3425 that character rather than attempting <a
jdaggett@8430 3426 href="#system-font-fallback"><em>system font fallback</em></a> for that
jdaggett@8430 3427 codepoint. When matching the replacement character U+FFFD, user agents may
jdaggett@8430 3428 skip the font matching process and immediately display some form of
jdaggett@8430 3429 missing glyph symbol, they are not required to display the glyph from the
jdaggett@8430 3430 font that would be selected by the font matching process.
jdaggett@2457 3431
jdaggett@2457 3432 <p>In general, the fonts for a given family will all have the same or
jdaggett@7311 3433 similar <a href="#character-map"><em title="character map">character
jdaggett@7311 3434 maps</em></a>. The process outlined here is designed to handle even font
jdaggett@7311 3435 families containing faces with widely variant <a href="#character-map"><em
jdaggett@7311 3436 title="character map">character maps</em></a>. However, authors are
jdaggett@7311 3437 cautioned that the use of such families can lead to unexpected results.
jdaggett@2457 3438
jdaggett@7309 3439 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
jdaggett@2509 3440 changes since CSS 2.1</h3>
jdaggett@2509 3441
jdaggett@2509 3442 <p>The algorithm above is different from CSS 2.1 in a number of key places.
jdaggett@2509 3443 These changes were made to better reflect actual font matching behavior
jdaggett@2509 3444 across user agent implementations.
jdaggett@2509 3445
jdaggett@2509 3446 <p>Differences compared to the font matching algorithm in CSS 2.1:
jdaggett@2509 3447
jdaggett@2509 3448 <ul>
jdaggett@2509 3449 <li>The algorithm includes font-stretch matching.
jdaggett@2509 3450
jdaggett@2509 3451 <li>All possible font-style matching scenarios are delineated.
jdaggett@2509 3452
jdaggett@2509 3453 <li>Small-caps fonts are not matched as part of the font matching process,
jdaggett@2509 3454 they are now handled via font features.
jdaggett@2509 3455
jdaggett@2509 3456 <li>Unicode variation selector matching is required.
jdaggett@6701 3457
jdaggett@6701 3458 <li>Cluster sequences are matched as a unit.
jdaggett@2509 3459 </ul>
jdaggett@531 3460
jdaggett@7309 3461 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
jdaggett@6701 3462 examples</h3>
jdaggett@6701 3463
jdaggett@531 3464 <div class=example>
jdaggett@531 3465 <p>It's useful to note that the CSS selector syntax may be used to create
jdaggett@531 3466 language-sensitive typography. For example, some Chinese and Japanese
jdaggett@1149 3467 characters are unified to have the same Unicode code point, although the
jdaggett@890 3468 abstract glyphs are not the same in the two languages.
jdaggett@531 3469
jdaggett@531 3470 <pre>*:lang(ja-jp) { font: 900 14pt/16pt &quot;Heisei Mincho W9&quot;, serif; }
jdaggett@531 3471 *:lang(zh-tw) { font: 800 14pt/16.5pt &quot;Li Sung&quot;, serif; }
jdaggett@512 3472 </pre>
jdaggett@531 3473
jdaggett@8430 3474 <p>This selects any element that has the given language — Japanese or
jdaggett@8430 3475 Traditional Chinese — and uses the appropriate font.
jdaggett@512 3476 </div>
jdaggett@1662 3477
jdaggett@6699 3478 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
jdaggett@1662 3479
jdaggett@1856 3480 <p>Modern font technologies support a variety of advanced typographic and
jdaggett@1856 3481 language-specific font features. Using these features, a single font can
jdaggett@1856 3482 provide glyphs for a wide range of ligatures, contextual and stylistic
jdaggett@1856 3483 alternates, tabular and old-style figures, small capitals, automatic
jdaggett@1856 3484 fractions, swashes, and alternates specific to a given language. To allow
jdaggett@8313 3485 authors control over these font capabilities, the ‘<code
jdaggett@8313 3486 class=property>font-variant</code>’ property has been expanded for CSS3.
jdaggett@8313 3487 It now functions as a shorthand for a set of properties that provide
jdaggett@8313 3488 control over stylistic font features.
jdaggett@1856 3489
jdaggett@1856 3490 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
jdaggett@1856 3491 selection and positioning</h3>
jdaggett@1856 3492
jdaggett@1856 3493 <p>Simple fonts used for displaying Latin text use a very basic processing
jdaggett@8313 3494 model. Fonts contain a <a href="#character-map"><em>character map</em></a>
jdaggett@8313 3495 which maps each character to a glyph for that character. Glyphs for
jdaggett@8313 3496 subsequent characters are simply placed one after the other along a run of
jdaggett@8313 3497 text. Modern font formats such as OpenType and AAT (Apple Advanced
jdaggett@8313 3498 Typography) use a richer processing model. The glyph for a given character
jdaggett@8313 3499 can be chosen and positioned not just based on the codepoint of the
jdaggett@8313 3500 character itself, but also on adjacent characters as well as the language,
jdaggett@8313 3501 script, and features enabled for the text. Font features may be required
jdaggett@8313 3502 for specific scripts, or recommended as enabled by default or they might
jdaggett@8313 3503 be stylistic features meant to be used under author control.
jdaggett@1856 3504
jdaggett@1856 3505 <p>For a good visual overview of these features, see the <a
jdaggett@1856 3506 href="#OPENTYPE-FONT-GUIDE"
jdaggett@1856 3507 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
jdaggett@1856 3508 For a detailed description of glyph processing for OpenType fonts, see <a
jdaggett@1856 3509 href="#WINDOWS-GLYPH-PROC"
jdaggett@1856 3510 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
jdaggett@1856 3511
jdaggett@8313 3512 <p>Stylistic font features can be classified into two broad categories:
jdaggett@6177 3513 ones that affect the harmonization of glyph shapes with the surrounding
jdaggett@8313 3514 context, such as kerning and ligature features, and ones such as the
jdaggett@6177 3515 small-caps, subscript/superscript and alternate features that affect shape
jdaggett@6177 3516 selection.
jdaggett@6176 3517
jdaggett@8313 3518 <p>The subproperties of <a href="#propdef-font-variant"
jdaggett@8313 3519 title="font-variant!!property">‘<code
jdaggett@8313 3520 class=property>font-variant</code>’</a> listed below are used to control
jdaggett@8313 3521 these stylistic font features. They do not control features that are
jdaggett@8313 3522 required for displaying certain scripts, such as the OpenType features
jdaggett@8313 3523 used when displaying Arabic or Indic language text. They affect glyph
jdaggett@8313 3524 selection and positioning, but do not affect font selection as described
jdaggett@8313 3525 in the font matching section (except in cases required for compatibility
jdaggett@8313 3526 with CSS 2.1).
jdaggett@1856 3527
jdaggett@1856 3528 <p>To assure consistent behavior across user agents, the equivalent
jdaggett@8313 3529 OpenType property settings are listed for individual properties and are
jdaggett@8313 3530 normative. When using other font formats these should be used as a
jdaggett@8313 3531 guideline to map CSS font feature property values to specific font
jdaggett@8313 3532 features.
jdaggett@1856 3533
jdaggett@1856 3534 <h3 id=language-specific-support><span class=secno>6.2
jdaggett@1856 3535 </span>Language-specific display</h3>
jdaggett@1856 3536
jdaggett@1856 3537 <p>OpenType also supports language-specific glyph selection and
jdaggett@1856 3538 positioning, so that text can be displayed correctly in cases where the
jdaggett@8313 3539 language dictates a specific display behavior. Many languages share a
jdaggett@8313 3540 common script, but the shape of certain letters can vary across those
jdaggett@8313 3541 languages. For example, certain Cyrillic letters have different shapes in
jdaggett@8313 3542 Russian text than in Bulgarian. In Latin text, it's common to render "fi"
jdaggett@8313 3543 with an explicit fi-ligature that lacks a dot on the "i". However, in
jdaggett@8313 3544 languages such as Turkish which uses both a dotted-i and a dotless-i, it's
jdaggett@8313 3545 important to not use this ligature or use a specialized version that
jdaggett@8313 3546 contains a dot over the "i". The example below shows language-specific
jdaggett@8313 3547 variations based on stylistic traditions found in Spanish, Italian and
jdaggett@8313 3548 French orthography:
jdaggett@2515 3549
jdaggett@2515 3550 <div class=featex><img alt="language specific forms, spanish"
jdaggett@2515 3551 src=locl-1.png></div>
jdaggett@2515 3552
jdaggett@2515 3553 <div class=featex><img alt="language specific forms, italian"
jdaggett@2515 3554 src=locl-2.png></div>
jdaggett@2515 3555
jdaggett@2515 3556 <div class=featex><img alt="language specific forms, french"
jdaggett@2515 3557 src=locl-3.png></div>
jdaggett@1856 3558
jdaggett@8313 3559 <p>If the content language of the element is known according to the rules
jdaggett@7355 3560 of the <a
jdaggett@7355 3561 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
jdaggett@7355 3562 language</a>, user agents are required to infer the OpenType language
jdaggett@7355 3563 system from the content language and use that when selecting and
jdaggett@7355 3564 positioning glyphs using an OpenType font.
jdaggett@7355 3565
jdaggett@7355 3566 <p>For OpenType fonts, in some cases it may be necessary to explicitly
jdaggett@7355 3567 declare the OpenType language to be used, for example when displaying text
jdaggett@7355 3568 in a given language that uses the typographic conventions of another
jdaggett@7355 3569 language or when the font does not explicitly support a given language but
jdaggett@7355 3570 supports a language that shares common typographic conventions. The ‘<a
jdaggett@4624 3571 href="#propdef-font-language-override"><code
jdaggett@4624 3572 class=property>font-language-override</code></a>’ property is used for
jdaggett@8225 3573 this purpose.</p>
jdaggett@1662 3574 <!-- prop: font-kerning -->
jdaggett@1662 3575
jdaggett@1856 3576 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
jdaggett@1662 3577 href="#propdef-font-kerning">font-kerning</a> property</h3>
jdaggett@1662 3578
jdaggett@4624 3579 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
jdaggett@1662 3580 <tbody>
jdaggett@1662 3581 <tr>
jdaggett@1662 3582 <td>Name:
jdaggett@1662 3583
jdaggett@1662 3584 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
jdaggett@1662 3585
jdaggett@1662 3586 <tr>
jdaggett@1662 3587 <td>Value:
jdaggett@1662 3588
jdaggett@8278 3589 <td><a href="#font-kerning-auto-value"
jdaggett@8278 3590 title="auto!!font-kerning">auto</a> | <a
jdaggett@8278 3591 href="#font-kerning-normal-value"
jdaggett@8278 3592 title="normal!!font-kerning">normal</a> | <a
jdaggett@8278 3593 href="#font-kerning-none-value" title="none!!font-kerning">none</a>
jdaggett@1662 3594
jdaggett@1662 3595 <tr>
jdaggett@1662 3596 <td>Initial:
jdaggett@1662 3597
jdaggett@1856 3598 <td>auto
jdaggett@1662 3599
jdaggett@1662 3600 <tr>
jdaggett@1662 3601 <td>Applies to:
jdaggett@1662 3602
jdaggett@1662 3603 <td>all elements
jdaggett@1662 3604
jdaggett@1662 3605 <tr>
jdaggett@1662 3606 <td>Inherited:
jdaggett@1662 3607
jdaggett@1662 3608 <td>yes
jdaggett@1662 3609
jdaggett@1662 3610 <tr>
jdaggett@1662 3611 <td>Percentages:
jdaggett@1662 3612
jdaggett@1662 3613 <td>N/A
jdaggett@1662 3614
jdaggett@1662 3615 <tr>
jdaggett@1662 3616 <td>Media:
jdaggett@1662 3617
jdaggett@1662 3618 <td>visual
jdaggett@1662 3619
jdaggett@1662 3620 <tr>
jdaggett@1662 3621 <td>Computed value:
jdaggett@1662 3622
jdaggett@1662 3623 <td>as specified
jdaggett@7377 3624
jdaggett@7377 3625 <tr>
jdaggett@7377 3626 <td>Animatable:
jdaggett@7377 3627
jdaggett@7377 3628 <td>no
jdaggett@1662 3629 </table>
jdaggett@1662 3630
jdaggett@2509 3631 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
jdaggett@2509 3632 property controls metric kerning, kerning that utilizes adjustment data
jdaggett@8276 3633 contained in the font.
jdaggett@8276 3634
jdaggett@8276 3635 <dl>
jdaggett@8278 3636 <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
jdaggett@8276 3637
jdaggett@8276 3638 <dd>Specifies that kerning is applied at the discretion of the user agent
jdaggett@8276 3639
jdaggett@8278 3640 <dt><dfn id=font-kerning-normal-value
jdaggett@8278 3641 title="normal!!font-kerning">normal</dfn>
jdaggett@8276 3642
jdaggett@8276 3643 <dd>Specifies that kerning is applied
jdaggett@8276 3644
jdaggett@8278 3645 <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
jdaggett@8276 3646
jdaggett@8276 3647 <dd>Specifies that kerning is not applied
jdaggett@8276 3648 </dl>
jdaggett@1662 3649
jdaggett@1662 3650 <p>For fonts that do not include kerning data this property will have no
jdaggett@1662 3651 visible effect. When rendering with OpenType fonts, the <a
jdaggett@1662 3652 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
jdaggett@2515 3653 specification suggests that kerning be enabled by default. When kerning is
jdaggett@6436 3654 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
jdaggett@8276 3655 vertical text runs the <span class=tag>vkrn</span> feature is enabled
jdaggett@8276 3656 instead). User agents must also support fonts that only support kerning
jdaggett@8276 3657 via data contained in a <span class=tag>kern</span> font table, as
jdaggett@8276 3658 detailed in the OpenType specification. If the ‘<code
jdaggett@8276 3659 class=property>letter-spacing</code>’ property is defined, kerning
jdaggett@8276 3660 adjustments are considered part of the default spacing and letter spacing
jdaggett@8276 3661 adjustments are made after kerning has been applied.
jdaggett@8276 3662
jdaggett@8276 3663 <p>When set to ‘<code class=property>auto</code>’, user agents can
jdaggett@8276 3664 determine whether to apply kerning or not based on a number of factors:
jdaggett@8276 3665 text size, script, or other factors that influence text processing speed.
jdaggett@8368 3666 Authors who want proper kerning should use <a
jdaggett@8368 3667 href="#font-kerning-normal-value" title="normal!!font-kerning">‘<code
jdaggett@8368 3668 class=property>normal</code>’</a> to explicitly enable kerning.
jdaggett@8279 3669 Likewise, some authors may prefer to disable kerning in situations where
jdaggett@8279 3670 performance is more important than precise appearance. However, in
jdaggett@8279 3671 well-designed modern implementations the use of kerning generally does not
jdaggett@8279 3672 have a large impact on text rendering speed.</p>
jdaggett@6176 3673 <!-- prop: font-variant-ligatures -->
jdaggett@6176 3674
jdaggett@6176 3675 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
jdaggett@6176 3676 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
jdaggett@6176 3677 property</h3>
jdaggett@6176 3678
jdaggett@6436 3679 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
jdaggett@6176 3680 <tbody>
jdaggett@6176 3681 <tr>
jdaggett@6176 3682 <td>Name:
jdaggett@6176 3683
jdaggett@6176 3684 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
jdaggett@6176 3685
jdaggett@6176 3686 <tr>
jdaggett@6176 3687 <td>Value:
jdaggett@6176 3688
jdaggett@8278 3689 <td><a href="#font-variant-ligatures-normal-value"
jdaggett@8278 3690 title="normal!!font-variant-ligatures">normal</a> | <a
jdaggett@8278 3691 href="#font-variant-ligatures-none-value"
jdaggett@8278 3692 title="none!!font-variant-ligatures">none</a> | [ <a
jdaggett@8225 3693 href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a> ||
jdaggett@8225 3694 <a
jdaggett@8225 3695 href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
jdaggett@8225 3696 || <a
jdaggett@8225 3697 href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
jdaggett@8225 3698 || <a
jdaggett@8225 3699 href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
jdaggett@8225 3700 ]
jdaggett@6176 3701
jdaggett@6176 3702 <tr>
jdaggett@6176 3703 <td>Initial:
jdaggett@6176 3704
jdaggett@6176 3705 <td>normal
jdaggett@6176 3706
jdaggett@6176 3707 <tr>
jdaggett@6176 3708 <td>Applies to:
jdaggett@6176 3709
jdaggett@6176 3710 <td>all elements
jdaggett@6176 3711
jdaggett@6176 3712 <tr>
jdaggett@6176 3713 <td>Inherited:
jdaggett@6176 3714
jdaggett@6176 3715 <td>yes
jdaggett@6176 3716
jdaggett@6176 3717 <tr>
jdaggett@6176 3718 <td>Percentages:
jdaggett@6176 3719
jdaggett@6176 3720 <td>N/A
jdaggett@6176 3721
jdaggett@6176 3722 <tr>
jdaggett@6176 3723 <td>Media:
jdaggett@6176 3724
jdaggett@6176 3725 <td>visual
jdaggett@6176 3726
jdaggett@6176 3727 <tr>
jdaggett@6176 3728 <td>Computed value:
jdaggett@6176 3729
jdaggett@6176 3730 <td>as specified
jdaggett@7377 3731
jdaggett@7377 3732 <tr>
jdaggett@7377 3733 <td>Animatable:
jdaggett@7377 3734
jdaggett@7377 3735 <td>no
jdaggett@6176 3736 </table>
jdaggett@6176 3737
jdaggett@6436 3738 <p>Ligatures and contextual forms are ways of combining glyphs to produce
jdaggett@8276 3739 more harmonized forms.
jdaggett@6176 3740
jdaggett@6176 3741 <pre
jdaggett@8225 3742 class=prod><dfn id=common-lig-values><var>&lt;common-lig-values&gt;</var></dfn> = [ <a href="#common-ligatures">common-ligatures</a> | <a href="#no-common-ligatures">no-common-ligatures</a> ]</pre>
jdaggett@6176 3743
jdaggett@6176 3744 <pre
jdaggett@8225 3745 class=prod><dfn id=discretionary-lig-values><var>&lt;discretionary-lig-values&gt;</var></dfn> = [ <a href="#discretionary-ligatures">discretionary-ligatures</a> | <a href="#no-discretionary-ligatures">no-discretionary-ligatures</a> ]</pre>
jdaggett@6176 3746
jdaggett@6176 3747 <pre
jdaggett@8225 3748 class=prod><dfn id=historical-lig-values><var>&lt;historical-lig-values&gt;</var></dfn> = [ <a href="#historical-ligatures">historical-ligatures</a> | <a href="#no-historical-ligatures">no-historical-ligatures</a> ]</pre>
jdaggett@6176 3749
jdaggett@6176 3750 <pre
jdaggett@8225 3751 class=prod><dfn id=contextual-alt-values><var>&lt;contextual-alt-values&gt;</var></dfn> = [ <a href="#contextual">contextual</a> | <a href="#no-contextual">no-contextual</a> ]</pre>
jdaggett@6176 3752
jdaggett@6176 3753 <p>Individual values have the following meanings:
jdaggett@6176 3754
jdaggett@6176 3755 <dl>
jdaggett@8278 3756 <dt><dfn id=font-variant-ligatures-normal-value
jdaggett@8278 3757 title="normal!!font-variant-ligatures">normal</dfn>
jdaggett@8278 3758
jdaggett@8368 3759 <dd>A value of <a href="#font-variant-ligatures-normal-value"
jdaggett@8368 3760 title="normal!!font-variant-ligatures">‘<code
jdaggett@8368 3761 class=property>normal</code>’</a> specifies that common default
jdaggett@8279 3762 features are enabled, <a href="#font-feature-resolution">as described in
jdaggett@8279 3763 detail in the next section</a>. For OpenType fonts, common ligatures and
jdaggett@8279 3764 contextual forms are on by default, discretionary and historical
jdaggett@8279 3765 ligatures are not.
jdaggett@8278 3766
jdaggett@8278 3767 <dt><dfn id=font-variant-ligatures-none-value
jdaggett@8278 3768 title="none!!font-variant-ligatures">none</dfn>
jdaggett@8276 3769
jdaggett@8276 3770 <dd>Specifies that all types of ligatures and contextual forms covered by
jdaggett@8276 3771 this property are explicitly disabled. In situations where ligatures are
jdaggett@8276 3772 not considered necessary, this may improve the speed of text rendering.
jdaggett@8276 3773
jdaggett@6176 3774 <dt><dfn id=common-ligatures>common-ligatures</dfn>
jdaggett@6176 3775
jdaggett@6436 3776 <dd>Enables display of common ligatures (OpenType features: <span
jdaggett@6436 3777 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
jdaggett@6436 3778 enabled by default.
jdaggett@6176 3779 </dl>
jdaggett@6176 3780
jdaggett@6176 3781 <div class=featex><img alt="common ligature example" src=liga.png></div>
jdaggett@6176 3782
jdaggett@6176 3783 <dl>
jdaggett@6176 3784 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
jdaggett@6176 3785
jdaggett@6436 3786 <dd>Disables display of common ligatures (OpenType features: <span
jdaggett@6436 3787 class=tag>liga, clig</span>).
jdaggett@6176 3788
jdaggett@6176 3789 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
jdaggett@6176 3790
jdaggett@6436 3791 <dd>Enables display of discretionary ligatures (OpenType feature: <span
jdaggett@8277 3792 class=tag>dlig</span>). Which ligatures are discretionary or optional is
jdaggett@8277 3793 decided by the type designer, so authors will need to refer to the
jdaggett@6176 3794 documentation of a given font to understand which ligatures are
jdaggett@6176 3795 considered discretionary.
jdaggett@6176 3796 </dl>
jdaggett@6176 3797
jdaggett@6176 3798 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
jdaggett@6176 3799
jdaggett@6176 3800 <dl>
jdaggett@6176 3801 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
jdaggett@6176 3802
jdaggett@6436 3803 <dd>Disables display of discretionary ligatures (OpenType feature: <span
jdaggett@6436 3804 class=tag>dlig</span>).
jdaggett@6176 3805
jdaggett@6176 3806 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
jdaggett@6176 3807
jdaggett@6436 3808 <dd>Enables display of historical ligatures (OpenType feature: <span
jdaggett@6436 3809 class=tag>hlig</span>).
jdaggett@6176 3810 </dl>
jdaggett@6176 3811
jdaggett@6176 3812 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
jdaggett@6176 3813
jdaggett@6176 3814 <dl>
jdaggett@6176 3815 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
jdaggett@6176 3816
jdaggett@6436 3817 <dd>Disables display of historical ligatures (OpenType feature: <span
jdaggett@6436 3818 class=tag>hlig</span>).
jdaggett@6176 3819
jdaggett@6176 3820 <dt><dfn id=contextual>contextual</dfn>
jdaggett@6176 3821
jdaggett@6436 3822 <dd>Enables display of contextual alternates (OpenType feature: <span
jdaggett@6436 3823 class=tag>calt</span>). Although not strictly a ligature feature, like
jdaggett@6176 3824 ligatures this feature is commonly used to harmonize the shapes of glyphs
jdaggett@6436 3825 with the surrounding context. For OpenType fonts, this feature is on by
jdaggett@6436 3826 default.
jdaggett@6176 3827 </dl>
jdaggett@6176 3828
jdaggett@6176 3829 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
jdaggett@6176 3830
jdaggett@6176 3831 <dl>
jdaggett@6176 3832 <dt><dfn id=no-contextual>no-contextual</dfn>
jdaggett@6176 3833
jdaggett@6436 3834 <dd>Disables display of contextual alternates (OpenType feature: <span
jdaggett@6436 3835 class=tag>calt</span>).
jdaggett@6176 3836 </dl>
jdaggett@6176 3837
jdaggett@6176 3838 <p>Required ligatures, needed for correctly rendering complex scripts, are
jdaggett@8278 3839 not affected by the settings above, including ‘<code
jdaggett@8278 3840 class=property>none</code>’ (OpenType feature: <span
jdaggett@6436 3841 class=tag>rlig</span>).</p>
jdaggett@3460 3842 <!-- prop: font-variant-position -->
jdaggett@3460 3843
jdaggett@6176 3844 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
jdaggett@3638 3845 and superscript forms: the <a
jdaggett@3460 3846 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
jdaggett@3460 3847
jdaggett@4624 3848 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
jdaggett@1662 3849 <tbody>
jdaggett@1662 3850 <tr>
jdaggett@1662 3851 <td>Name:
jdaggett@1662 3852
jdaggett@3460 3853 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
jdaggett@1662 3854
jdaggett@1662 3855 <tr>
jdaggett@1662 3856 <td>Value:
jdaggett@1662 3857
jdaggett@8368 3858 <td><a href="#font-variant-position-normal-value"
jdaggett@8368 3859 title="normal!!font-variant-position">normal</a> | <a
jdaggett@8279 3860 href="#sub">sub</a> | <a href="#super">super</a>
jdaggett@1732 3861
jdaggett@1732 3862 <tr>
jdaggett@1732 3863 <td>Initial:
jdaggett@1732 3864
jdaggett@1732 3865 <td>normal
jdaggett@1732 3866
jdaggett@1732 3867 <tr>
jdaggett@1732 3868 <td>Applies to:
jdaggett@1732 3869
jdaggett@1732 3870 <td>all elements
jdaggett@1732 3871
jdaggett@1732 3872 <tr>
jdaggett@1732 3873 <td>Inherited:
jdaggett@1732 3874
jdaggett@1732 3875 <td>yes
jdaggett@1732 3876
jdaggett@1732 3877 <tr>
jdaggett@1732 3878 <td>Percentages:
jdaggett@1732 3879
jdaggett@1732 3880 <td>N/A
jdaggett@1732 3881
jdaggett@1732 3882 <tr>
jdaggett@1732 3883 <td>Media:
jdaggett@1732 3884
jdaggett@1732 3885 <td>visual
jdaggett@1732 3886
jdaggett@1732 3887 <tr>
jdaggett@1732 3888 <td>Computed value:
jdaggett@1732 3889
jdaggett@1732 3890 <td>as specified
jdaggett@7377 3891
jdaggett@7377 3892 <tr>
jdaggett@7377 3893 <td>Animatable:
jdaggett@7377 3894
jdaggett@7377 3895 <td>no
jdaggett@1732 3896 </table>
jdaggett@1732 3897
jdaggett@5890 3898 <p>This property is used to enable typographic subscript and superscript
jdaggett@5890 3899 glyphs. These are alternate glyphs designed within the same em-box as
jdaggett@5890 3900 default glyphs and are intended to be laid out on the same baseline as the
jdaggett@5890 3901 default glyphs, with no resizing or repositioning of the baseline. They
jdaggett@5890 3902 are explicitly designed to match the surrounding text and to be more
jdaggett@5890 3903 readable without affecting the line height.
jdaggett@3511 3904
jdaggett@3511 3905 <div class=figure><img alt="comparison between real subscript glyphs and
jdaggett@3511 3906 synthesized ones" src=realsubscripts.png>
jdaggett@3511 3907 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
jdaggett@3511 3908 (bottom)
jdaggett@3511 3909 </div>
jdaggett@3460 3910
jdaggett@8279 3911 <p>Individual values have the following meanings:
jdaggett@8279 3912
jdaggett@8279 3913 <dl>
jdaggett@8368 3914 <dt><dfn id=font-variant-position-normal-value
jdaggett@8368 3915 title="normal!!font-variant-position">normal</dfn>
jdaggett@8279 3916
jdaggett@8279 3917 <dd>None of the features listed below are enabled.
jdaggett@8279 3918
jdaggett@8279 3919 <dt><dfn id=sub>sub</dfn>
jdaggett@8279 3920
jdaggett@8279 3921 <dd>Enables display of subscript variants (OpenType feature: <span
jdaggett@8279 3922 class=tag>subs</span>).
jdaggett@8279 3923
jdaggett@8279 3924 <dt><dfn id=super>super</dfn>
jdaggett@8279 3925
jdaggett@8279 3926 <dd>Enables display of superscript variants (OpenType feature: <span
jdaggett@8279 3927 class=tag>sups</span>).
jdaggett@8279 3928 </dl>
jdaggett@5890 3929
jdaggett@5890 3930 <p>Because of the semantic nature of subscripts and superscripts, when the
jdaggett@8279 3931 value is either ‘<a href="#sub"><code class=property>sub</code></a>’
jdaggett@8279 3932 or ‘<a href="#super"><code class=property>super</code></a>’ for a
jdaggett@8279 3933 given contiguous run of text, if a variant glyph is not available for all
jdaggett@8279 3934 the characters in the run, simulated glyphs must be synthesized for all
jdaggett@8279 3935 characters using reduced forms of the glyphs that would be used without
jdaggett@8280 3936 this feature applied. This is done per run to avoid a mixture of variant
jdaggett@8280 3937 glyphs and synthesized ones that would not align correctly. In the case of
jdaggett@8280 3938 OpenType fonts that lack subscript or superscript glyphs for a given
jdaggett@8280 3939 character, user agents must use the appropriate subscript and superscript
jdaggett@8280 3940 metrics specified in the selected font's <a
jdaggett@3460 3941 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
jdaggett@3460 3942 table</a> <a href="#OPENTYPE"
jdaggett@5891 3943 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
jdaggett@5891 3944 and offset of the synthesized substitutes.
jdaggett@2461 3945
jdaggett@8280 3946 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
jdaggett@8280 3947 using superscript metrics" src=superscript-alt-synth.png>
jdaggett@8280 3948 <p class=caption>Superscript alternate glyph (left), synthesized
jdaggett@8280 3949 superscript glyphs (middle), and incorrect mixture of the two (right)
jdaggett@8280 3950 </div>
jdaggett@8280 3951
jdaggett@8385 3952 <p>In situations where text decorations are only applied to runs of text
jdaggett@8385 3953 containing superscript or subscript glyphs, the synthesized glyphs must be
jdaggett@8385 3954 used to avoid problems with the placement of decorations.
jdaggett@8385 3955
jdaggett@2461 3956 <p>In the past, user agents have used font-size and vertical-align to
jdaggett@8368 3957 simulate subscripts and superscripts for the <code title="HTML sub
jdaggett@8368 3958 element">sub</code> and <code title="HTML sup element">sup</code>
jdaggett@8368 3959 elements. To allow a backwards compatible way of defining subscripts and
jdaggett@8368 3960 superscripts, it is recommended that authors use conditional rules <a
jdaggett@8368 3961 href="#CSS3-CONDITIONAL"
jdaggett@3460 3962 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
jdaggett@5890 3963 older user agents will still render subscripts and superscripts via the
jdaggett@5890 3964 older mechanism.
jdaggett@5890 3965
jdaggett@5890 3966 <p>Authors should note that fonts typically only provide subscript and
jdaggett@5890 3967 superscript glyphs for a subset of all characters supported by the font.
jdaggett@8280 3968 For example, while subscript and superscript glyphs are often available
jdaggett@8280 3969 for Latin numbers, glyphs for punctuation and letter characters are less
jdaggett@8280 3970 frequently provided. The synthetic fallback rules defined for this
jdaggett@8280 3971 property assure that subscripts and superscripts will always appear but
jdaggett@8280 3972 the appearance may not match author expectations if the font used does not
jdaggett@8280 3973 provide the appropriate alternate glyph for all characters contained in a
jdaggett@8280 3974 subscript or superscript.
jdaggett@8280 3975
jdaggett@8280 3976 <p>This property is not cumulative. Applying it to elements within a
jdaggett@5890 3977 subscript or superscript won't nest the placement of a subscript or
jdaggett@5890 3978 superscript glyph. Images contained within text runs where the value of
jdaggett@8279 3979 this property is ‘<a href="#sub"><code class=property>sub</code></a>’
jdaggett@8279 3980 or ‘<a href="#super"><code class=property>super</code></a>’ will be
jdaggett@8368 3981 drawn just as they would if the value was <a
jdaggett@8368 3982 href="#font-variant-position-normal-value"
jdaggett@8368 3983 title="normal!!font-variant-position">‘<code
jdaggett@8368 3984 class=property>normal</code>’</a>.</p>
jdaggett@8364 3985 <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
jdaggett@8364 3986 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
jdaggett@8280 3987
jdaggett@8280 3988 <p>Because of these limitations, ‘<a
jdaggett@8280 3989 href="#propdef-font-variant-position"><code
jdaggett@8280 3990 class=property>font-variant-position</code></a>’ is not recommended for
jdaggett@8280 3991 use in user agent stylesheets. Authors should use it in cases where
jdaggett@5890 3992 subscripts or superscripts will only contain the narrow range of
jdaggett@5890 3993 characters supported by the fonts specified.
jdaggett@2509 3994
jdaggett@8368 3995 <p class=note>The variant glyphs use the same baseline as the default
jdaggett@8368 3996 glyphs would use. There is no shift in the placement along the baseline,
jdaggett@8368 3997 so the use of variant glyphs doesn't affect the height of the inline box
jdaggett@8368 3998 or alter the height of the linebox. This makes superscript and subscript
jdaggett@8368 3999 variants ideal for situations where it's important that leading remain
jdaggett@8368 4000 constant, such as in multi-column layout.
jdaggett@8368 4001
jdaggett@2461 4002 <div class=example>
jdaggett@8279 4003 <p>A typical user agent default style for the <a class=tag
jdaggett@8279 4004 href="#sub">sub</a> element:</p>
jdaggett@2461 4005
jdaggett@2461 4006 <pre>sub {
jdaggett@2461 4007 vertical-align: sub;
jdaggett@2461 4008 font-size: smaller;
jdaggett@2461 4009 line-height: normal;
jdaggett@2461 4010 }
jdaggett@2461 4011 </pre>
jdaggett@2461 4012
jdaggett@3460 4013 <p>Using font-variant-position to specify typographic subscripts in a way
jdaggett@3460 4014 that will still show subscripts in older user agents:</p>
jdaggett@3460 4015
jdaggett@3460 4016 <pre>@supports ( font-variant-position: sub ) {
jdaggett@3460 4017
jdaggett@3460 4018 sub {
jdaggett@8280 4019 vertical-align: baseline;
jdaggett@3460 4020 font-size: 100%;
jdaggett@3460 4021 line-height: inherit;
jdaggett@3460 4022 font-variant-position: sub;
jdaggett@3460 4023 }
jdaggett@3460 4024
jdaggett@2461 4025 }
jdaggett@2461 4026 </pre>
jdaggett@2461 4027
jdaggett@4624 4028 <p>User agents that support the ‘<a
jdaggett@4624 4029 href="#propdef-font-variant-position"><code
jdaggett@4624 4030 class=property>font-variant-position</code></a>’ property will select a
jdaggett@4624 4031 subscript variant glyph and render this without adjusting the baseline or
jdaggett@4624 4032 font-size. Older user agents will ignore the ‘<a
jdaggett@4624 4033 href="#propdef-font-variant-position"><code
jdaggett@4624 4034 class=property>font-variant-position</code></a>’ property definition
jdaggett@4624 4035 and use the standard defaults for subscripts.</p>
jdaggett@2461 4036 </div>
jdaggett@2118 4037 <!-- prop: font-variant-caps -->
jdaggett@2118 4038
jdaggett@2118 4039 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
jdaggett@1662 4040 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
jdaggett@1662 4041
jdaggett@5809 4042 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
jdaggett@1662 4043 <tbody>
jdaggett@1662 4044 <tr>
jdaggett@1662 4045 <td>Name:
jdaggett@1662 4046
jdaggett@1662 4047 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
jdaggett@1662 4048
jdaggett@1662 4049 <tr>
jdaggett@1662 4050 <td>Value:
jdaggett@1662 4051
jdaggett@8278 4052 <td><a href="#font-variant-caps-normal-value"
jdaggett@8278 4053 title="normal!!font-variant-caps">normal</a> | <a
jdaggett@8278 4054 href="#small-caps">small-caps</a> | <a
jdaggett@8278 4055 href="#all-small-caps">all-small-caps</a> | <a
jdaggett@8278 4056 href="#petite-caps">petite-caps</a> | <a
jdaggett@8278 4057 href="#all-petite-caps">all-petite-caps</a> | <a
jdaggett@8278 4058 href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
jdaggett@1662 4059
jdaggett@1662 4060 <tr>
jdaggett@1662 4061 <td>Initial:
jdaggett@1662 4062
jdaggett@1662 4063 <td>normal
jdaggett@1662 4064
jdaggett@1662 4065 <tr>
jdaggett@1662 4066 <td>Applies to:
jdaggett@1662 4067
jdaggett@1662 4068 <td>all elements
jdaggett@1662 4069
jdaggett@1662 4070 <tr>
jdaggett@1662 4071 <td>Inherited:
jdaggett@1662 4072
jdaggett@1662 4073 <td>yes
jdaggett@1662 4074
jdaggett@1662 4075 <tr>
jdaggett@1662 4076 <td>Percentages:
jdaggett@1662 4077
jdaggett@1662 4078 <td>N/A
jdaggett@1662 4079
jdaggett@1662 4080 <tr>
jdaggett@1662 4081 <td>Media:
jdaggett@1662 4082
jdaggett@1662 4083 <td>visual
jdaggett@1662 4084
jdaggett@1662 4085 <tr>
jdaggett@1662 4086 <td>Computed value:
jdaggett@1662 4087
jdaggett@1662 4088 <td>as specified
jdaggett@7377 4089
jdaggett@7377 4090 <tr>
jdaggett@7377 4091 <td>Animatable:
jdaggett@7377 4092
jdaggett@7377 4093 <td>no
jdaggett@1662 4094 </table>
jdaggett@1662 4095
jdaggett@8280 4096 <p>This property allows the selection of alternate glyphs used for small or
jdaggett@8280 4097 petite capitals or for titling. These glyphs are specifically designed to
jdaggett@8280 4098 blend well with the surrounding normal glyphs, to maintain the weight and
jdaggett@8280 4099 readability which suffers when text is simply resized to fit this purpose.
jdaggett@1662 4100
jdaggett@1732 4101 <p>Individual values have the following meanings:
jdaggett@1662 4102
jdaggett@1662 4103 <dl>
jdaggett@8278 4104 <dt><dfn id=font-variant-caps-normal-value
jdaggett@8278 4105 title="normal!!font-variant-caps">normal</dfn>
jdaggett@5809 4106
jdaggett@5809 4107 <dd>None of the features listed below are enabled.
jdaggett@5809 4108
jdaggett@1662 4109 <dt><dfn id=small-caps>small-caps</dfn>
jdaggett@1662 4110
jdaggett@6436 4111 <dd>Enables display of small capitals (OpenType feature: <span
jdaggett@6436 4112 class=tag>smcp</span>). Small-caps glyphs typically use the form of
jdaggett@6436 4113 uppercase letters but are reduced to the size of lowercase letters.
jdaggett@1662 4114 </dl>
jdaggett@1662 4115
jdaggett@1662 4116 <div class=featex><img alt="small-caps example" src=smcp.png></div>
jdaggett@1662 4117
jdaggett@1662 4118 <dl>
jdaggett@1732 4119 <dt><dfn id=all-small-caps>all-small-caps</dfn>
jdaggett@1732 4120
jdaggett@1732 4121 <dd>Enables display of small capitals for both upper and lowercase letters
jdaggett@6436 4122 (OpenType features: <span class=tag>c2sc, smcp</span>).
jdaggett@1732 4123
jdaggett@1662 4124 <dt><dfn id=petite-caps>petite-caps</dfn>
jdaggett@1662 4125
jdaggett@6436 4126 <dd>Enables display of petite capitals (OpenType feature: <span
jdaggett@6436 4127 class=tag>pcap</span>).
jdaggett@1662 4128
jdaggett@1732 4129 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
jdaggett@1732 4130
jdaggett@1732 4131 <dd>Enables display of petite capitals for both upper and lowercase
jdaggett@6436 4132 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
jdaggett@1732 4133
jdaggett@6648 4134 <dt><dfn id=unicase>unicase</dfn>
jdaggett@6648 4135
jdaggett@6648 4136 <dd>Enables display of mixture of small capitals for uppercase letters
jdaggett@6648 4137 with normal lowercase letters (OpenType feature: <span
jdaggett@6648 4138 class=tag>unic</span>).
jdaggett@6648 4139
jdaggett@1662 4140 <dt><dfn id=titling-caps>titling-caps</dfn>
jdaggett@1662 4141
jdaggett@6436 4142 <dd>Enables display of titling capitals (OpenType feature: <span
jdaggett@6436 4143 class=tag>titl</span>). Uppercase letter glyphs are often designed for
jdaggett@6436 4144 use with lowercase letters. When used in all uppercase titling sequences
jdaggett@6436 4145 they can appear too strong. Titling capitals are designed specifically
jdaggett@6436 4146 for this situation.
jdaggett@1662 4147 </dl>
jdaggett@1662 4148
jdaggett@6648 4149 <p>The availability of these glyphs is based on whether a given feature is
jdaggett@6648 4150 defined or not in the feature list of the font. User agents can optionally
jdaggett@6648 4151 decide this on a per-script basis but should explicitly not decide this on
jdaggett@6648 4152 a per-character basis.
jdaggett@6648 4153
jdaggett@6648 4154 <p>Some fonts may only support a subset or none of the features described
jdaggett@6648 4155 for this property. For backwards compatibility with CSS 2.1, if ‘<a
jdaggett@4624 4156 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
jdaggett@4624 4157 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
jdaggett@4624 4158 is specified but small-caps glyphs are not available for a given font,
jdaggett@4624 4159 user agents should simulate a small-caps font, for example by taking a
jdaggett@6648 4160 normal font and replacing the glyphs for lowercase letters with scaled
jdaggett@6648 4161 versions of the glyphs for uppercase characters (replacing the glyphs for
jdaggett@6648 4162 both upper and lowercase letters in the case of ‘<a
jdaggett@4624 4163 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
jdaggett@6648 4164
jdaggett@6648 4165 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
jdaggett@6648 4166 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
bert@8683 4167 width=512>
jdaggett@6648 4168 <p class=caption>Synthetic vs. real small-caps
jdaggett@6648 4169 </div>
jdaggett@6648 4170
jdaggett@6648 4171 <p>To match the surrounding text, a font may provide alternate glyphs for
jdaggett@6648 4172 caseless characters when these features are enabled but when a user agent
jdaggett@6648 4173 simulates small capitals, it must not attempt to simulate alternates for
jdaggett@6648 4174 codepoints which are considered caseless.
jdaggett@6648 4175
jdaggett@6648 4176 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
jdaggett@6648 4177 characters with small-caps, all-small-caps enabled" class=hires
bert@8683 4178 src=small-capitals-variations.png width=418>
jdaggett@6648 4179 <p class=caption>Caseless characters with small-caps, all-small-caps
jdaggett@6648 4180 enabled
jdaggett@6648 4181 </div>
jdaggett@6648 4182
jdaggett@6648 4183 <p>If either ‘<a href="#petite-caps"><code
jdaggett@4624 4184 class=property>petite-caps</code></a>’ or ‘<a
jdaggett@4624 4185 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
jdaggett@4624 4186 is specified for a font that doesn't support these features, the property
jdaggett@4624 4187 behaves as if ‘<a href="#small-caps"><code
jdaggett@4624 4188 class=property>small-caps</code></a>’ or ‘<a
jdaggett@4624 4189 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
jdaggett@6648 4190 respectively, had been specified. If ‘<a href="#unicase"><code
jdaggett@6648 4191 class=property>unicase</code></a>’ is specified for a font that doesn't
jdaggett@6648 4192 support that feature, the property behaves as if ‘<a
jdaggett@6648 4193 href="#small-caps"><code class=property>small-caps</code></a>’ was
jdaggett@6648 4194 applied only to lowercased uppercase letters. If ‘<a
jdaggett@6648 4195 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
jdaggett@6648 4196 specified with a font that does not support this feature, this property
jdaggett@6648 4197 has no visible effect. When simulated small capital glyphs are used, for
jdaggett@4624 4198 scripts that lack uppercase and lowercase letters, ‘<a
jdaggett@4624 4199 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
jdaggett@4624 4200 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
jdaggett@4624 4201 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
jdaggett@4624 4202 ‘<a href="#all-petite-caps"><code
jdaggett@4624 4203 class=property>all-petite-caps</code></a>’ and ‘<a
jdaggett@4624 4204 href="#unicase"><code class=property>unicase</code></a>’ have no visible
jdaggett@2462 4205 effect.
jdaggett@1662 4206
jdaggett@6648 4207 <p>When casing transforms are used to simulate small capitals, the casing
jdaggett@8280 4208 transformations must match those used for the <span
jdaggett@6648 4209 class=property>‘<code class=property>text-transform</code>’</span>
jdaggett@6648 4210 property.
jdaggett@6648 4211
jdaggett@6648 4212 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
jdaggett@6648 4213 replace glyphs in a small-caps font so that the text appears in all
jdaggett@6648 4214 uppercase letters.
jdaggett@6648 4215
jdaggett@6648 4216 <div class=figure style="padding: 0; margin: auto;"><img alt="using
jdaggett@6648 4217 all-small-caps in acronym-laden text" class=hires
bert@8683 4218 src=acronym-laden-text.png width=596>
jdaggett@6648 4219 <p class=caption>Using small capitals to improve readability in
jdaggett@6648 4220 acronym-laden text
jdaggett@6648 4221 </div>
jdaggett@6648 4222
jdaggett@1662 4223 <div class=example>
jdaggett@1662 4224 <p>Quotes rendered italicised, with small-caps on the first line:</p>
jdaggett@1662 4225
jdaggett@1662 4226 <pre>blockquote { font-style: italic; }
jdaggett@1662 4227 blockquote:first-line { font-variant: small-caps; }
jdaggett@1662 4228
jdaggett@8397 4229 &lt;blockquote><a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/0036.html" style="text-decoration: none; border: none;">I'll be honor-bound to slap them like a haddock.</a>&lt;/blockquote>
jdaggett@1662 4230 </pre>
jdaggett@1662 4231 </div>
jdaggett@2118 4232 <!-- prop: font-variant-numeric -->
jdaggett@2118 4233
jdaggett@2118 4234 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
jdaggett@1662 4235 formatting: the <a
jdaggett@1662 4236 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
jdaggett@1662 4237
jdaggett@5809 4238 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
jdaggett@1662 4239 <tbody>
jdaggett@1662 4240 <tr>
jdaggett@1662 4241 <td>Name:
jdaggett@1662 4242
jdaggett@1662 4243 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
jdaggett@1662 4244
jdaggett@1662 4245 <tr>
jdaggett@1662 4246 <td>Value:
jdaggett@1662 4247
jdaggett@8278 4248 <td><a href="#font-variant-numeric-normal-value"
jdaggett@8278 4249 title="normal!!font-variant-numeric">normal</a> | [ <a
jdaggett@8225 4250 href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
jdaggett@8225 4251 || <a
jdaggett@8225 4252 href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
jdaggett@8225 4253 || <a
jdaggett@8225 4254 href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
jdaggett@8225 4255 || <a href="#ordinal">ordinal</a> || <a
jdaggett@8225 4256 href="#slashed-zero">slashed-zero</a> ]
jdaggett@1662 4257
jdaggett@1662 4258 <tr>
jdaggett@1662 4259 <td>Initial:
jdaggett@1662 4260
jdaggett@1662 4261 <td>normal
jdaggett@1662 4262
jdaggett@1662 4263 <tr>
jdaggett@1662 4264 <td>Applies to:
jdaggett@1662 4265
jdaggett@1662 4266 <td>all elements
jdaggett@1662 4267
jdaggett@1662 4268 <tr>
jdaggett@1662 4269 <td>Inherited:
jdaggett@1662 4270
jdaggett@1662 4271 <td>yes
jdaggett@1662 4272
jdaggett@1662 4273 <tr>
jdaggett@1662 4274 <td>Percentages:
jdaggett@1662 4275
jdaggett@1662 4276 <td>N/A
jdaggett@1662 4277
jdaggett@1662 4278 <tr>
jdaggett@1662 4279 <td>Media:
jdaggett@1662 4280
jdaggett@1662 4281 <td>visual
jdaggett@1662 4282
jdaggett@1662 4283 <tr>
jdaggett@1662 4284 <td>Computed value:
jdaggett@1662 4285
jdaggett@1662 4286 <td>as specified
jdaggett@7377 4287
jdaggett@7377 4288 <tr>
jdaggett@7377 4289 <td>Animatable:
jdaggett@7377 4290
jdaggett@7377 4291 <td>no
jdaggett@1662 4292 </table>
jdaggett@1662 4293
jdaggett@8311 4294 <p>Specifies control over numerical forms. The example below shows how some
jdaggett@8311 4295 of these values can be combined to influence the rendering of tabular data
jdaggett@8311 4296 with fonts that support these features. Within normal paragraph text,
jdaggett@8311 4297 proportional numbers are used while tabular numbers are used so that
jdaggett@8311 4298 columns of numbers line up properly:
jdaggett@1662 4299
jdaggett@1662 4300 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
jdaggett@1662 4301 number styles" src=numberstyles.png>
jdaggett@1662 4302 <p class=caption>Using number styles
jdaggett@1662 4303 </div>
jdaggett@1662 4304
jdaggett@8311 4305 <p>Possible combinations:
jdaggett@8311 4306
jdaggett@8311 4307 <pre
jdaggett@8311 4308 class=prod><dfn id=numeric-figure-values><var>&lt;numeric-figure-values&gt;</var></dfn> = [ <a href="#lining-nums">lining-nums</a> | <a href="#oldstyle-nums">oldstyle-nums</a> ]</pre>
jdaggett@8311 4309
jdaggett@8311 4310 <pre
jdaggett@8311 4311 class=prod><dfn id=numeric-spacing-values><var>&lt;numeric-spacing-values&gt;</var></dfn> = [ <a href="#proportional-nums">proportional-nums</a> | <a href="#tabular-nums">tabular-nums</a> ]</pre>
jdaggett@8311 4312
jdaggett@8311 4313 <pre
jdaggett@8311 4314 class=prod><dfn id=numeric-fraction-values><var>&lt;numeric-fraction-values&gt;</var></dfn> = [ <a href="#diagonal-fractions">diagonal-fractions</a> | <a href="#stacked-fractions">stacked-fractions</a> ]</pre>
jdaggett@8311 4315
jdaggett@8311 4316 <p>Individual values have the following meanings:
jdaggett@8311 4317
jdaggett@1662 4318 <dl>
jdaggett@8311 4319 <dt><dfn id=font-variant-numeric-normal-value
jdaggett@8311 4320 title="normal!!font-variant-numeric">normal</dfn>
jdaggett@8311 4321
jdaggett@8311 4322 <dd>None of the features listed below are enabled.
jdaggett@8311 4323
jdaggett@8311 4324 <dt><dfn id=lining-nums>lining-nums</dfn>
jdaggett@8311 4325
jdaggett@8311 4326 <dd>Enables display of lining numerals (OpenType feature: <span
jdaggett@8311 4327 class=tag>lnum</span>).
jdaggett@8311 4328
jdaggett@8311 4329 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
jdaggett@8311 4330
jdaggett@8311 4331 <dd>Enables display of old-style numerals (OpenType feature: <span
jdaggett@8311 4332 class=tag>onum</span>).
jdaggett@8311 4333
jdaggett@8311 4334 <dt><dfn id=proportional-nums>proportional-nums</dfn>
jdaggett@8311 4335
jdaggett@8311 4336 <dd>Enables display of proportional numerals (OpenType feature: <span
jdaggett@8311 4337 class=tag>pnum</span>).
jdaggett@8311 4338
jdaggett@8311 4339 <dt><dfn id=tabular-nums>tabular-nums</dfn>
jdaggett@8311 4340
jdaggett@8311 4341 <dd>Enables display of tabular numerals (OpenType feature: <span
jdaggett@8311 4342 class=tag>tnum</span>).
jdaggett@8311 4343
jdaggett@1662 4344 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
jdaggett@1662 4345
jdaggett@6436 4346 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
jdaggett@6436 4347 class=tag>frac</span>).
jdaggett@1662 4348 </dl>
jdaggett@1662 4349
jdaggett@1662 4350 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
jdaggett@1662 4351
jdaggett@1662 4352 <dl>
jdaggett@1662 4353 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
jdaggett@1662 4354
jdaggett@6436 4355 <dd>Enables display of lining stacked fractions (OpenType feature: <span
jdaggett@6436 4356 class=tag>afrc</span>).
jdaggett@1662 4357 </dl>
jdaggett@1662 4358
jdaggett@1662 4359 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
jdaggett@1662 4360
jdaggett@1662 4361 <dl>
jdaggett@3638 4362 <dt><dfn id=ordinal>ordinal</dfn>
jdaggett@3638 4363
jdaggett@3638 4364 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
jdaggett@6436 4365 <span class=tag>ordn</span>).
jdaggett@3638 4366
jdaggett@1662 4367 <dt><dfn id=slashed-zero>slashed-zero</dfn>
jdaggett@1662 4368
jdaggett@6436 4369 <dd>Enables display of slashed zeros (OpenType feature: <span
jdaggett@6436 4370 class=tag>zero</span>).
jdaggett@1662 4371 </dl>
jdaggett@1662 4372
jdaggett@1662 4373 <div class=featex><img alt="slashed zero example" src=zero.png></div>
jdaggett@1662 4374
jdaggett@1662 4375 <div class=example id=steak-marinade>
jdaggett@1662 4376 <p>A simple flank steak marinade recipe, rendered with automatic fractions
jdaggett@1662 4377 and old-style numerals:</p>
jdaggett@1662 4378
jdaggett@1662 4379 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
jdaggett@1662 4380
jdaggett@1662 4381 &lt;h4>Steak marinade:&lt;/h4>
jdaggett@1662 4382 &lt;ul>
jdaggett@1662 4383 &lt;li>&lt;span class="amount">2&lt;/span> tbsp olive oil&lt;/li>
jdaggett@1662 4384 &lt;li>&lt;span class="amount">1&lt;/span> tbsp lemon juice&lt;/li>
jdaggett@1662 4385 &lt;li>&lt;span class="amount">1&lt;/span> tbsp soy sauce&lt;/li>
jdaggett@1662 4386 &lt;li>&lt;span class="amount">1 1/2&lt;/span> tbsp dry minced onion&lt;/li>
jdaggett@1662 4387 &lt;li>&lt;span class="amount">2 1/2&lt;/span> tsp italian seasoning&lt;/li>
jdaggett@1732 4388 &lt;li>Salt &amp;amp; pepper&lt;/li>
jdaggett@1662 4389 &lt;/ul>
jdaggett@1662 4390
jdaggett@5596 4391 &lt;p>Mix the meat with the marinade and let it sit covered in the refrigerator
jdaggett@5596 4392 for a few hours or overnight.&lt;/p>
jdaggett@1662 4393 </pre>
jdaggett@8311 4394
jdaggett@8311 4395 <p>Note that the fraction feature is only applied to values not the entire
jdaggett@8311 4396 paragraph. Fonts often implement this feature using contextual rules
jdaggett@8311 4397 based on the use of the slash (‘<code class=css>/</code>’) character.
jdaggett@8311 4398 As such, it's not suitable for use as a paragraph-level style.</p>
jdaggett@1662 4399 </div>
jdaggett@2118 4400 <!-- prop: font-variant-alternates -->
jdaggett@2118 4401
jdaggett@2118 4402 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
jdaggett@2118 4403 and swashes: the <a
jdaggett@2118 4404 href="#propdef-font-variant-alternates">font-variant-alternates</a>
jdaggett@2118 4405 property</h3>
jdaggett@2118 4406
jdaggett@6176 4407 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
jdaggett@2118 4408 <tbody>
jdaggett@2118 4409 <tr>
jdaggett@2118 4410 <td>Name:
jdaggett@2118 4411
jdaggett@2118 4412 <td><dfn
jdaggett@2118 4413 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
jdaggett@2118 4414
jdaggett@2118 4415 <tr>
jdaggett@2118 4416 <td>Value:
jdaggett@2118 4417
jdaggett@8225 4418 <td>normal | [ <a href="#stylistic"
jdaggett@8225 4419 title=stylistic>stylistic(&lt;feature-value-name&gt;)</a> || <a
jdaggett@8225 4420 href="#historical-forms">historical-forms</a> || <a href="#styleset"
jdaggett@8225 4421 title=styleset>styleset(&lt;feature-value-name&gt; #)</a> || <a
jdaggett@8225 4422 href="#character-variant"
jdaggett@8225 4423 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 4424 #)</a> || <a href="#swash"
jdaggett@8225 4425 title=swash>swash(&lt;feature-value-name&gt;)</a> || <a
jdaggett@8225 4426 href="#ornaments"
jdaggett@8225 4427 title=ornaments>ornaments(&lt;feature-value-name&gt;)</a> || <a
jdaggett@8225 4428 href="#annotation"
jdaggett@8225 4429 title=annotation>annotation(&lt;feature-value-name&gt;)</a> ]
jdaggett@2118 4430
jdaggett@2118 4431 <tr>
jdaggett@2118 4432 <td>Initial:
jdaggett@2118 4433
jdaggett@2118 4434 <td>normal
jdaggett@2118 4435
jdaggett@2118 4436 <tr>
jdaggett@2118 4437 <td>Applies to:
jdaggett@2118 4438
jdaggett@2118 4439 <td>all elements
jdaggett@2118 4440
jdaggett@2118 4441 <tr>
jdaggett@2118 4442 <td>Inherited:
jdaggett@2118 4443
jdaggett@2118 4444 <td>yes
jdaggett@2118 4445
jdaggett@2118 4446 <tr>
jdaggett@2118 4447 <td>Percentages:
jdaggett@2118 4448
jdaggett@2118 4449 <td>N/A
jdaggett@2118 4450
jdaggett@2118 4451 <tr>
jdaggett@2118 4452 <td>Media:
jdaggett@2118 4453
jdaggett@2118 4454 <td>visual
jdaggett@2118 4455
jdaggett@2118 4456 <tr>
jdaggett@2118 4457 <td>Computed value:
jdaggett@2118 4458
jdaggett@2118 4459 <td>as specified
jdaggett@7377 4460
jdaggett@7377 4461 <tr>
jdaggett@7377 4462 <td>Animatable:
jdaggett@7377 4463
jdaggett@7377 4464 <td>no
jdaggett@2118 4465 </table>
jdaggett@2118 4466
jdaggett@2118 4467 <p>For any given character, fonts can provide a variety of alternate glyphs
jdaggett@2118 4468 in addition to the default glyph for that character. This property
jdaggett@2118 4469 provides control over the selection of these alternate glyphs.
jdaggett@2118 4470
jdaggett@8311 4471 <p>For many of the property values listed below, several different
jdaggett@8311 4472 alternate glyphs are available. How many alternates are available and what
jdaggett@8356 4473 they represent is font-specific, so these are each marked <dfn
jdaggett@8356 4474 id=font-specific>font specific</dfn> in the value definitions below.
jdaggett@8356 4475 Because the nature of these alternates is font-specific, the <a
jdaggett@8311 4476 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 4477 rule is used to define values for a specific font family or set of
jdaggett@8311 4478 families that associate a font-specific numeric
jdaggett@8311 4479 <code>&lt;feature-index&gt;</code> with a custom
jdaggett@8311 4480 <code>&lt;feature-value-name&gt;</code>, which is then used in this
jdaggett@8311 4481 property to select specific alternates:
jdaggett@8311 4482
jdaggett@8311 4483 <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
jdaggett@8311 4484
jdaggett@8311 4485 p {
jdaggett@8311 4486 font-family: Noble Script;
jdaggett@8311 4487 font-variant-alternates: swash(flowing); /* use swash alternate #2 */
jdaggett@8311 4488 }</pre>
jdaggett@8311 4489
jdaggett@8312 4490 <p>When a particular <code>&lt;feature-value-name&gt;</code> has not been
jdaggett@8312 4491 defined for a given family or for a particular feature type, the computed
jdaggett@8312 4492 value must be the same as if it had been defined. However, property values
jdaggett@8312 4493 that contain these undefined <code>&lt;feature-value-name&gt;</code>
jdaggett@8312 4494 identifiers must be ignored when choosing glyphs.
jdaggett@8312 4495
jdaggett@8312 4496 <pre>/* these two style rules are effectively the same */
jdaggett@8312 4497 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
jdaggett@8312 4498 p { font-variant-alternates: normal; }
jdaggett@8312 4499 </pre>
jdaggett@8312 4500
jdaggett@8312 4501 <p>This allows values to be defined and used for a given set of font
jdaggett@8312 4502 families but ignored if fallback occurs, since the font family name would
jdaggett@8312 4503 be different. If a given value is outside the range supported by a given
jdaggett@8312 4504 font, the value is ignored. These values never apply to generic font
jdaggett@8312 4505 families.
jdaggett@2556 4506
jdaggett@2118 4507 <p>Individual values have the following meanings:
jdaggett@2118 4508
jdaggett@2118 4509 <dl>
jdaggett@8278 4510 <dt><dfn id=font-variant-alternates-normal-value
jdaggett@8278 4511 title="normal!!font-variant-alternates">normal</dfn>
jdaggett@5809 4512
jdaggett@5809 4513 <dd>None of the features listed below are enabled.
jdaggett@5809 4514
jdaggett@2118 4515 <dt><dfn id=historical-forms>historical-forms</dfn>
jdaggett@2118 4516
jdaggett@6436 4517 <dd>Enables display of historical forms (OpenType feature: <span
jdaggett@6436 4518 class=tag>hist</span>).
jdaggett@2118 4519 </dl>
jdaggett@2118 4520
jdaggett@2118 4521 <div class=featex><img alt="historical form example" src=hist.png></div>
jdaggett@2118 4522
jdaggett@2118 4523 <dl>
jdaggett@8311 4524 <dt><dfn id=stylistic
jdaggett@8311 4525 title=stylistic>stylistic(&lt;feature-value-name&gt;)</dfn>
jdaggett@8311 4526
jdaggett@8356 4527 <dd>Enables display of stylistic alternates (<a
jdaggett@8356 4528 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
jdaggett@8356 4529 class=tag>salt &lt;feature-index&gt;</span>).
jdaggett@8311 4530 </dl>
jdaggett@8311 4531
jdaggett@8311 4532 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
jdaggett@8311 4533
jdaggett@8311 4534 <dl>
jdaggett@8225 4535 <dt><dfn id=styleset title=styleset>styleset(&lt;feature-value-name&gt;
jdaggett@8225 4536 #)</dfn>
jdaggett@2118 4537
jdaggett@8356 4538 <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
jdaggett@8356 4539 specific</em></a>, OpenType feature: <span
jdaggett@8356 4540 class=tag>ss&lt;feature-index&gt;</span> OpenType currently defines <span
jdaggett@8356 4541 class=tag>ss01</span> through <span class=tag>ss20</span>).
jdaggett@2118 4542 </dl>
jdaggett@2118 4543
jdaggett@2118 4544 <div class=featex><img alt="styleset example" src=ssnn.png></div>
jdaggett@2118 4545
jdaggett@2118 4546 <dl>
jdaggett@8225 4547 <dt><dfn id=character-variant
jdaggett@8225 4548 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 4549 #)</dfn>
jdaggett@2118 4550
jdaggett@8356 4551 <dd>Enables display of specific character variants (<a
jdaggett@8356 4552 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
jdaggett@6436 4553 class=tag>cv&lt;feature-index&gt;</span> OpenType currently defines <span
jdaggett@6436 4554 class=tag>cv01</span> through <span class=tag>cv99</span>).
jdaggett@2118 4555
jdaggett@8225 4556 <dt><dfn id=swash title=swash>swash(&lt;feature-value-name&gt;)</dfn>
jdaggett@2118 4557
jdaggett@8356 4558 <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
jdaggett@8356 4559 specific</em></a>, OpenType feature: <span class=tag>swsh
jdaggett@8356 4560 &lt;feature-index&gt;, cswh &lt;feature-index&gt;</span>).
jdaggett@2118 4561 </dl>
jdaggett@2118 4562
jdaggett@2118 4563 <div class=featex><img alt="swash example" src=swsh.png></div>
jdaggett@2118 4564
jdaggett@2118 4565 <dl>
jdaggett@8225 4566 <dt><dfn id=ornaments
jdaggett@7060 4567 title=ornaments>ornaments(&lt;feature-value-name&gt;)</dfn>
jdaggett@2118 4568
jdaggett@2118 4569 <dd>Enables replacement of default glyphs with ornaments, if provided in
jdaggett@8356 4570 the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
jdaggett@8356 4571 feature: <span class=tag>ornm &lt;feature-index&gt;</span>). Some fonts
jdaggett@8356 4572 may offer ornament glyphs as alternates for a wide collection of
jdaggett@8356 4573 characters; however, displaying arbitrary characters (e.g.,
jdaggett@8356 4574 alphanumerics) as ornaments is poor practice as it distorts the semantics
jdaggett@8356 4575 of the data. Font designers are encouraged to encode all ornaments
jdaggett@8356 4576 (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
jdaggett@8356 4577 alternates for the bullet character (U+2022) to allow authors to select
jdaggett@8356 4578 the desired glyph using ‘<a href="#ornaments"><code
jdaggett@8356 4579 class=property>ornaments</code></a>’.
jdaggett@2118 4580 </dl>
jdaggett@2118 4581
jdaggett@2118 4582 <div class=featex><img alt="ornaments example" src=ornm.png></div>
jdaggett@2118 4583
jdaggett@2118 4584 <dl>
jdaggett@8225 4585 <dt><dfn id=annotation
jdaggett@7060 4586 title=annotation>annotation(&lt;feature-value-name&gt;)</dfn>
jdaggett@2118 4587
jdaggett@8356 4588 <dd>Enables display of alternate annotation forms (<a
jdaggett@8356 4589 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
jdaggett@8356 4590 class=tag>nalt &lt;feature-index&gt;</span>).
jdaggett@2118 4591 </dl>
jdaggett@2118 4592
jdaggett@2118 4593 <div class=featex><img alt="alternate annotation form example"
jdaggett@2118 4594 src=nalt.png></div>
jdaggett@2118 4595
jdaggett@2472 4596 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
jdaggett@8311 4597 specific alternates: the <dfn id=at-font-feature-values-rule
jdaggett@8311 4598 style="font-weight: inherit; font-style:
jdaggett@8311 4599 inherit"><code>@font-feature-values</code></dfn> rule</h3>
jdaggett@2472 4600
jdaggett@4624 4601 <p>Several of the possible values of ‘<a
jdaggett@4624 4602 href="#propdef-font-variant-alternates"><code
jdaggett@4624 4603 class=property>font-variant-alternates</code></a>’ listed above are
jdaggett@8356 4604 labeled as <a href="#font-specific"><em>font specific</em></a>. For these
jdaggett@8356 4605 features fonts may define not just a single glyph but a set of alternate
jdaggett@8356 4606 glyphs with an index to select a given alternate. Since these are font
jdaggett@8356 4607 family specific, the <a
jdaggett@8311 4608 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8356 4609 rule is used to define named values for these indices for a given family.
jdaggett@8356 4610
jdaggett@8356 4611 <p class=note>See the <a href="#om-fontfeaturevalues">object model
jdaggett@8356 4612 reference section</a> for a description of the interfaces used to modify
jdaggett@8356 4613 these rules via the CSS Object Model.
jdaggett@8356 4614
jdaggett@8356 4615 <div class=example>
jdaggett@8356 4616 <p>In the case of the swash Q in the example shown above, the swash could
jdaggett@8356 4617 be specified using these style rules:</p>
jdaggett@8356 4618
jdaggett@8356 4619 <pre>
jdaggett@7041 4620
jdaggett@2472 4621 @font-feature-values Jupiter Sans {
jdaggett@7041 4622 @swash {
jdaggett@7041 4623 delicate: 1;
jdaggett@7041 4624 flowing: 2;
jdaggett@7041 4625 }
jdaggett@2472 4626 }
jdaggett@2472 4627
jdaggett@2472 4628 h2 { font-family: Jupiter Sans, sans-serif; }
jdaggett@2472 4629
jdaggett@2472 4630 /* show the second swash variant in h2 headings */
jdaggett@2472 4631 h2:first-letter { font-variant-alternates: swash(flowing); }
jdaggett@2472 4632
jdaggett@2479 4633 &lt;h2>Quick&lt;/h2></pre>
jdaggett@2472 4634
jdaggett@8356 4635 <p>When Jupiter Sans is present, the second alternate swash alternate will
jdaggett@8356 4636 be displayed. When not present, no swash character will be shown, since
jdaggett@8356 4637 the specific named value "flowing" is only defined for the Jupiter Sans
jdaggett@8356 4638 family. The @-mark indicates the name of the property value for which a
jdaggett@8356 4639 named value can be used. The name "flowing" is chosen by the author. The
jdaggett@8356 4640 index that represents each alternate is defined within a given font's
jdaggett@8356 4641 data.</p>
jdaggett@8356 4642 </div>
jdaggett@8356 4643
jdaggett@8356 4644 <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
jdaggett@8356 4645
jdaggett@8356 4646 <p>An <a
jdaggett@8356 4647 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8356 4648 rule is composed of a list of font families followed by a block containing
jdaggett@8356 4649 individual <a href="#featurevalueblock"><i
jdaggett@8356 4650 title="feature_value_block">feature value blocks</i></a> that take the
jdaggett@8356 4651 form of @-rules. Each block defines a set of named values for a specific
jdaggett@8356 4652 font feature when a given set of font families is used. Effectively, they
jdaggett@8356 4653 define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
jdaggett@8356 4654 ⟨values⟩ are the numeric indices used for specific features defined
jdaggett@8356 4655 for a given font.
jdaggett@8031 4656
jdaggett@8031 4657 <p>In terms of the grammar, this specification defines the following
jdaggett@8312 4658 productions:
jdaggett@8225 4659
jdaggett@8225 4660 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
jdaggett@8225 4661 : <a href="#fontfeaturevaluessym"><i>FONT_FEATURE_VALUES_SYM</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#fontfamilynamelist"><i>font_family_name_list</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4662 '{' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevalueblock"><i>feature_value_block</i></a>? [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevalueblock"><i>feature_value_block</i></a>? ]* '}' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4663 ;
jdaggett@8225 4664
jdaggett@8225 4665 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
jdaggett@8225 4666 : <a href="#fontfamilyname"><i>font_family_name</i></a> [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ',' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#fontfamilyname"><i>font_family_name</i></a> ]*
jdaggett@8225 4667 ;
jdaggett@8225 4668
jdaggett@8225 4669 <dfn id=fontfamilyname>font_family_name</dfn>
jdaggett@8225 4670 : <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>STRING</i></a> | [ <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>IDENT</i></a> [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>IDENT</i></a> ]* ]
jdaggett@8225 4671 ;
jdaggett@8225 4672
jdaggett@8225 4673 <dfn id=featurevalueblock>feature_value_block</dfn>
jdaggett@8225 4674 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4675 '{' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevaluedefinition"><i>feature_value_definition</i></a>? [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ';' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="#featurevaluedefinition"><i>feature_value_definition</i></a>? ]* '}' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
jdaggett@8225 4676 ;
jdaggett@8225 4677
jdaggett@8225 4678 <dfn id=featuretype>feature_type</dfn>:
jdaggett@8225 4679 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
jdaggett@8225 4680 ;
jdaggett@8225 4681
jdaggett@8225 4682 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
jdaggett@8225 4683 : <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>IDENT</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ':' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>NUMBER</i></a> [ <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>NUMBER</i></a> ]*
jdaggett@8225 4684 ;
jdaggett@8225 4685 </pre>
jdaggett@8225 4686
jdaggett@8032 4687 <p>The following new token is introduced:
jdaggett@8032 4688
jdaggett@8225 4689 <pre>@{F}{O}{N}{T}{-}{F}{E}{A}{T}{U}{R}{E}{-}{V}{A}{L}{U}{E}{S} {return <dfn id=fontfeaturevaluessym>FONT_FEATURE_VALUES_SYM</dfn>;}
jdaggett@2118 4690 </pre>
jdaggett@2118 4691
jdaggett@8356 4692 <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
jdaggett@8356 4693 value blocks</i></a> are handled as <a
jdaggett@8356 4694 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
jdaggett@8356 4695 consist of everything up to the next block or semi-colon, whichever comes
jdaggett@8356 4696 first.
jdaggett@8356 4697
jdaggett@8356 4698 <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
jdaggett@8356 4699 family list</i></a> is a comma-delimited list of <a
jdaggett@8356 4700 href="#fontfamilyname"><i title="font_family_name">font family
jdaggett@8356 4701 names</i></a> that match the definition of <a
jdaggett@8356 4702 href="#family-name-value"><var>&lt;family-name&gt;</var></a> for the <a
jdaggett@8278 4703 href="#propdef-font-family" title="font-family!!property">‘<code
jdaggett@8356 4704 class=property>font-family</code>’</a> property. This means that only
jdaggett@8356 4705 named font families are allowed, rules that include generic or system
jdaggett@8356 4706 fonts in the list of font families are syntax errors. However, if a user
jdaggett@8356 4707 agent defines a generic font to be a specific named font (e.g. Helvetica),
jdaggett@8356 4708 the settings associated with that family name will be used. If syntax
jdaggett@8356 4709 errors occur within the font family list, the entire rule must be ignored.
jdaggett@8356 4710
jdaggett@8356 4711 <p>Within <a href="#featurevalueblock"><i
jdaggett@8356 4712 title="feature_value_block">feature value blocks</i></a>, the <a
jdaggett@8356 4713 href="#featuretype"><i title="feature_type">feature type</i></a> is
jdaggett@8356 4714 ‘<code class=css>@</code>’ followed by the name of one of the <a
jdaggett@8356 4715 href="#font-specific"><em>font specific</em></a> property values of ‘<a
jdaggett@8356 4716 href="#propdef-font-variant-alternates"><code
jdaggett@8356 4717 class=property>font-variant-alternates</code></a>’ (e.g. <a
jdaggett@8356 4718 href="#swash"><code>@swash</code></a>). The identifiers used within
jdaggett@8356 4719 feature value definitions follow the rules of CSS user identifiers and are
jdaggett@8356 4720 case-sensitive. They are unique only for a given set of font families and
jdaggett@8356 4721 <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
jdaggett@8356 4722 same identifier used with a different <a href="#featuretype"><i
jdaggett@8356 4723 title="feature_type">feature type</i></a> is treated as a separate and
jdaggett@8356 4724 distinct value. If the same identifier is defined mulitple times for a
jdaggett@8356 4725 given <a href="#featuretype"><i title="feature_type">feature type</i></a>
jdaggett@8356 4726 and font family, the last defined value is used. Values associated with a
jdaggett@8356 4727 given identifier are limited to integer values 0 or greater.
jdaggett@8356 4728
jdaggett@8356 4729 <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
jdaggett@8356 4730 title="feature_value_definition">feature value definition</i></a>, such as
jdaggett@8356 4731 invalid identifiers or values, the entire <a
jdaggett@8356 4732 href="#featurevaluedefinition"><i title="feature_value_definition">feature
jdaggett@8356 4733 value definition</i></a> must be omitted, just as syntax errors in style
jdaggett@8356 4734 declarations are handled. When the <a href="#featuretype"><i
jdaggett@8356 4735 title="feature_type">feature type</i></a> is invalid, the entire
jdaggett@8356 4736 associated <a href="#featurevalueblock"><i
jdaggett@8356 4737 title="feature_value_block">feature value block</i></a> must be ignored.
jdaggett@8356 4738
jdaggett@8356 4739 <div class=example>
jdaggett@8356 4740 <p>Rules that are equivalent given syntax error handling:</p>
jdaggett@8356 4741
jdaggett@8356 4742 <pre>@font-feature-values Bongo {
jdaggett@7679 4743 @swash { ornate: 1; }
jdaggett@7679 4744 annotation { boxed: 4; } /* should be @annotation! */
jdaggett@8031 4745 @swash { double-loops: 1; flowing: -1; } /* negative value */
jdaggett@8031 4746 @ornaments ; /* incomplete definition */
jdaggett@8031 4747 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
jdaggett@8356 4748 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a> /* random editing mistake */
jdaggett@7679 4749 }</pre>
jdaggett@7679 4750
jdaggett@8356 4751 <p>The example above is equivalent to:</p>
jdaggett@8356 4752
jdaggett@8356 4753 <pre>@font-feature-values Bongo {
jdaggett@7679 4754 @swash { ornate: 1; }
jdaggett@8031 4755 @swash { double-loops: 1; }
jdaggett@8031 4756 @styleset { double-W: 14; sharp-terminals: 16 1; }
jdaggett@7679 4757 }</pre>
jdaggett@8356 4758 </div>
jdaggett@7096 4759
jdaggett@8311 4760 <p>If multiple <a
jdaggett@8311 4761 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8356 4762 rules are defined for a given family, the resulting values definitions are
jdaggett@8356 4763 the union of the definitions contained within these rules. This allows a
jdaggett@8356 4764 set of named values to be defined for a given font family globally for a
jdaggett@8356 4765 site and specific additions made per-page.
jdaggett@8356 4766
jdaggett@8356 4767 <div class=example>
jdaggett@8356 4768 <p>Using both site-wide and per-page feature values:</p>
jdaggett@8356 4769
jdaggett@8356 4770 <pre>
jdaggett@2472 4771 site.css:
jdaggett@2472 4772
jdaggett@2472 4773 @font-feature-values Mercury Serif {
jdaggett@7041 4774 @styleset {
jdaggett@7041 4775 stacked-g: 3; /* "two-storey" versions of g, a */
jdaggett@7041 4776 stacked-a: 4;
jdaggett@7041 4777 }
jdaggett@2472 4778 }
jdaggett@2472 4779
jdaggett@2472 4780 page.css:
jdaggett@8277 4781
jdaggett@2472 4782 @font-feature-values Mercury Serif {
jdaggett@7041 4783 @styleset {
jdaggett@7041 4784 geometric-m: 7; /* alternate version of m */
jdaggett@7041 4785 }
jdaggett@2472 4786 }
jdaggett@8277 4787
jdaggett@2472 4788 body {
jdaggett@2472 4789 font-family: Mercury Serif, serif;
jdaggett@2472 4790
jdaggett@2472 4791 /* enable both the use of stacked g and alternate m */
jdaggett@2472 4792 font-variant-alternates: styleset(stacked-g, geometric-m);
jdaggett@2472 4793 }</pre>
jdaggett@8356 4794 </div>
jdaggett@8356 4795
jdaggett@8356 4796 <div class=example>
jdaggett@8356 4797 <p>Using a commonly named value allows authors to use a single style rule
jdaggett@8356 4798 to cover a set of fonts for which the underlying selector is different
jdaggett@8356 4799 for each font. If either font in the example below is found, a circled
jdaggett@8356 4800 number glyph will be used:</p>
jdaggett@8356 4801
jdaggett@8356 4802 <pre>@font-feature-values Taisho Gothic {
jdaggett@7041 4803 @annotation { boxed: 1; circled: 4; }
jdaggett@2118 4804 }
jdaggett@2118 4805
jdaggett@2118 4806 @font-feature-values Otaru Kisa {
jdaggett@7041 4807 @annotation { circled: 1; black-boxed: 3; }
jdaggett@2118 4808 }
jdaggett@2118 4809
jdaggett@2118 4810 h3.title {
jdaggett@2118 4811 /* circled form defined for both fonts */
jdaggett@2118 4812 font-family: Taisho Gothic, Otaru Kisa;
jdaggett@2118 4813 font-variant: annotation(circled);
jdaggett@2118 4814 }</pre>
jdaggett@8356 4815 </div>
jdaggett@8356 4816
jdaggett@8356 4817 <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
jdaggett@8356 4818 </span>Multi-valued feature value definitions</h4>
jdaggett@8356 4819
jdaggett@8356 4820 <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
jdaggett@8356 4821 href="#propdef-font-variant-alternates"><code
jdaggett@8356 4822 class=property>font-variant-alternates</code></a>’ property values take
jdaggett@8356 4823 a single value (e.g. ‘<a href="#swash"><code
jdaggett@8356 4824 class=property>swash</code></a>’). The ‘<a
jdaggett@8356 4825 href="#character-variant"><code
jdaggett@8356 4826 class=property>character-variant</code></a>’ property value allows two
jdaggett@8356 4827 values and ‘<a href="#styleset"><code
jdaggett@8356 4828 class=property>styleset</code></a>’ allows an unlimited number.
jdaggett@3571 4829
jdaggett@3571 4830 <p>For the styleset property value, multiple values indicate the style sets
jdaggett@7095 4831 to be enabled. Values between 1 and 99 enable OpenType features <span
jdaggett@7095 4832 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
jdaggett@7095 4833 OpenType standard only officially defines <span class=tag>ss01</span>
jdaggett@8356 4834 through <span class=tag>ss20</span>. For OpenType fonts, values greater
jdaggett@8356 4835 than 99 or equal to 0 do not generate a syntax error when parsed but
jdaggett@8356 4836 enable no OpenType features.
jdaggett@2472 4837
jdaggett@2472 4838 <pre>@font-feature-values Mars Serif {
jdaggett@8277 4839 @styleset {
jdaggett@7041 4840 alt-g: 1; /* implies ss01 = 1 */
jdaggett@7041 4841 curly-quotes: 3; /* implies ss03 = 1 */
jdaggett@7041 4842 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
jdaggett@7041 4843 }
jdaggett@7041 4844
jdaggett@7041 4845 @styleset {
jdaggett@7095 4846 dumb: 125; /* &gt;99, ignored */
jdaggett@7041 4847 }
jdaggett@7041 4848
jdaggett@7041 4849 @swash {
jdaggett@7041 4850 swishy: 3 5; /* more than 1 value for swash, syntax error */
jdaggett@7041 4851 }
jdaggett@2472 4852 }
jdaggett@2472 4853
jdaggett@2472 4854 p.codeblock {
jdaggett@2472 4855 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
jdaggett@2472 4856 font-variant-alternates: styleset(curly-quotes, code);
jdaggett@2472 4857 }</pre>
jdaggett@2472 4858
jdaggett@2472 4859 <p>For character-variant, a single value between 1 and 99 indicates the
jdaggett@6436 4860 enabling of OpenType feature <span class=tag>cv01</span> through <span
jdaggett@7095 4861 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
jdaggett@8356 4862 to 0 are ignored but do not generate a syntax error when parsed but enable
jdaggett@8356 4863 no OpenType features. When two values are listed, the first value
jdaggett@8356 4864 indicates the feature used and the second the value passed for that
jdaggett@8356 4865 feature. If more than two values are assigned to a given name, a syntax
jdaggett@8356 4866 error occurs and the entire <a href="#featurevaluedefinition"><i
jdaggett@8356 4867 title="feature_value_definition">feature value definition</i></a> is
jdaggett@8356 4868 ignored.
jdaggett@2472 4869
jdaggett@2472 4870 <pre>@font-feature-values MM Greek {
jdaggett@7041 4871 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
jdaggett@7041 4872 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
jdaggett@8356 4873 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
jdaggett@7041 4874 @character-variant { gamma: 12; } /* implies cv12 = 1 */
jdaggett@7041 4875 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
jdaggett@7041 4876 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
jdaggett@7041 4877 @character-variant { silly: 105; } /* &gt;99, ignored */
jdaggett@7041 4878 @character-variant { dumb: 323 3; } /* &gt;99, ignored */
jdaggett@2472 4879 }
jdaggett@2472 4880
jdaggett@2472 4881 #title {
jdaggett@2472 4882 /* use the third alternate beta, first alternate gamma */
jdaggett@2472 4883 font-variant-alternates: character-variant(beta-3, gamma);
jdaggett@3571 4884 }
jdaggett@3571 4885
jdaggett@3571 4886 p {
jdaggett@3571 4887 /* zeta-2 follows zeta, implies cv20 = 2 */
jdaggett@3571 4888 font-variant-alternates: character-variant(zeta, zeta-2);
jdaggett@3571 4889 }
jdaggett@3571 4890
jdaggett@3571 4891 .special {
jdaggett@3571 4892 /* zeta follows zeta-2, implies cv20 = 3 */
jdaggett@3571 4893 font-variant-alternates: character-variant(zeta-2, zeta);
jdaggett@2472 4894 }</pre>
jdaggett@2472 4895
jdaggett@2472 4896 <div class=figure><img alt="Matching text on Byzantine seals using
jdaggett@2472 4897 character variants" src=byzantineseal.png>
jdaggett@2472 4898 <p class=caption>Byzantine seal text displayed with character variants
jdaggett@2472 4899 </div>
jdaggett@2472 4900
jdaggett@2472 4901 <div class=example>
jdaggett@2472 4902 <p>In the figure above, the text in red is rendered using a font
jdaggett@2472 4903 containing character variants that mimic the character forms found on a
jdaggett@2472 4904 Byzantine seal from the 8th century A.D. Two lines below is the same text
jdaggett@2472 4905 displayed in a font without variants. Note the two variants for U and N
jdaggett@2509 4906 used on the seal.</p>
jdaggett@2472 4907
jdaggett@2472 4908 <pre>@font-feature-values Athena Ruby {
jdaggett@7041 4909 @character-variant {
jdaggett@7041 4910 leo-B: 2 1;
jdaggett@7041 4911 leo-M: 13 3;
jdaggett@7041 4912 leo-alt-N: 14 1;
jdaggett@7041 4913 leo-N: 14 2;
jdaggett@8277 4914 leo-T: 20 1;
jdaggett@7041 4915 leo-U: 21 2;
jdaggett@7041 4916 leo-alt-U: 21 4;
jdaggett@7041 4917 }
jdaggett@2472 4918 }
jdaggett@2472 4919
jdaggett@2472 4920 p {
jdaggett@6653 4921 font-variant: discretionary-ligatures,
jdaggett@6653 4922 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
jdaggett@2472 4923 }
jdaggett@2472 4924
jdaggett@8277 4925 span.alt-N {
jdaggett@2472 4926 font-variant-alternates: character-variant(leo-alt-N);
jdaggett@2472 4927 }
jdaggett@2472 4928
jdaggett@2472 4929 span.alt-U {
jdaggett@2472 4930 font-variant-alternates: character-variant(leo-alt-U);
jdaggett@2472 4931 }
jdaggett@2472 4932
jdaggett@2472 4933 &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 4934
jdaggett@8277 4935 &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 4936 </pre>
jdaggett@2118 4937 </div>
jdaggett@2118 4938
jdaggett@2118 4939 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
jdaggett@2118 4940 Asian text rendering: the <a
jdaggett@1662 4941 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
jdaggett@1662 4942 property</h3>
jdaggett@1662 4943
jdaggett@5809 4944 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
jdaggett@1662 4945 <tbody>
jdaggett@1662 4946 <tr>
jdaggett@1662 4947 <td>Name:
jdaggett@1662 4948
jdaggett@1662 4949 <td><dfn
jdaggett@1662 4950 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
jdaggett@1662 4951
jdaggett@1662 4952 <tr>
jdaggett@1662 4953 <td>Value:
jdaggett@1662 4954
jdaggett@8278 4955 <td><a href="#font-variant-east-asian-normal-value"
jdaggett@8278 4956 title="normal!!font-variant-east-asian">normal</a> | [ <a
jdaggett@8225 4957 href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
jdaggett@8225 4958 || <a
jdaggett@8225 4959 href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
jdaggett@8225 4960 || <a href="#ruby">ruby</a> ]
jdaggett@1662 4961
jdaggett@1662 4962 <tr>
jdaggett@1662 4963 <td>Initial:
jdaggett@1662 4964
jdaggett@1662 4965 <td>normal
jdaggett@1662 4966
jdaggett@1662 4967 <tr>
jdaggett@1662 4968 <td>Applies to:
jdaggett@1662 4969
jdaggett@1662 4970 <td>all elements
jdaggett@1662 4971
jdaggett@1662 4972 <tr>
jdaggett@1662 4973 <td>Inherited:
jdaggett@1662 4974
jdaggett@1662 4975 <td>yes
jdaggett@1662 4976
jdaggett@1662 4977 <tr>
jdaggett@1662 4978 <td>Percentages:
jdaggett@1662 4979
jdaggett@1662 4980 <td>N/A
jdaggett@1662 4981
jdaggett@1662 4982 <tr>
jdaggett@1662 4983 <td>Media:
jdaggett@1662 4984
jdaggett@1662 4985 <td>visual
jdaggett@1662 4986
jdaggett@1662 4987 <tr>
jdaggett@1662 4988 <td>Computed value:
jdaggett@1662 4989
jdaggett@1662 4990 <td>as specified
jdaggett@7377 4991
jdaggett@7377 4992 <tr>
jdaggett@7377 4993 <td>Animatable:
jdaggett@7377 4994
jdaggett@7377 4995 <td>no
jdaggett@1662 4996 </table>
jdaggett@1662 4997
jdaggett@6693 4998 <p>Allows control of glyph substitution and sizing in East Asian text.
jdaggett@1662 4999
jdaggett@1662 5000 <pre
jdaggett@8225 5001 class=prod><dfn id=east-asian-variant-values><var>&lt;east-asian-variant-values&gt;</var></dfn> = [ <a href="#jis78">jis78</a> | <a href="#jis83">jis83</a> | <a href="#jis90">jis90</a> | <a href="#jis04">jis04</a> | <a href="#simplified">simplified</a> | <a href="#traditional">traditional</a> ]</pre>
jdaggett@1662 5002
jdaggett@1662 5003 <pre
jdaggett@8225 5004 class=prod><dfn id=east-asian-width-values><var>&lt;east-asian-width-values&gt;</var></dfn> = [ <a href="#full-width">full-width</a> | <a href="#proportional-width">proportional-width</a> ]</pre>
jdaggett@1732 5005
jdaggett@1732 5006 <p>Individual values have the following meanings:
jdaggett@1662 5007
jdaggett@1662 5008 <dl>
jdaggett@8278 5009 <dt><dfn id=font-variant-east-asian-normal-value
jdaggett@8278 5010 title="normal!!font-variant-east-asian">normal</dfn>
jdaggett@5809 5011
jdaggett@5809 5012 <dd>None of the features listed below are enabled.
jdaggett@5809 5013
jdaggett@1662 5014 <dt><dfn id=jis78>jis78</dfn>
jdaggett@1662 5015
jdaggett@6436 5016 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
jdaggett@6436 5017 class=tag>jp78</span>).
jdaggett@1662 5018 </dl>
jdaggett@1662 5019
jdaggett@1662 5020 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
jdaggett@1662 5021
jdaggett@1662 5022 <dl>
jdaggett@1662 5023 <dt><dfn id=jis83>jis83</dfn>
jdaggett@1662 5024
jdaggett@6436 5025 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
jdaggett@6436 5026 class=tag>jp83</span>).
jdaggett@1662 5027
jdaggett@1662 5028 <dt><dfn id=jis90>jis90</dfn>
jdaggett@1662 5029
jdaggett@6436 5030 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
jdaggett@6436 5031 class=tag>jp90</span>).
jdaggett@1662 5032
jdaggett@1662 5033 <dt><dfn id=jis04>jis04</dfn>
jdaggett@1662 5034
jdaggett@6436 5035 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
jdaggett@6436 5036 class=tag>jp04</span>).
jdaggett@6693 5037 <p>The various JIS variants reflect the glyph forms defined in different
jdaggett@6693 5038 Japanese national standards. Fonts generally include glyphs defined by
jdaggett@6693 5039 the most recent national standard but it's sometimes necessary to use
jdaggett@6693 5040 older variants, to match signage for example.</p>
jdaggett@1662 5041
jdaggett@2504 5042 <dt><dfn id=simplified>simplified</dfn>
jdaggett@2504 5043
jdaggett@6436 5044 <dd>Enables rendering of simplified forms (OpenType feature: <span
jdaggett@6436 5045 class=tag>smpl</span>).
jdaggett@2504 5046
jdaggett@2504 5047 <dt><dfn id=traditional>traditional</dfn>
jdaggett@2504 5048
jdaggett@6436 5049 <dd>Enables rendering of traditional forms (OpenType feature: <span
jdaggett@6436 5050 class=tag>trad</span>).
jdaggett@1662 5051 </dl>
jdaggett@1662 5052
jdaggett@8312 5053 <p>The ‘<a href="#simplified"><code
jdaggett@8312 5054 class=property>simplified</code></a>’ and ‘<a
jdaggett@8312 5055 href="#traditional"><code class=property>traditional</code></a>’ values
jdaggett@8312 5056 allow control over the glyph forms for characters which have been
jdaggett@8312 5057 simplified over time but for which the older, traditional form is still
jdaggett@8312 5058 used in some contexts. The exact set of characters and glyph forms will
jdaggett@8312 5059 vary to some degree by context for which a given font was designed.
jdaggett@8312 5060
jdaggett@1662 5061 <div class=featex><img alt="tradtional form example" src=trad.png></div>
jdaggett@1662 5062
jdaggett@1662 5063 <dl>
jdaggett@1662 5064 <dt><dfn id=full-width>full-width</dfn>
jdaggett@1662 5065
jdaggett@6436 5066 <dd>Enables rendering of full-width variants (OpenType feature: <span
jdaggett@6436 5067 class=tag>fwid</span>).
jdaggett@1662 5068
jdaggett@1662 5069 <dt><dfn id=proportional-width>proportional-width</dfn>
jdaggett@1662 5070
jdaggett@1662 5071 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
jdaggett@6436 5072 <span class=tag>pwid</span>).
jdaggett@1662 5073 </dl>
jdaggett@1662 5074
jdaggett@1662 5075 <div class=featex><img alt="proportionally spaced Japanese example"
jdaggett@1662 5076 src=pwid.png></div>
jdaggett@1662 5077
jdaggett@3638 5078 <dl>
jdaggett@3638 5079 <dt><dfn id=ruby>ruby</dfn>
jdaggett@3638 5080
jdaggett@6436 5081 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
jdaggett@6436 5082 class=tag>ruby</span>). Since ruby text is generally smaller than the
jdaggett@3638 5083 associated body text, font designers can design special glyphs for use
jdaggett@3638 5084 with ruby that are more readable than scaled down versions of the default
jdaggett@3638 5085 glyphs. Only glyph selection is affected, there is no associated font
jdaggett@3638 5086 scaling or other change that affects line layout. The red ruby text below
jdaggett@3638 5087 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
jdaggett@3638 5088 Note the slight difference in stroke thickness.
jdaggett@3638 5089 </dl>
jdaggett@3638 5090
jdaggett@3638 5091 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
jdaggett@3638 5092
jdaggett@2118 5093 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
jdaggett@1856 5094 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
jdaggett@1662 5095 property</h3>
jdaggett@1662 5096
jdaggett@6436 5097 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
jdaggett@1662 5098 <tbody>
jdaggett@1662 5099 <tr>
jdaggett@1662 5100 <td>Name:
jdaggett@1662 5101
jdaggett@8278 5102 <td><dfn id=propdef-font-variant
jdaggett@8278 5103 title="font-variant!!property">font-variant</dfn>
jdaggett@1662 5104
jdaggett@1662 5105 <tr>
jdaggett@1662 5106 <td>Value:
jdaggett@1662 5107
jdaggett@8278 5108 <td><a href="#font-variant-normal-value"
jdaggett@8278 5109 title="normal!!font-variant">normal</a> | <a
jdaggett@8278 5110 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
jdaggett@8278 5111 <a href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a>
jdaggett@8278 5112 || <a
jdaggett@8225 5113 href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
jdaggett@8225 5114 || <a
jdaggett@8225 5115 href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
jdaggett@8225 5116 || <a
jdaggett@8225 5117 href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
jdaggett@8225 5118 || <a href="#stylistic"><var
jdaggett@8225 5119 title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 5120 href="#historical-forms"><var>historical-forms</var></a> || <a
jdaggett@8225 5121 href="#styleset"><var
jdaggett@8225 5122 title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
jdaggett@8225 5123 href="#character-variant"><var
jdaggett@8225 5124 title=character-variant>character-variant(&lt;feature-value-name&gt;
jdaggett@8225 5125 #)</var></a> || <a href="#swash"><var
jdaggett@8225 5126 title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 5127 href="#ornaments"><var
jdaggett@8225 5128 title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
jdaggett@8225 5129 href="#annotation"><var
jdaggett@8225 5130 title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
jdaggett@8225 5131 <a href="#small-caps"><i>small-caps</i></a> | <a
jdaggett@8225 5132 href="#all-small-caps"><i>all-small-caps</i></a> | <a
jdaggett@8225 5133 href="#petite-caps"><i>petite-caps</i></a> | <a
jdaggett@8225 5134 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
jdaggett@8225 5135 href="#unicase"><i>unicase</i></a> | <a
jdaggett@8225 5136 href="#titling-caps"><i>titling-caps</i></a> ] || <a
jdaggett@8225 5137 href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
jdaggett@8225 5138 || <a
jdaggett@8225 5139 href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
jdaggett@8225 5140 || <a
jdaggett@8225 5141 href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
jdaggett@8225 5142 || <a href="#ordinal"><i>ordinal</i></a> || <a
jdaggett@8225 5143 href="#slashed-zero"><i>slashed-zero</i></a> || <a
jdaggett@8225 5144 href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
jdaggett@8225 5145 || <a
jdaggett@8225 5146 href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
jdaggett@8225 5147 || <a href="#ruby"><i>ruby</i></a> ]
jdaggett@1662 5148
jdaggett@1662 5149 <tr>
jdaggett@1662 5150 <td>Initial:
jdaggett@1662 5151
jdaggett@1662 5152 <td>normal
jdaggett@1662 5153
jdaggett@1662 5154 <tr>
jdaggett@1662 5155 <td>Applies to:
jdaggett@1662 5156
jdaggett@1662 5157 <td>all elements
jdaggett@1662 5158
jdaggett@1662 5159 <tr>
jdaggett@1662 5160 <td>Inherited:
jdaggett@1662 5161
jdaggett@1662 5162 <td>yes
jdaggett@1662 5163
jdaggett@1662 5164 <tr>
jdaggett@1662 5165 <td>Percentages:
jdaggett@1662 5166
jdaggett@7377 5167 <td>see individual properties
jdaggett@1662 5168
jdaggett@1662 5169 <tr>
jdaggett@1662 5170 <td>Media:
jdaggett@1662 5171
jdaggett@1662 5172 <td>visual
jdaggett@1662 5173
jdaggett@1662 5174 <tr>
jdaggett@1662 5175 <td>Computed value:
jdaggett@1662 5176
jdaggett@7377 5177 <td>see individual properties
jdaggett@7377 5178
jdaggett@7377 5179 <tr>
jdaggett@7377 5180 <td>Animatable:
jdaggett@7377 5181
jdaggett@7377 5182 <td>see individual properties
jdaggett@1662 5183 </table>
jdaggett@1662 5184
jdaggett@8313 5185 <p>The <a href="#propdef-font-variant"
jdaggett@8313 5186 title="font-variant!!property">‘<code
jdaggett@8313 5187 class=property>font-variant</code>’</a> property is a shorthand for all
jdaggett@8313 5188 font-variant subproperties. The value <dfn id=font-variant-normal-value
jdaggett@8313 5189 title="normal!!font-variant">‘<code
jdaggett@8313 5190 class=property>normal</code>’</dfn> resets all subproperties of <a
jdaggett@8313 5191 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 5192 class=property>font-variant</code>’</a> to their inital value. The <dfn
jdaggett@8313 5193 id=font-variant-none-value title="none!!font-variant">‘<code
jdaggett@8313 5194 class=property>none</code>’</dfn> value sets ‘<a
jdaggett@8313 5195 href="#propdef-font-variant-ligatures"><code
jdaggett@8278 5196 class=property>font-variant-ligatures</code></a>’ to ‘<code
jdaggett@8278 5197 class=property>none</code>’ and resets all other font feature properties
jdaggett@8278 5198 to their initial value. Like other shorthands, using <a
jdaggett@8278 5199 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 5200 class=property>font-variant</code>’</a> resets unspecified <a
jdaggett@8313 5201 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8313 5202 class=property>font-variant</code>’</a> subproperties to their initial
jdaggett@8313 5203 values. It does not reset the values of either ‘<a
jdaggett@8313 5204 href="#propdef-font-language-override"><code
jdaggett@8279 5205 class=property>font-language-override</code></a>’ or <a
jdaggett@8279 5206 href="#propdef-font-feature-settings"
jdaggett@8279 5207 title="font-feature-settings!!property">‘<code
jdaggett@8279 5208 class=property>font-feature-settings</code>’</a>.
jdaggett@1662 5209
jdaggett@2118 5210 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
jdaggett@2509 5211 font feature settings control: the <a
jdaggett@1662 5212 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
jdaggett@1662 5213
jdaggett@4624 5214 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
jdaggett@1662 5215 <tbody>
jdaggett@1662 5216 <tr>
jdaggett@1662 5217 <td>Name:
jdaggett@1662 5218
jdaggett@8279 5219 <td><dfn id=propdef-font-feature-settings
jdaggett@8279 5220 title="font-feature-settings!!property">font-feature-settings</dfn>
jdaggett@1662 5221
jdaggett@1662 5222 <tr>
jdaggett@1662 5223 <td>Value:
jdaggett@1662 5224
jdaggett@8278 5225 <td><a href="#font-feature-settings-normal-value"
jdaggett@8278 5226 title="normal!!font-feature-settings">normal</a> | <a
jdaggett@8225 5227 href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
jdaggett@1662 5228
jdaggett@1662 5229 <tr>
jdaggett@1662 5230 <td>Initial:
jdaggett@1662 5231
jdaggett@1662 5232 <td>normal
jdaggett@1662 5233
jdaggett@1662 5234 <tr>
jdaggett@1662 5235 <td>Applies to:
jdaggett@1662 5236
jdaggett@1662 5237 <td>all elements
jdaggett@1662 5238
jdaggett@1662 5239 <tr>
jdaggett@1662 5240 <td>Inherited:
jdaggett@1662 5241
jdaggett@1662 5242 <td>yes
jdaggett@1662 5243
jdaggett@1662 5244 <tr>
jdaggett@1662 5245 <td>Percentages:
jdaggett@1662 5246
jdaggett@1662 5247 <td>N/A
jdaggett@1662 5248
jdaggett@1662 5249 <tr>
jdaggett@1662 5250 <td>Media:
jdaggett@1662 5251
jdaggett@1662 5252 <td>visual
jdaggett@1662 5253
jdaggett@1662 5254 <tr>
jdaggett@1662 5255 <td>Computed value:
jdaggett@1662 5256
jdaggett@1662 5257 <td>as specified
jdaggett@7377 5258
jdaggett@7377 5259 <tr>
jdaggett@7377 5260 <td>Animatable:
jdaggett@7377 5261
jdaggett@7377 5262 <td>no
jdaggett@1662 5263 </table>
jdaggett@2474 5264
jdaggett@2474 5265 <p>This property provides low-level control over OpenType font features. It
jdaggett@2474 5266 is intended as a way of providing access to font features that are not
jdaggett@8312 5267 widely used but are needed for a particular use case.
jdaggett@8312 5268
jdaggett@8312 5269 <p>Authors should generally use <a href="#propdef-font-variant"
jdaggett@8312 5270 title="font-variant!!property">‘<code
jdaggett@8312 5271 class=property>font-variant</code>’</a> and its related subproperties
jdaggett@8312 5272 whenever possible and only use this property for special cases where its
jdaggett@8312 5273 use is the only way of accessing a particular infrequently used font
jdaggett@8312 5274 feature.
jdaggett@8312 5275
jdaggett@8312 5276 <pre>/* enable small caps and use second swash alternate */
jdaggett@8312 5277 font-feature-settings: "smcp", "swsh" 2;</pre>
jdaggett@8312 5278
jdaggett@8312 5279 <p>A value of <dfn id=font-feature-settings-normal-value
jdaggett@8278 5280 title="normal!!font-feature-settings">‘<code
jdaggett@8278 5281 class=property>normal</code>’</dfn> means that no change in glyph
jdaggett@8278 5282 selection or positioning occurs due to this property.
jdaggett@2474 5283
jdaggett@2509 5284 <p>Feature tag values have the following syntax:
jdaggett@2474 5285
jdaggett@2474 5286 <pre
jdaggett@8225 5287 class=prod><dfn id=feature-tag-value><var>&lt;feature-tag-value&gt;</var></dfn> = &lt;string&gt; [ &lt;integer&gt; | on | off ]?</pre>
jdaggett@2509 5288
jdaggett@5532 5289 <p>The &lt;string&gt; is a case-sensitive OpenType feature tag. As
jdaggett@5532 5290 specified in the OpenType specification, feature tags contain four ASCII
jdaggett@5532 5291 characters. Tag strings longer or shorter than four characters, or
jdaggett@5596 5292 containing characters outside the U+20–7E codepoint range are invalid.
jdaggett@8312 5293 Feature tags need only match a feature tag defined in the font, so they
jdaggett@8312 5294 are not limited to explicitly registered OpenType features. Fonts defining
jdaggett@8312 5295 custom feature tags should follow the <a
jdaggett@2474 5296 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
jdaggett@2474 5297 rules</a> defined in the OpenType specification <a
jdaggett@1662 5298 href="#OPENTYPE-FEATURES"
jdaggett@2474 5299 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
jdaggett@8927 5300
jdaggett@8927 5301 <p>Feature tags not present in the font are ignored; a user agent must not
jdaggett@8927 5302 attempt to synthesize fallback behavior based on these feature tags. The
jdaggett@8927 5303 one exception is that user agents may synthetically support the <span
jdaggett@8927 5304 class=tag>kern</span> feature with fonts that contain kerning data in the
jdaggett@8927 5305 form of a ‘<code class=property>kern</code>’ table but lack <span
jdaggett@8927 5306 class=tag>kern</span> feature support in the ‘<code
jdaggett@8927 5307 class=property>GPOS</code>’ table.
jdaggett@8927 5308
jdaggett@8927 5309 <p class=note>In general, authors should use the ‘<a
jdaggett@5946 5310 href="#propdef-font-kerning"><code
jdaggett@8927 5311 class=property>font-kerning</code></a>’ property to explicitly enable or
jdaggett@8927 5312 disable kerning since this property always affects fonts with either type
jdaggett@8927 5313 of kerning data.
jdaggett@5946 5314
jdaggett@2509 5315 <p>If present, a value indicates an index used for glyph selection. An
jdaggett@2509 5316 &lt;integer&gt; value must be 0 or greater. A value of 0 indicates that
jdaggett@2509 5317 the feature is disabled. For boolean features, a value of 1 enables the
jdaggett@2509 5318 feature. For non-boolean features, a value of 1 or greater enables the
jdaggett@2509 5319 feature and indicates the feature selection index. A value of ‘<code
jdaggett@2509 5320 class=property>on</code>’ is synonymous with 1 and ‘<code
jdaggett@2509 5321 class=property>off</code>’ is synonymous with 0. If the value is
jdaggett@2509 5322 omitted, a value of 1 is assumed.
jdaggett@2474 5323
jdaggett@2474 5324 <pre>
jdaggett@2509 5325 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
jdaggett@2509 5326 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
jdaggett@2515 5327 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
jdaggett@2509 5328 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
jdaggett@2515 5329 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
jdaggett@5530 5330 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
jdaggett@8859 5331 font-feature-settings: "silly" off; /* invalid, tag too long */
jdaggett@2509 5332 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
jdaggett@5530 5333 font-feature-settings: dlig; /* invalid, tag must be a string */
jdaggett@2474 5334 </pre>
jdaggett@1662 5335
jdaggett@8272 5336 <p>When values greater than the range supported by the font are specified,
jdaggett@8272 5337 the behavior is explicitly undefined. For boolean features, in general
jdaggett@8272 5338 these will enable the feature. For non-boolean features, out of range
jdaggett@8272 5339 values will in general be equivalent to a 0 value. However, in both cases
jdaggett@8272 5340 the exact behavior will depend upon the way the font is designed
jdaggett@8272 5341 (specifically, which type of lookup is used to define the feature).
jdaggett@8272 5342
jdaggett@2474 5343 <p>Although specifically defined for OpenType feature tags, feature tags
jdaggett@2474 5344 for other modern font formats that support font features may be added in
jdaggett@5530 5345 the future. Where possible, features defined for other font formats should
jdaggett@5530 5346 attempt to follow the pattern of registered OpenType tags.
jdaggett@2509 5347
jdaggett@1662 5348 <div class=example>
jdaggett@1662 5349 <p>The Japanese text below will be rendered with half-width kana
jdaggett@1662 5350 characters:</p>
jdaggett@1662 5351
jdaggett@1662 5352 <pre lang=ja>
jdaggett@2509 5353 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
jdaggett@1662 5354
jdaggett@1662 5355 &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 5356 </pre>
jdaggett@1662 5357 </div>
jdaggett@1662 5358
jdaggett@2118 5359 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
jdaggett@1732 5360 language override: the <a
jdaggett@1732 5361 href="#propdef-font-language-override">font-language-override</a> property</h3>
jdaggett@1732 5362
jdaggett@5809 5363 <table class=propdef id=namefont-language-overridevaluenormal-lt>
jdaggett@1662 5364 <tbody>
jdaggett@1662 5365 <tr>
jdaggett@1662 5366 <td>Name:
jdaggett@1662 5367
jdaggett@1732 5368 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
jdaggett@1662 5369
jdaggett@1662 5370 <tr>
jdaggett@1662 5371 <td>Value:
jdaggett@1662 5372
jdaggett@8278 5373 <td><a href="#font-language-override-normal-value"
jdaggett@8278 5374 title="normal!!font-language-override">normal</a> | <a
jdaggett@8278 5375 href="#font-language-override-string-value"><var>&lt;string&gt;</var></a>
jdaggett@1662 5376
jdaggett@1662 5377 <tr>
jdaggett@1662 5378 <td>Initial:
jdaggett@1662 5379
jdaggett@8278 5380 <td><a href="#font-language-override-normal-value"
jdaggett@8278 5381 title="normal!!font-language-override">normal</a>
jdaggett@1662 5382
jdaggett@1662 5383 <tr>
jdaggett@1662 5384 <td>Applies to:
jdaggett@1662 5385
jdaggett@1662 5386 <td>all elements
jdaggett@1662 5387
jdaggett@1662 5388 <tr>
jdaggett@1662 5389 <td>Inherited:
jdaggett@1662 5390
jdaggett@1662 5391 <td>yes
jdaggett@1662 5392
jdaggett@1662 5393 <tr>
jdaggett@1662 5394 <td>Percentages:
jdaggett@1662 5395
jdaggett@1662 5396 <td>N/A
jdaggett@1662 5397
jdaggett@1662 5398 <tr>
jdaggett@1662 5399 <td>Media:
jdaggett@1662 5400
jdaggett@1662 5401 <td>visual
jdaggett@1662 5402
jdaggett@1662 5403 <tr>
jdaggett@1662 5404 <td>Computed value:
jdaggett@1662 5405
jdaggett@1662 5406 <td>as specified
jdaggett@7377 5407
jdaggett@7377 5408 <tr>
jdaggett@7377 5409 <td>Animatable:
jdaggett@7377 5410
jdaggett@7377 5411 <td>no
jdaggett@1662 5412 </table>
jdaggett@1662 5413
jdaggett@8278 5414 <p>Normally, authors can control the use of language-specific glyph
jdaggett@8278 5415 substitutions and positioning by setting the content language of an
jdaggett@8278 5416 element, as <a href="#language-specific-support">described above</a>:
jdaggett@8278 5417
jdaggett@8278 5418 <pre>&lt;!-- Display text using S'gaw Karen specific features -->
jdaggett@8387 5419 &lt;p lang="ksw">...&lt;/p></pre>
jdaggett@8278 5420
jdaggett@8278 5421 <p>In some cases, authors may need to specify a language system that
jdaggett@8278 5422 differs from the content language, for example due to the need to mimic
jdaggett@8278 5423 another language's typographic traditions. The ‘<a
jdaggett@8278 5424 href="#propdef-font-language-override"><code
jdaggett@8278 5425 class=property>font-language-override</code></a>’ property allows
jdaggett@8278 5426 authors to explicitly specify the language system of the font, overriding
jdaggett@8278 5427 the language system implied by the content language.
jdaggett@8278 5428
jdaggett@8278 5429 <p>Values have the following meanings:
jdaggett@8278 5430
jdaggett@8278 5431 <dl>
jdaggett@8278 5432 <dt><dfn id=font-language-override-normal-value
jdaggett@8278 5433 title="normal!!font-language-override">normal</dfn>
jdaggett@8278 5434
jdaggett@8278 5435 <dd>specifies that when rendering with OpenType fonts, the content
jdaggett@8278 5436 language of the element is used to infer the OpenType language system
jdaggett@8278 5437
jdaggett@8278 5438 <dt><dfn
jdaggett@8278 5439 id=font-language-override-string-value><var>&lt;string&gt;</var></dfn>
jdaggett@8278 5440
jdaggett@8368 5441 <dd>single three-letter case-sensitive OpenType <a
jdaggett@8278 5442 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
jdaggett@8278 5443 system tag</a>, specifies the OpenType language system to be used instead
jdaggett@8278 5444 of the language system implied by the language of the element
jdaggett@8278 5445 </dl>
jdaggett@8385 5446 <!-- For this level, string represents a single language code, there's no concept of "fallback"
jdaggett@8385 5447 http://www.w3.org/2013/06/07-css-minutes.html#item04 -->
jdaggett@1662 5448
jdaggett@8312 5449 <p>Use of invalid OpenType language system tags must not generate a parse
jdaggett@8312 5450 error but must be ignored when doing glyph selection and placement.
jdaggett@8312 5451
jdaggett@1662 5452 <div class=example>
jdaggett@7179 5453 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
jdaggett@1662 5454 Declaration of Human Rights</a> has been translated into a wide variety
jdaggett@1662 5455 of languages. In Turkish, Article 9 of this document might be marked up
jdaggett@1662 5456 as below:</p>
jdaggett@1662 5457
jdaggett@1662 5458 <pre lang=tr>&lt;body lang="tr">
jdaggett@1662 5459
jdaggett@1662 5460 &lt;h4>Madde 9&lt;/h4>
jdaggett@1662 5461 &lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
jdaggett@1662 5462 </pre>
jdaggett@1662 5463
jdaggett@1662 5464 <p>Here the user agent uses the value of the ‘<code
jdaggett@1662 5465 class=property>lang</code>’ attribute when rendering text and
jdaggett@1662 5466 appropriately renders this text without ‘<code
jdaggett@4624 5467 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
jdaggett@4624 5468 href="#propdef-font-language-override"><code
jdaggett@4624 5469 class=property>font-language-override</code></a>’ property.</p>
jdaggett@1662 5470
jdaggett@1662 5471 <p>However, a given font may lack support for a specific language. In this
jdaggett@1662 5472 situation authors may need to use the typographic conventions of a
jdaggett@1662 5473 related language that are supported by that font:</p>
jdaggett@1662 5474
jdaggett@1662 5475 <pre lang=mk>&lt;body lang="mk"> &lt;!-- Macedonian lang code --&gt;
jdaggett@1662 5476
jdaggett@1732 5477 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
jdaggett@1662 5478
jdaggett@1662 5479 &lt;h4>Члeн 9&lt;/h4>
jdaggett@1662 5480 &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 5481
jdaggett@1662 5482 </pre>
jdaggett@1662 5483
jdaggett@1662 5484 <p>The Macedonian text here will be rendered using Serbian typographic
jdaggett@1662 5485 conventions, with the assumption that the font specified supports
jdaggett@1662 5486 Serbian.</p>
jdaggett@1662 5487 </div>
jdaggett@1662 5488
jdaggett@6176 5489 <p><a id=rendering-considerations></a>
jdaggett@6176 5490
jdaggett@6699 5491 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
jdaggett@6699 5492 Resolution</h2>
jdaggett@6176 5493
jdaggett@6176 5494 <p>As described in the previous section, font features can be enabled in a
jdaggett@8278 5495 variety of ways, either via the use of <a href="#propdef-font-variant"
jdaggett@8278 5496 title="font-variant!!property">‘<code
jdaggett@8279 5497 class=property>font-variant</code>’</a> or <a
jdaggett@8279 5498 href="#propdef-font-feature-settings"
jdaggett@8279 5499 title="font-feature-settings!!property">‘<code
jdaggett@8279 5500 class=property>font-feature-settings</code>’</a> in a style rule or
jdaggett@8311 5501 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@8311 5502 The resolution order for the union of these settings is defined below.
jdaggett@8311 5503 Features defined via CSS properties are applied on top of layout engine
jdaggett@8311 5504 default features.
jdaggett@6176 5505
jdaggett@6699 5506 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
jdaggett@6699 5507
jdaggett@6176 5508 <p>For OpenType fonts, user agents must enable the default features defined
jdaggett@6436 5509 in the OpenType documentation for a given script and writing mode.
jdaggett@6436 5510 Required ligatures, common ligatures and contextual forms must be enabled
jdaggett@6436 5511 by default (OpenType features: <span class=tag>rlig, liga, clig,
jdaggett@6436 5512 calt</span>), along with localized forms (OpenType feature: <span
jdaggett@6436 5513 class=tag>locl</span>), and features required for proper display of
jdaggett@6436 5514 composed characters and marks (OpenType features: <span class=tag>ccmp,
jdaggett@6436 5515 mark, mkmk</span>). These features must always be enabled, even when the
jdaggett@8278 5516 value of the <a href="#propdef-font-variant"
jdaggett@8278 5517 title="font-variant!!property">‘<code
jdaggett@8279 5518 class=property>font-variant</code>’</a> and <a
jdaggett@8279 5519 href="#propdef-font-feature-settings"
jdaggett@8279 5520 title="font-feature-settings!!property">‘<code
jdaggett@8368 5521 class=property>font-feature-settings</code>’</a> properties is <span
jdaggett@8368 5522 title="normal value">‘<code class=property>normal</code>’</span>.
jdaggett@8368 5523 Individual features are only disabled when explicitly overridden by the
jdaggett@8368 5524 author, as when ‘<a href="#propdef-font-variant-ligatures"><code
jdaggett@6176 5525 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
jdaggett@6176 5526 href="#no-common-ligatures"><code
jdaggett@7377 5527 class=property>no-common-ligatures</code></a>’. For handling complex
jdaggett@7377 5528 scripts such as <a
jdaggett@6176 5529 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
jdaggett@6176 5530 <a
jdaggett@6176 5531 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
jdaggett@6176 5532 or <a
jdaggett@6176 5533 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
jdaggett@6436 5534 additional features are required. For upright text within vertical text
jdaggett@6436 5535 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
jdaggett@6436 5536 must be enabled.
jdaggett@1662 5537
jdaggett@6699 5538 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
jdaggett@6699 5539
jdaggett@8356 5540 <p>General and <a href="#font-specific"><em>font specific</em></a> font
jdaggett@8356 5541 feature property settings are resolved in the order below, in ascending
jdaggett@8360 5542 order of precedence. This ordering is used to construct a combined list of
jdaggett@8356 5543 font features that affect a given text run.
jdaggett@1662 5544
jdaggett@1662 5545 <ol>
jdaggett@6436 5546 <li>Font features enabled by default, including features required for a
jdaggett@6436 5547 given script.
jdaggett@6176 5548
jdaggett@8311 5549 <li>If the font is defined via an <a
jdaggett@8311 5550 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
jdaggett@8311 5551 features implied by the font-variant descriptor in the <a
jdaggett@8311 5552 href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@8311 5553
jdaggett@8311 5554 <li>If the font is defined via an <a
jdaggett@8311 5555 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
jdaggett@8311 5556 features implied by the font-feature-settings descriptor in the <a
jdaggett@8311 5557 href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@1662 5558
jdaggett@8804 5559 <li>Font features implied by the value of the <a
jdaggett@8804 5560 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8804 5561 class=property>font-variant</code>’</a> property, the related <a
jdaggett@8804 5562 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8804 5563 class=property>font-variant</code>’</a> subproperties and any other CSS
jdaggett@8804 5564 property that uses OpenType features (e.g. the ‘<a
jdaggett@8804 5565 href="#propdef-font-kerning"><code
jdaggett@8804 5566 class=property>font-kerning</code></a>’ property).</li>
jdaggett@8804 5567 <!-- other CSS props override 'font-variant' but not 'font-feature-settings' -->
jdaggett@8804 5568 <!-- http://lists.w3.org/Archives/Public/www-style/2013Aug/0110.html -->
jdaggett@8804 5569
jdaggett@8278 5570 <li>Feature settings determined by properties other than <a
jdaggett@8278 5571 href="#propdef-font-variant" title="font-variant!!property">‘<code
jdaggett@8279 5572 class=property>font-variant</code>’</a> or <a
jdaggett@8279 5573 href="#propdef-font-feature-settings"
jdaggett@8279 5574 title="font-feature-settings!!property">‘<code
jdaggett@8279 5575 class=property>font-feature-settings</code>’</a>. For example, setting
jdaggett@8279 5576 a non-default value for the ‘<code
jdaggett@8360 5577 class=property>letter-spacing</code>’ property disables common
jdaggett@8360 5578 ligatures.
jdaggett@6176 5579
jdaggett@8279 5580 <li>Font features implied by the value of <a
jdaggett@8279 5581 href="#propdef-font-feature-settings"
jdaggett@8279 5582 title="font-feature-settings!!property">‘<code
jdaggett@8279 5583 class=property>font-feature-settings</code>’</a> property.
jdaggett@1662 5584 </ol>
jdaggett@1662 5585
jdaggett@3511 5586 <p>This ordering allows authors to set up a general set of defaults for
jdaggett@8311 5587 fonts within their <a
jdaggett@8311 5588 href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
jdaggett@8311 5589 them with property settings for specific elements. General property
jdaggett@8311 5590 settings override the settings in <a
jdaggett@8311 5591 href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
jdaggett@8311 5592 font feature settings override <a href="#propdef-font-variant"
jdaggett@8278 5593 title="font-variant!!property">‘<code
jdaggett@8278 5594 class=property>font-variant</code>’</a> property settings.
jdaggett@1732 5595
jdaggett@1732 5596 <p>For situations where the combined list of font feature settings contains
jdaggett@3511 5597 more than one value for the same feature, the last value is used. When a
jdaggett@3511 5598 font lacks support for a given underlying font feature, text is simply
jdaggett@3511 5599 rendered as if that font feature was not enabled; font fallback does not
jdaggett@3511 5600 occur and no attempt is made to synthesize the feature except where
jdaggett@8360 5601 explicitly defined for specific properties.
jdaggett@1662 5602
jdaggett@6699 5603 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
jdaggett@6699 5604 precedence examples</h3>
jdaggett@6699 5605
jdaggett@1662 5606 <div class=example>
jdaggett@1662 5607 <p>With the styles below, numbers are rendered proportionally when used
jdaggett@1662 5608 within a paragraph but are shown in tabular form within tables of prices:</p>
jdaggett@1662 5609
jdaggett@8277 5610 <pre>body {
jdaggett@8277 5611 font-variant-numeric: proportional-nums;
jdaggett@1662 5612 }
jdaggett@1662 5613
jdaggett@1662 5614 table.prices td {
jdaggett@8277 5615 font-variant-numeric: tabular-nums;
jdaggett@1662 5616 }
jdaggett@1662 5617 </pre>
jdaggett@1662 5618 </div>
jdaggett@1662 5619
jdaggett@1662 5620 <div class=example>
jdaggett@8360 5621 <p>When the <a href="#descdef-font-variant"
jdaggett@8360 5622 title="font-variant!!descriptor">font-variant</a> descriptor is used
jdaggett@8360 5623 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
jdaggett@8360 5624 it only applies to the font defined by that rule.</p>
jdaggett@1662 5625
jdaggett@1662 5626 <pre>@font-face {
jdaggett@1662 5627 font-family: MainText;
jdaggett@8860 5628 src: url(http://example.com/font.woff);
jdaggett@1662 5629 font-variant: oldstyle-nums proportional-nums styleset(1,3);
jdaggett@1662 5630 }
jdaggett@1662 5631
jdaggett@1662 5632 body {
jdaggett@1662 5633 font-family: MainText, Helvetica;
jdaggett@1662 5634 }
jdaggett@1662 5635
jdaggett@1662 5636 table.prices td {
jdaggett@8277 5637 font-variant-numeric: tabular-nums;
jdaggett@1662 5638 }
jdaggett@1662 5639 </pre>
jdaggett@1662 5640
jdaggett@1662 5641 <p>In this case, old-style numerals will be used throughout but only where
jdaggett@1662 5642 the font "MainText" is used. Just as in the previous example, tabular
jdaggett@4624 5643 values will be used in price tables since ‘<a
jdaggett@4624 5644 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
jdaggett@4624 5645 appears in a general style rule and its use is mutually exclusive with
jdaggett@4624 5646 ‘<a href="#proportional-nums"><code
jdaggett@4624 5647 class=property>proportional-nums</code></a>’. Stylistic alternate sets
jdaggett@4624 5648 will only be used where MainText is used.</p>
jdaggett@1662 5649 </div>
jdaggett@1662 5650
jdaggett@1662 5651 <div class=example>
jdaggett@8311 5652 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
jdaggett@8311 5653 also be used to access font features in locally available fonts via the
jdaggett@8311 5654 use of <code>local()</code> in the ‘<a href="#descdef-src"><code
jdaggett@8311 5655 class=property>src</code></a>’ descriptor of the <a
jdaggett@8311 5656 href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
jdaggett@1662 5657
jdaggett@1662 5658 <pre>@font-face {
jdaggett@1662 5659 font-family: BodyText;
jdaggett@1662 5660 src: local("HiraMaruPro-W4");
jdaggett@1662 5661 font-variant: proportional-width;
jdaggett@2509 5662 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
jdaggett@1662 5663 }
jdaggett@1662 5664
jdaggett@1662 5665 body { font-family: BodyText, serif; }
jdaggett@1662 5666 </pre>
jdaggett@1662 5667
jdaggett@1662 5668 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
jdaggett@1662 5669 text rendering occurs, Japanese kana will be proportionally spaced and
jdaggett@1662 5670 Latin text will be italicised. Text rendered with the fallback serif font
jdaggett@1662 5671 will use default rendering properties.</p>
jdaggett@1662 5672 </div>
jdaggett@1662 5673
jdaggett@1662 5674 <div class=example>
jdaggett@3460 5675 <p>In the example below, discretionary ligatures are enabled only for a
jdaggett@1662 5676 downloadable font but are disabled within spans of class "special":</p>
jdaggett@1662 5677
jdaggett@1662 5678 <pre>@font-face {
jdaggett@1662 5679 font-family: main;
jdaggett@1662 5680 src: url(fonts/ffmeta.woff) format("woff");
jdaggett@3460 5681 font-variant: discretionary-ligatures;
jdaggett@1662 5682 }
jdaggett@1662 5683
jdaggett@1662 5684 body { font-family: main, Helvetica; }
jdaggett@3460 5685 span.special { font-variant-ligatures: no-discretionary-ligatures; }
jdaggett@1662 5686 </pre>
jdaggett@1662 5687
jdaggett@8360 5688 <p>Suppose one adds a rule using ‘<code
jdaggett@8360 5689 class=property>font-feature-settings</code>’ to enable discretionary
jdaggett@8360 5690 ligatures:</p>
jdaggett@1662 5691
jdaggett@1662 5692 <pre>body { font-family: main, Helvetica; }
jdaggett@2509 5693 span { font-feature-settings: "dlig"; }
jdaggett@3460 5694 span.special { font-variant-ligatures: no-discretionary-ligatures; }
jdaggett@1662 5695 </pre>
jdaggett@1662 5696
jdaggett@8360 5697 <p>In this case, discretionary ligatures <em>will</em> be rendered within
jdaggett@8360 5698 spans of class "special". This is because both the <a
jdaggett@8279 5699 href="#propdef-font-feature-settings"
jdaggett@8279 5700 title="font-feature-settings!!property">‘<code
jdaggett@8279 5701 class=property>font-feature-settings</code>’</a> and ‘<a
jdaggett@4624 5702 href="#propdef-font-variant-ligatures"><code
jdaggett@4624 5703 class=property>font-variant-ligatures</code></a>’ properties apply to
jdaggett@4624 5704 these spans. Although the ‘<code class=css>no-discretionary
jdaggett@4624 5705 ligatures</code>’ setting of ‘<a
jdaggett@4624 5706 href="#propdef-font-variant-ligatures"><code
jdaggett@4624 5707 class=property>font-variant-ligatures</code></a>’ effectively disables
jdaggett@8279 5708 the OpenType <span class=tag>dlig</span> feature, because the <a
jdaggett@8279 5709 href="#propdef-font-feature-settings"
jdaggett@8279 5710 title="font-feature-settings!!property">‘<code
jdaggett@8279 5711 class=property>font-feature-settings</code>’</a> is resolved after
jdaggett@8279 5712 that, the ‘<code class=property>dlig</code>’ value reenables
jdaggett@4624 5713 discretionary ligatures.</p>
jdaggett@1662 5714 </div>
jdaggett@1244 5715
jdaggett@7021 5716 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
jdaggett@7021 5717
jdaggett@8311 5718 <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
jdaggett@8311 5719 and <a
jdaggett@8311 5720 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 5721 rules can be accessed via the following extensions to the CSS Object
jdaggett@8311 5722 Model.
jdaggett@7021 5723
jdaggett@7021 5724 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
jdaggett@7021 5725 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
jdaggett@7021 5726
jdaggett@7021 5727 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
jdaggett@8311 5728 <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
jdaggett@7021 5729
jdaggett@7021 5730 <pre class=idl>
jdaggett@7021 5731 interface CSSFontFaceRule : CSSRule {
jdaggett@7041 5732 attribute DOMString family;
jdaggett@7041 5733 attribute DOMString src;
jdaggett@7041 5734 attribute DOMString style;
jdaggett@7041 5735 attribute DOMString weight;
jdaggett@7041 5736 attribute DOMString stretch;
jdaggett@7041 5737 attribute DOMString unicodeRange;
jdaggett@7041 5738 attribute DOMString variant;
jdaggett@7041 5739 attribute DOMString featureSettings;
jdaggett@7021 5740 }</pre>
jdaggett@7021 5741
jdaggett@7022 5742 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
jdaggett@7022 5743 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
jdaggett@7022 5744 defined a different variant of this rule. This definition supercedes that
jdaggett@7022 5745 one.
jdaggett@7021 5746
jdaggett@7021 5747 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
jdaggett@7021 5748 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
jdaggett@7021 5749 interface</h3>
jdaggett@7021 5750
jdaggett@7021 5751 <p>The <code>CSSRule</code> interface is extended as follows:
jdaggett@7021 5752
jdaggett@7021 5753 <pre class=idl>partial interface CSSRule {
jdaggett@7021 5754 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
jdaggett@7021 5755 }</pre>
jdaggett@7021 5756
jdaggett@7021 5757 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
jdaggett@8311 5758 interface represents a <a
jdaggett@8311 5759 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 5760 rule.
jdaggett@7021 5761
jdaggett@7021 5762 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
jdaggett@8640 5763 attribute DOMString fontFamily;
jdaggett@8640 5764 readonly attribute CSSFontFeatureValuesMap annotation;
jdaggett@8640 5765 readonly attribute CSSFontFeatureValuesMap ornaments;
jdaggett@8640 5766 readonly attribute CSSFontFeatureValuesMap stylistic;
jdaggett@8640 5767 readonly attribute CSSFontFeatureValuesMap swash;
jdaggett@8640 5768 readonly attribute CSSFontFeatureValuesMap characterVariant;
jdaggett@8640 5769 readonly attribute CSSFontFeatureValuesMap styleset;
jdaggett@8640 5770 }
jdaggett@8640 5771
jdaggett@8640 5772 [MapClass(DOMString, sequence&lt;unsigned long&gt;)]
jdaggett@8640 5773 interface CSSFontFeatureValuesMap {
jdaggett@8646 5774 void set(DOMString featureValueName,
jdaggett@8646 5775 (unsigned long or sequence&lt;unsigned long&gt;) values);
jdaggett@8640 5776 }</pre>
jdaggett@7021 5777
jdaggett@7021 5778 <dl class=idl-attributes>
jdaggett@8640 5779 <dt><var>fontFamily</var> of type <code>DOMString</code>
jdaggett@7021 5780
jdaggett@7021 5781 <dd>The list of one or more font families for which a given set of feature
jdaggett@7021 5782 values is defined.
jdaggett@7021 5783
jdaggett@8640 5784 <dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
jdaggett@8640 5785
jdaggett@8640 5786 <dd>Maps of feature values associated with feature value names for a given
jdaggett@8640 5787 ‘<a href="#propdef-font-variant-alternates"><code
jdaggett@8640 5788 class=property>font-variant-alternates</code></a>’ value type
jdaggett@7021 5789 </dl>
jdaggett@7021 5790
jdaggett@8640 5791 <p>Each value map attribute of <a
jdaggett@8640 5792 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
jdaggett@8640 5793 reflects the values defined via a corresponding <a
jdaggett@8640 5794 href="#featurevalueblock"><i title="feature_value_block">feature value
jdaggett@8640 5795 block</i></a>. Thus, the <var title="annotation
jdaggett@8640 5796 attribute">annotation</var> attribute contains the values contained within
jdaggett@8640 5797 a <code title="@annotation">@annotation</code> <a
jdaggett@8640 5798 href="#featurevalueblock"><i title="feature_value_block">feature value
jdaggett@8640 5799 block</i></a>, the <var title="ornaments attribute">ornaments</var>
jdaggett@8640 5800 attribute contains the values contained with a <code
jdaggett@8640 5801 title="@ornaments">@ornaments</code> <a href="#featurevalueblock"><i
jdaggett@8640 5802 title="feature_value_block">feature value block</i></a> and so forth.
jdaggett@8640 5803
jdaggett@8654 5804 <p>The <code>CSSFontFeatureValuesMap</code> interface uses the <a
jdaggett@8655 5805 href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map
jdaggett@8655 5806 class methods</a> but the <code>set</code> method has different behavior.
jdaggett@8655 5807 It takes a sequence of unsigned integers and associates it with a given
jdaggett@8654 5808 <code>featureValueName</code>. The method behaves the same as the default
jdaggett@8654 5809 map class method except that a single unsigned long value is treated as a
jdaggett@8654 5810 sequence of a single value. The method throws an exception if an invalid
jdaggett@8654 5811 number of values is passed in. If the associated <a
jdaggett@8654 5812 href="#featurevalueblock"><i title="feature_value_block">feature value
jdaggett@8640 5813 block</i></a> only allows a limited number of values, the <code>set</code>
jdaggett@8640 5814 method throws an <code>InvalidAccessError</code> exception when the input
jdaggett@8653 5815 sequence to <code>set</code> contains more than the limited number of
jdaggett@8653 5816 values. See the description of <a
jdaggett@8640 5817 href="#multi-valued-feature-value-definitions">multi-valued feature value
jdaggett@8640 5818 definitions</a> for details on the maximum number of values allowed for a
jdaggett@8640 5819 given type of <a href="#featurevalueblock"><i
jdaggett@8646 5820 title="feature_value_block">feature value block</i></a>. The
jdaggett@8653 5821 <code>get</code> method always returns a sequence of values, even if the
jdaggett@8653 5822 sequence only contains a single value.
jdaggett@8279 5823
jdaggett@2737 5824 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
jdaggett@1662 5825 properties to CSS properties</h2>
jdaggett@1662 5826
jdaggett@1662 5827 <p><em>This appendix is included as background for some of the problems and
jdaggett@890 5828 situations that are described in other sections. It should be viewed as
jdaggett@890 5829 informative only.</em>
jdaggett@890 5830
jdaggett@512 5831 <p>Font properties in CSS are designed to be independent of the underlying
jdaggett@512 5832 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
jdaggett@890 5833 SVG fonts in addition to the common TrueType and OpenType fonts. But there
jdaggett@1244 5834 are facets of the TrueType and OpenType formats that often cause confusion
jdaggett@2556 5835 for authors and present challenges to implementers on different platforms.
jdaggett@1244 5836
jdaggett@1244 5837 <p>Originally developed at Apple, TrueType was designed as an outline font
jdaggett@1244 5838 format for both screen and print. Microsoft joined Apple in developing the
jdaggett@1244 5839 TrueType format and both platforms have supported TrueType fonts since
jdaggett@1244 5840 then. Font data in the TrueType format consists of a set of tables
jdaggett@1244 5841 distinguished with common four-letter tag names, each containing a
jdaggett@1244 5842 specific type of data. For example, naming information, including
jdaggett@1244 5843 copyright and license information, is stored in the ‘<code
jdaggett@7311 5844 class=property>name</code>’ table. The <a
jdaggett@7311 5845 href="#character-map"><em>character map</em></a> (‘<code
jdaggett@1244 5846 class=property>cmap</code>’) table contains a mapping of character
jdaggett@1244 5847 encodings to glyphs. Apple later added additional tables for supporting
jdaggett@1244 5848 enhanced typographic functionality; these are now called Apple Advanced
jdaggett@1244 5849 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
jdaggett@1662 5850 tables for advanced typography and called their format OpenType <a
jdaggett@1662 5851 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
jdaggett@890 5852
jdaggett@890 5853 <p>In many cases the font data used under Microsoft Windows or Linux is
jdaggett@890 5854 slightly different from the data used under Apple's Mac OS X because the
jdaggett@6694 5855 TrueType format allowed for explicit variation across platforms. This
jdaggett@7311 5856 includes font metrics, names and <a href="#character-map"><em>character
jdaggett@7311 5857 map</em></a> data.
jdaggett@6694 5858
jdaggett@6694 5859 <p>Specifically, font family name data is handled differently across
jdaggett@6694 5860 platforms. For TrueType and OpenType fonts these names are contained in
jdaggett@6694 5861 the ‘<code class=property>name</code>’ table, in name records with
jdaggett@8276 5862 name ID 1. Mulitple names can be stored for different locales, but
jdaggett@6694 5863 Microsoft recommends fonts always include at least a US English version of
jdaggett@6694 5864 the name. On Windows, Microsoft made the decision for backwards
jdaggett@6694 5865 compatibility to limit this family name to a maximum of four faces; for
jdaggett@6694 5866 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
jdaggett@6694 5867 ID 21) can be used. Other platforms such as OSX don't have this
jdaggett@8276 5868 limitation, so the family name is used to define all possible groupings.
jdaggett@6694 5869
jdaggett@6694 5870 <p>Other name table data provides names used to uniquely identify a
jdaggett@6694 5871 specific face within a family. The full font name (name ID 4) and the
jdaggett@8276 5872 Postscript name (name ID 6) describe a single face uniquely. For example,
jdaggett@8276 5873 the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
jdaggett@8276 5874 and a Postscript name of "GillSans-Bold". There can be multiple localized
jdaggett@8276 5875 versions of the fullname for a given face, but the Postscript name is
jdaggett@1244 5876 always a unique name made from a limited set of ASCII characters.
jdaggett@1244 5877
jdaggett@1244 5878 <p>On various platforms, different names are used to search for a font. For
jdaggett@1244 5879 example, with the Windows GDI CreateIndirectFont API, either a family or
jdaggett@8276 5880 fullname can be used to lookup a face, while on Mac OS X the
jdaggett@8095 5881 CTFontCreateWithName API call is used to lookup a given face using the
jdaggett@8095 5882 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
jdaggett@8095 5883 to be searched using any of these names. In situations where platform
jdaggett@8095 5884 API's automatically substitute other font choices, it may be necessary to
jdaggett@8095 5885 verify a returned font matches a given name.
jdaggett@1244 5886
jdaggett@1244 5887 <p>The weight of a given face can be determined via the usWeightClass field
jdaggett@1244 5888 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
jdaggett@1244 5889 the width can be determined via the usWidthClass of the OS/2 table or
jdaggett@6694 5890 inferred from the style name. For historical reasons related to synthetic
jdaggett@6694 5891 bolding at weights 200 or lower with the Windows GDI API, font designers
jdaggett@6694 5892 have sometimes skewed values in the OS/2 table to avoid these weights.
jdaggett@1244 5893
jdaggett@1244 5894 <p>Rendering complex scripts that use contextual shaping such as Thai,
jdaggett@1244 5895 Arabic and Devanagari requires features present only in OpenType or AAT
jdaggett@1244 5896 fonts. Currently, complex script rendering is supported on Windows and
jdaggett@7521 5897 Linux using OpenType font features while both OpenType and AAT font
jdaggett@7521 5898 features are used under Mac OS X.
jdaggett@1244 5899
jdaggett@2472 5900 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
jdaggett@2472 5901
jdaggett@2472 5902 <h3 class=no-num id=recent-changes> Changes from the <a
jdaggett@8699 5903 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">July 2013 CSS3
jdaggett@8699 5904 Fonts Last Call Working Draft</a></h3>
jdaggett@2472 5905
jdaggett@2472 5906 <p>Major changes include:
jdaggett@2472 5907
jdaggett@2472 5908 <ul>
jdaggett@8804 5909 <li>reorder feature precedence such that features implied by other CSS
jdaggett@8804 5910 properties override ‘<code class=property>font-variant</code>’
jdaggett@8804 5911 settings
jdaggett@8860 5912
jdaggett@8860 5913 <li>switched examples to use .woff files
jdaggett@8860 5914
jdaggett@8872 5915 <li>revised wording of font fetching algorithm
jdaggett@8872 5916
jdaggett@8930 5917 <li>clarify meaning of <a href="#font-size-adjust-auto-value"
jdaggett@8930 5918 title="auto!!font-size-adjust">‘<code class=property>auto</code>’</a>
jdaggett@8930 5919 value for ‘<a href="#propdef-font-size-adjust"><code
jdaggett@8930 5920 class=property>font-size-adjust</code></a>’
jdaggett@8930 5921
jdaggett@8930 5922 <li>allow user agents to synthesize OpenType <span class=tag>kern</span>
jdaggett@8930 5923 feature
jdaggett@8930 5924
jdaggett@8860 5925 <li>minor editorial cleanups
jdaggett@2472 5926 </ul>
jdaggett@2472 5927
jdaggett@529 5928 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
jdaggett@529 5929
jdaggett@1662 5930 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
jdaggett@1662 5931 their help and feedback. John Hudson was kind enough to take the time to
jdaggett@2472 5932 explain the subtleties of OpenType language tags and provided the example
jdaggett@2472 5933 of character variant usage for displaying text on Byzantine seals. Ken
jdaggett@2472 5934 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
jdaggett@2472 5935 and Unicode variation selectors. The idea for supporting font features by
jdaggett@8313 5936 using <a href="#propdef-font-variant"
jdaggett@8313 5937 title="font-variant!!property">‘<code
jdaggett@8313 5938 class=property>font-variant</code>’</a> subproperties originated with
jdaggett@8313 5939 Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
jdaggett@8313 5940 of the initial design ideas for the <a
jdaggett@8311 5941 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
jdaggett@8311 5942 rule. Thanks also to House Industries for allowing the use of Ed Interlock
jdaggett@8311 5943 in the discretionary ligatures example.
jdaggett@1662 5944
jdaggett@529 5945 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
jdaggett@529 5946 that is <em>The Elements of Typographic Style</em>.
jdaggett@529 5947
jdaggett@7242 5948 <h2 class=no-num id=conformance> Conformance</h2>
jdaggett@7242 5949
jdaggett@7242 5950 <h3 class=no-num id=conventions> Document Conventions</h3>
jdaggett@7242 5951
jdaggett@7242 5952 <p>Conformance requirements are expressed with a combination of descriptive
jdaggett@7242 5953 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
jdaggett@7242 5954 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
jdaggett@7242 5955 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
jdaggett@7242 5956 normative parts of this document are to be interpreted as described in RFC
jdaggett@7242 5957 2119. However, for readability, these words do not appear in all uppercase
jdaggett@7242 5958 letters in this specification.
jdaggett@7242 5959
jdaggett@7242 5960 <p>All of the text of this specification is normative except sections
jdaggett@7242 5961 explicitly marked as non-normative, examples, and notes. <a
jdaggett@7242 5962 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
jdaggett@7242 5963
jdaggett@7242 5964 <p>Examples in this specification are introduced with the words “for
jdaggett@7242 5965 example” or are set apart from the normative text with
jdaggett@7242 5966 <code>class="example"</code>, like this:
jdaggett@7242 5967
jdaggett@7242 5968 <div class=example>
jdaggett@7242 5969 <p>This is an example of an informative example.
jdaggett@7242 5970 </div>
jdaggett@7242 5971
jdaggett@7242 5972 <p>Informative notes begin with the word “Note” and are set apart from
jdaggett@7242 5973 the normative text with <code>class="note"</code>, like this:
jdaggett@7242 5974
jdaggett@7242 5975 <p class=note>Note, this is an informative note.
jdaggett@7242 5976
jdaggett@7242 5977 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
jdaggett@7242 5978
jdaggett@7242 5979 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
jdaggett@7242 5980 classes:
jdaggett@7242 5981
jdaggett@7242 5982 <dl>
jdaggett@7243 5983 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
jdaggett@7242 5984 sheet</dfn>
jdaggett@7242 5985
jdaggett@7242 5986 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
jdaggett@7242 5987 style sheet</a>.
jdaggett@7242 5988
jdaggett@7243 5989 <dt><dfn id=renderer>renderer</dfn>
jdaggett@7242 5990
jdaggett@7242 5991 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jdaggett@7242 5992 that interprets the semantics of a style sheet and renders documents that
jdaggett@7242 5993 use them.
jdaggett@7242 5994
jdaggett@7242 5995 <dt><dfn id=authoring-tool>authoring tool</dfn>
jdaggett@7242 5996
jdaggett@7242 5997 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
jdaggett@7242 5998 that writes a style sheet.
jdaggett@7242 5999 </dl>
jdaggett@7242 6000
jdaggett@7242 6001 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
jdaggett@7242 6002 declarations that use properties defined in this module have values that
jdaggett@7242 6003 are valid according to the generic CSS grammar and the individual grammars
jdaggett@7242 6004 of each property as given in this module.
jdaggett@7242 6005
jdaggett@7242 6006 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
jdaggett@7242 6007 interpreting the style sheet as defined by the appropriate specifications,
jdaggett@7242 6008 it supports all the features defined by CSS Fonts Level 3 Module by
jdaggett@7242 6009 parsing them correctly and rendering the document accordingly. However,
jdaggett@7242 6010 the inability of a UA to correctly render a document due to limitations of
jdaggett@7242 6011 the device does not make the UA non-conformant. (For example, a UA is not
jdaggett@7242 6012 required to render color on a monochrome monitor.)
jdaggett@7242 6013
jdaggett@7242 6014 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
jdaggett@7242 6015 style sheets that are syntactically correct according to the generic CSS
jdaggett@7242 6016 grammar and the individual grammars of each feature in this module, and
jdaggett@7242 6017 meet all other conformance requirements of style sheets as described in
jdaggett@7242 6018 this module.
jdaggett@7242 6019
jdaggett@7242 6020 <h3 class=no-num id=partial> Partial Implementations</h3>
jdaggett@7242 6021
jdaggett@7242 6022 <p>So that authors can exploit the forward-compatible parsing rules to
jdaggett@7242 6023 assign fallback values, CSS renderers <strong>must</strong> treat as
jdaggett@7242 6024 invalid (and <a
jdaggett@7242 6025 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
jdaggett@7242 6026 appropriate</a>) any at-rules, properties, property values, keywords, and
jdaggett@7242 6027 other syntactic constructs for which they have no usable level of support.
jdaggett@7242 6028 In particular, user agents <strong>must not</strong> selectively ignore
jdaggett@7242 6029 unsupported component values and honor supported values in a single
jdaggett@7242 6030 multi-value property declaration: if any value is considered invalid (as
jdaggett@7242 6031 unsupported values must be), CSS requires that the entire declaration be
jdaggett@7242 6032 ignored.
jdaggett@7242 6033
jdaggett@7242 6034 <h3 class=no-num id=experimental> Experimental Implementations</h3>
jdaggett@7242 6035
jdaggett@7242 6036 <p>To avoid clashes with future CSS features, the CSS2.1 specification
jdaggett@7242 6037 reserves a <a
jdaggett@7242 6038 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
jdaggett@7242 6039 syntax</a> for proprietary and experimental extensions to CSS.
jdaggett@7242 6040
jdaggett@7242 6041 <p>Prior to a specification reaching the Candidate Recommendation stage in
jdaggett@7242 6042 the W3C process, all implementations of a CSS feature are considered
jdaggett@7242 6043 experimental. The CSS Working Group recommends that implementations use a
jdaggett@7242 6044 vendor-prefixed syntax for such features, including those in W3C Working
jdaggett@7242 6045 Drafts. This avoids incompatibilities with future changes in the draft.
jdaggett@7242 6046
jdaggett@7242 6047 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
jdaggett@7242 6048
jdaggett@7242 6049 <p>Once a specification reaches the Candidate Recommendation stage,
jdaggett@7242 6050 non-experimental implementations are possible, and implementors should
jdaggett@7242 6051 release an unprefixed implementation of any CR-level feature they can
jdaggett@7242 6052 demonstrate to be correctly implemented according to spec.
jdaggett@7242 6053
jdaggett@7242 6054 <p>To establish and maintain the interoperability of CSS across
jdaggett@7242 6055 implementations, the CSS Working Group requests that non-experimental CSS
jdaggett@7242 6056 renderers submit an implementation report (and, if necessary, the
jdaggett@7242 6057 testcases used for that implementation report) to the W3C before releasing
jdaggett@7242 6058 an unprefixed implementation of any CSS features. Testcases submitted to
jdaggett@7242 6059 W3C are subject to review and correction by the CSS Working Group.
jdaggett@7242 6060
jdaggett@7242 6061 <p>Further information on submitting testcases and implementation reports
jdaggett@7242 6062 can be found from on the CSS Working Group's website at <a
jdaggett@7242 6063 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
jdaggett@7242 6064 Questions should be directed to the <a
jdaggett@7242 6065 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
jdaggett@7242 6066 mailing list.
jdaggett@7242 6067
jdaggett@484 6068 <h2 class=no-num id=references>References</h2>
jdaggett@484 6069
jdaggett@1662 6070 <h3 class=no-num id=normative-references>Normative References</h3>
jdaggett@484 6071 <!--begin-normative-->
jdaggett@484 6072 <!-- Sorted by label -->
jdaggett@484 6073
jdaggett@484 6074 <dl class=bibliography>
jdaggett@8031 6075 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
jdaggett@484 6076 <!---->
jdaggett@531 6077
jdaggett@2461 6078 <dt id=CHARMOD>[CHARMOD]
jdaggett@2461 6079
jdaggett@2461 6080 <dd>Martin J. Dürst; et al. <a
jdaggett@2737 6081 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
jdaggett@2461 6082 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
jdaggett@2461 6083 2005. W3C Recommendation. URL: <a
jdaggett@2737 6084 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
jdaggett@2461 6085 </dd>
jdaggett@2461 6086 <!---->
jdaggett@2461 6087
jdaggett@2457 6088 <dt id=CORS>[CORS]
jdaggett@1662 6089
jdaggett@1662 6090 <dd>Anne van Kesteren. <a
jdaggett@7242 6091 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
jdaggett@7242 6092 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
jdaggett@7242 6093 Recommendation. (Work in progress.) URL: <a
jdaggett@7242 6094 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
jdaggett@1662 6095 </dd>
jdaggett@1662 6096 <!---->
jdaggett@1662 6097
jdaggett@3041 6098 <dt id=CSS21>[CSS21]
jdaggett@3041 6099
jdaggett@3041 6100 <dd>Bert Bos; et al. <a
jdaggett@8031 6101 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
jdaggett@3041 6102 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
jdaggett@3041 6103 2011. W3C Recommendation. URL: <a
jdaggett@8031 6104 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
jdaggett@3041 6105 </dd>
jdaggett@3041 6106 <!---->
jdaggett@3041 6107
jdaggett@5833 6108 <dt id=CSS3VAL>[CSS3VAL]
jdaggett@5833 6109
jdaggett@5833 6110 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
jdaggett@8386 6111 href="http://www.w3.org/TR/2013/CR-css3-values-20130404/"><cite>CSS
jdaggett@8386 6112 Values and Units Module Level 3.</cite></a> 4 April 2013. W3C Candidate
jdaggett@6701 6113 Recommendation. (Work in progress.) URL: <a
jdaggett@8386 6114 href="http://www.w3.org/TR/2013/CR-css3-values-20130404/">http://www.w3.org/TR/2013/CR-css3-values-20130404/</a>
jdaggett@5833 6115 </dd>
jdaggett@5833 6116 <!---->
jdaggett@5833 6117
jdaggett@1662 6118 <dt id=HTML5>[HTML5]
jdaggett@1662 6119
jdaggett@1856 6120 <dd>Ian Hickson. <a
jdaggett@7242 6121 href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
jdaggett@7242 6122 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
jdaggett@7242 6123 <a
jdaggett@7242 6124 href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
jdaggett@1662 6125 </dd>
jdaggett@1662 6126 <!---->
jdaggett@1662 6127
jdaggett@1662 6128 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
jdaggett@1662 6129
jdaggett@1662 6130 <dd><a
bert@8683 6131 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136"><cite>Information
jdaggett@1662 6132 technology — Coding of audio-visual objects — Part 22: Open Font
jdaggett@1662 6133 Format.</cite></a> International Organization for Standardization.
jdaggett@1662 6134 ISO/IEC 14496-22:2009. URL: <a
bert@8683 6135 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136">http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136</a>
jdaggett@1662 6136 </dd>
jdaggett@1662 6137 <!---->
jdaggett@1662 6138
jdaggett@1662 6139 <dt id=OPENTYPE>[OPENTYPE]
jdaggett@1662 6140
jdaggett@1662 6141 <dd><a
jdaggett@1662 6142 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
jdaggett@1662 6143 specification.</cite></a> Microsoft. URL: <a
jdaggett@1662 6144 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
jdaggett@1662 6145 </dd>
jdaggett@1662 6146 <!---->
jdaggett@1662 6147
jdaggett@1662 6148 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
jdaggett@1662 6149
jdaggett@1662 6150 <dd><a
jdaggett@1662 6151 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
jdaggett@1662 6152 feature registry.</cite></a> Microsoft. URL: <a
jdaggett@1662 6153 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
jdaggett@1662 6154 </dd>
jdaggett@1662 6155 <!---->
jdaggett@1662 6156
jdaggett@7103 6157 <dt id=RFC2119>[RFC2119]
jdaggett@7103 6158
jdaggett@7103 6159 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
jdaggett@7103 6160 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
jdaggett@7103 6161 RFC 2119. URL: <a
jdaggett@7103 6162 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
jdaggett@7103 6163 </dd>
jdaggett@7103 6164 <!---->
jdaggett@7103 6165
jdaggett@2457 6166 <dt id=UAX15>[UAX15]
jdaggett@2457 6167
jdaggett@7242 6168 <dd>Mark Davis; Ken Whistler. <a
jdaggett@7242 6169 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
jdaggett@7242 6170 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
jdaggett@7242 6171 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
jdaggett@2457 6172 </dd>
jdaggett@2457 6173 <!---->
jdaggett@2457 6174
jdaggett@1856 6175 <dt id=UAX29>[UAX29]
jdaggett@1856 6176
jdaggett@1856 6177 <dd>Mark Davis. <a
jdaggett@5809 6178 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
jdaggett@7242 6179 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
jdaggett@2461 6180 URL: <a
jdaggett@5809 6181 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
jdaggett@1856 6182 </dd>
jdaggett@1856 6183 <!---->
jdaggett@1856 6184
jdaggett@3041 6185 <dt id=UNICODE6>[UNICODE6]
jdaggett@531 6186
jdaggett@531 6187 <dd>The Unicode Consortium. <a
jdaggett@7242 6188 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
jdaggett@7242 6189 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
jdaggett@7242 6190 Version 6.2.0 URL: <a
jdaggett@7242 6191 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
jdaggett@531 6192 </dd>
jdaggett@531 6193 <!---->
jdaggett@484 6194 </dl>
jdaggett@484 6195 <!--end-normative-->
jdaggett@3041 6196 <!--{{!CSS21}}-->
jdaggett@5833 6197 <!--{{!CSS3VAL}}-->
jdaggett@1662 6198 <!--{{!OPENTYPE}}-->
jdaggett@1662 6199 <!--{{!OPENTYPE-FEATURES}}-->
jdaggett@1662 6200 <!--{{!OPEN-FONT-FORMAT}}-->
jdaggett@3041 6201 <!--{{!UNICODE6}}-->
jdaggett@2457 6202 <!--{{!UAX15}}-->
jdaggett@1856 6203 <!--{{!UAX29}}-->
jdaggett@2457 6204 <!--{{!CORS}}-->
jdaggett@1662 6205 <!--{{!HTML5}}-->
jdaggett@2461 6206 <!--{{!CHARMOD}}-->
jdaggett@1662 6207
jdaggett@1662 6208 <h3 class=no-num id=other-references>Other References</h3>
jdaggett@484 6209 <!--begin-informative-->
jdaggett@484 6210 <!-- Sorted by label -->
jdaggett@484 6211
jdaggett@484 6212 <dl class=bibliography>
jdaggett@8031 6213 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
jdaggett@484 6214 <!---->
jdaggett@484 6215
jdaggett@3042 6216 <dt id=AAT-FEATURES>[AAT-FEATURES]
jdaggett@3042 6217
jdaggett@3042 6218 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
jdaggett@3042 6219 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
jdaggett@3042 6220 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
jdaggett@3042 6221 </dd>
jdaggett@3042 6222 <!---->
jdaggett@3042 6223
jdaggett@512 6224 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
jdaggett@512 6225
jdaggett@513 6226 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
jdaggett@1148 6227 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
jdaggett@512 6228 <!---->
jdaggett@512 6229
jdaggett@3042 6230 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
jdaggett@3042 6231
jdaggett@3042 6232 <dd>François Yergeau; et al. <a
jdaggett@5809 6233 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
jdaggett@5809 6234 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
jdaggett@5809 6235 W3C Working Draft. (Work in progress.) URL: <a
jdaggett@5809 6236 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
jdaggett@3042 6237 </dd>
jdaggett@3042 6238 <!---->
jdaggett@3042 6239
jdaggett@1732 6240 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
jdaggett@1732 6241
jdaggett@1732 6242 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
jdaggett@1732 6243 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
jdaggett@1732 6244 <!---->
jdaggett@1732 6245
jdaggett@3460 6246 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
jdaggett@3460 6247
jdaggett@3460 6248 <dd>L. David Baron. <a
jdaggett@8386 6249 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/"><cite>CSS
jdaggett@8386 6250 Conditional Rules Module Level 3.</cite></a> 4 April 2013. W3C Candidate
jdaggett@8386 6251 Recommendation. (Work in progress.) URL: <a
jdaggett@8386 6252 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/">http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a>
jdaggett@3460 6253 </dd>
jdaggett@3460 6254 <!---->
jdaggett@3460 6255
jdaggett@6701 6256 <dt id=CSS3TEXT>[CSS3TEXT]
jdaggett@6701 6257
jdaggett@6701 6258 <dd>Elika J. Etemad; Koji Ishii. <a
jdaggett@7041 6259 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
jdaggett@7041 6260 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
jdaggett@6701 6261 progress.) URL: <a
jdaggett@7041 6262 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
jdaggett@6701 6263 </dd>
jdaggett@6701 6264 <!---->
jdaggett@6701 6265
jdaggett@1856 6266 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
jdaggett@1856 6267
jdaggett@1856 6268 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
jdaggett@1856 6269 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
jdaggett@1856 6270 ISBN 0-201-17633-5.</dd>
jdaggett@1856 6271 <!---->
jdaggett@1856 6272
jdaggett@7022 6273 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
jdaggett@7022 6274
jdaggett@7022 6275 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
jdaggett@7179 6276 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
jdaggett@7022 6277 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
jdaggett@7022 6278 2000. W3C Recommendation. URL: <a
jdaggett@7179 6279 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 6280 </dd>
jdaggett@7022 6281 <!---->
jdaggett@7022 6282
jdaggett@498 6283 <dt id=ELEMTYPO>[ELEMTYPO]
jdaggett@498 6284
jdaggett@498 6285 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
jdaggett@7488 6286 4.</cite> Hartley &amp; Marks. 2013. ISBN 0-88179-212-8.</dd>
jdaggett@498 6287 <!---->
jdaggett@498 6288
jdaggett@513 6289 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
jdaggett@513 6290
jdaggett@1148 6291 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
jdaggett@1148 6292 ISBN 1-932026-01-0.</dd>
jdaggett@512 6293 <!---->
jdaggett@1662 6294
jdaggett@1662 6295 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
jdaggett@1662 6296
jdaggett@1662 6297 <dd><a
jdaggett@3538 6298 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
jdaggett@1662 6299 User Guide.</cite></a> FontShop International. URL: <a
jdaggett@3538 6300 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 6301 </dd>
jdaggett@1662 6302 <!---->
jdaggett@1856 6303
jdaggett@2527 6304 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
jdaggett@2527 6305
jdaggett@2527 6306 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
jdaggett@6659 6307 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
jdaggett@2527 6308 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
jdaggett@2527 6309 <!---->
jdaggett@2527 6310
jdaggett@1856 6311 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
jdaggett@1856 6312
jdaggett@1856 6313 <dd>John Hudson. <a
jdaggett@1856 6314 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
jdaggett@1856 6315 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
jdaggett@1856 6316 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
jdaggett@1856 6317 </dd>
jdaggett@1856 6318 <!---->
jdaggett@484 6319 </dl>
jdaggett@484 6320 <!--end-informative-->
jdaggett@518 6321 <!--{{ARABIC-TYPO}}-->
jdaggett@1732 6322 <!--{{CJKV-INFO-PROCESSING}}-->
jdaggett@1856 6323 <!--{{DIGITAL-TYPOGRAPHY}}-->
jdaggett@7022 6324 <!--{{DOM-LEVEL-2-STYLE}}-->
jdaggett@518 6325 <!--{{ELEMTYPO}}-->
jdaggett@1856 6326 <!--{{LANGCULTTYPE}}-->
jdaggett@1662 6327 <!--{{OPENTYPE-FONT-GUIDE}}-->
jdaggett@2527 6328 <!--{{RASTER-TRAGEDY}}-->
jdaggett@1856 6329 <!--{{WINDOWS-GLYPH-PROC}}-->
jdaggett@3042 6330 <!--{{CHARMOD-NORM}}-->
jdaggett@3042 6331 <!--{{AAT-FEATURES}}-->
jdaggett@3460 6332 <!--{{CSS3-CONDITIONAL}}-->
jdaggett@6701 6333 <!--{{CSS3TEXT}}-->
jdaggett@484 6334
jdaggett@484 6335 <h2 class=no-num id=index>Index</h2>
jdaggett@484 6336 <!--begin-index-->
jdaggett@484 6337
jdaggett@484 6338 <ul class=indexlist>
jdaggett@8278 6339 <li>100...900 weight values, <a href="#font-weight-numeric-values"
jdaggett@8278 6340 title="100...900 weight values"><strong>3.2</strong></a>
jdaggett@8278 6341
jdaggett@8225 6342 <li><var>&lt;absolute-size&gt;</var>, <a href="#absolute-size-value"
jdaggett@7060 6343 title="&lt;absolute-size&gt;"><strong>3.5</strong></a>
jdaggett@890 6344
jdaggett@8225 6345 <li><var>&lt;common-lig-values&gt;</var>, <a href="#common-lig-values"
jdaggett@8225 6346 title="&lt;common-lig-values&gt;"><strong>6.4</strong></a>
jdaggett@2479 6347
jdaggett@2479 6348 <li><var>&lt;contextual-alt-values&gt;</var>, <a
jdaggett@8225 6349 href="#contextual-alt-values"
jdaggett@6176 6350 title="&lt;contextual-alt-values&gt;"><strong>6.4</strong></a>
jdaggett@2479 6351
jdaggett@8225 6352 <li><var>&lt;discretionary-lig-values&gt;</var>, <a
jdaggett@8225 6353 href="#discretionary-lig-values"
jdaggett@8225 6354 title="&lt;discretionary-lig-values&gt;"><strong>6.4</strong></a>
jdaggett@3460 6355
jdaggett@2479 6356 <li><var>&lt;east-asian-variant-values&gt;</var>, <a
jdaggett@8225 6357 href="#east-asian-variant-values"
jdaggett@2479 6358 title="&lt;east-asian-variant-values&gt;"><strong>6.10</strong></a>
jdaggett@2479 6359
jdaggett@2479 6360 <li><var>&lt;east-asian-width-values&gt;</var>, <a
jdaggett@8225 6361 href="#east-asian-width-values"
jdaggett@2479 6362 title="&lt;east-asian-width-values&gt;"><strong>6.10</strong></a>
jdaggett@2479 6363
jdaggett@8225 6364 <li><var>&lt;family-name&gt;</var>, <a href="#family-name-value"
jdaggett@8225 6365 title="&lt;family-name&gt;"><strong>3.1</strong></a>
jdaggett@8225 6366
jdaggett@8225 6367 <li><var>&lt;feature-tag-value&gt;</var>, <a href="#feature-tag-value"
jdaggett@2515 6368 title="&lt;feature-tag-value&gt;"><strong>6.12</strong></a>
jdaggett@2515 6369
jdaggett@8225 6370 <li><var>&lt;font-face-name&gt;</var>, <a href="#font-face-name-value"
jdaggett@7060 6371 title="&lt;font-face-name&gt;"><strong>4.3</strong></a>
jdaggett@4624 6372
jdaggett@4624 6373 <li><var>&lt;font-variant-css21&gt;</var>, <a
jdaggett@8225 6374 href="#font-variant-css21-values"
jdaggett@4624 6375 title="&lt;font-variant-css21&gt;"><strong>3.7</strong></a>
jdaggett@4624 6376
jdaggett@8225 6377 <li><var>&lt;generic-family&gt;</var>, <a href="#generic-family-value"
jdaggett@8225 6378 title="&lt;generic-family&gt;"><strong>3.1</strong></a>
jdaggett@8225 6379
jdaggett@8225 6380 <li><var>&lt;historical-lig-values&gt;</var>, <a
jdaggett@8225 6381 href="#historical-lig-values"
jdaggett@8225 6382 title="&lt;historical-lig-values&gt;"><strong>6.4</strong></a>
jdaggett@8225 6383
jdaggett@8225 6384 <li><var>&lt;length&gt;</var>, <a href="#length-size-value"
jdaggett@8225 6385 title="&lt;length&gt;"><strong>3.5</strong></a>
jdaggett@8225 6386
jdaggett@8225 6387 <li><var>&lt;number&gt;</var>, <a href="#aspect-ratio-value"
jdaggett@8225 6388 title="&lt;number&gt;"><strong>3.6</strong></a>
jdaggett@4624 6389
jdaggett@4624 6390 <li><var>&lt;numeric-figure-values&gt;</var>, <a
jdaggett@8225 6391 href="#numeric-figure-values"
jdaggett@4624 6392 title="&lt;numeric-figure-values&gt;"><strong>6.7</strong></a>
jdaggett@4624 6393
jdaggett@4624 6394 <li><var>&lt;numeric-fraction-values&gt;</var>, <a
jdaggett@8225 6395 href="#numeric-fraction-values"
jdaggett@4624 6396 title="&lt;numeric-fraction-values&gt;"><strong>6.7</strong></a>
jdaggett@4624 6397
jdaggett@4624 6398 <li><var>&lt;numeric-spacing-values&gt;</var>, <a
jdaggett@8225 6399 href="#numeric-spacing-values"
jdaggett@4624 6400 title="&lt;numeric-spacing-values&gt;"><strong>6.7</strong></a>
jdaggett@4624 6401
jdaggett@8225 6402 <li><var>&lt;percentage&gt;</var>, <a href="#percentage-size-value"
jdaggett@8225 6403 title="&lt;percentage&gt;"><strong>3.5</strong></a>
jdaggett@8225 6404
jdaggett@8225 6405 <li><var>&lt;relative-size&gt;</var>, <a href="#relative-size-value"
jdaggett@7060 6406 title="&lt;relative-size&gt;"><strong>3.5</strong></a>
jdaggett@7060 6407
jdaggett@8278 6408 <li><var>&lt;string&gt;</var>, <a
jdaggett@8278 6409 href="#font-language-override-string-value"
jdaggett@8278 6410 title="&lt;string&gt;"><strong>6.13</strong></a>
jdaggett@8278 6411
jdaggett@8225 6412 <li><var>&lt;urange&gt;</var>, <a href="#urange-value"
jdaggett@8225 6413 title="&lt;urange&gt;"><strong>4.5</strong></a>
jdaggett@2479 6414
jdaggett@8311 6415 <li><code>@font-face</code>, <a href="#at-font-face-rule"
jdaggett@8311 6416 title="@font-face"><strong>4.1</strong></a>
jdaggett@8311 6417
jdaggett@8311 6418 <li><code>@font-feature-values</code>, <a
jdaggett@8311 6419 href="#at-font-feature-values-rule"
jdaggett@8311 6420 title="@font-feature-values"><strong>6.9</strong></a>
jdaggett@2479 6421
jdaggett@4624 6422 <li>all-petite-caps, <a href="#all-petite-caps"
jdaggett@4624 6423 title=all-petite-caps><strong>6.6</strong></a>
jdaggett@4624 6424
jdaggett@4624 6425 <li>all-small-caps, <a href="#all-small-caps"
jdaggett@4624 6426 title=all-small-caps><strong>6.6</strong></a>
jdaggett@4624 6427
jdaggett@8225 6428 <li>annotation, <a href="#annotation"
jdaggett@7060 6429 title=annotation><strong>6.8</strong></a>
jdaggett@4624 6430
jdaggett@4624 6431 <li>aspect value, <a href="#aspect-value0" title="aspect
jdaggett@4624 6432 value"><strong>3.6</strong></a>
jdaggett@4624 6433
jdaggett@7103 6434 <li>authoring tool, <a href="#authoring-tool" title="authoring
jdaggett@7243 6435 tool"><strong>#</strong></a>
jdaggett@7103 6436
jdaggett@8278 6437 <li>auto
jdaggett@8278 6438 <ul>
jdaggett@8278 6439 <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
jdaggett@8278 6440 font-kerning"><strong>6.3</strong></a>
jdaggett@8278 6441
jdaggett@8278 6442 <li>font-size-adjust, <a href="#font-size-adjust-auto-value"
jdaggett@8278 6443 title="auto, font-size-adjust"><strong>3.6</strong></a>
jdaggett@8278 6444 </ul>
jdaggett@8278 6445
jdaggett@8278 6446 <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
jdaggett@8278 6447
jdaggett@8278 6448 <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
jdaggett@8278 6449
jdaggett@7311 6450 <li>character map, <a href="#character-map" title="character
jdaggett@7311 6451 map"><strong>5.2</strong></a>
jdaggett@7311 6452
jdaggett@8225 6453 <li>character-variant, <a href="#character-variant"
jdaggett@7060 6454 title=character-variant><strong>6.8</strong></a>
jdaggett@4624 6455
jdaggett@4624 6456 <li>common-ligatures, <a href="#common-ligatures"
jdaggett@6176 6457 title=common-ligatures><strong>6.4</strong></a>
jdaggett@4624 6458
jdaggett@8391 6459 <li>composite face, <a href="#composite-face" title="composite
jdaggett@8391 6460 face"><strong>5.2</strong></a>
jdaggett@8391 6461
jdaggett@8278 6462 <li>condensed, <a href="#condensed"
jdaggett@8278 6463 title=condensed><strong>3.3</strong></a>
jdaggett@8278 6464
jdaggett@4624 6465 <li>contextual, <a href="#contextual"
jdaggett@6176 6466 title=contextual><strong>6.4</strong></a>
jdaggett@4624 6467
jdaggett@7021 6468 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
jdaggett@7021 6469 title=CSSFontFaceRule><strong>8.1</strong></a>
jdaggett@7021 6470
jdaggett@7021 6471 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
jdaggett@7021 6472 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
jdaggett@7021 6473
jdaggett@4624 6474 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
jdaggett@4624 6475 of"><strong>#</strong></a>
jdaggett@4624 6476
jdaggett@7232 6477 <li>default face, <a href="#default-face" title="default
jdaggett@7309 6478 face"><strong>5.2</strong></a>
jdaggett@7232 6479
jdaggett@8031 6480 <li>descriptor_declaration, <a href="#descriptordeclaration"
jdaggett@8031 6481 title="descriptor_declaration"><strong>4.1</strong></a>
jdaggett@8031 6482
jdaggett@4624 6483 <li>diagonal-fractions, <a href="#diagonal-fractions"
jdaggett@4624 6484 title=diagonal-fractions><strong>6.7</strong></a>
jdaggett@4624 6485
jdaggett@4624 6486 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
jdaggett@6176 6487 title=discretionary-ligatures><strong>6.4</strong></a>
jdaggett@4624 6488
jdaggett@8391 6489 <li>effective character map, <a href="#effective-character-map"
jdaggett@8391 6490 title="effective character map"><strong>4.5</strong></a>
jdaggett@8391 6491
jdaggett@8278 6492 <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
jdaggett@8278 6493
jdaggett@8278 6494 <li>extra-condensed, <a href="#extra-condensed"
jdaggett@8278 6495 title=extra-condensed><strong>3.3</strong></a>
jdaggett@8278 6496
jdaggett@8278 6497 <li>extra-expanded, <a href="#extra-expanded"
jdaggett@8278 6498 title=extra-expanded><strong>3.3</strong></a>
jdaggett@8278 6499
jdaggett@4624 6500 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
jdaggett@4624 6501 of"><strong>#</strong></a>
jdaggett@4624 6502
jdaggett@8031 6503 <li>feature_type, <a href="#featuretype"
jdaggett@8356 6504 title="feature_type"><strong>6.9.1</strong></a>
jdaggett@8031 6505
jdaggett@8031 6506 <li>feature_value_block, <a href="#featurevalueblock"
jdaggett@8356 6507 title="feature_value_block"><strong>6.9.1</strong></a>
jdaggett@8031 6508
jdaggett@8031 6509 <li>feature_value_definition, <a href="#featurevaluedefinition"
jdaggett@8356 6510 title="feature_value_definition"><strong>6.9.1</strong></a>
jdaggett@7679 6511
jdaggett@8431 6512 <li>first available font, <a href="#first-available-font" title="first
jdaggett@8431 6513 available font"><strong>5.2</strong></a>
jdaggett@8431 6514
jdaggett@4624 6515 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
jdaggett@2472 6516
jdaggett@8356 6517 <li>font specific, <a href="#font-specific" title="font
jdaggett@8356 6518 specific"><strong>6.8</strong></a>
jdaggett@8356 6519
jdaggett@8278 6520 <li>font-family
jdaggett@8278 6521 <ul>
jdaggett@8278 6522 <li>descriptor, <a href="#descdef-font-family" title="font-family,
jdaggett@8278 6523 descriptor"><strong>4.2</strong></a>
jdaggett@8278 6524
jdaggett@8278 6525 <li>property, <a href="#propdef-font-family" title="font-family,
jdaggett@8278 6526 property"><strong>3.1</strong></a>
jdaggett@8278 6527 </ul>
jdaggett@1662 6528
jdaggett@8279 6529 <li>font-feature-settings
jdaggett@8278 6530 <ul>
jdaggett@8278 6531 <li>descriptor, <a href="#descdef-font-feature-settings"
jdaggett@8278 6532 title="font-feature-settings, descriptor"><strong>4.7</strong></a>
jdaggett@8279 6533
jdaggett@8279 6534 <li>property, <a href="#propdef-font-feature-settings"
jdaggett@8279 6535 title="font-feature-settings, property"><strong>6.12</strong></a>
jdaggett@8278 6536 </ul>
jdaggett@7060 6537
jdaggett@1662 6538 <li>font-kerning, <a href="#propdef-font-kerning"
jdaggett@1856 6539 title=font-kerning><strong>6.3</strong></a>
jdaggett@1662 6540
jdaggett@1732 6541 <li>font-language-override, <a href="#propdef-font-language-override"
jdaggett@2118 6542 title=font-language-override><strong>6.13</strong></a>
jdaggett@1662 6543
jdaggett@1662 6544 <li>font-size, <a href="#propdef-font-size"
jdaggett@1662 6545 title=font-size><strong>3.5</strong></a>
jdaggett@1662 6546
jdaggett@1662 6547 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
jdaggett@1662 6548 title=font-size-adjust><strong>3.6</strong></a>
jdaggett@1662 6549
jdaggett@8278 6550 <li>font-stretch
jdaggett@8278 6551 <ul>
jdaggett@8278 6552 <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
jdaggett@8278 6553 descriptor"><strong>4.4</strong></a>
jdaggett@8278 6554
jdaggett@8278 6555 <li>property, <a href="#propdef-font-stretch" title="font-stretch,
jdaggett@8278 6556 property"><strong>3.3</strong></a>
jdaggett@8278 6557 </ul>
jdaggett@8278 6558
jdaggett@8278 6559 <li>font-style
jdaggett@8278 6560 <ul>
jdaggett@8278 6561 <li>descriptor, <a href="#descdef-font-style" title="font-style,
jdaggett@8278 6562 descriptor"><strong>4.4</strong></a>
jdaggett@8278 6563
jdaggett@8278 6564 <li>property, <a href="#propdef-font-style" title="font-style,
jdaggett@8278 6565 property"><strong>3.4</strong></a>
jdaggett@8278 6566 </ul>
jdaggett@7060 6567
jdaggett@2487 6568 <li>font-synthesis, <a href="#propdef-font-synthesis"
jdaggett@2487 6569 title=font-synthesis><strong>3.8</strong></a>
jdaggett@2457 6570
jdaggett@8278 6571 <li>font-variant
jdaggett@8278 6572 <ul>
jdaggett@8278 6573 <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
jdaggett@8278 6574 descriptor"><strong>4.7</strong></a>
jdaggett@8278 6575
jdaggett@8278 6576 <li>property, <a href="#propdef-font-variant" title="font-variant,
jdaggett@8278 6577 property"><strong>6.11</strong></a>
jdaggett@8278 6578 </ul>
jdaggett@1662 6579
jdaggett@1662 6580 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
jdaggett@2118 6581 title=font-variant-alternates><strong>6.8</strong></a>
jdaggett@1662 6582
jdaggett@1662 6583 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
jdaggett@2118 6584 title=font-variant-caps><strong>6.6</strong></a>
jdaggett@1732 6585
jdaggett@1662 6586 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
jdaggett@2118 6587 title=font-variant-east-asian><strong>6.10</strong></a>
jdaggett@1662 6588
jdaggett@1662 6589 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
jdaggett@6176 6590 title=font-variant-ligatures><strong>6.4</strong></a>
jdaggett@1662 6591
jdaggett@1662 6592 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
jdaggett@2118 6593 title=font-variant-numeric><strong>6.7</strong></a>
jdaggett@2118 6594
jdaggett@3460 6595 <li>font-variant-position, <a href="#propdef-font-variant-position"
jdaggett@6176 6596 title=font-variant-position><strong>6.5</strong></a>
jdaggett@3460 6597
jdaggett@8278 6598 <li>font-weight
jdaggett@8278 6599 <ul>
jdaggett@8278 6600 <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
jdaggett@8278 6601 descriptor"><strong>4.4</strong></a>
jdaggett@8278 6602
jdaggett@8278 6603 <li>property, <a href="#propdef-font-weight" title="font-weight,
jdaggett@8278 6604 property"><strong>3.2</strong></a>
jdaggett@8278 6605 </ul>
jdaggett@1662 6606
jdaggett@8031 6607 <li>font_face_rule, <a href="#fontfacerule"
jdaggett@8031 6608 title="font_face_rule"><strong>4.1</strong></a>
jdaggett@8031 6609
jdaggett@8225 6610 <li>FONT_FACE_SYM, <a href="#fontfacesym"
jdaggett@8225 6611 title="FONT_FACE_SYM"><strong>4.1</strong></a>
jdaggett@8225 6612
jdaggett@8031 6613 <li>font_family_name, <a href="#fontfamilyname"
jdaggett@8356 6614 title="font_family_name"><strong>6.9.1</strong></a>
jdaggett@8031 6615
jdaggett@8031 6616 <li>font_family_name_list, <a href="#fontfamilynamelist"
jdaggett@8356 6617 title="font_family_name_list"><strong>6.9.1</strong></a>
jdaggett@8031 6618
jdaggett@8031 6619 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
jdaggett@8356 6620 title="font_feature_values_rule"><strong>6.9.1</strong></a>
jdaggett@8031 6621
jdaggett@8225 6622 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
jdaggett@8356 6623 title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
jdaggett@8225 6624
jdaggett@1662 6625 <li>full-width, <a href="#full-width"
jdaggett@2118 6626 title=full-width><strong>6.10</strong></a>
jdaggett@1662 6627
jdaggett@1662 6628 <li>historical-forms, <a href="#historical-forms"
jdaggett@2118 6629 title=historical-forms><strong>6.8</strong></a>
jdaggett@1662 6630
jdaggett@1662 6631 <li>historical-ligatures, <a href="#historical-ligatures"
jdaggett@6176 6632 title=historical-ligatures><strong>6.4</strong></a>
jdaggett@1732 6633
jdaggett@8278 6634 <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
jdaggett@8278 6635
jdaggett@2118 6636 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
jdaggett@2118 6637
jdaggett@2118 6638 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
jdaggett@2118 6639
jdaggett@2118 6640 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
jdaggett@2118 6641
jdaggett@2118 6642 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
jdaggett@1662 6643
jdaggett@8278 6644 <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
jdaggett@8278 6645
jdaggett@1662 6646 <li>lining-nums, <a href="#lining-nums"
jdaggett@2118 6647 title=lining-nums><strong>6.7</strong></a>
jdaggett@890 6648
jdaggett@890 6649 <li>monospace, definition of, <a href="#monospace0" title="monospace,
jdaggett@890 6650 definition of"><strong>#</strong></a>
jdaggett@890 6651
jdaggett@1662 6652 <li>no-common-ligatures, <a href="#no-common-ligatures"
jdaggett@6176 6653 title=no-common-ligatures><strong>6.4</strong></a>
jdaggett@1662 6654
jdaggett@1662 6655 <li>no-contextual, <a href="#no-contextual"
jdaggett@6176 6656 title=no-contextual><strong>6.4</strong></a>
jdaggett@1662 6657
jdaggett@3460 6658 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
jdaggett@6176 6659 title=no-discretionary-ligatures><strong>6.4</strong></a>
jdaggett@3460 6660
jdaggett@1662 6661 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
jdaggett@6176 6662 title=no-historical-ligatures><strong>6.4</strong></a>
jdaggett@1662 6663
jdaggett@8278 6664 <li>none
jdaggett@8278 6665 <ul>
jdaggett@8278 6666 <li>font-kerning, <a href="#font-kerning-none-value" title="none,
jdaggett@8278 6667 font-kerning"><strong>6.3</strong></a>
jdaggett@8278 6668
jdaggett@8278 6669 <li>font-size-adjust, <a href="#font-size-adjust-none-value"
jdaggett@8278 6670 title="none, font-size-adjust"><strong>3.6</strong></a>
jdaggett@8278 6671
jdaggett@8278 6672 <li>font-variant, <a href="#font-variant-none-value" title="none,
jdaggett@8278 6673 font-variant"><strong>6.11</strong></a>
jdaggett@8278 6674
jdaggett@8278 6675 <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
jdaggett@8278 6676 title="none, font-variant-ligatures"><strong>6.4</strong></a>
jdaggett@8278 6677 </ul>
jdaggett@8278 6678
jdaggett@8368 6679 <li>normal
jdaggett@8278 6680 <ul>
jdaggett@8278 6681 <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
jdaggett@8278 6682 title="normal, font-feature-settings"><strong>6.12</strong></a>
jdaggett@8278 6683
jdaggett@8278 6684 <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
jdaggett@8278 6685 font-kerning"><strong>6.3</strong></a>
jdaggett@8278 6686
jdaggett@8278 6687 <li>font-language-override, <a
jdaggett@8278 6688 href="#font-language-override-normal-value" title="normal,
jdaggett@8278 6689 font-language-override"><strong>6.13</strong></a>
jdaggett@8278 6690
jdaggett@8278 6691 <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
jdaggett@8278 6692 font-stretch"><strong>3.3</strong></a>
jdaggett@8278 6693
jdaggett@8278 6694 <li>font-style, <a href="#font-style-normal-value" title="normal,
jdaggett@8278 6695 font-style"><strong>3.4</strong></a>
jdaggett@8278 6696
jdaggett@8278 6697 <li>font-variant, <a href="#font-variant-normal-value" title="normal,
jdaggett@8278 6698 font-variant"><strong>6.11</strong></a>
jdaggett@8278 6699
jdaggett@8278 6700 <li>font-variant-alternates, <a
jdaggett@8278 6701 href="#font-variant-alternates-normal-value" title="normal,
jdaggett@8278 6702 font-variant-alternates"><strong>6.8</strong></a>
jdaggett@8278 6703
jdaggett@8278 6704 <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
jdaggett@8278 6705 title="normal, font-variant-caps"><strong>6.6</strong></a>
jdaggett@8278 6706
jdaggett@8278 6707 <li>font-variant-east-asian, <a
jdaggett@8278 6708 href="#font-variant-east-asian-normal-value" title="normal,
jdaggett@8278 6709 font-variant-east-asian"><strong>6.10</strong></a>
jdaggett@8278 6710
jdaggett@8278 6711 <li>font-variant-ligatures, <a
jdaggett@8278 6712 href="#font-variant-ligatures-normal-value" title="normal,
jdaggett@8278 6713 font-variant-ligatures"><strong>6.4</strong></a>
jdaggett@8278 6714
jdaggett@8278 6715 <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
jdaggett@8278 6716 title="normal, font-variant-numeric"><strong>6.7</strong></a>
jdaggett@8278 6717
jdaggett@8368 6718 <li>font-variant-position, <a href="#font-variant-position-normal-value"
jdaggett@8368 6719 title="normal, font-variant-position"><strong>6.5</strong></a>
jdaggett@8368 6720
jdaggett@8278 6721 <li>font-weight, <a href="#font-weight-normal-value" title="normal,
jdaggett@8278 6722 font-weight"><strong>3.2</strong></a>
jdaggett@8278 6723 </ul>
jdaggett@8278 6724
jdaggett@8278 6725 <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
jdaggett@5809 6726
jdaggett@1662 6727 <li>oldstyle-nums, <a href="#oldstyle-nums"
jdaggett@2118 6728 title=oldstyle-nums><strong>6.7</strong></a>
jdaggett@2118 6729
jdaggett@3638 6730 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
jdaggett@3638 6731
jdaggett@8225 6732 <li>ornaments, <a href="#ornaments"
jdaggett@7060 6733 title=ornaments><strong>6.8</strong></a>
jdaggett@2118 6734
jdaggett@1662 6735 <li>petite-caps, <a href="#petite-caps"
jdaggett@2118 6736 title=petite-caps><strong>6.6</strong></a>
jdaggett@1662 6737
jdaggett@1662 6738 <li>proportional-nums, <a href="#proportional-nums"
jdaggett@2118 6739 title=proportional-nums><strong>6.7</strong></a>
jdaggett@1662 6740
jdaggett@1662 6741 <li>proportional-width, <a href="#proportional-width"
jdaggett@2118 6742 title=proportional-width><strong>6.10</strong></a>
jdaggett@512 6743
jdaggett@7243 6744 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
jdaggett@7103 6745
jdaggett@3638 6746 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
jdaggett@1662 6747
jdaggett@890 6748 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
jdaggett@890 6749 definition of"><strong>#</strong></a>
jdaggett@890 6750
jdaggett@8278 6751 <li>semi-condensed, <a href="#semi-condensed-"
jdaggett@8278 6752 title=semi-condensed><strong>3.3</strong></a>
jdaggett@8278 6753
jdaggett@8278 6754 <li>semi-expanded, <a href="#semi-expanded"
jdaggett@8278 6755 title=semi-expanded><strong>3.3</strong></a>
jdaggett@8278 6756
jdaggett@890 6757 <li>serif, definition of, <a href="#serif0" title="serif, definition
jdaggett@890 6758 of"><strong>#</strong></a>
jdaggett@890 6759
jdaggett@2504 6760 <li>simplified, <a href="#simplified"
jdaggett@2504 6761 title=simplified><strong>6.10</strong></a>
jdaggett@1662 6762
jdaggett@1662 6763 <li>slashed-zero, <a href="#slashed-zero"
jdaggett@2118 6764 title=slashed-zero><strong>6.7</strong></a>
jdaggett@1662 6765
jdaggett@1662 6766 <li>small-caps, <a href="#small-caps"
jdaggett@2118 6767 title=small-caps><strong>6.6</strong></a>
jdaggett@1662 6768
jdaggett@1662 6769 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
jdaggett@1662 6770
jdaggett@1662 6771 <li>stacked-fractions, <a href="#stacked-fractions"
jdaggett@2118 6772 title=stacked-fractions><strong>6.7</strong></a>
jdaggett@2118 6773
jdaggett@7103 6774 <li>style sheet
jdaggett@7103 6775 <ul>
jdaggett@7103 6776 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
jdaggett@7243 6777 conformance class"><strong>#</strong></a>
jdaggett@7103 6778 </ul>
jdaggett@7103 6779
jdaggett@8225 6780 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
jdaggett@8225 6781
jdaggett@8225 6782 <li>stylistic, <a href="#stylistic"
jdaggett@7060 6783 title=stylistic><strong>6.8</strong></a>
jdaggett@7060 6784
jdaggett@8279 6785 <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
jdaggett@8279 6786
jdaggett@8279 6787 <li>super, <a href="#super" title=super><strong>6.5</strong></a>
jdaggett@8279 6788
jdaggett@8397 6789 <li>support, <a href="#support" title=support><strong>5.2</strong></a>
jdaggett@8397 6790
jdaggett@8225 6791 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
jdaggett@1662 6792
jdaggett@8363 6793 <li>system font fallback, <a href="#system-font-fallback" title="system
jdaggett@8363 6794 font fallback"><strong>5.2</strong></a>
jdaggett@8363 6795
jdaggett@1662 6796 <li>tabular-nums, <a href="#tabular-nums"
jdaggett@2118 6797 title=tabular-nums><strong>6.7</strong></a>
jdaggett@1662 6798
jdaggett@1662 6799 <li>titling-caps, <a href="#titling-caps"
jdaggett@2118 6800 title=titling-caps><strong>6.6</strong></a>
jdaggett@1856 6801
jdaggett@2504 6802 <li>traditional, <a href="#traditional"
jdaggett@2504 6803 title=traditional><strong>6.10</strong></a>
jdaggett@2118 6804
jdaggett@8278 6805 <li>ultra-condensed, <a href="#ultra-condensed"
jdaggett@8278 6806 title=ultra-condensed><strong>3.3</strong></a>
jdaggett@8278 6807
jdaggett@8278 6808 <li>ultra-expanded, <a href="#ultra-expanded"
jdaggett@8278 6809 title=ultra-expanded><strong>3.3</strong></a>
jdaggett@8278 6810
jdaggett@2118 6811 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
jdaggett@1662 6812
jdaggett@1662 6813 <li>unicode-range, <a href="#descdef-unicode-range"
jdaggett@890 6814 title=unicode-range><strong>4.5</strong></a>
jdaggett@7311 6815
jdaggett@7311 6816 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
jdaggett@7311 6817
jdaggett@7311 6818 <li>width, <a href="#width" title=width><strong>2</strong></a>
jdaggett@484 6819 </ul>
jdaggett@484 6820 <!--end-index-->
jdaggett@484 6821
jdaggett@484 6822 <h2 class=no-num id=property-index>Property index</h2>
jdaggett@890 6823 <!--begin-properties-->
jdaggett@484 6824
jdaggett@484 6825 <table class=proptable>
jdaggett@484 6826 <thead>
jdaggett@484 6827 <tr>
jdaggett@484 6828 <th>Property
jdaggett@484 6829
jdaggett@484 6830 <th>Values
jdaggett@484 6831
jdaggett@484 6832 <th>Initial
jdaggett@484 6833
jdaggett@1148 6834 <th>Applies to
jdaggett@484 6835
jdaggett@484 6836 <th>Inh.
jdaggett@484 6837
jdaggett@484 6838 <th>Percentages
jdaggett@484 6839
jdaggett@484 6840 <th>Media
jdaggett@484 6841
jdaggett@484 6842 <tbody>
jdaggett@3460 6843 <tr>
jdaggett@3460 6844 <th><a class=property href="#propdef-font">font</a>
jdaggett@484 6845
jdaggett@8225 6846 <td>[ [ &lt;‘font-style’&gt; || &lt;font-variant-css21&gt; ||
jdaggett@8225 6847 &lt;‘font-weight’&gt; || &lt;‘font-stretch’ ]?
jdaggett@8225 6848 &lt;‘font-size’&gt; [ / &lt;‘line-height’&gt; ]?
jdaggett@8225 6849 &lt;‘font-family’&gt; ] | caption | icon | menu | message-box |
jdaggett@7020 6850 small-caption | status-bar
jdaggett@484 6851
jdaggett@484 6852 <td>see individual properties
jdaggett@484 6853
jdaggett@484 6854 <td>all elements
jdaggett@484 6855
jdaggett@484 6856 <td>yes
jdaggett@484 6857
jdaggett@484 6858 <td>see individual properties
jdaggett@484 6859
jdaggett@484 6860 <td>visual
jdaggett@484 6861
jdaggett@3460 6862 <tr>
jdaggett@8278 6863 <th><span class=property>font-family</span>
jdaggett@484 6864
jdaggett@8225 6865 <td>[ &lt;family-name&gt; | &lt;generic-family&gt; ] #
jdaggett@484 6866
jdaggett@484 6867 <td>depends on user agent
jdaggett@484 6868
jdaggett@484 6869 <td>all elements
jdaggett@484 6870
jdaggett@484 6871 <td>yes
jdaggett@484 6872
jdaggett@484 6873 <td>N/A
jdaggett@484 6874
jdaggett@484 6875 <td>visual
jdaggett@484 6876
jdaggett@3460 6877 <tr>
jdaggett@8279 6878 <th><span class=property>font-feature-settings</span>
jdaggett@1662 6879
jdaggett@8225 6880 <td>normal | &lt;feature-tag-value&gt; #
jdaggett@1662 6881
jdaggett@1662 6882 <td>normal
jdaggett@1662 6883
jdaggett@1662 6884 <td>all elements
jdaggett@1662 6885
jdaggett@1662 6886 <td>yes
jdaggett@1662 6887
jdaggett@1662 6888 <td>N/A
jdaggett@1662 6889
jdaggett@1662 6890 <td>visual
jdaggett@1662 6891
jdaggett@3460 6892 <tr>
jdaggett@3460 6893 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
jdaggett@1662 6894
jdaggett@1856 6895 <td>auto | normal | none
jdaggett@1856 6896
jdaggett@1856 6897 <td>auto
jdaggett@1662 6898
jdaggett@1662 6899 <td>all elements
jdaggett@1662 6900
jdaggett@1662 6901 <td>yes
jdaggett@1662 6902
jdaggett@1662 6903 <td>N/A
jdaggett@1662 6904
jdaggett@1662 6905 <td>visual
jdaggett@1662 6906
jdaggett@3460 6907 <tr>
jdaggett@3460 6908 <th><a class=property
jdaggett@1732 6909 href="#propdef-font-language-override">font-language-override</a>
jdaggett@1662 6910
jdaggett@5809 6911 <td>normal | &lt;string&gt;
jdaggett@1662 6912
jdaggett@1662 6913 <td>normal
jdaggett@1662 6914
jdaggett@1662 6915 <td>all elements
jdaggett@1662 6916
jdaggett@1662 6917 <td>yes
jdaggett@1662 6918
jdaggett@1662 6919 <td>N/A
jdaggett@1662 6920
jdaggett@1662 6921 <td>visual
jdaggett@1662 6922
jdaggett@3460 6923 <tr>
jdaggett@3460 6924 <th><a class=property href="#propdef-font-size">font-size</a>
jdaggett@484 6925
jdaggett@8225 6926 <td>&lt;absolute-size&gt; | &lt;relative-size&gt; | &lt;length&gt; |
jdaggett@8225 6927 &lt;percentage&gt;
jdaggett@484 6928
jdaggett@484 6929 <td>medium
jdaggett@484 6930
jdaggett@484 6931 <td>all elements
jdaggett@484 6932
jdaggett@484 6933 <td>yes
jdaggett@484 6934
jdaggett@484 6935 <td>refer to parent element's font size
jdaggett@484 6936
jdaggett@484 6937 <td>visual
jdaggett@484 6938
jdaggett@3460 6939 <tr>
jdaggett@3460 6940 <th><a class=property
jdaggett@1662 6941 href="#propdef-font-size-adjust">font-size-adjust</a>
jdaggett@484 6942
jdaggett@8225 6943 <td>none | auto | &lt;number&gt;
jdaggett@484 6944
jdaggett@484 6945 <td>none
jdaggett@484 6946
jdaggett@484 6947 <td>all elements
jdaggett@484 6948
jdaggett@484 6949 <td>yes
jdaggett@484 6950
jdaggett@554 6951 <td>N/A
jdaggett@484 6952
jdaggett@484 6953 <td>visual
jdaggett@484 6954
jdaggett@3460 6955 <tr>
jdaggett@8278 6956 <th><span class=property>font-stretch</span>
jdaggett@1662 6957
jdaggett@1662 6958 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@1662 6959 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@5809 6960 ultra-expanded
jdaggett@484 6961
jdaggett@484 6962 <td>normal
jdaggett@484 6963
jdaggett@484 6964 <td>all elements
jdaggett@484 6965
jdaggett@484 6966 <td>yes
jdaggett@484 6967
jdaggett@484 6968 <td>N/A
jdaggett@484 6969
jdaggett@484 6970 <td>visual
jdaggett@484 6971
jdaggett@3460 6972 <tr>
jdaggett@8278 6973 <th><span class=property>font-style</span>
jdaggett@484 6974
jdaggett@5809 6975 <td>normal | italic | oblique
jdaggett@484 6976
jdaggett@484 6977 <td>normal
jdaggett@484 6978
jdaggett@484 6979 <td>all elements
jdaggett@484 6980
jdaggett@484 6981 <td>yes
jdaggett@484 6982
jdaggett@484 6983 <td>N/A
jdaggett@484 6984
jdaggett@484 6985 <td>visual
jdaggett@484 6986
jdaggett@3460 6987 <tr>
jdaggett@3460 6988 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
jdaggett@2487 6989
jdaggett@2487 6990 <td>none | [ weight || style ]
jdaggett@2487 6991
jdaggett@2487 6992 <td>weight style
jdaggett@2457 6993
jdaggett@2457 6994 <td>all elements
jdaggett@2457 6995
jdaggett@2457 6996 <td>yes
jdaggett@2457 6997
jdaggett@2457 6998 <td>N/A
jdaggett@2457 6999
jdaggett@2457 7000 <td>visual
jdaggett@2457 7001
jdaggett@3460 7002 <tr>
jdaggett@8278 7003 <th><span class=property>font-variant</span>
jdaggett@1662 7004
jdaggett@6436 7005 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@3460 7006 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@3041 7007 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@8225 7008 || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
jdaggett@8225 7009 character-variant(&lt;feature-value-name&gt; #) ||
jdaggett@5833 7010 swash(&lt;feature-value-name&gt;) ||
jdaggett@3041 7011 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@4545 7012 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@6648 7013 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@2509 7014 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@3638 7015 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@3638 7016 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@3638 7017 ruby ]
jdaggett@484 7018
jdaggett@484 7019 <td>normal
jdaggett@484 7020
jdaggett@484 7021 <td>all elements
jdaggett@484 7022
jdaggett@484 7023 <td>yes
jdaggett@484 7024
jdaggett@7377 7025 <td>see individual properties
jdaggett@484 7026
jdaggett@484 7027 <td>visual
jdaggett@484 7028
jdaggett@3460 7029 <tr>
jdaggett@3460 7030 <th><a class=property
jdaggett@1662 7031 href="#propdef-font-variant-alternates">font-variant-alternates</a>
jdaggett@1662 7032
jdaggett@6176 7033 <td>normal | [ stylistic(&lt;feature-value-name&gt;) || historical-forms
jdaggett@8225 7034 || styleset(&lt;feature-value-name&gt; #) ||
jdaggett@8225 7035 character-variant(&lt;feature-value-name&gt; #) ||
jdaggett@5833 7036 swash(&lt;feature-value-name&gt;) ||
jdaggett@3638 7037 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@3638 7038 annotation(&lt;feature-value-name&gt;) ]
jdaggett@1662 7039
jdaggett@1662 7040 <td>normal
jdaggett@1662 7041
jdaggett@1662 7042 <td>all elements
jdaggett@1662 7043
jdaggett@1662 7044 <td>yes
jdaggett@1662 7045
jdaggett@1662 7046 <td>N/A
jdaggett@1662 7047
jdaggett@1662 7048 <td>visual
jdaggett@1662 7049
jdaggett@3460 7050 <tr>
jdaggett@3460 7051 <th><a class=property
jdaggett@1662 7052 href="#propdef-font-variant-caps">font-variant-caps</a>
jdaggett@1662 7053
jdaggett@5809 7054 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
jdaggett@6648 7055 | unicase | titling-caps
jdaggett@1662 7056
jdaggett@1662 7057 <td>normal
jdaggett@1662 7058
jdaggett@1662 7059 <td>all elements
jdaggett@1662 7060
jdaggett@1662 7061 <td>yes
jdaggett@1662 7062
jdaggett@1662 7063 <td>N/A
jdaggett@1662 7064
jdaggett@1662 7065 <td>visual
jdaggett@1662 7066
jdaggett@3460 7067 <tr>
jdaggett@3460 7068 <th><a class=property
jdaggett@1662 7069 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
jdaggett@1662 7070
jdaggett@5809 7071 <td>normal | [ &lt;east-asian-variant-values&gt; ||
jdaggett@3638 7072 &lt;east-asian-width-values&gt; || ruby ]
jdaggett@1662 7073
jdaggett@1662 7074 <td>normal
jdaggett@1662 7075
jdaggett@1662 7076 <td>all elements
jdaggett@1662 7077
jdaggett@1662 7078 <td>yes
jdaggett@1662 7079
jdaggett@1662 7080 <td>N/A
jdaggett@1662 7081
jdaggett@1662 7082 <td>visual
jdaggett@1662 7083
jdaggett@3460 7084 <tr>
jdaggett@3460 7085 <th><a class=property
jdaggett@1662 7086 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
jdaggett@1662 7087
jdaggett@8225 7088 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@8225 7089 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@8225 7090 &lt;contextual-alt-values&gt; ]
jdaggett@1662 7091
jdaggett@1662 7092 <td>normal
jdaggett@1662 7093
jdaggett@1662 7094 <td>all elements
jdaggett@1662 7095
jdaggett@1662 7096 <td>yes
jdaggett@1662 7097
jdaggett@1662 7098 <td>N/A
jdaggett@1662 7099
jdaggett@1662 7100 <td>visual
jdaggett@1662 7101
jdaggett@3460 7102 <tr>
jdaggett@3460 7103 <th><a class=property
jdaggett@1662 7104 href="#propdef-font-variant-numeric">font-variant-numeric</a>
jdaggett@1662 7105
jdaggett@5809 7106 <td>normal | [ &lt;numeric-figure-values&gt; ||
jdaggett@1732 7107 &lt;numeric-spacing-values&gt; || &lt;numeric-fraction-values&gt; ||
jdaggett@3638 7108 ordinal || slashed-zero ]
jdaggett@1662 7109
jdaggett@1662 7110 <td>normal
jdaggett@1662 7111
jdaggett@1662 7112 <td>all elements
jdaggett@1662 7113
jdaggett@1662 7114 <td>yes
jdaggett@1662 7115
jdaggett@1662 7116 <td>N/A
jdaggett@1662 7117
jdaggett@1662 7118 <td>visual
jdaggett@1662 7119
jdaggett@3460 7120 <tr>
jdaggett@3460 7121 <th><a class=property
jdaggett@3460 7122 href="#propdef-font-variant-position">font-variant-position</a>
jdaggett@3460 7123
jdaggett@3638 7124 <td>normal | sub | super
jdaggett@3460 7125
jdaggett@3460 7126 <td>normal
jdaggett@3460 7127
jdaggett@3460 7128 <td>all elements
jdaggett@3460 7129
jdaggett@3460 7130 <td>yes
jdaggett@3460 7131
jdaggett@3460 7132 <td>N/A
jdaggett@3460 7133
jdaggett@3460 7134 <td>visual
jdaggett@3460 7135
jdaggett@3460 7136 <tr>
jdaggett@8278 7137 <th><span class=property>font-weight</span>
jdaggett@484 7138
jdaggett@484 7139 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
jdaggett@5809 7140 | 700 | 800 | 900
jdaggett@484 7141
jdaggett@484 7142 <td>normal
jdaggett@484 7143
jdaggett@484 7144 <td>all elements
jdaggett@484 7145
jdaggett@484 7146 <td>yes
jdaggett@484 7147
jdaggett@484 7148 <td>N/A
jdaggett@484 7149
jdaggett@484 7150 <td>visual
jdaggett@484 7151 </table>
jdaggett@890 7152 <!--end-properties-->
jdaggett@5596 7153 <!--begin-descriptors-->
jdaggett@5596 7154
jdaggett@5596 7155 <table class=proptable>
jdaggett@5596 7156 <thead>
jdaggett@5596 7157 <tr>
jdaggett@5596 7158 <th>Descriptor
jdaggett@5596 7159
jdaggett@5596 7160 <th>Value
jdaggett@5596 7161
jdaggett@5596 7162 <th>Initial
jdaggett@5596 7163
jdaggett@5596 7164 <th>Percentages
jdaggett@5596 7165
jdaggett@5596 7166 <th>Media
jdaggett@5596 7167
jdaggett@5596 7168 <tbody>
jdaggett@5596 7169 <tr>
jdaggett@8278 7170 <th><span class=property>font-family</span>
jdaggett@5596 7171
jdaggett@8225 7172 <td>&lt;family-name&gt;
jdaggett@5596 7173
jdaggett@5596 7174 <td>N/A
jdaggett@5596 7175
jdaggett@5596 7176 <tr>
jdaggett@8279 7177 <th><span class=property>font-feature-settings</span>
jdaggett@5596 7178
jdaggett@8225 7179 <td>normal | &lt;feature-tag-value&gt; #
jdaggett@5596 7180
jdaggett@5596 7181 <td>normal
jdaggett@5596 7182
jdaggett@5596 7183 <tr>
jdaggett@8278 7184 <th><span class=property>font-stretch</span>
jdaggett@5596 7185
jdaggett@5596 7186 <td>normal | ultra-condensed | extra-condensed | condensed |
jdaggett@5596 7187 semi-condensed | semi-expanded | expanded | extra-expanded |
jdaggett@5596 7188 ultra-expanded
jdaggett@5596 7189
jdaggett@5596 7190 <td>normal
jdaggett@5596 7191
jdaggett@5596 7192 <tr>
jdaggett@8278 7193 <th><span class=property>font-style</span>
jdaggett@5596 7194
jdaggett@5596 7195 <td>normal | italic | oblique
jdaggett@5596 7196
jdaggett@5596 7197 <td>normal
jdaggett@5596 7198
jdaggett@5596 7199 <tr>
jdaggett@8278 7200 <th><span class=property>font-variant</span>
jdaggett@5596 7201
jdaggett@8225 7202 <td>normal | none | [ &lt;common-lig-values&gt; ||
jdaggett@5596 7203 &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
jdaggett@5596 7204 &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
jdaggett@8225 7205 || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
jdaggett@8225 7206 character-variant(&lt;feature-value-name&gt; #) ||
jdaggett@5833 7207 swash(&lt;feature-value-name&gt;) ||
jdaggett@5596 7208 ornaments(&lt;feature-value-name&gt;) ||
jdaggett@5596 7209 annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
jdaggett@6648 7210 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
jdaggett@5596 7211 &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
jdaggett@5596 7212 &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
jdaggett@5596 7213 &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
jdaggett@5596 7214 ruby ]
jdaggett@5596 7215
jdaggett@5596 7216 <td>normal
jdaggett@5596 7217
jdaggett@5596 7218 <tr>
jdaggett@8278 7219 <th><span class=property>font-weight</span>
jdaggett@5596 7220
jdaggett@5596 7221 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
jdaggett@5596 7222
jdaggett@5596 7223 <td>normal
jdaggett@5596 7224
jdaggett@5596 7225 <tr>
jdaggett@5596 7226 <th><a class=property href="#descdef-src">src</a>
jdaggett@5596 7227
jdaggett@8225 7228 <td>[ &lt;url> [format(&lt;string> #)]? | &lt;font-face-name&gt; ] #
jdaggett@5596 7229
jdaggett@5596 7230 <td>N/A
jdaggett@5596 7231
jdaggett@5596 7232 <tr>
jdaggett@5596 7233 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
jdaggett@5596 7234
jdaggett@8225 7235 <td>&lt;urange&gt; #
jdaggett@5596 7236
jdaggett@5596 7237 <td>U+0-10FFFF
jdaggett@5596 7238 </table>
jdaggett@5596 7239 <!--end-descriptors-->
jdaggett@6648 7240 <script type="text/javascript">
jdaggett@6648 7241 window.onload = function () {
jdaggett@6648 7242 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
jdaggett@6648 7243 var i, hiresElements = document.getElementsByClassName("hires");
jdaggett@6648 7244 for (i = 0; i < hiresElements.length; i++) {
jdaggett@6648 7245 var h = hiresElements[i];
jdaggett@6648 7246 if (h.tagName != "IMG") continue;
jdaggett@6648 7247 var src = h.getAttribute("src");
jdaggett@6648 7248 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
jdaggett@6648 7249 h.src = src2x;
jdaggett@6648 7250 }
jdaggett@6648 7251 }
jdaggett@6648 7252 </script>
jdaggett@484 7253 </html>
jdaggett@484 7254 <!-- Keep this comment at the end of the file
jdaggett@484 7255 Local variables:
jdaggett@484 7256 mode: sgml
jdaggett@484 7257 sgml-declaration:"~/SGML/HTML4.decl"
jdaggett@484 7258 sgml-default-doctype-name:"html"
jdaggett@484 7259 sgml-minimize-attributes:t
jdaggett@484 7260 sgml-nofill-elements:("pre" "style" "br")
jdaggett@484 7261 sgml-live-element-indicator:t
jdaggett@484 7262 sgml-omittag:nil
jdaggett@484 7263 sgml-shorttag:nil
jdaggett@484 7264 sgml-namecase-general:t
jdaggett@484 7265 sgml-general-insert-case:lower
jdaggett@484 7266 sgml-always-quote-attributes:t
jdaggett@484 7267 sgml-indent-step:nil
jdaggett@484 7268 sgml-indent-data:t
jdaggett@484 7269 sgml-parent-document:nil
jdaggett@484 7270 sgml-exposed-tags:nil
jdaggett@484 7271 sgml-local-catalogs:nil
jdaggett@484 7272 sgml-local-ecat-files:nil
jdaggett@484 7273 End:
jdaggett@484 7274 -->
jdaggett@8277 7275 <!--
jdaggett@1856 7276
jdaggett@1856 7277 to do:
jdaggett@1856 7278
jdaggett@1856 7279 - wording of OpenType family name handling
jdaggett@1856 7280 - handling combining sequences in the font matching algorithm
jdaggett@1856 7281 - fix-up fi ligature example
jdaggett@1856 7282
jdaggett@1856 7283 -->

mercurial