Thu, 11 Jul 2013 22:54:43 +0200
[css3-fonts] Fixed some mark-up problems and broken links turned up by the pubrules checker.
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
4 <html lang=en>
5 <head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
7 <title>CSS Fonts Module Level 3</title>
8 <!--
9 FIXME when publishing: copy the current default.css and link to
10 "default.css" rather than "../default.css"
11 -->
12 <link href="../default.css" rel=stylesheet type="text/css">
13 <!-- I'm just experimenting here, don't get your bee in a bonnet -->
14 <script src="http://use.typekit.com/xon2bky.js"
15 type="text/javascript"></script>
16 <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
18 <style type="text/css">
20 body, th, td, h1, h2, h3, h4, h5, h6 {
21 font-family: "myriad-pro", sans-serif !important;
22 }
24 body {
25 padding: 2em 70px 2em 70px;
26 }
28 p + p, p.mtb {
29 margin-top: 0.8em;
30 text-indent: 0px;
31 }
33 #bolderlighter {
34 width: 40%;
35 }
37 #bolderlighter th {
38 text-align: center;
39 }
41 #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
42 padding-right: 2em;
43 text-align: left;
44 }
46 dd {
47 margin-bottom: 1em;
48 }
50 #authors dd {
51 margin-bottom: 0;
52 }
54 #fontstylematchingalg {
55 list-style-type: lower-alpha;
56 }
58 #fontmatchingalg ul, #fontmatchingalg ol {
59 margin-top: 0.8em;
60 }
62 #fontmatchingalg li + li {
63 margin-top: 0.8em;
64 }
66 div.example {
67 padding: 1em;
68 margin-top: 1em;
69 }
71 div.example + div.example {
72 margin-top: 2em;
73 }
75 div.figure {
76 page-break-inside: avoid;
77 }
79 pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
81 div.featex {
82 width: 700px;
83 }
85 div.featex img {
86 margin: auto;
87 display: block;
88 }
90 span.tag {
91 font-family: monospace;
92 font-size: 120%;
93 }
95 ol ol {
96 list-style-type: lower-alpha;
97 }
99 .idl-code {
100 font-weight: bold;
101 color: #c50;
102 }
103 </style>
104 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
105 type="text/css">
106 <script defer=defer
107 src="http://test.csswg.org/harness/annotate.js#CSS3-FONTS_DEV"
108 type="text/javascript"></script>
110 <body>
111 <div class=head> <!--begin-logo-->
112 <p><a href="http://www.w3.org/"><img alt=W3C height=48
113 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
115 <h1>CSS Fonts Module Level 3</h1>
117 <h2 class="no-num no-toc" id=editors-draft-8-july-2013>[LONGSTATUS] [DATE: 8 July 2013]</h2>
119 <dl id=authors>
120 <dt>This version:
122 <dd><a
123 href="[VERSION]">[VERSION]</a>
125 <dt>Latest version:
127 <dd><a
128 href="[LATEST]">http://www.w3.org/TR/css-fonts-3/</a>
130 <dt>Latest editor's draft:
132 <dd><a
133 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
134 (<a
135 href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
136 log</a>)
138 <dt>Previous version:
140 <dd><a
141 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a>
143 <dt>Issues List:
145 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
146 issues in Tracker</a>
148 <dd><a
149 href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Fonts&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED">CSS3
150 Fonts issues in Bugzilla</a>
152 <dt>Discussion:
154 <dd><a
155 href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
156 with subject line “<kbd>[css-fonts] <var>… message topic
157 …</var></kbd>” (<a
158 href="http://lists.w3.org/Archives/Public/www-style/"
159 rel=discussion>archives</a>)
161 <dt>Editor:
163 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
164 </dl>
165 <!--begin-copyright-->
166 <p class=copyright><a
167 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
168 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
169 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
170 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
171 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
172 title="European Research Consortium for Informatics and
173 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
174 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
175 <a
176 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
177 <a
178 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
179 and <a
180 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
181 use</a> rules apply.</p>
182 <!--end-copyright-->
183 <hr title="Separator for header">
184 </div>
186 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
188 <p>This CSS3 module describes how font properties are specified and how
189 font resources are loaded dynamically. The contents of this specification
190 are a consolidation of content previously divided into <a
191 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
192 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
193 Web Fonts</a> modules. The description of font load events was moved into
194 the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
195 Events</a> module.
197 <h2 class="no-num no-toc" id=status>Status of this document</h2>
198 <!--begin-status-->
200 <p>This is a public copy of the editors' draft. It is provided for
201 discussion only and may change at any moment. Its publication here does
202 not imply endorsement of its contents by W3C. Don't cite this document
203 other than as work in progress.
205 <p>The (<a
206 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
207 mailing list <a
208 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
209 www-style@w3.org</a> (see <a
210 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
211 discussion of this specification. When sending e-mail, please put the text
212 “css3-fonts” in the subject, preferably like this:
213 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
215 <p>This document was produced by the <a
216 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
217 the <a href="http://www.w3.org/Style/">Style Activity</a>).
219 <p>This document was produced by a group operating under the <a
220 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
221 2004 W3C Patent Policy</a>. W3C maintains a <a
222 href="http://www.w3.org/2004/01/pp-impl/32061/status"
223 rel=disclosure>public list of any patent disclosures</a> made in
224 connection with the deliverables of the group; that page also includes
225 instructions for disclosing a patent. An individual who has actual
226 knowledge of a patent which the individual believes contains <a
227 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
228 Claim(s)</a> must disclose the information in accordance with <a
229 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
230 6 of the W3C Patent Policy</a>.</p>
231 <!--end-status-->
233 <h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
235 <p>The following features are at risk and may be removed when exiting CR:
237 <ul>
238 <li>fallback handling for text decoration in superscript/subscript variant
239 glyphs (‘<a href="#propdef-font-variant-position"><code
240 class=property>font-variant-position</code></a>’)
242 <li>‘<a href="#propdef-font-language-override"><code
243 class=property>font-language-override</code></a>’ property
244 </ul>
246 <p>This draft is a <strong>Last Call Working Draft</strong>. Please send
247 comments to the <a
248 href="http://lists.w3.org/Archives/Public/www-style/">www-style mailing
249 list</a> as described above. The <strong>deadline for comments</strong> is
250 six weeks after the date of publication in the header, 22 August 2013.
252 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
253 <!--begin-toc-->
255 <ul class=toc>
256 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
258 <li><a href="#typography-background"><span class=secno>2 </span>Typography
259 Background</a>
261 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
262 Properties</a>
263 <ul class=toc>
264 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
265 family: the font-family property</a>
266 <ul class=toc>
267 <li><a href="#generic-font-families"><span class=secno>3.1.1
268 </span>Generic font families</a>
269 </ul>
271 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
272 weight: the font-weight property</a>
274 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
275 width: the font-stretch property</a>
277 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
278 the font-style property</a>
280 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
281 the font-size property</a>
283 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
284 </span>Relative sizing: the font-size-adjust property</a>
286 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
287 property: the font property</a>
289 <li><a href="#font-synthesis-prop"><span class=secno>3.8
290 </span>Controlling synthetic faces: the font-synthesis property</a>
291 </ul>
293 <li><a href="#font-resources"><span class=secno>4 </span>Font
294 Resources</a>
295 <ul class=toc>
296 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
297 <code>@font-face</code> rule</a>
299 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
300 family: the font-family descriptor</a>
302 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
303 src descriptor</a>
305 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
306 descriptors: the font-style, font-weight, font-stretch descriptors</a>
308 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
309 range: the unicode-range descriptor</a>
311 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
312 character ranges to define composite fonts</a>
314 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
315 features: the font-variant and font-feature-settings descriptors</a>
317 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
318 loading guidelines</a>
320 <li><a href="#same-origin-restriction"><span class=secno>4.9
321 </span>Same-origin restriction for fonts</a>
322 <ul class=toc>
323 <li><a href="#default-same-origin-restriction"><span class=secno>4.9.1
324 </span>Default same-origin restriction</a>
326 <li><a href="#allowing-cross-origin-font-loading"><span
327 class=secno>4.9.2 </span>Allowing cross-origin font loading</a>
328 </ul>
329 </ul>
331 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
332 Matching Algorithm</a>
333 <ul class=toc>
334 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
335 sensitivity of font family names</a>
337 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
338 font styles</a>
340 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
341 matching</a>
343 <li><a href="#char-handling-issues"><span class=secno>5.4
344 </span>Character handling issues</a>
346 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
347 matching changes since CSS 2.1</a>
349 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
350 matching examples</a>
351 </ul>
353 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
354 Properties</a>
355 <ul class=toc>
356 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
357 </span>Glyph selection and positioning</a>
359 <li><a href="#language-specific-support"><span class=secno>6.2
360 </span>Language-specific display</a>
362 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
363 the font-kerning property</a>
365 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
366 </span>Ligatures: the font-variant-ligatures property</a>
368 <li><a href="#font-variant-position-prop"><span class=secno>6.5
369 </span>Subscript and superscript forms: the font-variant-position
370 property</a>
372 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
373 </span>Capitalization: the font-variant-caps property</a>
375 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
376 </span>Numerical formatting: the font-variant-numeric property</a>
378 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
379 </span>Alternates and swashes: the font-variant-alternates property</a>
382 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
383 font specific alternates: the <code>@font-feature-values</code>
384 rule</a>
385 <ul class=toc>
386 <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
387 syntax</a>
389 <li><a href="#multi-valued-feature-value-definitions"><span
390 class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
391 </ul>
393 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
394 </span>East Asian text rendering: the font-variant-east-asian
395 property</a>
397 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
398 shorthand for font rendering: the font-variant property</a>
400 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
401 </span>Low-level font feature settings control: the
402 font-feature-settings property</a>
404 <li><a href="#font-language-override-prop"><span class=secno>6.13
405 </span>Font language override: the font-language-override property</a>
406 </ul>
408 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
409 Feature Resolution </a>
410 <ul class=toc>
411 <li><a href="#default-features"><span class=secno>7.1 </span>Default
412 features</a>
414 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
415 precedence</a>
417 <li><a href="#feature-precedence-examples"><span class=secno>7.3
418 </span>Feature precedence examples</a>
419 </ul>
421 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
422 <ul class=toc>
423 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
424 <code>CSSFontFaceRule</code> interface</a>
426 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
427 <code>CSSFontFeatureValuesRule</code> interface</a>
428 </ul>
430 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
431 platform font properties to CSS properties</a>
433 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
434 <ul class=toc>
435 <li class=no-num><a href="#recent-changes"> Changes from the February
436 2013 CSS3 Fonts Working Draft</a>
437 </ul>
439 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
441 <li class=no-num><a href="#conformance"> Conformance</a>
442 <ul class=toc>
443 <li class=no-num><a href="#conventions"> Document Conventions</a>
445 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
448 <li class=no-num><a href="#partial"> Partial Implementations</a>
450 <li class=no-num><a href="#experimental"> Experimental
451 Implementations</a>
453 <li class=no-num><a href="#testing"> Non-Experimental
454 Implementations</a>
455 </ul>
457 <li class=no-num><a href="#references">References</a>
458 <ul class=toc>
459 <li class=no-num><a href="#normative-references">Normative
460 References</a>
462 <li class=no-num><a href="#other-references">Other References</a>
463 </ul>
465 <li class=no-num><a href="#index">Index</a>
467 <li class=no-num><a href="#property-index">Property index</a>
468 </ul>
469 <!--end-toc-->
471 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
473 <p>A font provides a resource containing the visual representation of
474 characters. At the simplest level it contains information that maps
475 character codes to shapes (called glyphs) that represent these characters.
476 Fonts sharing a common design style are commonly grouped into font
477 families classified by a set of standard font properties. Within a family,
478 the shape displayed for a given character can vary by stroke weight, slant
479 or relative width, among others. An individual font face is described by a
480 unique combination of these properties. For a given range of text, CSS
481 font properties are used to select a font family and a specific font face
482 within that family to be used when rendering that text. As a simple
483 example, to use the bold form of Helvetica one could use:
485 <pre>body {
486 font-family: Helvetica;
487 font-weight: bold;
488 }</pre>
490 <p>Font resources may be installed locally on the system on which a user
491 agent is running or downloadable. For local font resources descriptive
492 information can be obtained directly from the font resource. For
493 downloadable font resources (sometimes referred to as web fonts), the
494 descriptive information is included with the reference to the font
495 resource.
497 <p>Families of fonts typically don't contain a single face for each
498 possible variation of font properties. The CSS font selection mechanism
499 describes how to match a given set of CSS font properties to a single font
500 face.
502 <h2 id=typography-background><span class=secno>2 </span>Typography
503 Background</h2>
505 <p><em>This section is non-normative.</em>
507 <p> Typographic traditions vary across the globe, so there is no unique way
508 to classify all fonts across languages and cultures. For even common Latin
509 letters, wide variations are possible:
511 <div class=figure><img alt="variations in glyphs for a single character"
512 src=aaaaaa.png>
513 <p class=caption>One character, many glyph variations
514 </div>
516 <p>Differences in the anatomy of letterforms is one way to distinguish
517 fonts. For Latin fonts, flourishes at the ends of a character's main
518 strokes, or serifs, can distinguish a font from those without. Similar
519 comparisons exist in non-Latin fonts between fonts with tapered strokes
520 and those using primarily uniform strokes:
522 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
523 <p class=caption>Letterforms with and without serifs
524 </div>
526 <div class=figure><img alt="serif vs. non-serifs for japanese"
527 src=minchovsgothic.png>
528 <p class=caption>Similar groupings for Japanese typefaces
529 </div>
531 <p>Fonts contain letterforms and the data needed to map characters to these
532 letterforms. Often this may be a simple one-to-one mapping, but more
533 complex mappings are also possible. The use of combining diacritic marks
534 creates many variations for an underlying letterform:
536 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
537 <p class=caption>Variations with diacritic marks
538 </div>
540 <p>A sequence of characters can be represented by a single glyph known as a
541 ligature:
543 <div class=figure><img alt="example of a fi ligature"
544 src=final-ligature.png>
545 <p class=caption>Ligature example
546 </div>
548 <p>Visual transformations based on textual context are often stylistic
549 option in European languages. They are required to correctly render
550 languages like Arabic, the lam and alef characters below <em>must</em> be
551 combined when they exist in sequence:
553 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
554 <p class=caption>Required Arabic ligature
555 </div>
557 <p>The relative complexity of these shaping transformations requires
558 additional data within the font.
560 <p>Sets of font faces with various stylistic variations are often grouped
561 together into font families. In the simplest case a regular face is
562 supplemented with bold and italic faces, but much more extensive groupings
563 are possible. Variations in the thickness of letterform strokes, the <dfn
564 id=weight>weight</dfn>, and the overall proportions of the letterform, the
565 <dfn id=width>width</dfn>, are most common. In the example below, each
566 letter uses a different font face within the Univers font family. The
567 width used increases from top to bottom and the weight increases from left
568 to right:
570 <div class=figure><img alt="various width and weight variations within a
571 single family" src=weightwidthvariations.png>
572 <p class=caption>Weight and width variations within a single font family
573 </div>
575 <p>Creating fonts that support multiple scripts is a difficult task;
576 designers need to understand the cultural traditions surrounding the use
577 of type in different scripts and come up with letterforms that somehow
578 share a common theme. Many languages often share a common script and each
579 of these languages may have noticeable stylistic differences. For example,
580 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
581 many languages, not just Russian.
583 <p>The <a href="#character-map"><em>character map</em></a> of a font
584 defines the mapping of characters to glyphs for that font. If a document
585 contains characters not supported by the <a href="#character-map"><em
586 title="character map">character maps</em></a> of the fonts contained in a
587 font family list, a user agent may use a <a
588 href="#system-font-fallback"><em>system font fallback</em></a> procedure
589 to locate an appropriate font that does. If no appropriate font can be
590 found, some form of "missing glyph" character will be rendered by the user
591 agent. System fallback can occur when the specified list of font families
592 does not include a font that supports a given character.
594 <p>Although the <a href="#character-map"><em>character map</em></a> of a
595 font maps a given character to a glyph for that character, modern font
596 technologies such as OpenType and AAT (Apple Advanced Typography) provide
597 ways of mapping a character to different glyphs based upon feature
598 settings. Fonts in these formats allow these features to be embedded in
599 the font itself and controlled by applications. Common typographic
600 features which can be specified this way include ligatures, swashes,
601 contextual alternates, proportional and tabular figures, and automatic
602 fractions, to list just a few. For a visual overview of OpenType features,
603 see the <a href="#OPENTYPE-FONT-GUIDE"
604 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
606 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
608 <p>The particular font face used to render a character is determined by the
609 font family and other font properties that apply to a given element. This
610 structure allows settings to be varied independent of each other.</p>
611 <!-- prop: font-family -->
613 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
614 href="#propdef-font-family">font-family</a> property</h3>
616 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
617 <tbody>
618 <tr>
619 <td>Name:
621 <td><dfn id=propdef-font-family
622 title="font-family!!property">font-family</dfn>
624 <tr>
625 <td>Value:
627 <td>[ <a href="#family-name-value"><var><family-name></var></a> |
628 <a href="#generic-family-value"><var><generic-family></var></a> ]
629 #
631 <tr>
632 <td>Initial:
634 <td>depends on user agent
636 <tr>
637 <td>Applies to:
639 <td>all elements
641 <tr>
642 <td>Inherited:
644 <td>yes
646 <tr>
647 <td>Percentages:
649 <td>N/A
651 <tr>
652 <td>Media:
654 <td>visual
656 <tr>
657 <td>Computed value:
659 <td>as specified
661 <tr>
662 <td>Animatable:
664 <td>no
665 </table>
667 <p>This property specifies a prioritized list of font family names or
668 generic family names. A font family defines a set of faces that vary in
669 weight, width or slope. CSS uses the combination of a family name with
670 other style attributes to select an individual face. Using this selection
671 mechanism, rather than selecting a face via the style name as is often
672 done in design applications, allows some degree of regularity in textual
673 display when fallback occurs.
675 <p class=note>Designers should note that the CSS definition of font
676 attributes used for selection are explicitly not intended to define a font
677 taxonomy. A type designer's idea of a family may often extend to a set of
678 faces that vary along axes other than just the standard axes of weight,
679 width and slope. A family may extend to include both a set of serif faces
680 and a set of sans-serif faces or vary along axes that are unique to that
681 family. The CSS font selection mechanism merely provides a way to
682 determine the “closest” substitute when substitution is necessary.
684 <p>Unlike other CSS properties, component values are a comma-separated list
685 indicating alternatives. A user agent iterates through the list of family
686 names until it matches an available font that contains a glyph for the
687 character to be rendered. This allows for differences in available fonts
688 across platforms and for differences in the range of characters supported
689 by individual fonts.
691 <p>A font family name only specifies a name given to a set of font faces,
692 it does not specify an individual face. For example, given the
693 availability of the fonts below, Futura would match but Futura Medium
694 would not:
696 <div class=figure><img alt="family and face names"
697 src=familyvsfacename.png>
698 <p class=caption>Family and individual face names
699 </div>
701 <p>Consider the example below:
703 <div class=example>
704 <pre>body {
705 font-family: Helvetica, Verdana, sans-serif;
706 }</pre>
708 <p>If Helvetica is available it will be used when rendering. If neither
709 Helvetica nor Verdana is present, then the user-agent-defined sans serif
710 font will be used.</p>
711 </div>
713 <p>There are two types of font family names:
715 <dl>
716 <dt><dfn id=family-name-value><var><family-name></var></dfn>
718 <dd>The name of a font family of choice such as Helvetica or Verdana in
719 the previous example.
721 <dt><dfn id=generic-family-value><var><generic-family></var></dfn>
723 <dd> The following generic family keywords are defined: ‘<a
724 href="#serif"><code class=property>serif</code></a>’, ‘<a
725 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
726 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
727 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
728 href="#monospace"><code class=property>monospace</code></a>’. These
729 keywords can be used as a general fallback mechanism when an author's
730 desired font choices are not available. As keywords, they must not be
731 quoted. Authors are encouraged to append a generic font family as a last
732 alternative for improved robustness.
733 </dl>
735 <p>Font family names other than generic families must either be given
736 quoted as <a
737 href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or unquoted
738 as a sequence of one or more <a
739 href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
740 This means most punctuation characters and digits at the start of each
741 token must be escaped in unquoted font family names.
743 <p>To illustrate this, the following declarations are invalid:
745 <pre>
746 font-family: Red/Black, sans-serif;
747 font-family: "Lucida" Grande, sans-serif;
748 font-family: Ahem!, sans-serif;
749 font-family: test@foo, sans-serif;
750 font-family: #POUND, sans-serif;
751 font-family: Hawaii 5-0, sans-serif;
752 </pre>
754 <p>If a sequence of identifiers is given as a font family name, the
755 computed value is the name converted to a string by joining all the
756 identifiers in the sequence by single spaces.
758 <p>To avoid mistakes in escaping, it is recommended to quote font family
759 names that contain white space, digits, or punctuation characters other
760 than hyphens:
762 <pre>
763 body { font-family: "New Century Schoolbook", serif }
765 <BODY STYLE="font-family: '21st Century', fantasy">
766 </pre>
768 <p>Font family <em>names</em> that happen to be the same as a keyword value
769 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
770 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
771 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
772 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
773 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
774 class=property>cursive</code></a>’) must be quoted to prevent confusion
775 with the keywords with the same names. The keywords ‘<code
776 class=property>initial</code>’ and ‘<code
777 class=property>default</code>’ are reserved for future use and must also
778 be quoted when used as font names. UAs must not consider these keywords as
779 matching the <a
780 href="#family-name-value"><var><family-name></var></a> type.
782 <p>The precise way a set of fonts are grouped into font families varies
783 depending upon the platform font management API's. The Windows GDI API
784 only allows four faces to be grouped into a family while the DirectWrite
785 API and API's on OSX and other platforms support font families with a
786 variety of weights, widths and slopes (see <a
787 href="#platform-props-to-css">Appendix A</a> for more details).
789 <p>Some font formats allow fonts to carry multiple localizations of the
790 family name. User agents must recognize and correctly match all of these
791 names independent of the underlying platform localization, system API used
792 or document encoding:
794 <div class=figure><img alt="examples of localized family names"
795 src=localizedfamilynames.png>
796 <p class=caption>Localized family names
797 </div>
799 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
800 families</h4>
802 <p>All five generic font families are defined to exist in all CSS
803 implementations (they need not necessarily map to five distinct actual
804 fonts). User agents should provide reasonable default choices for the
805 generic font families, which express the characteristics of each family as
806 well as possible within the limits allowed by the underlying technology.
807 User agents are encouraged to allow users to select alternative choices
808 for the generic fonts.
810 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
811 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
813 <p>Serif fonts represent the formal text style for a script. This often
814 means but is not limited to glyphs that have finishing strokes, flared or
815 tapering ends, or have actual serifed endings (including slab serifs).
816 Serif fonts are typically proportionately-spaced. They often display a
817 greater variation between thick and thin strokes than fonts from the ‘<a
818 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
819 font family. CSS uses the term ‘<a href="#serif"><code
820 class=property>serif</code></a>’ to apply to a font for any script,
821 although other names may be more familiar for particular scripts, such as
822 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
823 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
824 class=property>serif</code></a>’ more due to its typographic role rather
825 than its actual design style. Any font that is so described may be used to
826 represent the generic ‘<a href="#serif"><code
827 class=property>serif</code></a>’ family.
829 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
830 <p class=caption>Sample serif fonts
831 </div>
833 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
834 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
835 id=sans-serif>sans-serif</dfn></a></span></h5>
837 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
838 low contrast (vertical and horizontal stems have the close to the same
839 thickness) and have stroke endings that are plain -- without any flaring,
840 cross stroke, or other ornamentation. Sans-serif fonts are typically
841 proportionately-spaced. They often have little variation between thick and
842 thin strokes, compared to fonts from the ‘<a href="#serif"><code
843 class=property>serif</code></a>’ family. CSS uses the term ‘<a
844 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
845 to a font for any script, although other names may be more familiar for
846 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
847 (Korean). Any font that is so described may be used to represent the
848 generic ‘<a href="#sans-serif"><code
849 class=property>sans-serif</code></a>’ family.
851 <div class=figure><img alt="sample sans-serif fonts"
852 src=sansserifexamples.png>
853 <p class=caption>Sample sans-serif fonts
854 </div>
856 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
857 title="cursive, definition of"> <a name=cursive-def><dfn
858 id=cursive>cursive</dfn></a></span></h5>
860 <p>Glyphs in cursive fonts generally use a more informal script style, and
861 the result looks more like handwritten pen or brush writing than printed
862 letterwork. CSS uses the term ‘<a href="#cursive"><code
863 class=property>cursive</code></a>’ to apply to a font for any script,
864 although other names such as Chancery, Brush, Swing and Script are also
865 used in font names.
867 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
868 <p class=caption>Sample cursive fonts
869 </div>
871 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
872 title="fantasy, definition of"> <a name=fantasy-def><dfn
873 id=fantasy>fantasy</dfn></a></span></h5>
875 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
876 playful representations of characters. These do not include Pi or Picture
877 fonts which do not represent actual characters.
879 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
880 <p class=caption>Sample fantasy fonts
881 </div>
883 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
884 title="monospace, definition of"> <a name=monospace-def><dfn
885 id=monospace>monospace</dfn></a></span></h5>
887 <p>The sole criterion of a monospace font is that all glyphs have the same
888 fixed width. This is often used to render samples of computer code.
890 <div class=figure><img alt="sample monospace fonts"
891 src=monospaceexamples.png>
892 <p class=caption>Sample monospace fonts
893 </div>
894 <!-- prop: font-weight -->
896 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
897 href="#propdef-font-weight">font-weight</a> property</h3>
899 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
900 <tbody>
901 <tr>
902 <td>Name:
904 <td><dfn id=propdef-font-weight
905 title="font-weight!!property">font-weight</dfn>
907 <tr>
908 <td>Value:
910 <td><a href="#font-weight-normal-value"
911 title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
912 href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
913 href="#font-weight-numeric-values" title="100...900 weight
914 values">100</a> | <a href="#font-weight-numeric-values"
915 title="100...900 weight values">200</a> | <a
916 href="#font-weight-numeric-values" title="100...900 weight
917 values">300</a> | <a href="#font-weight-numeric-values"
918 title="100...900 weight values">400</a> | <a
919 href="#font-weight-numeric-values" title="100...900 weight
920 values">500</a> | <a href="#font-weight-numeric-values"
921 title="100...900 weight values">600</a> | <a
922 href="#font-weight-numeric-values" title="100...900 weight
923 values">700</a> | <a href="#font-weight-numeric-values"
924 title="100...900 weight values">800</a> | <a
925 href="#font-weight-numeric-values" title="100...900 weight
926 values">900</a>
928 <tr>
929 <td>Initial:
931 <td>normal
933 <tr>
934 <td>Applies to:
936 <td>all elements
938 <tr>
939 <td>Inherited:
941 <td>yes
943 <tr>
944 <td>Percentages:
946 <td>N/A
948 <tr>
949 <td>Media:
951 <td>visual
953 <tr>
954 <td>Computed value:
956 <td>numeric weight value (see description)
958 <tr>
959 <td>Animatable:
961 <td>as <a
962 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
963 weight</a>
964 </table>
966 <p>The <a href="#propdef-font-weight"
967 title="font-weight!!property">‘<code
968 class=property>font-weight</code>’</a> property specifies the weight of
969 glyphs in the font, their degree of blackness or stroke thickness.
971 <p>Values have the following meanings:
973 <dl>
974 <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
975 to 900</dfn>
977 <dd>These values form an ordered sequence, where each number indicates a
978 weight that is at least as dark as its predecessor. These roughly
979 correspond to the commonly used weight names below:
980 </dl>
982 <ul>
983 <li>100 - Thin
985 <li>200 - Extra Light (Ultra Light)
987 <li>300 - Light
989 <li>400 - Normal
991 <li>500 - Medium
993 <li>600 - Semi Bold (Demi Bold)
995 <li>700 - Bold
997 <li>800 - Extra Bold (Ultra Bold)
999 <li>900 - Black (Heavy)
1000 </ul>
1002 <dl>
1003 <dt><dfn id=font-weight-normal-value
1004 title="normal!!font-weight">normal</dfn>
1006 <dd>Same as ‘<code class=css>400</code>’.
1008 <dt><dfn id=bold>bold</dfn>
1010 <dd>Same as ‘<code class=css>700</code>’.
1012 <dt><dfn id=bolder>bolder</dfn>
1014 <dd>Specifies a bolder weight than the inherited value.
1016 <dt><dfn id=lighter>lighter</dfn>
1018 <dd>Specifies a lighter weight than the inherited value.
1019 </dl>
1021 <p>Font formats that use a scale other than a nine-step scale should map
1022 their scale onto the CSS scale so that 400 roughly corresponds with a face
1023 that would be labeled as Regular, Book, Roman and 700 roughly matches a
1024 face that would be labeled as Bold. Or weights may be inferred from the
1025 style names, ones that correspond roughly with the scale above. The scale
1026 is relative, so a face with a larger weight value must never appear
1027 lighter. If style names are used to infer weights, care should be taken to
1028 handle variations in style names across locales.
1030 <p>Quite often there are only a few weights available for a particular font
1031 family. When a weight is specified for which no face exists, a face with a
1032 nearby weight is used. In general, bold weights map to faces with heavier
1033 weights and light weights map to faces with lighter weights (see the <a
1034 href="#font-matching-algorithm">font matching section below</a> for a
1035 precise definition). The examples here illustrate which face is used for
1036 different weights, grey indicates a face for that weight does not exist so
1037 a face with a nearby weight is used:
1039 <div class=figure><img alt="weight mappings for a family with 400, 700 and
1040 900 weights" src=optimaweights.png>
1041 <p class=caption>Weight mappings for a font family with 400, 700 and 900
1042 weight faces
1043 </div>
1045 <div class=figure><img alt="weight mappings for a family with 300, 600
1046 weights" src=hiraginoweights.png>
1047 <p class=caption>Weight mappings for a font family with 300 and 600 weight
1048 faces
1049 </div>
1051 <p>Although the practice is not well-loved by typographers, bold faces are
1052 often synthesized by user agents for faces that lack actual bold faces.
1053 For the purposes of style matching, these faces must be treated as if they
1054 exist within the family. Authors can explicitly avoid this behavior by
1055 using the ‘<a href="#propdef-font-synthesis"><code
1056 class=property>font-synthesis</code></a>’ property.
1058 <p>Specified values of ‘<a href="#bolder"><code
1059 class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
1060 class=property>lighter</code></a>’ indicate weights relative to the
1061 weight of the parent element. The computed weight is calculated based on
1062 the inherited <a href="#propdef-font-weight"
1063 title="font-weight!!property">‘<code
1064 class=property>font-weight</code>’</a> value using the chart below.
1066 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
1067 <thead>
1068 <tr>
1069 <th>Inherited value
1071 <th>bolder
1073 <th>lighter
1075 <tbody>
1076 <tr>
1077 <th>100
1079 <td>400
1081 <td>100
1083 <tr>
1084 <th>200
1086 <td>400
1088 <td>100
1090 <tr>
1091 <th>300
1093 <td>400
1095 <td>100
1097 <tr>
1098 <th>400
1100 <td>700
1102 <td>100
1104 <tr>
1105 <th>500
1107 <td>700
1109 <td>100
1111 <tr>
1112 <th>600
1114 <td>900
1116 <td>400
1118 <tr>
1119 <th>700
1121 <td>900
1123 <td>400
1125 <tr>
1126 <th>800
1128 <td>900
1130 <td>700
1132 <tr>
1133 <th>900
1135 <td>900
1137 <td>700
1138 </table>
1140 <p>The table above is equivalent to selecting the next relative bolder or
1141 lighter face, given a font family containing normal and bold faces along
1142 with a thin and a heavy face. Authors who desire finer control over the
1143 exact weight values used for a given element may use numerical values
1144 instead of relative weights.</p>
1145 <!-- prop: font-stretch -->
1147 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
1148 href="#propdef-font-stretch">font-stretch</a> property</h3>
1150 <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
1151 <tbody>
1152 <tr>
1153 <td>Name:
1155 <td><dfn id=propdef-font-stretch
1156 title="font-stretch!!property">font-stretch</dfn>
1158 <tr>
1159 <td>Value:
1161 <td> <a href="#font-stretch-normal-value"
1162 title="normal!!font-stretch">normal</a> | <a
1163 href="#ultra-condensed">ultra-condensed</a> | <a
1164 href="#extra-condensed">extra-condensed</a> | <a
1165 href="#condensed">condensed</a> | <a
1166 href="#semi-condensed-">semi-condensed</a> | <a
1167 href="#semi-expanded">semi-expanded</a> | <a
1168 href="#expanded">expanded</a> | <a
1169 href="#extra-expanded">extra-expanded</a> | <a
1170 href="#ultra-expanded">ultra-expanded</a>
1172 <tr>
1173 <td>Initial:
1175 <td>normal
1177 <tr>
1178 <td>Applies to:
1180 <td>all elements
1182 <tr>
1183 <td>Inherited:
1185 <td>yes
1187 <tr>
1188 <td>Percentages:
1190 <td>N/A
1192 <tr>
1193 <td>Media:
1195 <td>visual
1197 <tr>
1198 <td>Computed value:
1200 <td>as specified
1202 <tr>
1203 <td>Animatable:
1205 <td>as <a href="#font-stretch-animation">font stretch</a>
1206 </table>
1208 <p>The <a href="#propdef-font-stretch"
1209 title="font-stretch!!property">‘<code
1210 class=property>font-stretch</code>’</a> property selects a normal,
1211 condensed, or expanded face from a font family. Absolute keyword values
1212 have the following ordering, from narrowest to widest:
1214 <ul>
1215 <li><dfn id=ultra-condensed>ultra-condensed</dfn>
1217 <li><dfn id=extra-condensed>extra-condensed</dfn>
1219 <li><dfn id=condensed>condensed</dfn>
1221 <li><dfn id=semi-condensed->semi-condensed </dfn>
1223 <li><dfn id=font-stretch-normal-value
1224 title="normal!!font-stretch">normal</dfn>
1226 <li><dfn id=semi-expanded>semi-expanded</dfn>
1228 <li><dfn id=expanded>expanded</dfn>
1230 <li><dfn id=extra-expanded>extra-expanded</dfn>
1232 <li><dfn id=ultra-expanded>ultra-expanded</dfn>
1233 </ul>
1235 <p>When a face does not exist for a given width, normal or condensed values
1236 map to a narrower face, otherwise a wider face. Conversely, expanded
1237 values map to a wider face, otherwise a narrower face. The figure below
1238 shows how the nine font-stretch property settings affect font selection
1239 for font family containing a variety of widths, grey indicates a width for
1240 which no face exists and a different width is substituted:
1242 <div class=figure><img alt="width mappings for a family with condensed,
1243 normal and expanded faces" src=universwidths.png>
1244 <p class=caption>Width mappings for a font family with condensed, normal
1245 and expanded width faces
1246 </div>
1248 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
1249 interpolated in discrete steps. The interpolation happens as though the
1250 ordered values are equally spaced real numbers. The interpolation result
1251 is rounded to the nearest value, with values exactly halfway between two
1252 values rounded towards the later value in the list above.</p>
1253 <!-- prop: font-style -->
1255 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
1256 href="#propdef-font-style">font-style</a> property</h3>
1258 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
1259 <tbody>
1260 <tr>
1261 <td>Name:
1263 <td><dfn id=propdef-font-style
1264 title="font-style!!property">font-style</dfn>
1266 <tr>
1267 <td>Value:
1269 <td><a href="#font-style-normal-value"
1270 title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
1271 <a href="#oblique">oblique</a>
1273 <tr>
1274 <td>Initial:
1276 <td>normal
1278 <tr>
1279 <td>Applies to:
1281 <td>all elements
1283 <tr>
1284 <td>Inherited:
1286 <td>yes
1288 <tr>
1289 <td>Percentages:
1291 <td>N/A
1293 <tr>
1294 <td>Media:
1296 <td>visual
1298 <tr>
1299 <td>Computed value:
1301 <td>as specified
1303 <tr>
1304 <td>Animatable:
1306 <td>no
1307 </table>
1309 <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
1310 class=property>font-style</code>’</a> property allows italic or oblique
1311 faces to be selected. Italic forms are generally cursive in nature while
1312 oblique faces are typically sloped versions of the regular face. Oblique
1313 faces can be simulated by artificially sloping the glyphs of the regular
1314 face. Compare the artificially sloped renderings of Palatino ‘<code
1315 class=property>a</code>’ and Baskerville ‘<code
1316 class=property>N</code>’ in grey with the actual italic versions:
1318 <div class=figure><img alt="artificial sloping vs. real italics"
1319 src=realvsfakeitalics.png>
1320 <p class=caption>Artificial sloping versus real italics
1321 </div>
1323 <p>Values have the following meanings:
1325 <dl>
1326 <dt><dfn id=font-style-normal-value
1327 title="normal!!font-style">normal</dfn>
1329 <dd>selects a face that is classified as a normal face, one that is
1330 neither italic or obliqued
1332 <dt><dfn id=italic>italic</dfn>
1334 <dd>selects a font that is labeled as an italic face, or an oblique face
1335 if one is not
1337 <dt><dfn id=oblique>oblique</dfn>
1339 <dd>selects a font that is labeled as an oblique face, or an italic face
1340 if one is not
1341 </dl>
1343 <p>If no italic or oblique face is available, oblique faces can be
1344 synthesized by rendering non-obliqued faces with an artificial obliquing
1345 operation. The use of these artificially obliqued faces can be disabled
1346 using the ‘<a href="#propdef-font-synthesis"><code
1347 class=property>font-synthesis</code></a>’ property. The details of the
1348 obliquing operation are not explicitly defined.</p>
1349 <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
1351 <p>Many scripts lack the tradition of mixing a cursive form within text
1352 rendered with a normal face. Chinese, Japanese and Korean fonts almost
1353 always lack italic or oblique faces. Fonts that support a mixture of
1354 scripts will sometimes omit specific scripts such as Arabic from the set
1355 of glyphs supported in the italic face. User agents should be careful
1356 about making <a href="#character-map"><em>character map</em></a>
1357 assumptions across faces when implementing support for <a
1358 href="#system-font-fallback"><em>system font fallback</em></a>.</p>
1359 <!-- prop: font-size -->
1361 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
1362 href="#propdef-font-size">font-size</a> property</h3>
1364 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
1365 <tbody>
1366 <tr>
1367 <td>Name:
1369 <td><dfn id=propdef-font-size>font-size</dfn>
1371 <tr>
1372 <td>Value:
1374 <td><a href="#absolute-size-value"><var><absolute-size></var></a>
1375 | <a href="#relative-size-value"><var><relative-size></var></a> |
1376 <a href="#length-size-value"><var><length></var></a> | <a
1377 href="#percentage-size-value"><var><percentage></var></a>
1379 <tr>
1380 <td>Initial:
1382 <td>medium
1384 <tr>
1385 <td>Applies to:
1387 <td>all elements
1389 <tr>
1390 <td>Inherited:
1392 <td>yes
1394 <tr>
1395 <td>Percentages:
1397 <td>refer to parent element's font size
1399 <tr>
1400 <td>Media:
1402 <td>visual
1404 <tr>
1405 <td>Computed value:
1407 <td>absolute length
1409 <tr>
1410 <td>Animatable:
1412 <td>as <a
1413 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
1414 </table>
1416 <p>This property indicates the desired height of glyphs from the font. For
1417 scalable fonts, the font-size is a scale factor applied to the EM unit of
1418 the font. (Note that certain glyphs may bleed outside their EM box.) For
1419 non-scalable fonts, the font-size is converted into absolute units and
1420 matched against the declared font-size of the font, using the same
1421 absolute coordinate space for both of the matched values. Values have the
1422 following meanings:
1424 <dl>
1425 <dt><dfn id=absolute-size-value><var><absolute-size></var></dfn>
1427 <dd> An <a
1428 href="#absolute-size-value"><var><absolute-size></var></a> keyword
1429 refers to an entry in a table of font sizes computed and kept by the user
1430 agent. Possible values are:
1431 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
1433 <dt><dfn id=relative-size-value><var><relative-size></var></dfn>
1435 <dd> A <a href="#relative-size-value"><var><relative-size></var></a>
1436 keyword is interpreted relative to the table of font sizes and the
1437 computed ‘<a href="#propdef-font-size"><code
1438 class=property>font-size</code></a>’ of the parent element. Possible
1439 values are:
1440 <p> [ larger | smaller ]
1442 <p> For example, if the parent element has a font size of ‘<code
1443 class=property>medium</code>’, a value of ‘<code
1444 class=property>larger</code>’ will make the font size of the current
1445 element be ‘<code class=property>large</code>’. If the parent
1446 element's size is not close to a table entry, the user agent is free to
1447 interpolate between table entries or round off to the closest one. The
1448 user agent may have to extrapolate table values if the numerical value
1449 goes beyond the keywords.
1451 <dt><dfn id=length-size-value><var><length></var></dfn>
1453 <dd>A length value specifies an absolute font size (independent of the
1454 user agent's font table). Negative lengths are illegal.
1456 <dt><dfn id=percentage-size-value><var><percentage></var></dfn>
1458 <dd>A percentage value specifies an absolute font size relative to the
1459 parent element's font size. Use of percentage values, or values in
1460 ‘<code class=property>em</code>’s, leads to more robust and
1461 cascadable style sheets.
1462 </dl>
1464 <p>The following table provides user agent guidelines for the absolute-size
1465 scaling factor and their mapping to HTML heading and absolute font-sizes.
1466 The ‘<code class=property>medium</code>’ value is used as the
1467 reference middle value. The user agent may fine-tune these values for
1468 different fonts or different types of display devices.
1470 <table class=data>
1471 <thead>
1472 <tr>
1473 <th>CSS absolute-size values
1475 <th>xx-small
1477 <th>x-small
1479 <th>small
1481 <th>medium
1483 <th>large
1485 <th>x-large
1487 <th>xx-large
1489 <th>
1491 <tbody>
1492 <tr>
1493 <th>scaling factor
1495 <td>3/5
1497 <td>3/4
1499 <td>8/9
1501 <td>1
1503 <td>6/5
1505 <td>3/2
1507 <td>2/1
1509 <td>3/1
1511 <tr>
1512 <th>HTML headings
1514 <td>h6
1516 <td>
1518 <td>h5
1520 <td>h4
1522 <td>h3
1524 <td>h2
1526 <td>h1
1528 <td>
1530 <tr>
1531 <th>HTML font sizes
1533 <td>1
1535 <td>
1537 <td>2
1539 <td>3
1541 <td>4
1543 <td>5
1545 <td>6
1547 <td>7
1548 </table>
1550 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
1551 applying these guidelines should nevertheless avoid creating font-size
1552 resulting in less than 9 device pixels per EM unit on a computer
1553 display.</em>
1555 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
1556 factor between adjacent indexes was 1.5 which user experience proved to be
1557 too large. In CSS2, the suggested scaling factor for computer screen
1558 between adjacent indexes was 1.2 which still created issues for the small
1559 sizes. The new scaling factor varies between each index to provide a
1560 better readability.</em>
1562 <p>The actual value of this property may differ from the computed value due
1563 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
1564 class=property>font-size-adjust</code></a>’ and the unavailability of
1565 certain font sizes.
1567 <p>Child elements inherit the computed <a class=noxref
1568 href="#font-size-prop"> <span class=property>‘<code
1569 class=property>font-size</code>’</span></a> value (otherwise, the effect
1570 of <a class=noxref href="#font-size-adjust-prop"><span
1571 class=property>‘<code
1572 class=property>font-size-adjust</code>’</span></a> would compound).
1574 <div class=example>
1575 <p style="display:none">Example(s):
1577 <pre>p { font-size: 12pt; }
1578 blockquote { font-size: larger }
1579 em { font-size: 150% }
1580 em { font-size: 1.5em }
1581 </pre>
1582 </div>
1583 <!-- prop: font-size-adjust -->
1585 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
1586 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
1588 <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
1589 <tbody>
1590 <tr>
1591 <td>Name:
1593 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
1595 <tr>
1596 <td>Value:
1598 <td><a href="#font-size-adjust-none-value"
1599 title="none!!font-size-adjust">none</a> | <a
1600 href="#font-size-adjust-auto-value"
1601 title="auto!!font-size-adjust">auto</a> | <a
1602 href="#aspect-ratio-value"><var><number></var></a>
1604 <tr>
1605 <td>Initial:
1607 <td>none
1609 <tr>
1610 <td>Applies to:
1612 <td>all elements
1614 <tr>
1615 <td>Inherited:
1617 <td>yes
1619 <tr>
1620 <td>Percentages:
1622 <td>N/A
1624 <tr>
1625 <td>Media:
1627 <td>visual
1629 <tr>
1630 <td>Computed value:
1632 <td>as specified
1634 <tr>
1635 <td>Animatable:
1637 <td>as <a
1638 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
1639 </table>
1641 <p>For any given font size, the apparent size and legibility of text varies
1642 across fonts. For scripts such as Latin or Cyrillic that distinguish
1643 between upper and lowercase letters, the relative height of lowercase
1644 letters compared to their uppercase counterparts is a determining factor
1645 of legibility. This is commonly referred to as the <a class=index-def
1646 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
1647 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
1648 the x-height of a font divided by the font size.
1650 <p>In situations where font fallback occurs, fallback fonts may not share
1651 the same aspect ratio as the desired font family and will thus appear less
1652 readable. The font-size-adjust property is a way to preserve the
1653 readability of text when font fallback occurs. It does this by adjusting
1654 the font-size so that the x-height is the same regardless of the font
1655 used.
1657 <div class=example>
1658 <p>The style defined below defines Verdana as the desired font family, but
1659 if Verdana is not available Futura or Times will be used.</p>
1661 <pre>p {
1662 font-family: Verdana, Futura, Times;
1663 }
1665 <p>Lorem ipsum dolor sit amet, ...</p>
1666 </pre>
1668 <p>Verdana has a relatively high aspect ratio, lowercase letters are
1669 relatively tall compared to uppercase letters, so at small sizes text
1670 appears legible. Times has a lower aspect ratio and so if fallback
1671 occurs, the text will be less legible at small sizes than Verdana.</p>
1672 </div>
1674 <p>How text rendered in each of these fonts compares is shown below, the
1675 columns show text rendered in Verdana, Futura and Times. The same
1676 font-size value is used across cells within each row and red lines are
1677 included to show the differences in x-height. In the upper half each row
1678 is rendered in the same font-size value. The same is true for the lower
1679 half but in this half the font-size-adjust property is also set so that
1680 the actual font size is adjusted to preserve the x-height across each row.
1681 Note how small text remains relatively legible across each row in the
1682 lower half.
1684 <div class=figure><img alt="text with and without font-size-adjust"
1685 src=fontsizeadjust.png>
1686 <p class=caption>Text with and without the use of font-size-adjust
1687 </div>
1689 <p>This property allows authors to specify an <a
1690 href="#aspect-value"><i>aspect value</i></a> for an element that will
1691 effectively preserve the x-height of the first choice font, whether it is
1692 substituted or not. Values have the following meanings:
1694 <dl>
1695 <dt><dfn id=font-size-adjust-none-value
1696 title="none!!font-size-adjust">none</dfn>
1698 <dd>Do not preserve the font's x-height.
1700 <dt><dfn id=font-size-adjust-auto-value
1701 title="auto!!font-size-adjust">auto</dfn>
1703 <dd>Behaves just like <number>, except the number used is the <a
1704 href="#aspect-value"><i>aspect value</i></a> calculated by user agents
1705 for the first font in the list of fonts defined for the initial value of
1706 the <a href="#propdef-font-family" title="font-family!!property">‘<code
1707 class=property>font-family</code>’</a> property. Effectively this is
1708 the default font used when <a href="#propdef-font-family"
1709 title="font-family!!property">‘<code
1710 class=property>font-family</code>’</a> is not otherwise specified.
1711 <p>Authors can use this value to specify that font size should be
1712 normalized across fonts based on the x-height without the need to
1713 specify the aspect ratio explicitly.</p>
1715 <dt><dfn id=aspect-ratio-value><var><number></var></dfn>
1717 <dd>Specifies the <a href="#aspect-value"><i>aspect value</i></a> used in
1718 the calculation below to calculate the adjusted font size:
1719 <pre>c = ( a / a' ) s
1720 </pre>
1722 <p>where:</p>
1724 <pre>s = font-size value
1725 a = <a href="#aspect-value"><i>aspect value</i></a> as specified by the font-size-adjust property
1726 a' = <a href="#aspect-value"><i>aspect value</i></a> of actual font
1727 c = adjusted font-size to use
1728 </pre>
1730 <p>This value applies to any font that is selected but in typical usage
1731 it should be based on the <a href="#aspect-value"><i>aspect
1732 value</i></a> of the first font in the font-family list. If this is
1733 specified accurately, the <tt>(a/a')</tt> term in the formula above is
1734 effectively 1 for the first font and no adjustment occurs. If the value
1735 is specified inaccurately, text rendered using the first font in the
1736 family list will display differently in older user agents that don't
1737 support font-size-adjust.</p>
1738 </dl>
1740 <p>The value of ‘<a href="#propdef-font-size-adjust"><code
1741 class=property>font-size-adjust</code></a>’ affects the size of relative
1742 units that are based on font metrics of the <a
1743 href="#first-available-font"><i>first available font</i></a> such as
1744 <code>ex</code> and <code>ch</code> but does not affect the size of
1745 <code>em</code> units.
1747 <p>Authors can calculate the <a href="#aspect-value"><i>aspect
1748 value</i></a> for a given font by comparing spans with the same content
1749 but different font-size-adjust properties. If the same font-size is used,
1750 the spans will match when the font-size-adjust value is accurate for the
1751 given font.
1753 <div class=example>
1754 <p>Two spans with borders are used to determine the <a
1755 href="#aspect-value"><i>aspect value</i></a> of a font. The font-size is
1756 the same for both spans but the font-size-adjust property is specified
1757 only for the right span. Starting with a value of 0.5, the aspect value
1758 can be adjusted until the borders around the two letters line up.</p>
1760 <pre>p {
1761 font-family: Futura;
1762 font-size: 500px;
1763 }
1765 span {
1766 border: solid 1px red;
1767 }
1769 .adjust {
1770 font-size-adjust: 0.5;
1771 }
1773 <p><span>b</span><span class="adjust">b</span></p>
1774 </pre>
1776 <div class=figure><img alt="Futura with an <i>aspect value</i> of 0.5"
1777 src=beforefontsizeadjust.png>
1778 <p class=caption>Futura with an <a href="#aspect-value"><i>aspect
1779 value</i></a> of 0.5
1780 </div>
1782 <p>The box on the right is a bit bigger than the one on the left, so the
1783 <a href="#aspect-value"><i>aspect value</i></a> of this font is something
1784 less than 0.5. Adjust the value until the boxes align.</p>
1785 </div>
1786 <!-- prop: font -->
1788 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
1789 <a href="#propdef-font">font</a> property</h3>
1791 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
1792 <tbody>
1793 <tr>
1794 <td>Name:
1796 <td><dfn id=propdef-font>font</dfn>
1798 <tr>
1799 <td>Value:
1801 <td>[ [ <var><<a href="#propdef-font-style"
1802 title="font-style!!property">‘<code
1803 class=property>font-style</code>’</a>></var> || <a
1804 href="#font-variant-css21-values"><var><font-variant-css21></var></a>
1805 || <var><<a href="#propdef-font-weight"
1806 title="font-weight!!property">‘<code
1807 class=property>font-weight</code>’</a>></var> || <var><<a
1808 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
1809 class=property>font-stretch</code>’</a></var> ]? <var><‘<a
1810 href="#propdef-font-size"><code
1811 class=property>font-size</code></a>’></var> [ / <var><‘<code
1812 class=property>line-height</code>’></var> ]? <var><<a
1813 href="#propdef-font-family" title="font-family!!property">‘<code
1814 class=property>font-family</code>’</a>></var> ] | caption | icon |
1815 menu | message-box | small-caption | status-bar
1817 <tr>
1818 <td>Initial:
1820 <td>see individual properties
1822 <tr>
1823 <td>Applies to:
1825 <td>all elements
1827 <tr>
1828 <td>Inherited:
1830 <td>yes
1832 <tr>
1833 <td>Percentages:
1835 <td>see individual properties
1837 <tr>
1838 <td>Media:
1840 <td>visual
1842 <tr>
1843 <td>Computed value:
1845 <td>see individual properties
1847 <tr>
1848 <td>Animatable:
1850 <td>see individual properties
1851 </table>
1853 <p>The <span class=property>‘<a href="#propdef-font"><code
1854 class=property>font</code></a>’</span> property is, except as described
1855 below, a shorthand property for setting <a href="#propdef-font-style"
1856 title="font-style!!property">‘<code
1857 class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
1858 title="font-variant!!property">‘<code
1859 class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
1860 title="font-weight!!property">‘<code
1861 class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
1862 title="font-stretch!!property">‘<code
1863 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1864 href="#propdef-font-size"><code
1865 class=property>font-size</code></a>’</span>, <a class=property
1866 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1867 class=property>line-height</code>’</a>, <a href="#propdef-font-family"
1868 title="font-family!!property">‘<code
1869 class=property>font-family</code>’</a> at the same place in the
1870 stylesheet. Values for the <a href="#propdef-font-variant"
1871 title="font-variant!!property">‘<code
1872 class=property>font-variant</code>’</a> property may also be included
1873 but only those supported in CSS 2.1, none of the <a
1874 href="#propdef-font-variant" title="font-variant!!property">‘<code
1875 class=property>font-variant</code>’</a> values added in this
1876 specification can be used in the <span class=property>‘<a
1877 href="#propdef-font"><code class=property>font</code></a>’</span>
1878 shorthand:
1880 <pre
1881 class=prod><dfn id=font-variant-css21-values><var><font-variant-css21></var></dfn> = [normal | small-caps]</pre>
1883 <p>The syntax of this property is based on a traditional typographical
1884 shorthand notation to set multiple properties related to fonts.
1886 <p>All subproperties of the ‘<a href="#propdef-font"><code
1887 class=property>font</code></a>’ property are first reset to their
1888 initial values, including those listed above plus <span
1889 class=property>‘<a href="#propdef-font-size-adjust"><code
1890 class=property>font-size-adjust</code></a>’</span>, <span
1891 class=property>‘<a href="#propdef-font-kerning"><code
1892 class=property>font-kerning</code></a>’</span>, subproperties of <a
1893 href="#propdef-font-variant" title="font-variant!!property">‘<code
1894 class=property>font-variant</code>’</a> and and <span>‘<a
1895 href="#propdef-font-language-override"><code
1896 class=property>font-language-override</code></a>’</span>. Then, those
1897 properties that are given explicit values in the <span
1898 class=property>‘<a href="#propdef-font"><code
1899 class=property>font</code></a>’</span> shorthand are set to those
1900 values. For a definition of allowed and initial values, see the previously
1901 defined properties. For reasons of backwards compatibility, it is not
1902 possible to set <span class=property>‘<a
1903 href="#propdef-font-size-adjust"><code
1904 class=property>font-size-adjust</code></a>’</span> to anything other
1905 than its initial value using the <span class=property>‘<a
1906 href="#propdef-font"><code class=property>font</code></a>’</span>
1907 shorthand property; instead, use the individual property.
1909 <div class=example>
1910 <p style="display:none">Example(s):
1912 <pre>p { font: 12pt/14pt sans-serif }
1913 p { font: 80% sans-serif }
1914 p { font: x-large/110% "new century schoolbook", serif }
1915 p { font: bold italic large Palatino, serif }
1916 p { font: normal small-caps 120%/120% fantasy }
1917 p { font: condensed oblique 12pt "Helvetica Neue", serif; }
1918 </pre>
1920 <p> In the second rule, the font size percentage value (‘<code
1921 class=css>80%</code>’) refers to the computed ‘<a
1922 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
1923 the parent element. In the third rule, the line height percentage
1924 (‘<code class=css>110%</code>’) refers to the font size of the
1925 element itself.
1927 <p>The first three rules do not specify the <a
1928 href="#propdef-font-variant" title="font-variant!!property">‘<code
1929 class=property>font-variant</code>’</a> and <a
1930 href="#propdef-font-weight" title="font-weight!!property">‘<code
1931 class=property>font-weight</code>’</a> explicitly, so these properties
1932 receive their initial values (<span title="normal value">‘<code
1933 class=property>normal</code>’</span>). Notice that the font family name
1934 "new century schoolbook", which contains spaces, is enclosed in quotes.
1935 The fourth rule sets the <a href="#propdef-font-weight"
1936 title="font-weight!!property">‘<code
1937 class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
1938 class=property>bold</code></a>’, the <a href="#propdef-font-style"
1939 title="font-style!!property">‘<code
1940 class=property>font-style</code>’</a> to ‘<a href="#italic"><code
1941 class=property>italic</code></a>’, and implicitly sets <a
1942 href="#propdef-font-variant" title="font-variant!!property">‘<code
1943 class=property>font-variant</code>’</a> to <a
1944 href="#font-variant-normal-value" title="normal!!font-variant">‘<code
1945 class=property>normal</code>’</a>.
1947 <p> The fifth rule sets the <a href="#propdef-font-variant"
1948 title="font-variant!!property">‘<code
1949 class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
1950 class=property>small-caps</code></a>’), the <span class=property>‘<a
1951 href="#propdef-font-size"><code
1952 class=property>font-size</code></a>’</span> (120% of the parent's font
1953 size), the <a class=property
1954 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1955 class=property>line-height</code>’</a> (120% of the font size) and the
1956 <a href="#propdef-font-family" title="font-family!!property">‘<code
1957 class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
1958 class=property>fantasy</code></a>’). It follows that the keyword <span
1959 title="normal value">‘<code class=property>normal</code>’</span>
1960 applies to the two remaining properties: <a href="#propdef-font-style"
1961 title="font-style!!property">‘<code
1962 class=property>font-style</code>’</a> and <a
1963 href="#propdef-font-weight" title="font-weight!!property">‘<code
1964 class=property>font-weight</code>’</a>.
1966 <p>The sixth rule sets the <a href="#propdef-font-style"
1967 title="font-style!!property">‘<code
1968 class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
1969 title="font-stretch!!property">‘<code
1970 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1971 href="#propdef-font-size"><code
1972 class=property>font-size</code></a>’</span>, and <a
1973 href="#propdef-font-family" title="font-family!!property">‘<code
1974 class=property>font-family</code>’</a>, the other font properties being
1975 set to their initial values.
1976 </div>
1978 <p>Since the <a href="#propdef-font-stretch"
1979 title="font-stretch!!property">‘<code
1980 class=property>font-stretch</code>’</a> property was not defined in CSS
1981 2.1, when using <a href="#propdef-font-stretch"
1982 title="font-stretch!!property">‘<code
1983 class=property>font-stretch</code>’</a> values within ‘<a
1984 href="#propdef-font"><code class=property>font</code></a>’ rules,
1985 authors should include a extra version compatible with older user agents:
1987 <pre>p {
1988 font: 80% sans-serif; /* for older user agents */
1989 font: condensed 80% sans-serif;
1990 }</pre>
1992 <p>The following values refer to system fonts:
1994 <dl>
1995 <dt><strong>caption</strong>
1997 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
1998 etc.).
2000 <dt><strong>icon</strong>
2002 <dd>The font used to label icons.
2004 <dt><strong>menu</strong>
2006 <dd>The font used in menus (e.g., dropdown menus and menu lists).
2008 <dt><strong>message-box</strong>
2010 <dd>The font used in dialog boxes.
2012 <dt><strong>small-caption</strong>
2014 <dd>The font used for labeling small controls.
2016 <dt><strong>status-bar</strong>
2018 <dd>The font used in window status bars.
2019 </dl>
2021 <p>System fonts may only be set as a whole; that is, the font family, size,
2022 weight, style, etc. are all set at the same time. These values may then be
2023 altered individually if desired. If no font with the indicated
2024 characteristics exists on a given platform, the user agent should either
2025 intelligently substitute (e.g., a smaller version of the ‘<code
2026 class=property>caption</code>’ font might be used for the ‘<code
2027 class=property>small-caption</code>’ font), or substitute a user agent
2028 default font. As for regular fonts, if, for a system font, any of the
2029 individual properties are not part of the operating system's available
2030 user preferences, those properties should be set to their initial values.
2032 <p>That is why this property is "almost" a shorthand property: system fonts
2033 can only be specified with this property, not with <a
2034 href="#propdef-font-family" title="font-family!!property">‘<code
2035 class=property>font-family</code>’</a> itself, so <span
2036 class=property>‘<a href="#propdef-font"><code
2037 class=property>font</code></a>’</span> allows authors to do more than
2038 the sum of its subproperties. However, the individual properties such as
2039 <a href="#propdef-font-weight" title="font-weight!!property">‘<code
2040 class=property>font-weight</code>’</a> are still given values taken from
2041 the system font, which can be independently varied.
2043 <p>Note that the keywords used for the system fonts listed above are only
2044 treated as keywords when they occur in the initial position, in other
2045 positions the same string is treated as part of the font family name:
2047 <pre> font: menu; /* use the font settings for system menus */
2048 font: large menu; /* use a font family named "menu" */</pre>
2050 <div class=example>
2051 <p style="display:none">Example(s):
2053 <pre>button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
2054 button p { font: menu }
2055 button p em { font-weight: bolder }
2056 </pre>
2058 <p>If the font used for dropdown menus on a particular system happened to
2059 be, for example, 9-point Charcoal, with a weight of 600, then P elements
2060 that were descendants of BUTTON would be displayed as if this rule were
2061 in effect:
2063 <pre>button p { font: 600 9pt Charcoal }
2064 </pre>
2066 <p>Because the <span class=property>‘<a href="#propdef-font"><code
2067 class=property>font</code></a>’</span> shorthand resets to its initial
2068 value any property not explicitly given a value, this has the same effect
2069 as this declaration:
2071 <pre>button p {
2072 font-style: normal;
2073 font-variant: normal;
2074 font-weight: 600;
2075 font-size: 9pt;
2076 line-height: normal;
2077 font-family: Charcoal
2078 }
2079 </pre>
2080 </div>
2081 <!-- prop: font-synthesis -->
2083 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
2084 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
2085 property</h3>
2087 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
2088 <tbody>
2089 <tr>
2090 <td>Name:
2092 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
2094 <tr>
2095 <td>Value:
2097 <td>none | [ weight || style ]
2099 <tr>
2100 <td>Initial:
2102 <td>weight style
2104 <tr>
2105 <td>Applies to:
2107 <td>all elements
2109 <tr>
2110 <td>Inherited:
2112 <td>yes
2114 <tr>
2115 <td>Percentages:
2117 <td>N/A
2119 <tr>
2120 <td>Media:
2122 <td>visual
2124 <tr>
2125 <td>Computed value:
2127 <td>as specified
2129 <tr>
2130 <td>Animatable:
2132 <td>no
2133 </table>
2135 <p>This property controls whether user agents are allowed to synthesize
2136 bold or oblique font faces when a font family lacks bold or italic faces.
2137 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
2138 specified, user agents must not synthesize bold faces and if ‘<code
2139 class=property>style</code>’ is not specified user agents must not
2140 synthesize italic faces. A value of ‘<code class=property>none</code>’
2141 disallows all synthetic faces.
2143 <div class=example>
2144 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
2146 <pre>*:lang(ar) { font-synthesis: none; }
2147 </pre>
2148 </div>
2150 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
2152 <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
2153 id=at-font-face-rule style="font-weight: inherit; font-style:
2154 inherit"><code>@font-face</code></dfn> rule</h3>
2156 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
2157 for linking to fonts that are automatically fetched and activated when
2158 needed. This allows authors to select a font that closely matches the
2159 design goals for a given page rather than limiting the font choice to a
2160 set of fonts available on all platforms. A set of font descriptors define
2161 the location of a font resource, either locally or externally, along with
2162 the style characteristics of an individual face. Multiple <a
2163 href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
2164 construct font families with a variety of faces. Using CSS font matching
2165 rules, a user agent can selectively download only those faces that are
2166 needed for a given piece of text.
2168 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2169 consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
2170 at-keyword followed by a block of descriptor declarations. In terms of the
2171 grammar, this specification defines the following productions:
2173 <pre><dfn id=fontfacerule>font_face_rule</dfn>
2174 : <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>*
2175 ;
2177 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
2178 : <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>
2179 ;</pre>
2181 <p>The following new definitions are introduced:
2183 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
2184 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
2186 <p>The following new token is introduced:
2188 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
2190 <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2191 specifies a value for every font descriptor, either implicitly or
2192 explicitly. Those not given explicit values in the rule take the initial
2193 value listed with each descriptor in this specification. These descriptors
2194 apply solely within the context of the <a
2195 href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
2196 are defined, and do not apply to document language elements. There is no
2197 notion of which elements the descriptors apply to or whether the values
2198 are inherited by child elements. When a given descriptor occurs multiple
2199 times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
2200 rule, only the last descriptor declaration is used and all prior
2201 declarations for that descriptor are ignored.
2203 <div class=example>
2204 <p>To use a downloadable font called Gentium:</p>
2206 <pre>
2207 @font-face {
2208 font-family: Gentium;
2209 src: url(http://example.com/fonts/Gentium.ttf);
2210 }
2212 p { font-family: Gentium, serif; }
2213 </pre>
2215 <p>The user agent will download Gentium and use it when rendering text
2216 within paragraph elements. If for some reason the site serving the font
2217 is unavailable, the default serif font will be used.</p>
2218 </div>
2220 <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
2221 rules define a set of fonts available for use within the documents that
2222 contain these rules. When font matching is done, fonts defined using these
2223 rules are considered before other available fonts on a system.
2225 <p>Downloaded fonts are only available to documents that reference them.
2226 The process of activating these fonts must not make them available to
2227 other applications or to documents that don't directly link to the same
2228 font. User agent implementers might consider it convenient to use
2229 downloaded fonts when rendering characters in other documents for which no
2230 other available font exists as part of the <a
2231 href="#system-font-fallback"><em>system font fallback</em></a> procedure.
2232 However, this would cause a security leak since the contents of one page
2233 would be able to affect other pages, something an attacker could use as an
2234 attack vector. These restrictions do not affect caching behavior, fonts
2235 are cached the same way other web resources are cached.
2237 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
2238 properties in a declaration block, declarations of any descriptors that
2239 are not supported by the user agent must be ignored. <a
2240 href="#at-font-face-rule"><code>@font-face</code></a> rules require a
2241 font-family and src descriptor; if either of these are missing, the <a
2242 href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
2243 must be ignored entirely.
2245 <p>In cases where user agents have limited platform resources or implement
2246 the ability to disable downloadable font resources, <a
2247 href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
2248 ignored; the behavior of individual descriptors as defined in this
2249 specification should not be altered.
2251 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
2252 href="#descdef-font-family">font-family</a> descriptor</h3>
2254 <table class=descdef>
2255 <tbody>
2256 <tr>
2257 <td>Name:
2259 <td><dfn id=descdef-font-family
2260 title="font-family!!descriptor">font-family</dfn>
2262 <tr>
2263 <td>Value:
2265 <td><a href="#family-name-value"><var><family-name></var></a>
2267 <tr>
2268 <td><em>Initial:</em>
2270 <td>N/A
2271 </table>
2273 <p>This descriptor defines the font family name that will be used in all
2274 CSS font family name matching. It is required for the <a
2275 href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
2276 overrides the font family names contained in the underlying font data. If
2277 the font family name is the same as a font family available in a given
2278 user's environment, it effectively hides the underlying font for documents
2279 that use the stylesheet. This permits a web author to freely choose
2280 font-family names without worrying about conflicts with font family names
2281 present in a given user's environment. Likewise, platform substitutions
2282 for a given font family name must not be used.
2284 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
2285 href="#descdef-src">src</a> descriptor</h3>
2287 <table class=descdef>
2288 <tbody>
2289 <tr>
2290 <td>Name:
2292 <td><dfn id=descdef-src>src</dfn>
2294 <tr>
2295 <td>Value:
2297 <td>[ <url> [format(<string> #)]? | <a
2298 href="#font-face-name-value"><var><font-face-name></var></a> ] #
2300 <tr>
2301 <td><em>Initial:</em>
2303 <td>N/A
2304 </table>
2306 <p>This descriptor specifies the resource containing font data. It is
2307 required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
2308 rule to be valid. Its value is a prioritized, comma-separated list of
2309 external references or locally-installed font face names. When a font is
2310 needed the user agent iterates over the set of references listed, using
2311 the first one it can successfully activate. Fonts containing invalid data
2312 or local font faces that are not found are ignored and the user agent
2313 loads the next font in the list.
2315 <p>As with other URLs in CSS, the URL may be relative, in which case it is
2316 resolved relative to the location of the style sheet containing the <a
2317 href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
2318 SVG fonts, the URL points to an element within a document containing SVG
2319 font definitions. If the element reference is omitted, a reference to the
2320 first defined font is implied. Similarly, font container formats that can
2321 contain more than one font must load one and only one of the fonts for a
2322 given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
2323 Fragment identifiers are used to indicate which font to load. If a
2324 container format lacks a defined fragment identifier scheme,
2325 implementations should use a simple 1-based indexing scheme (e.g.
2326 "font-collection#1" for the first font, "font-collection#2" for the second
2327 font).
2329 <pre>
2330 src: url(fonts/simple.ttf); /* load simple.ttf relative to stylesheet location */
2331 src: url(/fonts/simple.ttf); /* load simple.ttf from absolute location */
2332 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
2333 </pre>
2335 <p>External references consist of a URL, followed by an optional hint
2336 describing the format of the font resource referenced by that URL. The
2337 format hint contains a comma-separated list of format strings that denote
2338 well-known font formats. Conformant user agents must skip downloading a
2339 font resource if the format hints indicate only unsupported or unknown
2340 font formats. If no format hints are supplied, the user agent should
2341 download the font resource.
2343 <pre>
2344 /* load WOFF font if possible, otherwise use OpenType font */
2345 @font-face {
2346 font-family: bodytext;
2347 src: url(ideal-sans-serif.woff) format("woff"),
2348 url(basic-sans-serif.ttf) format("opentype");
2349 }
2350 </pre>
2352 <p>Format strings defined by this specification:
2354 <table class=data id=fontformats>
2355 <thead>
2356 <tr>
2357 <th>String
2359 <th>Font Format
2361 <th>Common extensions
2363 <tbody>
2364 <tr>
2365 <th>"woff"
2367 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
2369 <td>.woff
2371 <tr>
2372 <th>"truetype"
2374 <td><a
2375 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
2377 <td>.ttf
2379 <tr>
2380 <th>"opentype"
2382 <td><a
2383 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
2385 <td>.ttf, .otf
2387 <tr>
2388 <th>"embedded-opentype"
2390 <td><a
2391 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
2392 OpenType</a>
2394 <td>.eot
2396 <tr>
2397 <th>"svg"
2399 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
2401 <td>.svg, .svgz
2402 </table>
2404 <p>Given the overlap in common usage between TrueType and OpenType, the
2405 format hints "truetype" and "opentype" must be considered as synonymous; a
2406 format hint of "opentype" does not imply that the font contains Postscript
2407 CFF style glyph data or that it contains OpenType layout information (see
2408 <a href="#platform-props-to-css">Appendix A</a> for more background on
2409 this).
2411 <p>When authors would prefer to use a locally available copy of a given
2412 font and download it if it's not, <code>local()</code> can be used. The
2413 locally-installed <dfn
2414 id=font-face-name-value><var><font-face-name></var></dfn> argument
2415 to <code>local()</code> is a format-specific string that uniquely
2416 identifies a single font face within a larger family. The syntax for a <a
2417 href="#font-face-name-value"><var><font-face-name></var></a> is a
2418 unique font face name enclosed by "local(" and ")". The name can
2419 optionally be enclosed in quotes. If unquoted, the unquoted font family
2420 name processing conventions apply; the name must be a sequence of
2421 identifiers separated by whitespace which is converted to a string by
2422 joining the identifiers together separated by a single space.
2424 <pre>
2425 /* regular face of Gentium */
2426 @font-face {
2427 font-family: MyGentium;
2428 src: local(Gentium), /* use locally available Gentium */
2429 url(Gentium.ttf); /* otherwise, download it */
2430 }
2431 </pre>
2433 <p>For OpenType and TrueType fonts, this string is used to match only the
2434 Postscript name or the full font name in the name table of locally
2435 available fonts. Which type of name is used varies by platform and font,
2436 so authors should include both of these names to assure proper matching
2437 across platforms. Platform substitutions for a given font name must not be
2438 used.
2440 <pre>
2441 /* bold face of Gentium */
2442 @font-face {
2443 font-family: MyGentium;
2444 src: local(Gentium Bold), /* full font name */
2445 local(Gentium-Bold), /* Postscript name */
2446 url(GentiumBold.ttf); /* otherwise, download it */
2447 font-weight: bold;
2448 }
2449 </pre>
2451 <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2452 specifies the characteristics of a single font within a family, the unique
2453 name used with <code>local()</code> specifies a single font, not an entire
2454 font family. Defined in terms of OpenType font data, the Postscript name
2455 is found in the font's <a
2456 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
2457 in the name record with nameID = 6 (see <a href="#OPENTYPE"
2458 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
2459 Postscript name is the commonly used key for all fonts on OSX and for
2460 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
2461 used as a unique key for fonts with TrueType glyphs on Windows.
2463 <p>For OpenType fonts with multiple localizations of the full font name,
2464 the US English version is used (language ID = 0x409 for Windows and
2465 language ID = 0 for Macintosh) or the first localization when a US English
2466 full font name is not available (the OpenType specification recommends
2467 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
2468 fonts minimally include US English names</a>). User agents that also match
2469 other full font names, e.g. matching the Dutch name when the current
2470 system locale is set to Dutch, are considered non-conformant. This is done
2471 not to prefer English but to avoid matching inconsistencies across font
2472 versions and OS localizations, since font style names (e.g. "Bold") are
2473 frequently localized into many languages and the set of localizations
2474 available varies widely across platform and font version. User agents that
2475 match a concatenation of family name (nameID = 1) with style name (nameID
2476 = 2) are considered non-conformant.
2478 <p>This also allows for referencing faces that belong to larger families
2479 that cannot otherwise be referenced.
2481 <div class=example>
2482 <p>Use a local font or reference an SVG font in another document:</p>
2484 <pre>
2485 @font-face {
2486 font-family: Headline;
2487 src: local(Futura-Medium),
2488 url(fonts.svg#MyGeometricModern) format("svg");
2489 }
2490 </pre>
2492 <p>Create an alias for local Japanese fonts on different platforms:</p>
2494 <pre>
2495 @font-face {
2496 font-family: jpgothic;
2497 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
2498 }
2499 </pre>
2501 <p>Reference a font face that cannot be matched within a larger family:</p>
2503 <pre>
2504 @font-face {
2505 font-family: Hoefler Text Ornaments;
2506 /* has the same font properties as Hoefler Text Regular */
2507 src: local(HoeflerText-Ornaments);
2508 }
2509 </pre>
2511 <p>Since localized fullnames never match, a document with the header style
2512 rules below would always render using the default serif font, regardless
2513 whether a particular system locale parameter is set to Finnish or not:</p>
2515 <pre>
2516 @font-face {
2517 font-family: SectionHeader;
2518 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
2519 font-weight: bold;
2520 }
2522 h2 { font-family: SectionHeader, serif; }
2523 </pre>
2525 <p>A conformant user agent would never load the font ‘<code
2526 class=css>gentium.eot</code>’ in the example below, since it is
2527 included in the first definition of the ‘<a href="#descdef-src"><code
2528 class=property>src</code></a>’ descriptor which is overridden by the
2529 second definition in the same <a
2530 href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
2532 <pre>
2533 @font-face {
2534 font-family: MainText;
2535 src: url(gentium.eot); /* for use with older non-conformant user agents */
2536 src: local("Gentium"), url(gentium.ttf); /* Overrides src definition */
2537 }
2538 </pre>
2539 </div>
2541 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
2542 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
2543 href="#descdef-font-weight">font-weight</a>, <a
2544 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
2546 <table class=descdef>
2547 <tbody>
2548 <tr>
2549 <td>Name:
2551 <td><dfn id=descdef-font-style
2552 title="font-style!!descriptor">font-style</dfn>
2554 <tr>
2555 <td>Value:
2557 <td>normal | italic | oblique
2559 <tr>
2560 <td><em>Initial:</em>
2562 <td>normal
2563 </table>
2565 <table class=descdef>
2566 <tbody>
2567 <tr>
2568 <td>Name:
2570 <td><dfn id=descdef-font-weight
2571 title="font-weight!!descriptor">font-weight</dfn>
2573 <tr>
2574 <td>Value:
2576 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
2578 <tr>
2579 <td><em>Initial:</em>
2581 <td>normal
2582 </table>
2584 <table class=descdef>
2585 <tbody>
2586 <tr>
2587 <td>Name:
2589 <td><dfn id=descdef-font-stretch
2590 title="font-stretch!!descriptor">font-stretch</dfn>
2592 <tr>
2593 <td>Value:
2595 <td>normal | ultra-condensed | extra-condensed | condensed |
2596 semi-condensed | semi-expanded | expanded | extra-expanded |
2597 ultra-expanded
2599 <tr>
2600 <td><em>Initial:</em>
2602 <td>normal
2603 </table>
2605 <p>These descriptors define the characteristics of a font face and are used
2606 in the process of matching styles to specific faces. For a font family
2607 defined with several <a
2608 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
2609 can either download all faces in the family or use these descriptors to
2610 selectively download font faces that match actual styles used in document.
2611 The values for these descriptors are the same as those for the
2612 corresponding font properties except that relative keywords are not
2613 allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
2614 and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
2615 these descriptors are omitted, initial values are assumed.
2617 <p>The value for these font face style attributes is used in place of the
2618 style implied by the underlying font data. This allows authors to combine
2619 faces in flexible combinations, even in situations where the original font
2620 data was arranged differently. User agents that implement synthetic
2621 bolding and obliquing must only apply synthetic styling in cases where the
2622 font descriptors imply this is needed, rather than based on the style
2623 attributes implied by the font data.
2625 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
2626 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
2628 <table class=descdef>
2629 <tbody>
2630 <tr>
2631 <td>Name:
2633 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
2635 <tr>
2636 <td>Value:
2638 <td><a href="#urange-value"><var><urange></var></a> #
2640 <tr>
2641 <td><em>Initial:</em>
2643 <td>U+0-10FFFF
2644 </table>
2646 <p>This descriptor defines the set of Unicode codepoints that may be
2647 supported by the font face for which it is declared. The descriptor value
2648 is a comma-delimited list of Unicode range (<a
2649 href="#urange-value"><var><urange></var></a>) values. The union of
2650 these ranges defines the set of codepoints that serves as a hint for user
2651 agents when deciding whether or not to download a font resource for a
2652 given text run.
2654 <p>Each <dfn id=urange-value><var><urange></var></dfn> value is a <a
2655 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2656 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
2657 "U+" or "u+" prefix followed by a codepoint range in one of the three
2658 forms listed below. Ranges that do not fit one of the these forms are
2659 invalid and cause the declaration to be ignored.
2661 <dl>
2662 <dt>single codepoint (e.g. U+416)
2664 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
2665 digits
2667 <dt>interval range (e.g. U+400-4ff)
2669 <dd>represented as two hyphen-separated valid Unicode codepoints
2670 indicating the inclusive start and end codepoints of a range
2672 <dt>wildcard range (e.g. U+4??)
2674 <dd>defined by the set of codepoints implied when trailing ‘<code
2675 class=css>?</code>’ characters signify any hexadeximal digit
2676 </dl>
2678 <p>Individual codepoints are written using hexadecimal values that
2679 correspond to <a href="http://www.unicode.org/charts/">Unicode character
2680 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
2681 inclusive. Digit values of codepoints are ASCII case-insensitive. For
2682 interval ranges, the start and end codepoints are valid Unicode values and
2683 the end codepoint is greater than or equal to the start codepoint.
2685 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
2686 "U+???") are valid and equivalent to a wildcard range with an initial zero
2687 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
2688 the range of valid Unicode codepoints are invalid. Because of this, the
2689 maximum number of trailing ‘<code class=css>?</code>’ wildcard
2690 characters is five, even though the <a
2691 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2692 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
2694 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
2695 href="#descdef-unicode-range"><code
2696 class=property>unicode-range</code></a>’ descriptor declaration, ranges
2697 may overlap. The union of these ranges defines the set of codepoints for
2698 which the corresponding font may be used. User agents must not download or
2699 use the font for codepoints outside this set. User agents may normalize
2700 the list of ranges into a list that is different but represents the same
2701 set of codepoints.
2703 <p>The associated font might not contain glyphs for the entire set of
2704 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
2705 class=property>unicode-range</code></a>’ descriptor. When the font is
2706 used, the <dfn id=effective-character-map>effective character map</dfn> is
2707 the intersection of the codepoints defined by ‘<a
2708 href="#descdef-unicode-range"><code
2709 class=property>unicode-range</code></a>’ with the font's <a
2710 href="#character-map"><em>character map</em></a>. This allows authors to
2711 define supported ranges in terms of broad ranges without worrying about
2712 the precise codepoint ranges supported by the underlying font.
2714 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
2715 to define composite fonts</h3>
2717 <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
2718 with different unicode ranges for the same family and style descriptor
2719 values can be used to create composite fonts that mix the glyphs from
2720 different fonts for different scripts. This can be used to combine fonts
2721 that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
2722 or it can be used by authors as a way of segmenting a font into fonts for
2723 commonly used characters and less frequently used characters. Since the
2724 user agent will only pull down the fonts it needs this helps reduce page
2725 bandwidth.
2727 <p>If the unicode ranges overlap for a set of <a
2728 href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
2729 family and style descriptor values, the rules are ordered in the reverse
2730 order they were defined; the last rule defined is the first to be checked
2731 for a given character.
2733 <p>Example ranges for specific languages or characters:
2735 <dl>
2736 <dt>unicode-range: U+A5;
2738 <dd>a single code point, the yen/yuan symbol
2740 <dt>unicode-range: U+0-7F;
2742 <dd>code range for basic ASCII characters
2744 <dt>unicode-range: U+590-5ff;
2746 <dd>code range for Hebrew characters
2748 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
2750 <dd>code range for Japanese kanji, hiragana and katakana characters plus
2751 yen/yuan symbol
2752 </dl>
2754 <div class=example>
2755 <p>The BBC provides news services in a wide variety of languages, many
2756 that are not well supported across all platforms. Using an <a
2757 href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
2758 provide a font for any of these languages, as it already does via a
2759 manual font download.</p>
2761 <pre>
2762 @font-face {
2763 font-family: BBCBengali;
2764 src: url(fonts/BBCBengali.ttf) format("opentype");
2765 unicode-range: U+00-FF, U+980-9FF;
2766 }
2767 </pre>
2768 </div>
2770 <div class=example>
2771 <p>Technical documents often require a wide range of symbols. The STIX
2772 Fonts project is one project aimed at providing fonts to support a wide
2773 range of technical typesetting in a standardized way. The example below
2774 shows the use of a font that provides glyphs for many of the mathematical
2775 and technical symbol ranges within Unicode:</p>
2777 <pre>
2778 @font-face {
2779 font-family: STIXGeneral;
2780 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
2781 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
2782 }
2783 </pre>
2784 </div>
2786 <div class=example>
2787 <p>This example shows how an author can override the glyphs used for Latin
2788 characters in a Japanese font with glyphs from a different font. The
2789 first rule specifies no range so it defaults to the entire range. The
2790 range specified in the second rule overlaps but takes precedence because
2791 it is defined later.</p>
2793 <pre>
2794 @font-face {
2795 font-family: JapaneseWithGentium;
2796 src: local(MSMincho);
2797 /* no range specified, defaults to entire range */
2798 }
2800 @font-face {
2801 font-family: JapaneseWithGentium;
2802 src: url(../fonts/Gentium.ttf);
2803 unicode-range: U+0-2FF;
2804 }
2805 </pre>
2806 </div>
2808 <div class=example>
2809 <p>Consider a family constructed to optimize bandwidth by separating out
2810 Latin, Japanese and other characters into different font files:</p>
2812 <pre>
2813 /* fallback font - size: 4.5MB */
2814 @font-face {
2815 font-family: DroidSans;
2816 src: url(DroidSansFallback.ttf);
2817 /* no range specified, defaults to entire range */
2818 }
2820 /* Japanese glyphs - size: 1.2MB */
2821 @font-face {
2822 font-family: DroidSans;
2823 src: url(DroidSansJapanese.ttf);
2824 unicode-range: U+3000-9FFF, U+ff??;
2825 }
2827 /* Latin, Greek, Cyrillic along with some
2828 punctuation and symbols - size: 190KB */
2829 @font-face {
2830 font-family: DroidSans;
2831 src: url(DroidSans.ttf);
2832 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
2833 }
2834 </pre>
2836 <p>For simple Latin text, only the font for Latin characters is
2837 downloaded:</p>
2839 <pre>
2840 body { font-family: DroidSans; }
2842 <p>This is that</p>
2843 </pre>
2845 <p>In this case the user agent first checks the unicode-range for the font
2846 containing Latin characters (DroidSans.ttf). Since all the characters
2847 above are in the range U+0-5FF, the user agent downloads the font and
2848 renders the text with that font.</p>
2850 <p>Next, consider text that makes use of an arrow character (⇨):</p>
2852 <pre>
2853 <p>This &#x21e8; that<p>
2854 </pre>
2856 <p>The user agent again first checks the unicode-range of the font
2857 containing Latin characters. Since U+2000-2300 includes the arrow code
2858 point (U+21E8), the user agent downloads the font. For this character
2859 however the Latin font does not have a matching glyph, so the effective
2860 unicode-range used for font matching excludes this code point. Next, the
2861 user agent evaluates the Japanese font. The unicode-range for the
2862 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
2863 user agent does not download the Japanese font. Next the fallback font is
2864 considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
2865 rule for the fallback font does not define unicode-range so its value
2866 defaults to the range of all Unicode code points. The fallback font is
2867 downloaded and used to render the arrow character.</p>
2868 </div>
2870 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
2871 href="#descdef-font-variant">font-variant</a> and <a
2872 href="#descdef-font-feature-settings">font-feature-settings</a>
2873 descriptors</h3>
2875 <table class=descdef>
2876 <tbody>
2877 <tr>
2878 <td>Name:
2880 <td><dfn id=descdef-font-variant
2881 title="font-variant!!descriptor">font-variant</dfn>
2883 <tr>
2884 <td>Value:
2886 <td><a href="#font-variant-normal-value"
2887 title="normal!!font-variant">normal</a> | <a
2888 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
2889 <a href="#common-lig-values"><var><common-lig-values></var></a>
2890 || <a
2891 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
2892 || <a
2893 href="#historical-lig-values"><var><historical-lig-values></var></a>
2894 || <a
2895 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
2896 || <a href="#stylistic"><var
2897 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
2898 href="#historical-forms"><var>historical-forms</var></a> || <a
2899 href="#styleset"><var
2900 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
2901 href="#character-variant"><var
2902 title=character-variant>character-variant(<feature-value-name>
2903 #)</var></a> || <a href="#swash"><var
2904 title=swash>swash(<feature-value-name>)</var></a> || <a
2905 href="#ornaments"><var
2906 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
2907 href="#annotation"><var
2908 title=annotation>annotation(<feature-value-name>)</var></a> || [
2909 <a href="#small-caps"><i>small-caps</i></a> | <a
2910 href="#all-small-caps"><i>all-small-caps</i></a> | <a
2911 href="#petite-caps"><i>petite-caps</i></a> | <a
2912 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
2913 href="#unicase"><i>unicase</i></a> | <a
2914 href="#titling-caps"><i>titling-caps</i></a> ] || <a
2915 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
2916 || <a
2917 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
2918 || <a
2919 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
2920 || <a href="#ordinal"><i>ordinal</i></a> || <a
2921 href="#slashed-zero"><i>slashed-zero</i></a> || <a
2922 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
2923 || <a
2924 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
2925 || <a href="#ruby"><i>ruby</i></a> ]
2927 <tr>
2928 <td><em>Initial:</em>
2930 <td>normal
2931 </table>
2933 <table class=descdef>
2934 <tbody>
2935 <tr>
2936 <td>Name:
2938 <td><dfn id=descdef-font-feature-settings
2939 title="font-feature-settings!!descriptor">font-feature-settings</dfn>
2941 <tr>
2942 <td>Value:
2944 <td><a href="#font-feature-settings-normal-value"
2945 title="normal!!font-feature-settings">normal</a> | <a
2946 href="#feature-tag-value"><var><feature-tag-value></var></a> #
2948 <tr>
2949 <td><em>Initial:</em>
2951 <td>normal
2952 </table>
2954 <p>These descriptors define initial settings that apply when the font
2955 defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
2956 rule is rendered. They do not affect font selection. Values are identical
2957 to those defined for the corresponding <a href="#propdef-font-variant"
2958 title="font-variant!!property">‘<code
2959 class=property>font-variant</code>’</a> and <a
2960 href="#propdef-font-feature-settings"
2961 title="font-feature-settings!!property">‘<code
2962 class=property>font-feature-settings</code>’</a> properties defined
2963 below except that the value ‘<code class=property>inherit</code>’ is
2964 omitted. When multiple font feature descriptors or properties are used,
2965 the cumulative effect on text rendering is detailed in the section <a
2966 href="#font-feature-resolution">Font Feature Resolution</a> below. In
2967 cases where specific values define synthesized fallback for certain <a
2968 href="#propdef-font-variant" title="font-variant!!property">‘<code
2969 class=property>font-variant</code>’</a> subproperties, the same
2970 synthesized fallback applies when used within those values are used with
2971 the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
2972 class=property>font-variant</code>’</a> descriptor.
2974 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
2975 guidelines</h3>
2977 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
2978 designed to allow lazy loading of font resources that are only downloaded
2979 when used within a document. A stylesheet can include <a
2980 href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
2981 of fonts of which only a select set are used; user agents must only
2982 download those fonts that are referred to within the style rules
2983 applicable to a given page. User agents that download all fonts defined in
2984 <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
2985 considering whether those fonts are in fact used within a page are
2986 considered non-conformant. In cases where a font might be downloaded in
2987 character fallback cases, user agents may download a font if it's
2988 contained within the computed value of <a href="#propdef-font-family"
2989 title="font-family!!property">‘<code
2990 class=property>font-family</code>’</a> for a given text run.
2992 <pre>
2993 @font-face {
2994 font-family: GeometricModern;
2995 src: url(font.ttf);
2996 }
2998 p {
2999 /* font will be downloaded for pages with p elements */
3000 font-family: GeometricModern, sans-serif;
3001 }
3003 h2 {
3004 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
3005 font-family: Futura, GeometricModern, sans-serif;
3006 }
3007 </pre>
3009 <p>In cases where textual content is loaded before downloadable fonts are
3010 available, user agents may render text as it would be rendered if
3011 downloadable font resources are not available or they may render text
3012 transparently with fallback fonts to avoid a flash of text using a
3013 fallback font. In cases where the font download fails user agents must
3014 display text, simply leaving transparent text is considered non-conformant
3015 behavior. Authors are advised to use fallback fonts in their font lists
3016 that closely match the metrics of the downloadable fonts to avoid large
3017 page reflows where possible.
3019 <h3 id=same-origin-restriction><span class=secno>4.9 </span>Same-origin
3020 restriction for fonts</h3>
3022 <h4 id=default-same-origin-restriction><span class=secno>4.9.1
3023 </span>Default same-origin restriction</h4>
3024 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
3025 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
3026 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
3027 -->
3029 <p>User agents must implement a same-origin restriction when loading fonts
3030 via the <a href="#at-font-face-rule"><code>@font-face</code></a>
3031 mechanism. This restriction limits the loading of fonts for a given
3032 document to fonts loaded from the same origin. Fonts can only be loaded
3033 via the same host, port, and method combination as the containing
3034 document, using the <a
3035 href="http://www.w3.org/TR/html5/browsers.html#origin">origin matching
3036 algorithm</a> described in the <a href="#HTML5"
3037 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification. The origin of
3038 the stylesheet containing <a
3039 href="#at-font-face-rule"><code>@font-face</code></a> rules is not used
3040 when deciding whether a font is same origin or not, only the origin of the
3041 containing document is used. The restriction applies to all font types.
3043 <p>Given a document located at http://example.com/page.html, fonts defined
3044 with ‘<a href="#descdef-src"><code class=property>src</code></a>’
3045 definitions considered cross origin must not be loaded:
3047 <pre>
3048 /* same origin (i.e. domain, scheme, port match document) */
3049 src: url(fonts/simple.ttf);
3050 src: url(//fonts/simple.ttf);
3052 /* cross origin, different scheme */
3053 src: url(https://example.com/fonts/simple.ttf);
3055 /* cross origin, different domain */
3056 src: url(http://another.example.com/fonts/simple.ttf);
3057 </pre>
3059 <h4 id=allowing-cross-origin-font-loading><span class=secno>4.9.2
3060 </span>Allowing cross-origin font loading</h4>
3062 <p>User agents must also implement the ability to relax this restriction
3063 using cross-site origin controls <a href="#CORS"
3064 rel=biblioentry>[CORS]<!--{{!CORS}}--></a> for fonts loaded via HTTP.
3065 Sites can explicitly allow cross-site downloading of font data using the
3066 <code>Access-Control-Allow-Origin</code> HTTP header. For other schemes,
3067 no explicit relaxation mechanism is defined or required.
3069 <p>For font loads, user agents must use the <a
3070 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
3071 CORS-enabled fetch</a> method defined by the <a href="#HTML5"
3072 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification for URL's
3073 defined within @font-face rules. When fetching, user agents must use
3074 "Anonymous" mode, set the referrer source to the stylesheet's URL and set
3075 the origin to the URL of the containing document.
3077 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
3078 Algorithm</h2>
3080 <p>The algorithm below describes how fonts are associated with individual
3081 runs of text. For each character in the run a font family is chosen and a
3082 particular font face is selected containing a glyph for that character.
3084 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
3085 font family names</h3>
3087 <p>As part of the font matching algorithm outlined below, user agents must
3088 match font family names used in style rules with actual font family names
3089 contained in fonts available in a given environment or with font family
3090 names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
3091 rules. User agents must match these names case insensitively, using the
3092 "Default Caseless Matching" algorithm outlined in the Unicode
3093 specification <a href="#UNICODE6"
3094 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
3095 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
3096 the algorithm must be applied without normalizing the strings involved and
3097 without applying any language-specific tailorings. The case folding method
3098 specified by this algorithm uses the case mappings with status field
3099 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
3100 in the CaseFolding.txt file of the Unicode Character Database.
3102 <p class=note> For authors this means that font family names are matched
3103 case insensitively, whether those names exist in a platform font or in the
3104 <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
3105 in a stylesheet. Authors should take care to ensure that names use a
3106 character sequence consistent with the actual font family name,
3107 particularly when using combining characters such as diacritical marks.
3108 For example, a family name that contains an uppercase A (U+0041) followed
3109 by a combining ring (U+030A) will <strong>not</strong> match a name that
3110 looks identical but which uses the precomposed lowercase a-ring character
3111 (U+00E5) instead of the combining sequence.
3113 <p class=note> Implementors should take care to verify that a given
3114 caseless string comparison implementation uses this precise algorithm and
3115 not assume that a given platform string matching routine follows it, as
3116 many of these have locale-specific behavior or use some level of string
3117 normalization.
3119 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
3120 styles</h3>
3122 <p>The procedure for choosing a font for a given character in a run of text
3123 consists of iterating over the font families named by the <a
3124 href="#propdef-font-family" title="font-family!!property">‘<code
3125 class=property>font-family</code>’</a> property, selecting a font face
3126 with the appropriate style based on other font properties and then
3127 determining whether a glyph exists for the given character. This is done
3128 using the <dfn id=character-map>character map</dfn> of the font, data
3129 which maps characters to the default glyph for that character. A font is
3130 considered to <dfn id=support>support</dfn> a given character if (1) the
3131 character is contained in the font's <a
3132 href="#character-map"><em>character map</em></a> and (2) if required by
3133 the containing script, shaping information is available for that
3134 character.
3136 <p>Some legacy fonts may include a given character in the <a
3137 href="#character-map"><em>character map</em></a> but lack the shaping
3138 information (e.g. <a
3139 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
3140 layout tables</a> or <a
3141 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_techAbout">Graphite
3142 tables</a>) necessary for correctly rendering text runs containing that
3143 character.
3145 <p>Codepoint sequences consisting of a base character followed by a
3146 sequence of combining characters are treated slightly differently, see the
3147 section on <a href="#cluster-matching">cluster matching</a> below.
3149 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
3150 given font family is defined to be the face that would be selected if all
3151 font style properties were set to their initial value.
3153 <ol id=fontmatchingalg>
3154 <li>Using the computed font property values for a given element, the user
3155 agent starts with the first family name specified by the <a
3156 href="#propdef-font-family" title="font-family!!property">‘<code
3157 class=property>font-family</code>’</a> property.
3159 <li>If the family name is a generic family keyword, the user agent looks
3160 up the appropriate font family name to be used. User agents may choose
3161 the generic font family to use based on the language of the containing
3162 element or the Unicode range of the character.
3164 <li>For other family names, the user agent attempts to find the family
3165 name among fonts defined via <a
3166 href="#at-font-face-rule"><code>@font-face</code></a> rules and then
3167 among available system fonts, matching names with a <a
3168 href="#font-family-casing">case-insensitive comparison</a> as outlined in
3169 the section above. On systems containing fonts with multiple localized
3170 font family names, user agents must match any of these names independent
3171 of the underlying system locale or platform API used. If the font
3172 resources defined for a given face in an <a
3173 href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
3174 available or contain invalid font data, then the face should be treated
3175 as not present in the family. If no faces are present for a family
3176 defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
3177 rules, the family should be treated as missing; matching a platform font
3178 with the same name must not occur in this case.
3180 <li>If a font family match occurs, the user agent assembles the set of
3181 font faces in that family and then narrows the set to a single face using
3182 other font properties in the order given below. A group of faces defined
3183 via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
3184 identical font descriptor values but differing ‘<a
3185 href="#descdef-unicode-range"><code
3186 class=property>unicode-range</code></a>’ values are considered to be a
3187 single <dfn id=composite-face>composite face</dfn> for this step:
3188 <ol id=fontstylematchingalg>
3189 <li><a href="#propdef-font-stretch"
3190 title="font-stretch!!property">‘<code
3191 class=property>font-stretch</code>’</a> is tried first. If the
3192 matching set contains faces with width values matching the <a
3193 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
3194 class=property>font-stretch</code>’</a> value, faces with other width
3195 values are removed from the matching set. If there is no face that
3196 exactly matches the width value the nearest width is used instead. If
3197 the value of <a href="#propdef-font-stretch"
3198 title="font-stretch!!property">‘<code
3199 class=property>font-stretch</code>’</a> is <a
3200 href="#font-stretch-normal-value" title="normal!!font-stretch">‘<code
3201 class=property>normal</code>’</a> or one of the condensed values,
3202 narrower width values are checked first, then wider values. If the
3203 value of <a href="#propdef-font-stretch"
3204 title="font-stretch!!property">‘<code
3205 class=property>font-stretch</code>’</a> is one of the expanded
3206 values, wider values are checked first, followed by narrower values.
3207 Once the closest matching width has been determined by this process,
3208 faces with other widths are removed from the matching set.
3210 <li><a href="#propdef-font-style" title="font-style!!property">‘<code
3211 class=property>font-style</code>’</a> is tried next. If the value of
3212 <a href="#propdef-font-style" title="font-style!!property">‘<code
3213 class=property>font-style</code>’</a> is ‘<a href="#italic"><code
3214 class=property>italic</code></a>’, italic faces are checked first,
3215 then oblique, then normal faces. If the value is ‘<a
3216 href="#oblique"><code class=property>oblique</code></a>’, oblique
3217 faces are checked first, then italic faces and then normal faces. If
3218 the value is <a href="#font-style-normal-value"
3219 title="normal!!font-style">‘<code
3220 class=property>normal</code>’</a>, normal faces are checked first,
3221 then oblique faces, then italic faces. Faces with other style values
3222 are excluded from the matching set. User agents are permitted to
3223 distinguish between italic and oblique faces within platform font
3224 families but this is not required, so all italic or oblique faces may
3225 be treated as italic faces. However, within font families defined via
3226 <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
3227 and oblique faces must be distinguished using the value of the <a
3228 href="#descdef-font-style" title="font-style!!descriptor">‘<code
3229 class=property>font-style</code>’</a> descriptor. For families that
3230 lack any italic or oblique faces, users agents may create artificial
3231 oblique faces, if this is permitted by the value of the ‘<a
3232 href="#propdef-font-synthesis"><code
3233 class=property>font-synthesis</code></a>’ property.
3235 <li><a href="#propdef-font-weight"
3236 title="font-weight!!property">‘<code
3237 class=property>font-weight</code>’</a> is matched next, so it will
3238 always reduce the matching set to a single font face. If bolder/lighter
3239 relative weights are used, the effective weight is calculated based on
3240 the inherited weight value, as described in the definition of the <a
3241 href="#propdef-font-weight" title="font-weight!!property">‘<code
3242 class=property>font-weight</code>’</a> property. Given the desired
3243 weight and the weights of faces in the matching set after the steps
3244 above, if the desired weight is available that face matches. Otherwise,
3245 a weight is chosen using the rules below:
3246 <ul>
3247 <li>If the desired weight is less than 400, weights below the desired
3248 weight are checked in descending order followed by weights above the
3249 desired weight in ascending order until a match is found.
3251 <li>If the desired weight is greater than 500, weights above the
3252 desired weight are checked in ascending order followed by weights
3253 below the desired weight in descending order until a match is found.
3255 <li>If the desired weight is 400, 500 is checked first and then the
3256 rule for desired weights less than 400 is used.
3258 <li>If the desired weight is 500, 400 is checked first and then the
3259 rule for desired weights less than 400 is used.
3260 </ul>
3262 <li><span class=property>‘<a href="#propdef-font-size"><code
3263 class=property>font-size</code></a>’</span> must be matched within a
3264 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
3265 are rounded to the nearest whole pixel, while the tolerance for
3266 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
3267 by ‘<code class=property>em</code>’ values in other properties, are
3268 based on the <span class=property>‘<a href="#propdef-font-size"><code
3269 class=property>font-size</code></a>’</span> value that is used, not
3270 the one that is specified.
3271 </ol>
3273 <li>
3274 <p>If the matched face is defined via <a
3275 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
3276 must use the procedure below to select a single font:
3278 <ol>
3279 <li>If the font resource has not been loaded and the range of characters
3280 defined by the ‘<a href="#descdef-unicode-range"><code
3281 class=property>unicode-range</code></a>’ descriptor value includes
3282 the character in question, load the font.
3284 <li>After downloading, if the <a
3285 href="#effective-character-map"><em>effective character map</em></a>
3286 supports the character in question, select that font.
3287 </ol>
3289 <p>When the matched face is a <a href="#composite-face"><em>composite
3290 face</em></a>, user agents must use the procedure above on each of the
3291 faces in the <a href="#composite-face"><em>composite face</em></a> in
3292 reverse order of <a
3293 href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
3295 <p>While the download occurs, user agents may either wait until the font
3296 is downloaded or render once with substituted font metrics and render
3297 again once the font is downloaded.</p>
3299 <li>
3300 <p>If no matching face exists or the matched face does not contain a
3301 glyph for the character to be rendered, the next family name is selected
3302 and the previous three steps repeated. Glyphs from other faces in the
3303 family are not considered. The only exception is that user agents may
3304 optionally substitute a synthetically obliqued version of the <a
3305 href="#default-face"><em>default face</em></a> if that face supports a
3306 given glyph and synthesis of these faces is permitted by the value of
3307 the ‘<a href="#propdef-font-synthesis"><code
3308 class=property>font-synthesis</code></a>’ property. For example, a
3309 synthetic italic version of the regular face may be used if the italic
3310 face doesn't support glyphs for Arabic.</p>
3311 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
3314 <li>If there are no more font families to be evaluated and no matching
3315 face has been found, then the user agent performs a <dfn
3316 id=system-font-fallback>system font fallback</dfn> procedure to find the
3317 best match for the character to be rendered. The result of this procedure
3318 may vary across user agents.
3320 <li>If a particular character cannot be displayed using any font, the user
3321 agent should indicate by some means that a character is not being
3322 displayed, displaying either a symbolic representation of the missing
3323 glyph (e.g. using a <a
3324 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
3325 Font</a>) or using the missing character glyph from a default font.
3326 </ol>
3328 <p>Optimizations of this process are allowed provided that an
3329 implementation behaves as if the algorithm had been followed exactly.
3330 Matching occurs in a well-defined order to insure that the results are as
3331 consistent as possible across user agents, given an identical set of
3332 available fonts and rendering technology.
3334 <p>The <dfn id=first-available-font>first available font</dfn>, used in the
3335 definition of <a
3336 href="http://www.w3.org/TR/css3-values/#font-relative-lengths"><em>font-relative
3337 lengths</em></a> such as ‘<code class=property>ex</code>’ and ‘<code
3338 class=property>ch</code>’, is defined to be the first available font
3339 that would match any character given font families in the ‘<code
3340 class=property>font-family</code>’ list (or a user agent's default font
3341 if none are available).
3343 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
3345 <p>When text contains characters such as combining marks, ideally the base
3346 character should be rendered using the same font as the mark, this assures
3347 proper placement of the mark. For this reason, the font matching algorithm
3348 for clusters is more specialized than the general case of matching a
3349 single character by itself. For sequences containing variation selectors,
3350 which indicate the precise glyph to be used for a given character, user
3351 agents always attempt <a href="#system-font-fallback"><em>system font
3352 fallback</em></a> to find the appropriate glyph before using the default
3353 glyph of the base character.
3355 <p>A sequence of codepoints containing combining mark or other modifiers is
3356 termed a grapheme cluster (see <a href="#CSS3TEXT"
3357 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
3358 description). For a given cluster containing a base character, <em>b</em>
3359 and a sequence of combining characters <em>c1, c2…</em>, the entire
3360 cluster is matched using these steps:
3362 <ol>
3363 <li>For each family in the font list, a face is chosen using the style
3364 selection rules defined in the previous section.
3365 <ol>
3366 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
3367 completely supported by the font, select this font for the sequence.
3369 <li>If a sequence of multiple codepoints is canonically equivalent to a
3370 single character and the font <a href="#support"><em
3371 title=support>supports</em></a> that character, select this font for
3372 the sequence.
3373 </ol>
3375 <li>If no font was found in the font list in step 1:
3376 <ol>
3377 <li>If <em>c1</em> is a variation selector, system fallback must be used
3378 to find a font that <a href="#support"><em
3379 title=support>supports</em></a> the full sequence of <em>b + c1</em>.
3380 If no font on the system <a href="#support"><em
3381 title=support>supports</em></a> the full sequence, match the single
3382 character <em>b</em> using the normal procedure for matching single
3383 characters and ignore the variation selector. Note: a sequence with
3384 more than one variation selector must be treated as an encoding error
3385 and the trailing selectors must be ignored. <a href="#UNICODE6"
3386 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>
3388 <li>Otherwise, the user agent may optionally use system font fallback to
3389 match a font that <a href="#support"><em
3390 title=support>supports</em></a> the entire cluster.
3391 </ol>
3393 <li>If no font is found in step 2, use the matching sequence from step 1
3394 to determine the longest sequence that is completely <a
3395 href="#support"><em title=support>supported</em></a> by a font in the
3396 font list and attempt to match the remaining combining characters
3397 separately using the rules for single characters.
3398 </ol>
3400 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
3401 issues</h3>
3403 <p>CSS font matching is always performed on text runs containing Unicode
3404 characters, so documents using legacy encodings are assumed to have been
3405 transcoded before matching fonts. For fonts containing <a
3406 href="#character-map"><em title="character map">character maps</em></a>
3407 for both legacy encodings and Unicode, the contents of the legacy encoding
3408 <a href="#character-map"><em>character map</em></a> must have no effect on
3409 the results of the font matching process.
3411 <p>The font matching process does not assume that text runs are in either
3412 normalized or denormalized form (see <a href="#CHARMOD-NORM"
3413 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
3414 details). Fonts may only support precomposed forms and not the decomposed
3415 sequence of base character plus combining marks. Authors should always
3416 tailor their choice of fonts to their content, including whether that
3417 content contains normalized or denormalized character streams.
3419 <p>If a given character is a Private-Use Area Unicode codepoint, user
3420 agents must only match font families named in the ‘<code
3421 class=property>font-family</code>’ list that are not generic families.
3422 If none of the families named in the ‘<code
3423 class=property>font-family</code>’ list contain a glyph for that
3424 codepoint, user agents must display some form of missing glyph symbol for
3425 that character rather than attempting <a
3426 href="#system-font-fallback"><em>system font fallback</em></a> for that
3427 codepoint. When matching the replacement character U+FFFD, user agents may
3428 skip the font matching process and immediately display some form of
3429 missing glyph symbol, they are not required to display the glyph from the
3430 font that would be selected by the font matching process.
3432 <p>In general, the fonts for a given family will all have the same or
3433 similar <a href="#character-map"><em title="character map">character
3434 maps</em></a>. The process outlined here is designed to handle even font
3435 families containing faces with widely variant <a href="#character-map"><em
3436 title="character map">character maps</em></a>. However, authors are
3437 cautioned that the use of such families can lead to unexpected results.
3439 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
3440 changes since CSS 2.1</h3>
3442 <p>The algorithm above is different from CSS 2.1 in a number of key places.
3443 These changes were made to better reflect actual font matching behavior
3444 across user agent implementations.
3446 <p>Differences compared to the font matching algorithm in CSS 2.1:
3448 <ul>
3449 <li>The algorithm includes font-stretch matching.
3451 <li>All possible font-style matching scenarios are delineated.
3453 <li>Small-caps fonts are not matched as part of the font matching process,
3454 they are now handled via font features.
3456 <li>Unicode variation selector matching is required.
3458 <li>Cluster sequences are matched as a unit.
3459 </ul>
3461 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
3462 examples</h3>
3464 <div class=example>
3465 <p>It's useful to note that the CSS selector syntax may be used to create
3466 language-sensitive typography. For example, some Chinese and Japanese
3467 characters are unified to have the same Unicode code point, although the
3468 abstract glyphs are not the same in the two languages.
3470 <pre>*:lang(ja-jp) { font: 900 14pt/16pt "Heisei Mincho W9", serif; }
3471 *:lang(zh-tw) { font: 800 14pt/16.5pt "Li Sung", serif; }
3472 </pre>
3474 <p>This selects any element that has the given language — Japanese or
3475 Traditional Chinese — and uses the appropriate font.
3476 </div>
3478 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
3480 <p>Modern font technologies support a variety of advanced typographic and
3481 language-specific font features. Using these features, a single font can
3482 provide glyphs for a wide range of ligatures, contextual and stylistic
3483 alternates, tabular and old-style figures, small capitals, automatic
3484 fractions, swashes, and alternates specific to a given language. To allow
3485 authors control over these font capabilities, the ‘<code
3486 class=property>font-variant</code>’ property has been expanded for CSS3.
3487 It now functions as a shorthand for a set of properties that provide
3488 control over stylistic font features.
3490 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
3491 selection and positioning</h3>
3493 <p>Simple fonts used for displaying Latin text use a very basic processing
3494 model. Fonts contain a <a href="#character-map"><em>character map</em></a>
3495 which maps each character to a glyph for that character. Glyphs for
3496 subsequent characters are simply placed one after the other along a run of
3497 text. Modern font formats such as OpenType and AAT (Apple Advanced
3498 Typography) use a richer processing model. The glyph for a given character
3499 can be chosen and positioned not just based on the codepoint of the
3500 character itself, but also on adjacent characters as well as the language,
3501 script, and features enabled for the text. Font features may be required
3502 for specific scripts, or recommended as enabled by default or they might
3503 be stylistic features meant to be used under author control.
3505 <p>For a good visual overview of these features, see the <a
3506 href="#OPENTYPE-FONT-GUIDE"
3507 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
3508 For a detailed description of glyph processing for OpenType fonts, see <a
3509 href="#WINDOWS-GLYPH-PROC"
3510 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
3512 <p>Stylistic font features can be classified into two broad categories:
3513 ones that affect the harmonization of glyph shapes with the surrounding
3514 context, such as kerning and ligature features, and ones such as the
3515 small-caps, subscript/superscript and alternate features that affect shape
3516 selection.
3518 <p>The subproperties of <a href="#propdef-font-variant"
3519 title="font-variant!!property">‘<code
3520 class=property>font-variant</code>’</a> listed below are used to control
3521 these stylistic font features. They do not control features that are
3522 required for displaying certain scripts, such as the OpenType features
3523 used when displaying Arabic or Indic language text. They affect glyph
3524 selection and positioning, but do not affect font selection as described
3525 in the font matching section (except in cases required for compatibility
3526 with CSS 2.1).
3528 <p>To assure consistent behavior across user agents, the equivalent
3529 OpenType property settings are listed for individual properties and are
3530 normative. When using other font formats these should be used as a
3531 guideline to map CSS font feature property values to specific font
3532 features.
3534 <h3 id=language-specific-support><span class=secno>6.2
3535 </span>Language-specific display</h3>
3537 <p>OpenType also supports language-specific glyph selection and
3538 positioning, so that text can be displayed correctly in cases where the
3539 language dictates a specific display behavior. Many languages share a
3540 common script, but the shape of certain letters can vary across those
3541 languages. For example, certain Cyrillic letters have different shapes in
3542 Russian text than in Bulgarian. In Latin text, it's common to render "fi"
3543 with an explicit fi-ligature that lacks a dot on the "i". However, in
3544 languages such as Turkish which uses both a dotted-i and a dotless-i, it's
3545 important to not use this ligature or use a specialized version that
3546 contains a dot over the "i". The example below shows language-specific
3547 variations based on stylistic traditions found in Spanish, Italian and
3548 French orthography:
3550 <div class=featex><img alt="language specific forms, spanish"
3551 src=locl-1.png></div>
3553 <div class=featex><img alt="language specific forms, italian"
3554 src=locl-2.png></div>
3556 <div class=featex><img alt="language specific forms, french"
3557 src=locl-3.png></div>
3559 <p>If the content language of the element is known according to the rules
3560 of the <a
3561 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
3562 language</a>, user agents are required to infer the OpenType language
3563 system from the content language and use that when selecting and
3564 positioning glyphs using an OpenType font.
3566 <p>For OpenType fonts, in some cases it may be necessary to explicitly
3567 declare the OpenType language to be used, for example when displaying text
3568 in a given language that uses the typographic conventions of another
3569 language or when the font does not explicitly support a given language but
3570 supports a language that shares common typographic conventions. The ‘<a
3571 href="#propdef-font-language-override"><code
3572 class=property>font-language-override</code></a>’ property is used for
3573 this purpose.</p>
3574 <!-- prop: font-kerning -->
3576 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
3577 href="#propdef-font-kerning">font-kerning</a> property</h3>
3579 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
3580 <tbody>
3581 <tr>
3582 <td>Name:
3584 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
3586 <tr>
3587 <td>Value:
3589 <td><a href="#font-kerning-auto-value"
3590 title="auto!!font-kerning">auto</a> | <a
3591 href="#font-kerning-normal-value"
3592 title="normal!!font-kerning">normal</a> | <a
3593 href="#font-kerning-none-value" title="none!!font-kerning">none</a>
3595 <tr>
3596 <td>Initial:
3598 <td>auto
3600 <tr>
3601 <td>Applies to:
3603 <td>all elements
3605 <tr>
3606 <td>Inherited:
3608 <td>yes
3610 <tr>
3611 <td>Percentages:
3613 <td>N/A
3615 <tr>
3616 <td>Media:
3618 <td>visual
3620 <tr>
3621 <td>Computed value:
3623 <td>as specified
3625 <tr>
3626 <td>Animatable:
3628 <td>no
3629 </table>
3631 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
3632 property controls metric kerning, kerning that utilizes adjustment data
3633 contained in the font.
3635 <dl>
3636 <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
3638 <dd>Specifies that kerning is applied at the discretion of the user agent
3640 <dt><dfn id=font-kerning-normal-value
3641 title="normal!!font-kerning">normal</dfn>
3643 <dd>Specifies that kerning is applied
3645 <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
3647 <dd>Specifies that kerning is not applied
3648 </dl>
3650 <p>For fonts that do not include kerning data this property will have no
3651 visible effect. When rendering with OpenType fonts, the <a
3652 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
3653 specification suggests that kerning be enabled by default. When kerning is
3654 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
3655 vertical text runs the <span class=tag>vkrn</span> feature is enabled
3656 instead). User agents must also support fonts that only support kerning
3657 via data contained in a <span class=tag>kern</span> font table, as
3658 detailed in the OpenType specification. If the ‘<code
3659 class=property>letter-spacing</code>’ property is defined, kerning
3660 adjustments are considered part of the default spacing and letter spacing
3661 adjustments are made after kerning has been applied.
3663 <p>When set to ‘<code class=property>auto</code>’, user agents can
3664 determine whether to apply kerning or not based on a number of factors:
3665 text size, script, or other factors that influence text processing speed.
3666 Authors who want proper kerning should use <a
3667 href="#font-kerning-normal-value" title="normal!!font-kerning">‘<code
3668 class=property>normal</code>’</a> to explicitly enable kerning.
3669 Likewise, some authors may prefer to disable kerning in situations where
3670 performance is more important than precise appearance. However, in
3671 well-designed modern implementations the use of kerning generally does not
3672 have a large impact on text rendering speed.</p>
3673 <!-- prop: font-variant-ligatures -->
3675 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
3676 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
3677 property</h3>
3679 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
3680 <tbody>
3681 <tr>
3682 <td>Name:
3684 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
3686 <tr>
3687 <td>Value:
3689 <td><a href="#font-variant-ligatures-normal-value"
3690 title="normal!!font-variant-ligatures">normal</a> | <a
3691 href="#font-variant-ligatures-none-value"
3692 title="none!!font-variant-ligatures">none</a> | [ <a
3693 href="#common-lig-values"><var><common-lig-values></var></a> ||
3694 <a
3695 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
3696 || <a
3697 href="#historical-lig-values"><var><historical-lig-values></var></a>
3698 || <a
3699 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
3700 ]
3702 <tr>
3703 <td>Initial:
3705 <td>normal
3707 <tr>
3708 <td>Applies to:
3710 <td>all elements
3712 <tr>
3713 <td>Inherited:
3715 <td>yes
3717 <tr>
3718 <td>Percentages:
3720 <td>N/A
3722 <tr>
3723 <td>Media:
3725 <td>visual
3727 <tr>
3728 <td>Computed value:
3730 <td>as specified
3732 <tr>
3733 <td>Animatable:
3735 <td>no
3736 </table>
3738 <p>Ligatures and contextual forms are ways of combining glyphs to produce
3739 more harmonized forms.
3741 <pre
3742 class=prod><dfn id=common-lig-values><var><common-lig-values></var></dfn> = [ <a href="#common-ligatures">common-ligatures</a> | <a href="#no-common-ligatures">no-common-ligatures</a> ]</pre>
3744 <pre
3745 class=prod><dfn id=discretionary-lig-values><var><discretionary-lig-values></var></dfn> = [ <a href="#discretionary-ligatures">discretionary-ligatures</a> | <a href="#no-discretionary-ligatures">no-discretionary-ligatures</a> ]</pre>
3747 <pre
3748 class=prod><dfn id=historical-lig-values><var><historical-lig-values></var></dfn> = [ <a href="#historical-ligatures">historical-ligatures</a> | <a href="#no-historical-ligatures">no-historical-ligatures</a> ]</pre>
3750 <pre
3751 class=prod><dfn id=contextual-alt-values><var><contextual-alt-values></var></dfn> = [ <a href="#contextual">contextual</a> | <a href="#no-contextual">no-contextual</a> ]</pre>
3753 <p>Individual values have the following meanings:
3755 <dl>
3756 <dt><dfn id=font-variant-ligatures-normal-value
3757 title="normal!!font-variant-ligatures">normal</dfn>
3759 <dd>A value of <a href="#font-variant-ligatures-normal-value"
3760 title="normal!!font-variant-ligatures">‘<code
3761 class=property>normal</code>’</a> specifies that common default
3762 features are enabled, <a href="#font-feature-resolution">as described in
3763 detail in the next section</a>. For OpenType fonts, common ligatures and
3764 contextual forms are on by default, discretionary and historical
3765 ligatures are not.
3767 <dt><dfn id=font-variant-ligatures-none-value
3768 title="none!!font-variant-ligatures">none</dfn>
3770 <dd>Specifies that all types of ligatures and contextual forms covered by
3771 this property are explicitly disabled. In situations where ligatures are
3772 not considered necessary, this may improve the speed of text rendering.
3774 <dt><dfn id=common-ligatures>common-ligatures</dfn>
3776 <dd>Enables display of common ligatures (OpenType features: <span
3777 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
3778 enabled by default.
3779 </dl>
3781 <div class=featex><img alt="common ligature example" src=liga.png></div>
3783 <dl>
3784 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
3786 <dd>Disables display of common ligatures (OpenType features: <span
3787 class=tag>liga, clig</span>).
3789 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
3791 <dd>Enables display of discretionary ligatures (OpenType feature: <span
3792 class=tag>dlig</span>). Which ligatures are discretionary or optional is
3793 decided by the type designer, so authors will need to refer to the
3794 documentation of a given font to understand which ligatures are
3795 considered discretionary.
3796 </dl>
3798 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
3800 <dl>
3801 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
3803 <dd>Disables display of discretionary ligatures (OpenType feature: <span
3804 class=tag>dlig</span>).
3806 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
3808 <dd>Enables display of historical ligatures (OpenType feature: <span
3809 class=tag>hlig</span>).
3810 </dl>
3812 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
3814 <dl>
3815 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
3817 <dd>Disables display of historical ligatures (OpenType feature: <span
3818 class=tag>hlig</span>).
3820 <dt><dfn id=contextual>contextual</dfn>
3822 <dd>Enables display of contextual alternates (OpenType feature: <span
3823 class=tag>calt</span>). Although not strictly a ligature feature, like
3824 ligatures this feature is commonly used to harmonize the shapes of glyphs
3825 with the surrounding context. For OpenType fonts, this feature is on by
3826 default.
3827 </dl>
3829 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
3831 <dl>
3832 <dt><dfn id=no-contextual>no-contextual</dfn>
3834 <dd>Disables display of contextual alternates (OpenType feature: <span
3835 class=tag>calt</span>).
3836 </dl>
3838 <p>Required ligatures, needed for correctly rendering complex scripts, are
3839 not affected by the settings above, including ‘<code
3840 class=property>none</code>’ (OpenType feature: <span
3841 class=tag>rlig</span>).</p>
3842 <!-- prop: font-variant-position -->
3844 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
3845 and superscript forms: the <a
3846 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
3848 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
3849 <tbody>
3850 <tr>
3851 <td>Name:
3853 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
3855 <tr>
3856 <td>Value:
3858 <td><a href="#font-variant-position-normal-value"
3859 title="normal!!font-variant-position">normal</a> | <a
3860 href="#sub">sub</a> | <a href="#super">super</a>
3862 <tr>
3863 <td>Initial:
3865 <td>normal
3867 <tr>
3868 <td>Applies to:
3870 <td>all elements
3872 <tr>
3873 <td>Inherited:
3875 <td>yes
3877 <tr>
3878 <td>Percentages:
3880 <td>N/A
3882 <tr>
3883 <td>Media:
3885 <td>visual
3887 <tr>
3888 <td>Computed value:
3890 <td>as specified
3892 <tr>
3893 <td>Animatable:
3895 <td>no
3896 </table>
3898 <p>This property is used to enable typographic subscript and superscript
3899 glyphs. These are alternate glyphs designed within the same em-box as
3900 default glyphs and are intended to be laid out on the same baseline as the
3901 default glyphs, with no resizing or repositioning of the baseline. They
3902 are explicitly designed to match the surrounding text and to be more
3903 readable without affecting the line height.
3905 <div class=figure><img alt="comparison between real subscript glyphs and
3906 synthesized ones" src=realsubscripts.png>
3907 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
3908 (bottom)
3909 </div>
3911 <p>Individual values have the following meanings:
3913 <dl>
3914 <dt><dfn id=font-variant-position-normal-value
3915 title="normal!!font-variant-position">normal</dfn>
3917 <dd>None of the features listed below are enabled.
3919 <dt><dfn id=sub>sub</dfn>
3921 <dd>Enables display of subscript variants (OpenType feature: <span
3922 class=tag>subs</span>).
3924 <dt><dfn id=super>super</dfn>
3926 <dd>Enables display of superscript variants (OpenType feature: <span
3927 class=tag>sups</span>).
3928 </dl>
3930 <p>Because of the semantic nature of subscripts and superscripts, when the
3931 value is either ‘<a href="#sub"><code class=property>sub</code></a>’
3932 or ‘<a href="#super"><code class=property>super</code></a>’ for a
3933 given contiguous run of text, if a variant glyph is not available for all
3934 the characters in the run, simulated glyphs must be synthesized for all
3935 characters using reduced forms of the glyphs that would be used without
3936 this feature applied. This is done per run to avoid a mixture of variant
3937 glyphs and synthesized ones that would not align correctly. In the case of
3938 OpenType fonts that lack subscript or superscript glyphs for a given
3939 character, user agents must use the appropriate subscript and superscript
3940 metrics specified in the selected font's <a
3941 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
3942 table</a> <a href="#OPENTYPE"
3943 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
3944 and offset of the synthesized substitutes.
3946 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
3947 using superscript metrics" src=superscript-alt-synth.png>
3948 <p class=caption>Superscript alternate glyph (left), synthesized
3949 superscript glyphs (middle), and incorrect mixture of the two (right)
3950 </div>
3952 <p>In situations where text decorations are only applied to runs of text
3953 containing superscript or subscript glyphs, the synthesized glyphs must be
3954 used to avoid problems with the placement of decorations.
3956 <p>In the past, user agents have used font-size and vertical-align to
3957 simulate subscripts and superscripts for the <code title="HTML sub
3958 element">sub</code> and <code title="HTML sup element">sup</code>
3959 elements. To allow a backwards compatible way of defining subscripts and
3960 superscripts, it is recommended that authors use conditional rules <a
3961 href="#CSS3-CONDITIONAL"
3962 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
3963 older user agents will still render subscripts and superscripts via the
3964 older mechanism.
3966 <p>Authors should note that fonts typically only provide subscript and
3967 superscript glyphs for a subset of all characters supported by the font.
3968 For example, while subscript and superscript glyphs are often available
3969 for Latin numbers, glyphs for punctuation and letter characters are less
3970 frequently provided. The synthetic fallback rules defined for this
3971 property assure that subscripts and superscripts will always appear but
3972 the appearance may not match author expectations if the font used does not
3973 provide the appropriate alternate glyph for all characters contained in a
3974 subscript or superscript.
3976 <p>This property is not cumulative. Applying it to elements within a
3977 subscript or superscript won't nest the placement of a subscript or
3978 superscript glyph. Images contained within text runs where the value of
3979 this property is ‘<a href="#sub"><code class=property>sub</code></a>’
3980 or ‘<a href="#super"><code class=property>super</code></a>’ will be
3981 drawn just as they would if the value was <a
3982 href="#font-variant-position-normal-value"
3983 title="normal!!font-variant-position">‘<code
3984 class=property>normal</code>’</a>.</p>
3985 <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
3986 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
3988 <p>Because of these limitations, ‘<a
3989 href="#propdef-font-variant-position"><code
3990 class=property>font-variant-position</code></a>’ is not recommended for
3991 use in user agent stylesheets. Authors should use it in cases where
3992 subscripts or superscripts will only contain the narrow range of
3993 characters supported by the fonts specified.
3995 <p class=note>The variant glyphs use the same baseline as the default
3996 glyphs would use. There is no shift in the placement along the baseline,
3997 so the use of variant glyphs doesn't affect the height of the inline box
3998 or alter the height of the linebox. This makes superscript and subscript
3999 variants ideal for situations where it's important that leading remain
4000 constant, such as in multi-column layout.
4002 <div class=example>
4003 <p>A typical user agent default style for the <a class=tag
4004 href="#sub">sub</a> element:</p>
4006 <pre>sub {
4007 vertical-align: sub;
4008 font-size: smaller;
4009 line-height: normal;
4010 }
4011 </pre>
4013 <p>Using font-variant-position to specify typographic subscripts in a way
4014 that will still show subscripts in older user agents:</p>
4016 <pre>@supports ( font-variant-position: sub ) {
4018 sub {
4019 vertical-align: baseline;
4020 font-size: 100%;
4021 line-height: inherit;
4022 font-variant-position: sub;
4023 }
4025 }
4026 </pre>
4028 <p>User agents that support the ‘<a
4029 href="#propdef-font-variant-position"><code
4030 class=property>font-variant-position</code></a>’ property will select a
4031 subscript variant glyph and render this without adjusting the baseline or
4032 font-size. Older user agents will ignore the ‘<a
4033 href="#propdef-font-variant-position"><code
4034 class=property>font-variant-position</code></a>’ property definition
4035 and use the standard defaults for subscripts.</p>
4036 </div>
4037 <!-- prop: font-variant-caps -->
4039 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
4040 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
4042 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
4043 <tbody>
4044 <tr>
4045 <td>Name:
4047 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
4049 <tr>
4050 <td>Value:
4052 <td><a href="#font-variant-caps-normal-value"
4053 title="normal!!font-variant-caps">normal</a> | <a
4054 href="#small-caps">small-caps</a> | <a
4055 href="#all-small-caps">all-small-caps</a> | <a
4056 href="#petite-caps">petite-caps</a> | <a
4057 href="#all-petite-caps">all-petite-caps</a> | <a
4058 href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
4060 <tr>
4061 <td>Initial:
4063 <td>normal
4065 <tr>
4066 <td>Applies to:
4068 <td>all elements
4070 <tr>
4071 <td>Inherited:
4073 <td>yes
4075 <tr>
4076 <td>Percentages:
4078 <td>N/A
4080 <tr>
4081 <td>Media:
4083 <td>visual
4085 <tr>
4086 <td>Computed value:
4088 <td>as specified
4090 <tr>
4091 <td>Animatable:
4093 <td>no
4094 </table>
4096 <p>This property allows the selection of alternate glyphs used for small or
4097 petite capitals or for titling. These glyphs are specifically designed to
4098 blend well with the surrounding normal glyphs, to maintain the weight and
4099 readability which suffers when text is simply resized to fit this purpose.
4101 <p>Individual values have the following meanings:
4103 <dl>
4104 <dt><dfn id=font-variant-caps-normal-value
4105 title="normal!!font-variant-caps">normal</dfn>
4107 <dd>None of the features listed below are enabled.
4109 <dt><dfn id=small-caps>small-caps</dfn>
4111 <dd>Enables display of small capitals (OpenType feature: <span
4112 class=tag>smcp</span>). Small-caps glyphs typically use the form of
4113 uppercase letters but are reduced to the size of lowercase letters.
4114 </dl>
4116 <div class=featex><img alt="small-caps example" src=smcp.png></div>
4118 <dl>
4119 <dt><dfn id=all-small-caps>all-small-caps</dfn>
4121 <dd>Enables display of small capitals for both upper and lowercase letters
4122 (OpenType features: <span class=tag>c2sc, smcp</span>).
4124 <dt><dfn id=petite-caps>petite-caps</dfn>
4126 <dd>Enables display of petite capitals (OpenType feature: <span
4127 class=tag>pcap</span>).
4129 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
4131 <dd>Enables display of petite capitals for both upper and lowercase
4132 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
4134 <dt><dfn id=unicase>unicase</dfn>
4136 <dd>Enables display of mixture of small capitals for uppercase letters
4137 with normal lowercase letters (OpenType feature: <span
4138 class=tag>unic</span>).
4140 <dt><dfn id=titling-caps>titling-caps</dfn>
4142 <dd>Enables display of titling capitals (OpenType feature: <span
4143 class=tag>titl</span>). Uppercase letter glyphs are often designed for
4144 use with lowercase letters. When used in all uppercase titling sequences
4145 they can appear too strong. Titling capitals are designed specifically
4146 for this situation.
4147 </dl>
4149 <p>The availability of these glyphs is based on whether a given feature is
4150 defined or not in the feature list of the font. User agents can optionally
4151 decide this on a per-script basis but should explicitly not decide this on
4152 a per-character basis.
4154 <p>Some fonts may only support a subset or none of the features described
4155 for this property. For backwards compatibility with CSS 2.1, if ‘<a
4156 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
4157 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
4158 is specified but small-caps glyphs are not available for a given font,
4159 user agents should simulate a small-caps font, for example by taking a
4160 normal font and replacing the glyphs for lowercase letters with scaled
4161 versions of the glyphs for uppercase characters (replacing the glyphs for
4162 both upper and lowercase letters in the case of ‘<a
4163 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
4165 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
4166 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
4167 width=512>
4168 <p class=caption>Synthetic vs. real small-caps
4169 </div>
4171 <p>To match the surrounding text, a font may provide alternate glyphs for
4172 caseless characters when these features are enabled but when a user agent
4173 simulates small capitals, it must not attempt to simulate alternates for
4174 codepoints which are considered caseless.
4176 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
4177 characters with small-caps, all-small-caps enabled" class=hires
4178 src=small-capitals-variations.png width=418>
4179 <p class=caption>Caseless characters with small-caps, all-small-caps
4180 enabled
4181 </div>
4183 <p>If either ‘<a href="#petite-caps"><code
4184 class=property>petite-caps</code></a>’ or ‘<a
4185 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
4186 is specified for a font that doesn't support these features, the property
4187 behaves as if ‘<a href="#small-caps"><code
4188 class=property>small-caps</code></a>’ or ‘<a
4189 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4190 respectively, had been specified. If ‘<a href="#unicase"><code
4191 class=property>unicase</code></a>’ is specified for a font that doesn't
4192 support that feature, the property behaves as if ‘<a
4193 href="#small-caps"><code class=property>small-caps</code></a>’ was
4194 applied only to lowercased uppercase letters. If ‘<a
4195 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
4196 specified with a font that does not support this feature, this property
4197 has no visible effect. When simulated small capital glyphs are used, for
4198 scripts that lack uppercase and lowercase letters, ‘<a
4199 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
4200 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4201 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
4202 ‘<a href="#all-petite-caps"><code
4203 class=property>all-petite-caps</code></a>’ and ‘<a
4204 href="#unicase"><code class=property>unicase</code></a>’ have no visible
4205 effect.
4207 <p>When casing transforms are used to simulate small capitals, the casing
4208 transformations must match those used for the <span
4209 class=property>‘<code class=property>text-transform</code>’</span>
4210 property.
4212 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
4213 replace glyphs in a small-caps font so that the text appears in all
4214 uppercase letters.
4216 <div class=figure style="padding: 0; margin: auto;"><img alt="using
4217 all-small-caps in acronym-laden text" class=hires
4218 src=acronym-laden-text.png width=596>
4219 <p class=caption>Using small capitals to improve readability in
4220 acronym-laden text
4221 </div>
4223 <div class=example>
4224 <p>Quotes rendered italicised, with small-caps on the first line:</p>
4226 <pre>blockquote { font-style: italic; }
4227 blockquote:first-line { font-variant: small-caps; }
4229 <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></blockquote>
4230 </pre>
4231 </div>
4232 <!-- prop: font-variant-numeric -->
4234 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
4235 formatting: the <a
4236 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
4238 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
4239 <tbody>
4240 <tr>
4241 <td>Name:
4243 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
4245 <tr>
4246 <td>Value:
4248 <td><a href="#font-variant-numeric-normal-value"
4249 title="normal!!font-variant-numeric">normal</a> | [ <a
4250 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
4251 || <a
4252 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
4253 || <a
4254 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
4255 || <a href="#ordinal">ordinal</a> || <a
4256 href="#slashed-zero">slashed-zero</a> ]
4258 <tr>
4259 <td>Initial:
4261 <td>normal
4263 <tr>
4264 <td>Applies to:
4266 <td>all elements
4268 <tr>
4269 <td>Inherited:
4271 <td>yes
4273 <tr>
4274 <td>Percentages:
4276 <td>N/A
4278 <tr>
4279 <td>Media:
4281 <td>visual
4283 <tr>
4284 <td>Computed value:
4286 <td>as specified
4288 <tr>
4289 <td>Animatable:
4291 <td>no
4292 </table>
4294 <p>Specifies control over numerical forms. The example below shows how some
4295 of these values can be combined to influence the rendering of tabular data
4296 with fonts that support these features. Within normal paragraph text,
4297 proportional numbers are used while tabular numbers are used so that
4298 columns of numbers line up properly:
4300 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
4301 number styles" src=numberstyles.png>
4302 <p class=caption>Using number styles
4303 </div>
4305 <p>Possible combinations:
4307 <pre
4308 class=prod><dfn id=numeric-figure-values><var><numeric-figure-values></var></dfn> = [ <a href="#lining-nums">lining-nums</a> | <a href="#oldstyle-nums">oldstyle-nums</a> ]</pre>
4310 <pre
4311 class=prod><dfn id=numeric-spacing-values><var><numeric-spacing-values></var></dfn> = [ <a href="#proportional-nums">proportional-nums</a> | <a href="#tabular-nums">tabular-nums</a> ]</pre>
4313 <pre
4314 class=prod><dfn id=numeric-fraction-values><var><numeric-fraction-values></var></dfn> = [ <a href="#diagonal-fractions">diagonal-fractions</a> | <a href="#stacked-fractions">stacked-fractions</a> ]</pre>
4316 <p>Individual values have the following meanings:
4318 <dl>
4319 <dt><dfn id=font-variant-numeric-normal-value
4320 title="normal!!font-variant-numeric">normal</dfn>
4322 <dd>None of the features listed below are enabled.
4324 <dt><dfn id=lining-nums>lining-nums</dfn>
4326 <dd>Enables display of lining numerals (OpenType feature: <span
4327 class=tag>lnum</span>).
4329 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
4331 <dd>Enables display of old-style numerals (OpenType feature: <span
4332 class=tag>onum</span>).
4334 <dt><dfn id=proportional-nums>proportional-nums</dfn>
4336 <dd>Enables display of proportional numerals (OpenType feature: <span
4337 class=tag>pnum</span>).
4339 <dt><dfn id=tabular-nums>tabular-nums</dfn>
4341 <dd>Enables display of tabular numerals (OpenType feature: <span
4342 class=tag>tnum</span>).
4344 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
4346 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
4347 class=tag>frac</span>).
4348 </dl>
4350 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
4352 <dl>
4353 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
4355 <dd>Enables display of lining stacked fractions (OpenType feature: <span
4356 class=tag>afrc</span>).
4357 </dl>
4359 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
4361 <dl>
4362 <dt><dfn id=ordinal>ordinal</dfn>
4364 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
4365 <span class=tag>ordn</span>).
4367 <dt><dfn id=slashed-zero>slashed-zero</dfn>
4369 <dd>Enables display of slashed zeros (OpenType feature: <span
4370 class=tag>zero</span>).
4371 </dl>
4373 <div class=featex><img alt="slashed zero example" src=zero.png></div>
4375 <div class=example id=steak-marinade>
4376 <p>A simple flank steak marinade recipe, rendered with automatic fractions
4377 and old-style numerals:</p>
4379 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
4381 <h4>Steak marinade:</h4>
4382 <ul>
4383 <li><span class="amount">2</span> tbsp olive oil</li>
4384 <li><span class="amount">1</span> tbsp lemon juice</li>
4385 <li><span class="amount">1</span> tbsp soy sauce</li>
4386 <li><span class="amount">1 1/2</span> tbsp dry minced onion</li>
4387 <li><span class="amount">2 1/2</span> tsp italian seasoning</li>
4388 <li>Salt &amp; pepper</li>
4389 </ul>
4391 <p>Mix the meat with the marinade and let it sit covered in the refrigerator
4392 for a few hours or overnight.</p>
4393 </pre>
4395 <p>Note that the fraction feature is only applied to values not the entire
4396 paragraph. Fonts often implement this feature using contextual rules
4397 based on the use of the slash (‘<code class=css>/</code>’) character.
4398 As such, it's not suitable for use as a paragraph-level style.</p>
4399 </div>
4400 <!-- prop: font-variant-alternates -->
4402 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
4403 and swashes: the <a
4404 href="#propdef-font-variant-alternates">font-variant-alternates</a>
4405 property</h3>
4407 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
4408 <tbody>
4409 <tr>
4410 <td>Name:
4412 <td><dfn
4413 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
4415 <tr>
4416 <td>Value:
4418 <td>normal | [ <a href="#stylistic"
4419 title=stylistic>stylistic(<feature-value-name>)</a> || <a
4420 href="#historical-forms">historical-forms</a> || <a href="#styleset"
4421 title=styleset>styleset(<feature-value-name> #)</a> || <a
4422 href="#character-variant"
4423 title=character-variant>character-variant(<feature-value-name>
4424 #)</a> || <a href="#swash"
4425 title=swash>swash(<feature-value-name>)</a> || <a
4426 href="#ornaments"
4427 title=ornaments>ornaments(<feature-value-name>)</a> || <a
4428 href="#annotation"
4429 title=annotation>annotation(<feature-value-name>)</a> ]
4431 <tr>
4432 <td>Initial:
4434 <td>normal
4436 <tr>
4437 <td>Applies to:
4439 <td>all elements
4441 <tr>
4442 <td>Inherited:
4444 <td>yes
4446 <tr>
4447 <td>Percentages:
4449 <td>N/A
4451 <tr>
4452 <td>Media:
4454 <td>visual
4456 <tr>
4457 <td>Computed value:
4459 <td>as specified
4461 <tr>
4462 <td>Animatable:
4464 <td>no
4465 </table>
4467 <p>For any given character, fonts can provide a variety of alternate glyphs
4468 in addition to the default glyph for that character. This property
4469 provides control over the selection of these alternate glyphs.
4471 <p>For many of the property values listed below, several different
4472 alternate glyphs are available. How many alternates are available and what
4473 they represent is font-specific, so these are each marked <dfn
4474 id=font-specific>font specific</dfn> in the value definitions below.
4475 Because the nature of these alternates is font-specific, the <a
4476 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4477 rule is used to define values for a specific font family or set of
4478 families that associate a font-specific numeric
4479 <code><feature-index></code> with a custom
4480 <code><feature-value-name></code>, which is then used in this
4481 property to select specific alternates:
4483 <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
4485 p {
4486 font-family: Noble Script;
4487 font-variant-alternates: swash(flowing); /* use swash alternate #2 */
4488 }</pre>
4490 <p>When a particular <code><feature-value-name></code> has not been
4491 defined for a given family or for a particular feature type, the computed
4492 value must be the same as if it had been defined. However, property values
4493 that contain these undefined <code><feature-value-name></code>
4494 identifiers must be ignored when choosing glyphs.
4496 <pre>/* these two style rules are effectively the same */
4497 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
4498 p { font-variant-alternates: normal; }
4499 </pre>
4501 <p>This allows values to be defined and used for a given set of font
4502 families but ignored if fallback occurs, since the font family name would
4503 be different. If a given value is outside the range supported by a given
4504 font, the value is ignored. These values never apply to generic font
4505 families.
4507 <p>Individual values have the following meanings:
4509 <dl>
4510 <dt><dfn id=font-variant-alternates-normal-value
4511 title="normal!!font-variant-alternates">normal</dfn>
4513 <dd>None of the features listed below are enabled.
4515 <dt><dfn id=historical-forms>historical-forms</dfn>
4517 <dd>Enables display of historical forms (OpenType feature: <span
4518 class=tag>hist</span>).
4519 </dl>
4521 <div class=featex><img alt="historical form example" src=hist.png></div>
4523 <dl>
4524 <dt><dfn id=stylistic
4525 title=stylistic>stylistic(<feature-value-name>)</dfn>
4527 <dd>Enables display of stylistic alternates (<a
4528 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4529 class=tag>salt <feature-index></span>).
4530 </dl>
4532 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
4534 <dl>
4535 <dt><dfn id=styleset title=styleset>styleset(<feature-value-name>
4536 #)</dfn>
4538 <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
4539 specific</em></a>, OpenType feature: <span
4540 class=tag>ss<feature-index></span> OpenType currently defines <span
4541 class=tag>ss01</span> through <span class=tag>ss20</span>).
4542 </dl>
4544 <div class=featex><img alt="styleset example" src=ssnn.png></div>
4546 <dl>
4547 <dt><dfn id=character-variant
4548 title=character-variant>character-variant(<feature-value-name>
4549 #)</dfn>
4551 <dd>Enables display of specific character variants (<a
4552 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4553 class=tag>cv<feature-index></span> OpenType currently defines <span
4554 class=tag>cv01</span> through <span class=tag>cv99</span>).
4556 <dt><dfn id=swash title=swash>swash(<feature-value-name>)</dfn>
4558 <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
4559 specific</em></a>, OpenType feature: <span class=tag>swsh
4560 <feature-index>, cswh <feature-index></span>).
4561 </dl>
4563 <div class=featex><img alt="swash example" src=swsh.png></div>
4565 <dl>
4566 <dt><dfn id=ornaments
4567 title=ornaments>ornaments(<feature-value-name>)</dfn>
4569 <dd>Enables replacement of default glyphs with ornaments, if provided in
4570 the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
4571 feature: <span class=tag>ornm <feature-index></span>). Some fonts
4572 may offer ornament glyphs as alternates for a wide collection of
4573 characters; however, displaying arbitrary characters (e.g.,
4574 alphanumerics) as ornaments is poor practice as it distorts the semantics
4575 of the data. Font designers are encouraged to encode all ornaments
4576 (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
4577 alternates for the bullet character (U+2022) to allow authors to select
4578 the desired glyph using ‘<a href="#ornaments"><code
4579 class=property>ornaments</code></a>’.
4580 </dl>
4582 <div class=featex><img alt="ornaments example" src=ornm.png></div>
4584 <dl>
4585 <dt><dfn id=annotation
4586 title=annotation>annotation(<feature-value-name>)</dfn>
4588 <dd>Enables display of alternate annotation forms (<a
4589 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4590 class=tag>nalt <feature-index></span>).
4591 </dl>
4593 <div class=featex><img alt="alternate annotation form example"
4594 src=nalt.png></div>
4596 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
4597 specific alternates: the <dfn id=at-font-feature-values-rule
4598 style="font-weight: inherit; font-style:
4599 inherit"><code>@font-feature-values</code></dfn> rule</h3>
4601 <p>Several of the possible values of ‘<a
4602 href="#propdef-font-variant-alternates"><code
4603 class=property>font-variant-alternates</code></a>’ listed above are
4604 labeled as <a href="#font-specific"><em>font specific</em></a>. For these
4605 features fonts may define not just a single glyph but a set of alternate
4606 glyphs with an index to select a given alternate. Since these are font
4607 family specific, the <a
4608 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4609 rule is used to define named values for these indices for a given family.
4611 <p class=note>See the <a href="#om-fontfeaturevalues">object model
4612 reference section</a> for a description of the interfaces used to modify
4613 these rules via the CSS Object Model.
4615 <div class=example>
4616 <p>In the case of the swash Q in the example shown above, the swash could
4617 be specified using these style rules:</p>
4619 <pre>
4621 @font-feature-values Jupiter Sans {
4622 @swash {
4623 delicate: 1;
4624 flowing: 2;
4625 }
4626 }
4628 h2 { font-family: Jupiter Sans, sans-serif; }
4630 /* show the second swash variant in h2 headings */
4631 h2:first-letter { font-variant-alternates: swash(flowing); }
4633 <h2>Quick</h2></pre>
4635 <p>When Jupiter Sans is present, the second alternate swash alternate will
4636 be displayed. When not present, no swash character will be shown, since
4637 the specific named value "flowing" is only defined for the Jupiter Sans
4638 family. The @-mark indicates the name of the property value for which a
4639 named value can be used. The name "flowing" is chosen by the author. The
4640 index that represents each alternate is defined within a given font's
4641 data.</p>
4642 </div>
4644 <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
4646 <p>An <a
4647 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4648 rule is composed of a list of font families followed by a block containing
4649 individual <a href="#featurevalueblock"><i
4650 title="feature_value_block">feature value blocks</i></a> that take the
4651 form of @-rules. Each block defines a set of named values for a specific
4652 font feature when a given set of font families is used. Effectively, they
4653 define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
4654 ⟨values⟩ are the numeric indices used for specific features defined
4655 for a given font.
4657 <p>In terms of the grammar, this specification defines the following
4658 productions:
4660 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
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>*
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>*
4663 ;
4665 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
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> ]*
4667 ;
4669 <dfn id=fontfamilyname>font_family_name</dfn>
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> ]* ]
4671 ;
4673 <dfn id=featurevalueblock>feature_value_block</dfn>
4674 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
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>*
4676 ;
4678 <dfn id=featuretype>feature_type</dfn>:
4679 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
4680 ;
4682 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
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> ]*
4684 ;
4685 </pre>
4687 <p>The following new token is introduced:
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>;}
4690 </pre>
4692 <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
4693 value blocks</i></a> are handled as <a
4694 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
4695 consist of everything up to the next block or semi-colon, whichever comes
4696 first.
4698 <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
4699 family list</i></a> is a comma-delimited list of <a
4700 href="#fontfamilyname"><i title="font_family_name">font family
4701 names</i></a> that match the definition of <a
4702 href="#family-name-value"><var><family-name></var></a> for the <a
4703 href="#propdef-font-family" title="font-family!!property">‘<code
4704 class=property>font-family</code>’</a> property. This means that only
4705 named font families are allowed, rules that include generic or system
4706 fonts in the list of font families are syntax errors. However, if a user
4707 agent defines a generic font to be a specific named font (e.g. Helvetica),
4708 the settings associated with that family name will be used. If syntax
4709 errors occur within the font family list, the entire rule must be ignored.
4711 <p>Within <a href="#featurevalueblock"><i
4712 title="feature_value_block">feature value blocks</i></a>, the <a
4713 href="#featuretype"><i title="feature_type">feature type</i></a> is
4714 ‘<code class=css>@</code>’ followed by the name of one of the <a
4715 href="#font-specific"><em>font specific</em></a> property values of ‘<a
4716 href="#propdef-font-variant-alternates"><code
4717 class=property>font-variant-alternates</code></a>’ (e.g. <a
4718 href="#swash"><code>@swash</code></a>). The identifiers used within
4719 feature value definitions follow the rules of CSS user identifiers and are
4720 case-sensitive. They are unique only for a given set of font families and
4721 <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
4722 same identifier used with a different <a href="#featuretype"><i
4723 title="feature_type">feature type</i></a> is treated as a separate and
4724 distinct value. If the same identifier is defined mulitple times for a
4725 given <a href="#featuretype"><i title="feature_type">feature type</i></a>
4726 and font family, the last defined value is used. Values associated with a
4727 given identifier are limited to integer values 0 or greater.
4729 <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
4730 title="feature_value_definition">feature value definition</i></a>, such as
4731 invalid identifiers or values, the entire <a
4732 href="#featurevaluedefinition"><i title="feature_value_definition">feature
4733 value definition</i></a> must be omitted, just as syntax errors in style
4734 declarations are handled. When the <a href="#featuretype"><i
4735 title="feature_type">feature type</i></a> is invalid, the entire
4736 associated <a href="#featurevalueblock"><i
4737 title="feature_value_block">feature value block</i></a> must be ignored.
4739 <div class=example>
4740 <p>Rules that are equivalent given syntax error handling:</p>
4742 <pre>@font-feature-values Bongo {
4743 @swash { ornate: 1; }
4744 annotation { boxed: 4; } /* should be @annotation! */
4745 @swash { double-loops: 1; flowing: -1; } /* negative value */
4746 @ornaments ; /* incomplete definition */
4747 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
4748 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a> /* random editing mistake */
4749 }</pre>
4751 <p>The example above is equivalent to:</p>
4753 <pre>@font-feature-values Bongo {
4754 @swash { ornate: 1; }
4755 @swash { double-loops: 1; }
4756 @styleset { double-W: 14; sharp-terminals: 16 1; }
4757 }</pre>
4758 </div>
4760 <p>If multiple <a
4761 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4762 rules are defined for a given family, the resulting values definitions are
4763 the union of the definitions contained within these rules. This allows a
4764 set of named values to be defined for a given font family globally for a
4765 site and specific additions made per-page.
4767 <div class=example>
4768 <p>Using both site-wide and per-page feature values:</p>
4770 <pre>
4771 site.css:
4773 @font-feature-values Mercury Serif {
4774 @styleset {
4775 stacked-g: 3; /* "two-storey" versions of g, a */
4776 stacked-a: 4;
4777 }
4778 }
4780 page.css:
4782 @font-feature-values Mercury Serif {
4783 @styleset {
4784 geometric-m: 7; /* alternate version of m */
4785 }
4786 }
4788 body {
4789 font-family: Mercury Serif, serif;
4791 /* enable both the use of stacked g and alternate m */
4792 font-variant-alternates: styleset(stacked-g, geometric-m);
4793 }</pre>
4794 </div>
4796 <div class=example>
4797 <p>Using a commonly named value allows authors to use a single style rule
4798 to cover a set of fonts for which the underlying selector is different
4799 for each font. If either font in the example below is found, a circled
4800 number glyph will be used:</p>
4802 <pre>@font-feature-values Taisho Gothic {
4803 @annotation { boxed: 1; circled: 4; }
4804 }
4806 @font-feature-values Otaru Kisa {
4807 @annotation { circled: 1; black-boxed: 3; }
4808 }
4810 h3.title {
4811 /* circled form defined for both fonts */
4812 font-family: Taisho Gothic, Otaru Kisa;
4813 font-variant: annotation(circled);
4814 }</pre>
4815 </div>
4817 <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
4818 </span>Multi-valued feature value definitions</h4>
4820 <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
4821 href="#propdef-font-variant-alternates"><code
4822 class=property>font-variant-alternates</code></a>’ property values take
4823 a single value (e.g. ‘<a href="#swash"><code
4824 class=property>swash</code></a>’). The ‘<a
4825 href="#character-variant"><code
4826 class=property>character-variant</code></a>’ property value allows two
4827 values and ‘<a href="#styleset"><code
4828 class=property>styleset</code></a>’ allows an unlimited number.
4830 <p>For the styleset property value, multiple values indicate the style sets
4831 to be enabled. Values between 1 and 99 enable OpenType features <span
4832 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
4833 OpenType standard only officially defines <span class=tag>ss01</span>
4834 through <span class=tag>ss20</span>. For OpenType fonts, values greater
4835 than 99 or equal to 0 do not generate a syntax error when parsed but
4836 enable no OpenType features.
4838 <pre>@font-feature-values Mars Serif {
4839 @styleset {
4840 alt-g: 1; /* implies ss01 = 1 */
4841 curly-quotes: 3; /* implies ss03 = 1 */
4842 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
4843 }
4845 @styleset {
4846 dumb: 125; /* >99, ignored */
4847 }
4849 @swash {
4850 swishy: 3 5; /* more than 1 value for swash, syntax error */
4851 }
4852 }
4854 p.codeblock {
4855 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
4856 font-variant-alternates: styleset(curly-quotes, code);
4857 }</pre>
4859 <p>For character-variant, a single value between 1 and 99 indicates the
4860 enabling of OpenType feature <span class=tag>cv01</span> through <span
4861 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
4862 to 0 are ignored but do not generate a syntax error when parsed but enable
4863 no OpenType features. When two values are listed, the first value
4864 indicates the feature used and the second the value passed for that
4865 feature. If more than two values are assigned to a given name, a syntax
4866 error occurs and the entire <a href="#featurevaluedefinition"><i
4867 title="feature_value_definition">feature value definition</i></a> is
4868 ignored.
4870 <pre>@font-feature-values MM Greek {
4871 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
4872 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
4873 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
4874 @character-variant { gamma: 12; } /* implies cv12 = 1 */
4875 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
4876 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
4877 @character-variant { silly: 105; } /* >99, ignored */
4878 @character-variant { dumb: 323 3; } /* >99, ignored */
4879 }
4881 #title {
4882 /* use the third alternate beta, first alternate gamma */
4883 font-variant-alternates: character-variant(beta-3, gamma);
4884 }
4886 p {
4887 /* zeta-2 follows zeta, implies cv20 = 2 */
4888 font-variant-alternates: character-variant(zeta, zeta-2);
4889 }
4891 .special {
4892 /* zeta follows zeta-2, implies cv20 = 3 */
4893 font-variant-alternates: character-variant(zeta-2, zeta);
4894 }</pre>
4896 <div class=figure><img alt="Matching text on Byzantine seals using
4897 character variants" src=byzantineseal.png>
4898 <p class=caption>Byzantine seal text displayed with character variants
4899 </div>
4901 <div class=example>
4902 <p>In the figure above, the text in red is rendered using a font
4903 containing character variants that mimic the character forms found on a
4904 Byzantine seal from the 8th century A.D. Two lines below is the same text
4905 displayed in a font without variants. Note the two variants for U and N
4906 used on the seal.</p>
4908 <pre>@font-feature-values Athena Ruby {
4909 @character-variant {
4910 leo-B: 2 1;
4911 leo-M: 13 3;
4912 leo-alt-N: 14 1;
4913 leo-N: 14 2;
4914 leo-T: 20 1;
4915 leo-U: 21 2;
4916 leo-alt-U: 21 4;
4917 }
4918 }
4920 p {
4921 font-variant: discretionary-ligatures,
4922 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
4923 }
4925 span.alt-N {
4926 font-variant-alternates: character-variant(leo-alt-N);
4927 }
4929 span.alt-U {
4930 font-variant-alternates: character-variant(leo-alt-U);
4931 }
4933 <p>ENO....UP͞RSTU<span class="alt-U">U</span>͞<span class="alt-U">U</span>ΚΑΙTỤẠG̣IUPNS</p>
4935 <p>LEON|ΚΑΙCONSTA|NTI<span class="alt-N">N</span>OS..|STOIBAṢ.|LIṢROM|AIO<span class="alt-N">N</span></p>
4936 </pre>
4937 </div>
4939 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
4940 Asian text rendering: the <a
4941 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
4942 property</h3>
4944 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
4945 <tbody>
4946 <tr>
4947 <td>Name:
4949 <td><dfn
4950 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
4952 <tr>
4953 <td>Value:
4955 <td><a href="#font-variant-east-asian-normal-value"
4956 title="normal!!font-variant-east-asian">normal</a> | [ <a
4957 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
4958 || <a
4959 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
4960 || <a href="#ruby">ruby</a> ]
4962 <tr>
4963 <td>Initial:
4965 <td>normal
4967 <tr>
4968 <td>Applies to:
4970 <td>all elements
4972 <tr>
4973 <td>Inherited:
4975 <td>yes
4977 <tr>
4978 <td>Percentages:
4980 <td>N/A
4982 <tr>
4983 <td>Media:
4985 <td>visual
4987 <tr>
4988 <td>Computed value:
4990 <td>as specified
4992 <tr>
4993 <td>Animatable:
4995 <td>no
4996 </table>
4998 <p>Allows control of glyph substitution and sizing in East Asian text.
5000 <pre
5001 class=prod><dfn id=east-asian-variant-values><var><east-asian-variant-values></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>
5003 <pre
5004 class=prod><dfn id=east-asian-width-values><var><east-asian-width-values></var></dfn> = [ <a href="#full-width">full-width</a> | <a href="#proportional-width">proportional-width</a> ]</pre>
5006 <p>Individual values have the following meanings:
5008 <dl>
5009 <dt><dfn id=font-variant-east-asian-normal-value
5010 title="normal!!font-variant-east-asian">normal</dfn>
5012 <dd>None of the features listed below are enabled.
5014 <dt><dfn id=jis78>jis78</dfn>
5016 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
5017 class=tag>jp78</span>).
5018 </dl>
5020 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
5022 <dl>
5023 <dt><dfn id=jis83>jis83</dfn>
5025 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
5026 class=tag>jp83</span>).
5028 <dt><dfn id=jis90>jis90</dfn>
5030 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
5031 class=tag>jp90</span>).
5033 <dt><dfn id=jis04>jis04</dfn>
5035 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
5036 class=tag>jp04</span>).
5037 <p>The various JIS variants reflect the glyph forms defined in different
5038 Japanese national standards. Fonts generally include glyphs defined by
5039 the most recent national standard but it's sometimes necessary to use
5040 older variants, to match signage for example.</p>
5042 <dt><dfn id=simplified>simplified</dfn>
5044 <dd>Enables rendering of simplified forms (OpenType feature: <span
5045 class=tag>smpl</span>).
5047 <dt><dfn id=traditional>traditional</dfn>
5049 <dd>Enables rendering of traditional forms (OpenType feature: <span
5050 class=tag>trad</span>).
5051 </dl>
5053 <p>The ‘<a href="#simplified"><code
5054 class=property>simplified</code></a>’ and ‘<a
5055 href="#traditional"><code class=property>traditional</code></a>’ values
5056 allow control over the glyph forms for characters which have been
5057 simplified over time but for which the older, traditional form is still
5058 used in some contexts. The exact set of characters and glyph forms will
5059 vary to some degree by context for which a given font was designed.
5061 <div class=featex><img alt="tradtional form example" src=trad.png></div>
5063 <dl>
5064 <dt><dfn id=full-width>full-width</dfn>
5066 <dd>Enables rendering of full-width variants (OpenType feature: <span
5067 class=tag>fwid</span>).
5069 <dt><dfn id=proportional-width>proportional-width</dfn>
5071 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
5072 <span class=tag>pwid</span>).
5073 </dl>
5075 <div class=featex><img alt="proportionally spaced Japanese example"
5076 src=pwid.png></div>
5078 <dl>
5079 <dt><dfn id=ruby>ruby</dfn>
5081 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
5082 class=tag>ruby</span>). Since ruby text is generally smaller than the
5083 associated body text, font designers can design special glyphs for use
5084 with ruby that are more readable than scaled down versions of the default
5085 glyphs. Only glyph selection is affected, there is no associated font
5086 scaling or other change that affects line layout. The red ruby text below
5087 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
5088 Note the slight difference in stroke thickness.
5089 </dl>
5091 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
5093 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
5094 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
5095 property</h3>
5097 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
5098 <tbody>
5099 <tr>
5100 <td>Name:
5102 <td><dfn id=propdef-font-variant
5103 title="font-variant!!property">font-variant</dfn>
5105 <tr>
5106 <td>Value:
5108 <td><a href="#font-variant-normal-value"
5109 title="normal!!font-variant">normal</a> | <a
5110 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
5111 <a href="#common-lig-values"><var><common-lig-values></var></a>
5112 || <a
5113 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
5114 || <a
5115 href="#historical-lig-values"><var><historical-lig-values></var></a>
5116 || <a
5117 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
5118 || <a href="#stylistic"><var
5119 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
5120 href="#historical-forms"><var>historical-forms</var></a> || <a
5121 href="#styleset"><var
5122 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
5123 href="#character-variant"><var
5124 title=character-variant>character-variant(<feature-value-name>
5125 #)</var></a> || <a href="#swash"><var
5126 title=swash>swash(<feature-value-name>)</var></a> || <a
5127 href="#ornaments"><var
5128 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
5129 href="#annotation"><var
5130 title=annotation>annotation(<feature-value-name>)</var></a> || [
5131 <a href="#small-caps"><i>small-caps</i></a> | <a
5132 href="#all-small-caps"><i>all-small-caps</i></a> | <a
5133 href="#petite-caps"><i>petite-caps</i></a> | <a
5134 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
5135 href="#unicase"><i>unicase</i></a> | <a
5136 href="#titling-caps"><i>titling-caps</i></a> ] || <a
5137 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
5138 || <a
5139 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
5140 || <a
5141 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
5142 || <a href="#ordinal"><i>ordinal</i></a> || <a
5143 href="#slashed-zero"><i>slashed-zero</i></a> || <a
5144 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
5145 || <a
5146 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
5147 || <a href="#ruby"><i>ruby</i></a> ]
5149 <tr>
5150 <td>Initial:
5152 <td>normal
5154 <tr>
5155 <td>Applies to:
5157 <td>all elements
5159 <tr>
5160 <td>Inherited:
5162 <td>yes
5164 <tr>
5165 <td>Percentages:
5167 <td>see individual properties
5169 <tr>
5170 <td>Media:
5172 <td>visual
5174 <tr>
5175 <td>Computed value:
5177 <td>see individual properties
5179 <tr>
5180 <td>Animatable:
5182 <td>see individual properties
5183 </table>
5185 <p>The <a href="#propdef-font-variant"
5186 title="font-variant!!property">‘<code
5187 class=property>font-variant</code>’</a> property is a shorthand for all
5188 font-variant subproperties. The value <dfn id=font-variant-normal-value
5189 title="normal!!font-variant">‘<code
5190 class=property>normal</code>’</dfn> resets all subproperties of <a
5191 href="#propdef-font-variant" title="font-variant!!property">‘<code
5192 class=property>font-variant</code>’</a> to their inital value. The <dfn
5193 id=font-variant-none-value title="none!!font-variant">‘<code
5194 class=property>none</code>’</dfn> value sets ‘<a
5195 href="#propdef-font-variant-ligatures"><code
5196 class=property>font-variant-ligatures</code></a>’ to ‘<code
5197 class=property>none</code>’ and resets all other font feature properties
5198 to their initial value. Like other shorthands, using <a
5199 href="#propdef-font-variant" title="font-variant!!property">‘<code
5200 class=property>font-variant</code>’</a> resets unspecified <a
5201 href="#propdef-font-variant" title="font-variant!!property">‘<code
5202 class=property>font-variant</code>’</a> subproperties to their initial
5203 values. It does not reset the values of either ‘<a
5204 href="#propdef-font-language-override"><code
5205 class=property>font-language-override</code></a>’ or <a
5206 href="#propdef-font-feature-settings"
5207 title="font-feature-settings!!property">‘<code
5208 class=property>font-feature-settings</code>’</a>.
5210 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
5211 font feature settings control: the <a
5212 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
5214 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
5215 <tbody>
5216 <tr>
5217 <td>Name:
5219 <td><dfn id=propdef-font-feature-settings
5220 title="font-feature-settings!!property">font-feature-settings</dfn>
5222 <tr>
5223 <td>Value:
5225 <td><a href="#font-feature-settings-normal-value"
5226 title="normal!!font-feature-settings">normal</a> | <a
5227 href="#feature-tag-value"><var><feature-tag-value></var></a> #
5229 <tr>
5230 <td>Initial:
5232 <td>normal
5234 <tr>
5235 <td>Applies to:
5237 <td>all elements
5239 <tr>
5240 <td>Inherited:
5242 <td>yes
5244 <tr>
5245 <td>Percentages:
5247 <td>N/A
5249 <tr>
5250 <td>Media:
5252 <td>visual
5254 <tr>
5255 <td>Computed value:
5257 <td>as specified
5259 <tr>
5260 <td>Animatable:
5262 <td>no
5263 </table>
5265 <p>This property provides low-level control over OpenType font features. It
5266 is intended as a way of providing access to font features that are not
5267 widely used but are needed for a particular use case.
5269 <p>Authors should generally use <a href="#propdef-font-variant"
5270 title="font-variant!!property">‘<code
5271 class=property>font-variant</code>’</a> and its related subproperties
5272 whenever possible and only use this property for special cases where its
5273 use is the only way of accessing a particular infrequently used font
5274 feature.
5276 <pre>/* enable small caps and use second swash alternate */
5277 font-feature-settings: "smcp", "swsh" 2;</pre>
5279 <p>A value of <dfn id=font-feature-settings-normal-value
5280 title="normal!!font-feature-settings">‘<code
5281 class=property>normal</code>’</dfn> means that no change in glyph
5282 selection or positioning occurs due to this property.
5284 <p>Feature tag values have the following syntax:
5286 <pre
5287 class=prod><dfn id=feature-tag-value><var><feature-tag-value></var></dfn> = <string> [ <integer> | on | off ]?</pre>
5289 <p>The <string> is a case-sensitive OpenType feature tag. As
5290 specified in the OpenType specification, feature tags contain four ASCII
5291 characters. Tag strings longer or shorter than four characters, or
5292 containing characters outside the U+20–7E codepoint range are invalid.
5293 Feature tags need only match a feature tag defined in the font, so they
5294 are not limited to explicitly registered OpenType features. Fonts defining
5295 custom feature tags should follow the <a
5296 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
5297 rules</a> defined in the OpenType specification <a
5298 href="#OPENTYPE-FEATURES"
5299 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
5300 Feature tags not present in the font are ignored; a user agent must not
5301 attempt to synthesize fallback behavior based on these feature tags.
5303 <p>This means that explicitly disabling the <span class=tag>kern</span>
5304 feature will not affect the application of kerning data found in the
5305 ‘<code class=property>kern</code>’ table (as opposed to kerning data
5306 associated with the <span class=tag>kern</span> feature in the ‘<code
5307 class=property>GPOS</code>’ table). Authors should use the ‘<a
5308 href="#propdef-font-kerning"><code
5309 class=property>font-kerning</code></a>’ property to explictly enable or
5310 disable kerning since this property affects both types of kerning.
5312 <p>If present, a value indicates an index used for glyph selection. An
5313 <integer> value must be 0 or greater. A value of 0 indicates that
5314 the feature is disabled. For boolean features, a value of 1 enables the
5315 feature. For non-boolean features, a value of 1 or greater enables the
5316 feature and indicates the feature selection index. A value of ‘<code
5317 class=property>on</code>’ is synonymous with 1 and ‘<code
5318 class=property>off</code>’ is synonymous with 0. If the value is
5319 omitted, a value of 1 is assumed.
5321 <pre>
5322 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
5323 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
5324 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
5325 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
5326 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
5327 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
5328 font-feature-settings: "palin" off; /* good idea but invalid tagname */
5329 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
5330 font-feature-settings: dlig; /* invalid, tag must be a string */
5331 </pre>
5333 <p>When values greater than the range supported by the font are specified,
5334 the behavior is explicitly undefined. For boolean features, in general
5335 these will enable the feature. For non-boolean features, out of range
5336 values will in general be equivalent to a 0 value. However, in both cases
5337 the exact behavior will depend upon the way the font is designed
5338 (specifically, which type of lookup is used to define the feature).
5340 <p>Although specifically defined for OpenType feature tags, feature tags
5341 for other modern font formats that support font features may be added in
5342 the future. Where possible, features defined for other font formats should
5343 attempt to follow the pattern of registered OpenType tags.
5345 <div class=example>
5346 <p>The Japanese text below will be rendered with half-width kana
5347 characters:</p>
5349 <pre lang=ja>
5350 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
5352 <p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p>
5353 </pre>
5354 </div>
5356 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
5357 language override: the <a
5358 href="#propdef-font-language-override">font-language-override</a> property</h3>
5360 <table class=propdef id=namefont-language-overridevaluenormal-lt>
5361 <tbody>
5362 <tr>
5363 <td>Name:
5365 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
5367 <tr>
5368 <td>Value:
5370 <td><a href="#font-language-override-normal-value"
5371 title="normal!!font-language-override">normal</a> | <a
5372 href="#font-language-override-string-value"><var><string></var></a>
5374 <tr>
5375 <td>Initial:
5377 <td><a href="#font-language-override-normal-value"
5378 title="normal!!font-language-override">normal</a>
5380 <tr>
5381 <td>Applies to:
5383 <td>all elements
5385 <tr>
5386 <td>Inherited:
5388 <td>yes
5390 <tr>
5391 <td>Percentages:
5393 <td>N/A
5395 <tr>
5396 <td>Media:
5398 <td>visual
5400 <tr>
5401 <td>Computed value:
5403 <td>as specified
5405 <tr>
5406 <td>Animatable:
5408 <td>no
5409 </table>
5411 <p>Normally, authors can control the use of language-specific glyph
5412 substitutions and positioning by setting the content language of an
5413 element, as <a href="#language-specific-support">described above</a>:
5415 <pre><!-- Display text using S'gaw Karen specific features -->
5416 <p lang="ksw">...</p></pre>
5418 <p>In some cases, authors may need to specify a language system that
5419 differs from the content language, for example due to the need to mimic
5420 another language's typographic traditions. The ‘<a
5421 href="#propdef-font-language-override"><code
5422 class=property>font-language-override</code></a>’ property allows
5423 authors to explicitly specify the language system of the font, overriding
5424 the language system implied by the content language.
5426 <p>Values have the following meanings:
5428 <dl>
5429 <dt><dfn id=font-language-override-normal-value
5430 title="normal!!font-language-override">normal</dfn>
5432 <dd>specifies that when rendering with OpenType fonts, the content
5433 language of the element is used to infer the OpenType language system
5435 <dt><dfn
5436 id=font-language-override-string-value><var><string></var></dfn>
5438 <dd>single three-letter case-sensitive OpenType <a
5439 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
5440 system tag</a>, specifies the OpenType language system to be used instead
5441 of the language system implied by the language of the element
5442 </dl>
5443 <!-- For this level, string represents a single language code, there's no concept of "fallback"
5444 http://www.w3.org/2013/06/07-css-minutes.html#item04 -->
5446 <p>Use of invalid OpenType language system tags must not generate a parse
5447 error but must be ignored when doing glyph selection and placement.
5449 <div class=example>
5450 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
5451 Declaration of Human Rights</a> has been translated into a wide variety
5452 of languages. In Turkish, Article 9 of this document might be marked up
5453 as below:</p>
5455 <pre lang=tr><body lang="tr">
5457 <h4>Madde 9</h4>
5458 <p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.</p>
5459 </pre>
5461 <p>Here the user agent uses the value of the ‘<code
5462 class=property>lang</code>’ attribute when rendering text and
5463 appropriately renders this text without ‘<code
5464 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
5465 href="#propdef-font-language-override"><code
5466 class=property>font-language-override</code></a>’ property.</p>
5468 <p>However, a given font may lack support for a specific language. In this
5469 situation authors may need to use the typographic conventions of a
5470 related language that are supported by that font:</p>
5472 <pre lang=mk><body lang="mk"> <!-- Macedonian lang code -->
5474 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
5476 <h4>Члeн 9</h4>
5477 <p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
5479 </pre>
5481 <p>The Macedonian text here will be rendered using Serbian typographic
5482 conventions, with the assumption that the font specified supports
5483 Serbian.</p>
5484 </div>
5486 <p><a id=rendering-considerations></a>
5488 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
5489 Resolution</h2>
5491 <p>As described in the previous section, font features can be enabled in a
5492 variety of ways, either via the use of <a href="#propdef-font-variant"
5493 title="font-variant!!property">‘<code
5494 class=property>font-variant</code>’</a> or <a
5495 href="#propdef-font-feature-settings"
5496 title="font-feature-settings!!property">‘<code
5497 class=property>font-feature-settings</code>’</a> in a style rule or
5498 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5499 The resolution order for the union of these settings is defined below.
5500 Features defined via CSS properties are applied on top of layout engine
5501 default features.
5503 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
5505 <p>For OpenType fonts, user agents must enable the default features defined
5506 in the OpenType documentation for a given script and writing mode.
5507 Required ligatures, common ligatures and contextual forms must be enabled
5508 by default (OpenType features: <span class=tag>rlig, liga, clig,
5509 calt</span>), along with localized forms (OpenType feature: <span
5510 class=tag>locl</span>), and features required for proper display of
5511 composed characters and marks (OpenType features: <span class=tag>ccmp,
5512 mark, mkmk</span>). These features must always be enabled, even when the
5513 value of the <a href="#propdef-font-variant"
5514 title="font-variant!!property">‘<code
5515 class=property>font-variant</code>’</a> and <a
5516 href="#propdef-font-feature-settings"
5517 title="font-feature-settings!!property">‘<code
5518 class=property>font-feature-settings</code>’</a> properties is <span
5519 title="normal value">‘<code class=property>normal</code>’</span>.
5520 Individual features are only disabled when explicitly overridden by the
5521 author, as when ‘<a href="#propdef-font-variant-ligatures"><code
5522 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
5523 href="#no-common-ligatures"><code
5524 class=property>no-common-ligatures</code></a>’. For handling complex
5525 scripts such as <a
5526 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
5527 <a
5528 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
5529 or <a
5530 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
5531 additional features are required. For upright text within vertical text
5532 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
5533 must be enabled.
5535 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
5537 <p>General and <a href="#font-specific"><em>font specific</em></a> font
5538 feature property settings are resolved in the order below, in ascending
5539 order of precedence. This ordering is used to construct a combined list of
5540 font features that affect a given text run.
5542 <ol>
5543 <li>Font features enabled by default, including features required for a
5544 given script.
5546 <li>If the font is defined via an <a
5547 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5548 features implied by the font-variant descriptor in the <a
5549 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5551 <li>If the font is defined via an <a
5552 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5553 features implied by the font-feature-settings descriptor in the <a
5554 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5556 <li>Feature settings determined by properties other than <a
5557 href="#propdef-font-variant" title="font-variant!!property">‘<code
5558 class=property>font-variant</code>’</a> or <a
5559 href="#propdef-font-feature-settings"
5560 title="font-feature-settings!!property">‘<code
5561 class=property>font-feature-settings</code>’</a>. For example, setting
5562 a non-default value for the ‘<code
5563 class=property>letter-spacing</code>’ property disables common
5564 ligatures.
5566 <li>Font features implied by the value of the <a
5567 href="#propdef-font-variant" title="font-variant!!property">‘<code
5568 class=property>font-variant</code>’</a> property, the related <a
5569 href="#propdef-font-variant" title="font-variant!!property">‘<code
5570 class=property>font-variant</code>’</a> subproperties and any other CSS
5571 property that uses OpenType features (e.g. the ‘<a
5572 href="#propdef-font-kerning"><code
5573 class=property>font-kerning</code></a>’ property).
5575 <li>Font features implied by the value of <a
5576 href="#propdef-font-feature-settings"
5577 title="font-feature-settings!!property">‘<code
5578 class=property>font-feature-settings</code>’</a> property.
5579 </ol>
5581 <p>This ordering allows authors to set up a general set of defaults for
5582 fonts within their <a
5583 href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
5584 them with property settings for specific elements. General property
5585 settings override the settings in <a
5586 href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
5587 font feature settings override <a href="#propdef-font-variant"
5588 title="font-variant!!property">‘<code
5589 class=property>font-variant</code>’</a> property settings.
5591 <p>For situations where the combined list of font feature settings contains
5592 more than one value for the same feature, the last value is used. When a
5593 font lacks support for a given underlying font feature, text is simply
5594 rendered as if that font feature was not enabled; font fallback does not
5595 occur and no attempt is made to synthesize the feature except where
5596 explicitly defined for specific properties.
5598 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
5599 precedence examples</h3>
5601 <div class=example>
5602 <p>With the styles below, numbers are rendered proportionally when used
5603 within a paragraph but are shown in tabular form within tables of prices:</p>
5605 <pre>body {
5606 font-variant-numeric: proportional-nums;
5607 }
5609 table.prices td {
5610 font-variant-numeric: tabular-nums;
5611 }
5612 </pre>
5613 </div>
5615 <div class=example>
5616 <p>When the <a href="#descdef-font-variant"
5617 title="font-variant!!descriptor">font-variant</a> descriptor is used
5618 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
5619 it only applies to the font defined by that rule.</p>
5621 <pre>@font-face {
5622 font-family: MainText;
5623 src: url(http://example.com/font.ttf);
5624 font-variant: oldstyle-nums proportional-nums styleset(1,3);
5625 }
5627 body {
5628 font-family: MainText, Helvetica;
5629 }
5631 table.prices td {
5632 font-variant-numeric: tabular-nums;
5633 }
5634 </pre>
5636 <p>In this case, old-style numerals will be used throughout but only where
5637 the font "MainText" is used. Just as in the previous example, tabular
5638 values will be used in price tables since ‘<a
5639 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
5640 appears in a general style rule and its use is mutually exclusive with
5641 ‘<a href="#proportional-nums"><code
5642 class=property>proportional-nums</code></a>’. Stylistic alternate sets
5643 will only be used where MainText is used.</p>
5644 </div>
5646 <div class=example>
5647 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
5648 also be used to access font features in locally available fonts via the
5649 use of <code>local()</code> in the ‘<a href="#descdef-src"><code
5650 class=property>src</code></a>’ descriptor of the <a
5651 href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
5653 <pre>@font-face {
5654 font-family: BodyText;
5655 src: local("HiraMaruPro-W4");
5656 font-variant: proportional-width;
5657 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
5658 }
5660 body { font-family: BodyText, serif; }
5661 </pre>
5663 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
5664 text rendering occurs, Japanese kana will be proportionally spaced and
5665 Latin text will be italicised. Text rendered with the fallback serif font
5666 will use default rendering properties.</p>
5667 </div>
5669 <div class=example>
5670 <p>In the example below, discretionary ligatures are enabled only for a
5671 downloadable font but are disabled within spans of class "special":</p>
5673 <pre>@font-face {
5674 font-family: main;
5675 src: url(fonts/ffmeta.woff) format("woff");
5676 font-variant: discretionary-ligatures;
5677 }
5679 body { font-family: main, Helvetica; }
5680 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5681 </pre>
5683 <p>Suppose one adds a rule using ‘<code
5684 class=property>font-feature-settings</code>’ to enable discretionary
5685 ligatures:</p>
5687 <pre>body { font-family: main, Helvetica; }
5688 span { font-feature-settings: "dlig"; }
5689 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5690 </pre>
5692 <p>In this case, discretionary ligatures <em>will</em> be rendered within
5693 spans of class "special". This is because both the <a
5694 href="#propdef-font-feature-settings"
5695 title="font-feature-settings!!property">‘<code
5696 class=property>font-feature-settings</code>’</a> and ‘<a
5697 href="#propdef-font-variant-ligatures"><code
5698 class=property>font-variant-ligatures</code></a>’ properties apply to
5699 these spans. Although the ‘<code class=css>no-discretionary
5700 ligatures</code>’ setting of ‘<a
5701 href="#propdef-font-variant-ligatures"><code
5702 class=property>font-variant-ligatures</code></a>’ effectively disables
5703 the OpenType <span class=tag>dlig</span> feature, because the <a
5704 href="#propdef-font-feature-settings"
5705 title="font-feature-settings!!property">‘<code
5706 class=property>font-feature-settings</code>’</a> is resolved after
5707 that, the ‘<code class=property>dlig</code>’ value reenables
5708 discretionary ligatures.</p>
5709 </div>
5711 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
5713 <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
5714 and <a
5715 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5716 rules can be accessed via the following extensions to the CSS Object
5717 Model.
5719 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
5720 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
5722 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
5723 <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5725 <pre class=idl>
5726 interface CSSFontFaceRule : CSSRule {
5727 attribute DOMString family;
5728 attribute DOMString src;
5729 attribute DOMString style;
5730 attribute DOMString weight;
5731 attribute DOMString stretch;
5732 attribute DOMString unicodeRange;
5733 attribute DOMString variant;
5734 attribute DOMString featureSettings;
5735 }</pre>
5737 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
5738 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
5739 defined a different variant of this rule. This definition supercedes that
5740 one.
5742 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
5743 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5744 interface</h3>
5746 <p>The <code>CSSRule</code> interface is extended as follows:
5748 <pre class=idl>partial interface CSSRule {
5749 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
5750 }</pre>
5752 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
5753 interface represents a <a
5754 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5755 rule.
5757 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
5758 attribute DOMString fontFamily;
5759 readonly attribute CSSFontFeatureValuesMap annotation;
5760 readonly attribute CSSFontFeatureValuesMap ornaments;
5761 readonly attribute CSSFontFeatureValuesMap stylistic;
5762 readonly attribute CSSFontFeatureValuesMap swash;
5763 readonly attribute CSSFontFeatureValuesMap characterVariant;
5764 readonly attribute CSSFontFeatureValuesMap styleset;
5765 }
5767 [MapClass(DOMString, sequence<unsigned long>)]
5768 interface CSSFontFeatureValuesMap {
5769 void set(DOMString featureValueName,
5770 (unsigned long or sequence<unsigned long>) values);
5771 }</pre>
5773 <dl class=idl-attributes>
5774 <dt><var>fontFamily</var> of type <code>DOMString</code>
5776 <dd>The list of one or more font families for which a given set of feature
5777 values is defined.
5779 <dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
5781 <dd>Maps of feature values associated with feature value names for a given
5782 ‘<a href="#propdef-font-variant-alternates"><code
5783 class=property>font-variant-alternates</code></a>’ value type
5784 </dl>
5786 <p>Each value map attribute of <a
5787 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5788 reflects the values defined via a corresponding <a
5789 href="#featurevalueblock"><i title="feature_value_block">feature value
5790 block</i></a>. Thus, the <var title="annotation
5791 attribute">annotation</var> attribute contains the values contained within
5792 a <code title="@annotation">@annotation</code> <a
5793 href="#featurevalueblock"><i title="feature_value_block">feature value
5794 block</i></a>, the <var title="ornaments attribute">ornaments</var>
5795 attribute contains the values contained with a <code
5796 title="@ornaments">@ornaments</code> <a href="#featurevalueblock"><i
5797 title="feature_value_block">feature value block</i></a> and so forth.
5799 <p>The <code>CSSFontFeatureValuesMap</code> interface uses the <a
5800 href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map
5801 class methods</a> but the <code>set</code> method has different behavior.
5802 It takes a sequence of unsigned integers and associates it with a given
5803 <code>featureValueName</code>. The method behaves the same as the default
5804 map class method except that a single unsigned long value is treated as a
5805 sequence of a single value. The method throws an exception if an invalid
5806 number of values is passed in. If the associated <a
5807 href="#featurevalueblock"><i title="feature_value_block">feature value
5808 block</i></a> only allows a limited number of values, the <code>set</code>
5809 method throws an <code>InvalidAccessError</code> exception when the input
5810 sequence to <code>set</code> contains more than the limited number of
5811 values. See the description of <a
5812 href="#multi-valued-feature-value-definitions">multi-valued feature value
5813 definitions</a> for details on the maximum number of values allowed for a
5814 given type of <a href="#featurevalueblock"><i
5815 title="feature_value_block">feature value block</i></a>. The
5816 <code>get</code> method always returns a sequence of values, even if the
5817 sequence only contains a single value.
5819 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
5820 properties to CSS properties</h2>
5822 <p><em>This appendix is included as background for some of the problems and
5823 situations that are described in other sections. It should be viewed as
5824 informative only.</em>
5826 <p>Font properties in CSS are designed to be independent of the underlying
5827 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
5828 SVG fonts in addition to the common TrueType and OpenType fonts. But there
5829 are facets of the TrueType and OpenType formats that often cause confusion
5830 for authors and present challenges to implementers on different platforms.
5832 <p>Originally developed at Apple, TrueType was designed as an outline font
5833 format for both screen and print. Microsoft joined Apple in developing the
5834 TrueType format and both platforms have supported TrueType fonts since
5835 then. Font data in the TrueType format consists of a set of tables
5836 distinguished with common four-letter tag names, each containing a
5837 specific type of data. For example, naming information, including
5838 copyright and license information, is stored in the ‘<code
5839 class=property>name</code>’ table. The <a
5840 href="#character-map"><em>character map</em></a> (‘<code
5841 class=property>cmap</code>’) table contains a mapping of character
5842 encodings to glyphs. Apple later added additional tables for supporting
5843 enhanced typographic functionality; these are now called Apple Advanced
5844 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
5845 tables for advanced typography and called their format OpenType <a
5846 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
5848 <p>In many cases the font data used under Microsoft Windows or Linux is
5849 slightly different from the data used under Apple's Mac OS X because the
5850 TrueType format allowed for explicit variation across platforms. This
5851 includes font metrics, names and <a href="#character-map"><em>character
5852 map</em></a> data.
5854 <p>Specifically, font family name data is handled differently across
5855 platforms. For TrueType and OpenType fonts these names are contained in
5856 the ‘<code class=property>name</code>’ table, in name records with
5857 name ID 1. Mulitple names can be stored for different locales, but
5858 Microsoft recommends fonts always include at least a US English version of
5859 the name. On Windows, Microsoft made the decision for backwards
5860 compatibility to limit this family name to a maximum of four faces; for
5861 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
5862 ID 21) can be used. Other platforms such as OSX don't have this
5863 limitation, so the family name is used to define all possible groupings.
5865 <p>Other name table data provides names used to uniquely identify a
5866 specific face within a family. The full font name (name ID 4) and the
5867 Postscript name (name ID 6) describe a single face uniquely. For example,
5868 the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
5869 and a Postscript name of "GillSans-Bold". There can be multiple localized
5870 versions of the fullname for a given face, but the Postscript name is
5871 always a unique name made from a limited set of ASCII characters.
5873 <p>On various platforms, different names are used to search for a font. For
5874 example, with the Windows GDI CreateIndirectFont API, either a family or
5875 fullname can be used to lookup a face, while on Mac OS X the
5876 CTFontCreateWithName API call is used to lookup a given face using the
5877 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
5878 to be searched using any of these names. In situations where platform
5879 API's automatically substitute other font choices, it may be necessary to
5880 verify a returned font matches a given name.
5882 <p>The weight of a given face can be determined via the usWeightClass field
5883 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
5884 the width can be determined via the usWidthClass of the OS/2 table or
5885 inferred from the style name. For historical reasons related to synthetic
5886 bolding at weights 200 or lower with the Windows GDI API, font designers
5887 have sometimes skewed values in the OS/2 table to avoid these weights.
5889 <p>Rendering complex scripts that use contextual shaping such as Thai,
5890 Arabic and Devanagari requires features present only in OpenType or AAT
5891 fonts. Currently, complex script rendering is supported on Windows and
5892 Linux using OpenType font features while both OpenType and AAT font
5893 features are used under Mac OS X.
5895 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
5897 <h3 class=no-num id=recent-changes> Changes from the <a
5898 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">February 2013
5899 CSS3 Fonts Working Draft</a></h3>
5901 <p>Major changes include:
5903 <ul>
5904 <li>Moved font load events into a separate <a
5905 href="http://dev.w3.org/csswg/css-font-load-events/">spec</a>
5907 <li>Tightened syntax rules for <a
5908 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5909 rules
5911 <li>Added grammar productions for <a
5912 href="#at-font-face-rule"><code>@font-face</code></a> and <a
5913 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5914 rules
5916 <li>Revised definition of ‘<a href="#descdef-unicode-range"><code
5917 class=property>unicode-range</code></a>’ descriptor
5919 <li>Detailed font matching of composite faces
5921 <li>Revised object model interface of CSSFontFeatureValuesRule
5923 <li>Detailed effect of ‘<a href="#propdef-font-size-adjust"><code
5924 class=property>font-size-adjust</code></a>’ on relative unit sizes
5926 <li>Reference the potentially CORS-enabled fetch method defined in HTML5
5927 </ul>
5929 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
5931 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
5932 their help and feedback. John Hudson was kind enough to take the time to
5933 explain the subtleties of OpenType language tags and provided the example
5934 of character variant usage for displaying text on Byzantine seals. Ken
5935 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
5936 and Unicode variation selectors. The idea for supporting font features by
5937 using <a href="#propdef-font-variant"
5938 title="font-variant!!property">‘<code
5939 class=property>font-variant</code>’</a> subproperties originated with
5940 Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
5941 of the initial design ideas for the <a
5942 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5943 rule. Thanks also to House Industries for allowing the use of Ed Interlock
5944 in the discretionary ligatures example.
5946 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
5947 that is <em>The Elements of Typographic Style</em>.
5949 <h2 class=no-num id=conformance> Conformance</h2>
5951 <h3 class=no-num id=conventions> Document Conventions</h3>
5953 <p>Conformance requirements are expressed with a combination of descriptive
5954 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
5955 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
5956 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
5957 normative parts of this document are to be interpreted as described in RFC
5958 2119. However, for readability, these words do not appear in all uppercase
5959 letters in this specification.
5961 <p>All of the text of this specification is normative except sections
5962 explicitly marked as non-normative, examples, and notes. <a
5963 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
5965 <p>Examples in this specification are introduced with the words “for
5966 example” or are set apart from the normative text with
5967 <code>class="example"</code>, like this:
5969 <div class=example>
5970 <p>This is an example of an informative example.
5971 </div>
5973 <p>Informative notes begin with the word “Note” and are set apart from
5974 the normative text with <code>class="note"</code>, like this:
5976 <p class=note>Note, this is an informative note.
5978 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
5980 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
5981 classes:
5983 <dl>
5984 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
5985 sheet</dfn>
5987 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
5988 style sheet</a>.
5990 <dt><dfn id=renderer>renderer</dfn>
5992 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5993 that interprets the semantics of a style sheet and renders documents that
5994 use them.
5996 <dt><dfn id=authoring-tool>authoring tool</dfn>
5998 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5999 that writes a style sheet.
6000 </dl>
6002 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
6003 declarations that use properties defined in this module have values that
6004 are valid according to the generic CSS grammar and the individual grammars
6005 of each property as given in this module.
6007 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
6008 interpreting the style sheet as defined by the appropriate specifications,
6009 it supports all the features defined by CSS Fonts Level 3 Module by
6010 parsing them correctly and rendering the document accordingly. However,
6011 the inability of a UA to correctly render a document due to limitations of
6012 the device does not make the UA non-conformant. (For example, a UA is not
6013 required to render color on a monochrome monitor.)
6015 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
6016 style sheets that are syntactically correct according to the generic CSS
6017 grammar and the individual grammars of each feature in this module, and
6018 meet all other conformance requirements of style sheets as described in
6019 this module.
6021 <h3 class=no-num id=partial> Partial Implementations</h3>
6023 <p>So that authors can exploit the forward-compatible parsing rules to
6024 assign fallback values, CSS renderers <strong>must</strong> treat as
6025 invalid (and <a
6026 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
6027 appropriate</a>) any at-rules, properties, property values, keywords, and
6028 other syntactic constructs for which they have no usable level of support.
6029 In particular, user agents <strong>must not</strong> selectively ignore
6030 unsupported component values and honor supported values in a single
6031 multi-value property declaration: if any value is considered invalid (as
6032 unsupported values must be), CSS requires that the entire declaration be
6033 ignored.
6035 <h3 class=no-num id=experimental> Experimental Implementations</h3>
6037 <p>To avoid clashes with future CSS features, the CSS2.1 specification
6038 reserves a <a
6039 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
6040 syntax</a> for proprietary and experimental extensions to CSS.
6042 <p>Prior to a specification reaching the Candidate Recommendation stage in
6043 the W3C process, all implementations of a CSS feature are considered
6044 experimental. The CSS Working Group recommends that implementations use a
6045 vendor-prefixed syntax for such features, including those in W3C Working
6046 Drafts. This avoids incompatibilities with future changes in the draft.
6048 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
6050 <p>Once a specification reaches the Candidate Recommendation stage,
6051 non-experimental implementations are possible, and implementors should
6052 release an unprefixed implementation of any CR-level feature they can
6053 demonstrate to be correctly implemented according to spec.
6055 <p>To establish and maintain the interoperability of CSS across
6056 implementations, the CSS Working Group requests that non-experimental CSS
6057 renderers submit an implementation report (and, if necessary, the
6058 testcases used for that implementation report) to the W3C before releasing
6059 an unprefixed implementation of any CSS features. Testcases submitted to
6060 W3C are subject to review and correction by the CSS Working Group.
6062 <p>Further information on submitting testcases and implementation reports
6063 can be found from on the CSS Working Group's website at <a
6064 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
6065 Questions should be directed to the <a
6066 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
6067 mailing list.
6069 <h2 class=no-num id=references>References</h2>
6071 <h3 class=no-num id=normative-references>Normative References</h3>
6072 <!--begin-normative-->
6073 <!-- Sorted by label -->
6075 <dl class=bibliography>
6076 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6077 <!---->
6079 <dt id=CHARMOD>[CHARMOD]
6081 <dd>Martin J. Dürst; et al. <a
6082 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
6083 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
6084 2005. W3C Recommendation. URL: <a
6085 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
6086 </dd>
6087 <!---->
6089 <dt id=CORS>[CORS]
6091 <dd>Anne van Kesteren. <a
6092 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
6093 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
6094 Recommendation. (Work in progress.) URL: <a
6095 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
6096 </dd>
6097 <!---->
6099 <dt id=CSS21>[CSS21]
6101 <dd>Bert Bos; et al. <a
6102 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
6103 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
6104 2011. W3C Recommendation. URL: <a
6105 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
6106 </dd>
6107 <!---->
6109 <dt id=CSS3VAL>[CSS3VAL]
6111 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
6112 href="http://www.w3.org/TR/2013/CR-css3-values-20130404/"><cite>CSS
6113 Values and Units Module Level 3.</cite></a> 4 April 2013. W3C Candidate
6114 Recommendation. (Work in progress.) URL: <a
6115 href="http://www.w3.org/TR/2013/CR-css3-values-20130404/">http://www.w3.org/TR/2013/CR-css3-values-20130404/</a>
6116 </dd>
6117 <!---->
6119 <dt id=HTML5>[HTML5]
6121 <dd>Ian Hickson. <a
6122 href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
6123 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
6124 <a
6125 href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
6126 </dd>
6127 <!---->
6129 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
6131 <dd><a
6132 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136"><cite>Information
6133 technology — Coding of audio-visual objects — Part 22: Open Font
6134 Format.</cite></a> International Organization for Standardization.
6135 ISO/IEC 14496-22:2009. URL: <a
6136 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>
6137 </dd>
6138 <!---->
6140 <dt id=OPENTYPE>[OPENTYPE]
6142 <dd><a
6143 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
6144 specification.</cite></a> Microsoft. URL: <a
6145 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
6146 </dd>
6147 <!---->
6149 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
6151 <dd><a
6152 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
6153 feature registry.</cite></a> Microsoft. URL: <a
6154 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
6155 </dd>
6156 <!---->
6158 <dt id=RFC2119>[RFC2119]
6160 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
6161 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
6162 RFC 2119. URL: <a
6163 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
6164 </dd>
6165 <!---->
6167 <dt id=UAX15>[UAX15]
6169 <dd>Mark Davis; Ken Whistler. <a
6170 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
6171 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
6172 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
6173 </dd>
6174 <!---->
6176 <dt id=UAX29>[UAX29]
6178 <dd>Mark Davis. <a
6179 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
6180 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
6181 URL: <a
6182 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
6183 </dd>
6184 <!---->
6186 <dt id=UNICODE6>[UNICODE6]
6188 <dd>The Unicode Consortium. <a
6189 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
6190 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
6191 Version 6.2.0 URL: <a
6192 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
6193 </dd>
6194 <!---->
6195 </dl>
6196 <!--end-normative-->
6197 <!--{{!CSS21}}-->
6198 <!--{{!CSS3VAL}}-->
6199 <!--{{!OPENTYPE}}-->
6200 <!--{{!OPENTYPE-FEATURES}}-->
6201 <!--{{!OPEN-FONT-FORMAT}}-->
6202 <!--{{!UNICODE6}}-->
6203 <!--{{!UAX15}}-->
6204 <!--{{!UAX29}}-->
6205 <!--{{!CORS}}-->
6206 <!--{{!HTML5}}-->
6207 <!--{{!CHARMOD}}-->
6209 <h3 class=no-num id=other-references>Other References</h3>
6210 <!--begin-informative-->
6211 <!-- Sorted by label -->
6213 <dl class=bibliography>
6214 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6215 <!---->
6217 <dt id=AAT-FEATURES>[AAT-FEATURES]
6219 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
6220 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
6221 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
6222 </dd>
6223 <!---->
6225 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
6227 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
6228 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
6229 <!---->
6231 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
6233 <dd>François Yergeau; et al. <a
6234 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
6235 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
6236 W3C Working Draft. (Work in progress.) URL: <a
6237 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
6238 </dd>
6239 <!---->
6241 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
6243 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
6244 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
6245 <!---->
6247 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
6249 <dd>L. David Baron. <a
6250 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/"><cite>CSS
6251 Conditional Rules Module Level 3.</cite></a> 4 April 2013. W3C Candidate
6252 Recommendation. (Work in progress.) URL: <a
6253 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/">http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a>
6254 </dd>
6255 <!---->
6257 <dt id=CSS3TEXT>[CSS3TEXT]
6259 <dd>Elika J. Etemad; Koji Ishii. <a
6260 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
6261 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
6262 progress.) URL: <a
6263 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
6264 </dd>
6265 <!---->
6267 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
6269 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
6270 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
6271 ISBN 0-201-17633-5.</dd>
6272 <!---->
6274 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
6276 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
6277 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
6278 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
6279 2000. W3C Recommendation. URL: <a
6280 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>
6281 </dd>
6282 <!---->
6284 <dt id=ELEMTYPO>[ELEMTYPO]
6286 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
6287 4.</cite> Hartley & Marks. 2013. ISBN 0-88179-212-8.</dd>
6288 <!---->
6290 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
6292 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
6293 ISBN 1-932026-01-0.</dd>
6294 <!---->
6296 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
6298 <dd><a
6299 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
6300 User Guide.</cite></a> FontShop International. URL: <a
6301 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
6302 </dd>
6303 <!---->
6305 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
6307 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
6308 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
6309 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
6310 <!---->
6312 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
6314 <dd>John Hudson. <a
6315 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
6316 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
6317 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
6318 </dd>
6319 <!---->
6320 </dl>
6321 <!--end-informative-->
6322 <!--{{ARABIC-TYPO}}-->
6323 <!--{{CJKV-INFO-PROCESSING}}-->
6324 <!--{{DIGITAL-TYPOGRAPHY}}-->
6325 <!--{{DOM-LEVEL-2-STYLE}}-->
6326 <!--{{ELEMTYPO}}-->
6327 <!--{{LANGCULTTYPE}}-->
6328 <!--{{OPENTYPE-FONT-GUIDE}}-->
6329 <!--{{RASTER-TRAGEDY}}-->
6330 <!--{{WINDOWS-GLYPH-PROC}}-->
6331 <!--{{CHARMOD-NORM}}-->
6332 <!--{{AAT-FEATURES}}-->
6333 <!--{{CSS3-CONDITIONAL}}-->
6334 <!--{{CSS3TEXT}}-->
6336 <h2 class=no-num id=index>Index</h2>
6337 <!--begin-index-->
6339 <ul class=indexlist>
6340 <li>100...900 weight values, <a href="#font-weight-numeric-values"
6341 title="100...900 weight values"><strong>3.2</strong></a>
6343 <li><var><absolute-size></var>, <a href="#absolute-size-value"
6344 title="<absolute-size>"><strong>3.5</strong></a>
6346 <li><var><common-lig-values></var>, <a href="#common-lig-values"
6347 title="<common-lig-values>"><strong>6.4</strong></a>
6349 <li><var><contextual-alt-values></var>, <a
6350 href="#contextual-alt-values"
6351 title="<contextual-alt-values>"><strong>6.4</strong></a>
6353 <li><var><discretionary-lig-values></var>, <a
6354 href="#discretionary-lig-values"
6355 title="<discretionary-lig-values>"><strong>6.4</strong></a>
6357 <li><var><east-asian-variant-values></var>, <a
6358 href="#east-asian-variant-values"
6359 title="<east-asian-variant-values>"><strong>6.10</strong></a>
6361 <li><var><east-asian-width-values></var>, <a
6362 href="#east-asian-width-values"
6363 title="<east-asian-width-values>"><strong>6.10</strong></a>
6365 <li><var><family-name></var>, <a href="#family-name-value"
6366 title="<family-name>"><strong>3.1</strong></a>
6368 <li><var><feature-tag-value></var>, <a href="#feature-tag-value"
6369 title="<feature-tag-value>"><strong>6.12</strong></a>
6371 <li><var><font-face-name></var>, <a href="#font-face-name-value"
6372 title="<font-face-name>"><strong>4.3</strong></a>
6374 <li><var><font-variant-css21></var>, <a
6375 href="#font-variant-css21-values"
6376 title="<font-variant-css21>"><strong>3.7</strong></a>
6378 <li><var><generic-family></var>, <a href="#generic-family-value"
6379 title="<generic-family>"><strong>3.1</strong></a>
6381 <li><var><historical-lig-values></var>, <a
6382 href="#historical-lig-values"
6383 title="<historical-lig-values>"><strong>6.4</strong></a>
6385 <li><var><length></var>, <a href="#length-size-value"
6386 title="<length>"><strong>3.5</strong></a>
6388 <li><var><number></var>, <a href="#aspect-ratio-value"
6389 title="<number>"><strong>3.6</strong></a>
6391 <li><var><numeric-figure-values></var>, <a
6392 href="#numeric-figure-values"
6393 title="<numeric-figure-values>"><strong>6.7</strong></a>
6395 <li><var><numeric-fraction-values></var>, <a
6396 href="#numeric-fraction-values"
6397 title="<numeric-fraction-values>"><strong>6.7</strong></a>
6399 <li><var><numeric-spacing-values></var>, <a
6400 href="#numeric-spacing-values"
6401 title="<numeric-spacing-values>"><strong>6.7</strong></a>
6403 <li><var><percentage></var>, <a href="#percentage-size-value"
6404 title="<percentage>"><strong>3.5</strong></a>
6406 <li><var><relative-size></var>, <a href="#relative-size-value"
6407 title="<relative-size>"><strong>3.5</strong></a>
6409 <li><var><string></var>, <a
6410 href="#font-language-override-string-value"
6411 title="<string>"><strong>6.13</strong></a>
6413 <li><var><urange></var>, <a href="#urange-value"
6414 title="<urange>"><strong>4.5</strong></a>
6416 <li><code>@font-face</code>, <a href="#at-font-face-rule"
6417 title="@font-face"><strong>4.1</strong></a>
6419 <li><code>@font-feature-values</code>, <a
6420 href="#at-font-feature-values-rule"
6421 title="@font-feature-values"><strong>6.9</strong></a>
6423 <li>all-petite-caps, <a href="#all-petite-caps"
6424 title=all-petite-caps><strong>6.6</strong></a>
6426 <li>all-small-caps, <a href="#all-small-caps"
6427 title=all-small-caps><strong>6.6</strong></a>
6429 <li>annotation, <a href="#annotation"
6430 title=annotation><strong>6.8</strong></a>
6432 <li>aspect value, <a href="#aspect-value0" title="aspect
6433 value"><strong>3.6</strong></a>
6435 <li>authoring tool, <a href="#authoring-tool" title="authoring
6436 tool"><strong>#</strong></a>
6438 <li>auto
6439 <ul>
6440 <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
6441 font-kerning"><strong>6.3</strong></a>
6443 <li>font-size-adjust, <a href="#font-size-adjust-auto-value"
6444 title="auto, font-size-adjust"><strong>3.6</strong></a>
6445 </ul>
6447 <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
6449 <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
6451 <li>character map, <a href="#character-map" title="character
6452 map"><strong>5.2</strong></a>
6454 <li>character-variant, <a href="#character-variant"
6455 title=character-variant><strong>6.8</strong></a>
6457 <li>common-ligatures, <a href="#common-ligatures"
6458 title=common-ligatures><strong>6.4</strong></a>
6460 <li>composite face, <a href="#composite-face" title="composite
6461 face"><strong>5.2</strong></a>
6463 <li>condensed, <a href="#condensed"
6464 title=condensed><strong>3.3</strong></a>
6466 <li>contextual, <a href="#contextual"
6467 title=contextual><strong>6.4</strong></a>
6469 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
6470 title=CSSFontFaceRule><strong>8.1</strong></a>
6472 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
6473 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
6475 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
6476 of"><strong>#</strong></a>
6478 <li>default face, <a href="#default-face" title="default
6479 face"><strong>5.2</strong></a>
6481 <li>descriptor_declaration, <a href="#descriptordeclaration"
6482 title="descriptor_declaration"><strong>4.1</strong></a>
6484 <li>diagonal-fractions, <a href="#diagonal-fractions"
6485 title=diagonal-fractions><strong>6.7</strong></a>
6487 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
6488 title=discretionary-ligatures><strong>6.4</strong></a>
6490 <li>effective character map, <a href="#effective-character-map"
6491 title="effective character map"><strong>4.5</strong></a>
6493 <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
6495 <li>extra-condensed, <a href="#extra-condensed"
6496 title=extra-condensed><strong>3.3</strong></a>
6498 <li>extra-expanded, <a href="#extra-expanded"
6499 title=extra-expanded><strong>3.3</strong></a>
6501 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
6502 of"><strong>#</strong></a>
6504 <li>feature_type, <a href="#featuretype"
6505 title="feature_type"><strong>6.9.1</strong></a>
6507 <li>feature_value_block, <a href="#featurevalueblock"
6508 title="feature_value_block"><strong>6.9.1</strong></a>
6510 <li>feature_value_definition, <a href="#featurevaluedefinition"
6511 title="feature_value_definition"><strong>6.9.1</strong></a>
6513 <li>first available font, <a href="#first-available-font" title="first
6514 available font"><strong>5.2</strong></a>
6516 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
6518 <li>font specific, <a href="#font-specific" title="font
6519 specific"><strong>6.8</strong></a>
6521 <li>font-family
6522 <ul>
6523 <li>descriptor, <a href="#descdef-font-family" title="font-family,
6524 descriptor"><strong>4.2</strong></a>
6526 <li>property, <a href="#propdef-font-family" title="font-family,
6527 property"><strong>3.1</strong></a>
6528 </ul>
6530 <li>font-feature-settings
6531 <ul>
6532 <li>descriptor, <a href="#descdef-font-feature-settings"
6533 title="font-feature-settings, descriptor"><strong>4.7</strong></a>
6535 <li>property, <a href="#propdef-font-feature-settings"
6536 title="font-feature-settings, property"><strong>6.12</strong></a>
6537 </ul>
6539 <li>font-kerning, <a href="#propdef-font-kerning"
6540 title=font-kerning><strong>6.3</strong></a>
6542 <li>font-language-override, <a href="#propdef-font-language-override"
6543 title=font-language-override><strong>6.13</strong></a>
6545 <li>font-size, <a href="#propdef-font-size"
6546 title=font-size><strong>3.5</strong></a>
6548 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
6549 title=font-size-adjust><strong>3.6</strong></a>
6551 <li>font-stretch
6552 <ul>
6553 <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
6554 descriptor"><strong>4.4</strong></a>
6556 <li>property, <a href="#propdef-font-stretch" title="font-stretch,
6557 property"><strong>3.3</strong></a>
6558 </ul>
6560 <li>font-style
6561 <ul>
6562 <li>descriptor, <a href="#descdef-font-style" title="font-style,
6563 descriptor"><strong>4.4</strong></a>
6565 <li>property, <a href="#propdef-font-style" title="font-style,
6566 property"><strong>3.4</strong></a>
6567 </ul>
6569 <li>font-synthesis, <a href="#propdef-font-synthesis"
6570 title=font-synthesis><strong>3.8</strong></a>
6572 <li>font-variant
6573 <ul>
6574 <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
6575 descriptor"><strong>4.7</strong></a>
6577 <li>property, <a href="#propdef-font-variant" title="font-variant,
6578 property"><strong>6.11</strong></a>
6579 </ul>
6581 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
6582 title=font-variant-alternates><strong>6.8</strong></a>
6584 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
6585 title=font-variant-caps><strong>6.6</strong></a>
6587 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
6588 title=font-variant-east-asian><strong>6.10</strong></a>
6590 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
6591 title=font-variant-ligatures><strong>6.4</strong></a>
6593 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
6594 title=font-variant-numeric><strong>6.7</strong></a>
6596 <li>font-variant-position, <a href="#propdef-font-variant-position"
6597 title=font-variant-position><strong>6.5</strong></a>
6599 <li>font-weight
6600 <ul>
6601 <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
6602 descriptor"><strong>4.4</strong></a>
6604 <li>property, <a href="#propdef-font-weight" title="font-weight,
6605 property"><strong>3.2</strong></a>
6606 </ul>
6608 <li>font_face_rule, <a href="#fontfacerule"
6609 title="font_face_rule"><strong>4.1</strong></a>
6611 <li>FONT_FACE_SYM, <a href="#fontfacesym"
6612 title="FONT_FACE_SYM"><strong>4.1</strong></a>
6614 <li>font_family_name, <a href="#fontfamilyname"
6615 title="font_family_name"><strong>6.9.1</strong></a>
6617 <li>font_family_name_list, <a href="#fontfamilynamelist"
6618 title="font_family_name_list"><strong>6.9.1</strong></a>
6620 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
6621 title="font_feature_values_rule"><strong>6.9.1</strong></a>
6623 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
6624 title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
6626 <li>full-width, <a href="#full-width"
6627 title=full-width><strong>6.10</strong></a>
6629 <li>historical-forms, <a href="#historical-forms"
6630 title=historical-forms><strong>6.8</strong></a>
6632 <li>historical-ligatures, <a href="#historical-ligatures"
6633 title=historical-ligatures><strong>6.4</strong></a>
6635 <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
6637 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
6639 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
6641 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
6643 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
6645 <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
6647 <li>lining-nums, <a href="#lining-nums"
6648 title=lining-nums><strong>6.7</strong></a>
6650 <li>monospace, definition of, <a href="#monospace0" title="monospace,
6651 definition of"><strong>#</strong></a>
6653 <li>no-common-ligatures, <a href="#no-common-ligatures"
6654 title=no-common-ligatures><strong>6.4</strong></a>
6656 <li>no-contextual, <a href="#no-contextual"
6657 title=no-contextual><strong>6.4</strong></a>
6659 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
6660 title=no-discretionary-ligatures><strong>6.4</strong></a>
6662 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
6663 title=no-historical-ligatures><strong>6.4</strong></a>
6665 <li>none
6666 <ul>
6667 <li>font-kerning, <a href="#font-kerning-none-value" title="none,
6668 font-kerning"><strong>6.3</strong></a>
6670 <li>font-size-adjust, <a href="#font-size-adjust-none-value"
6671 title="none, font-size-adjust"><strong>3.6</strong></a>
6673 <li>font-variant, <a href="#font-variant-none-value" title="none,
6674 font-variant"><strong>6.11</strong></a>
6676 <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
6677 title="none, font-variant-ligatures"><strong>6.4</strong></a>
6678 </ul>
6680 <li>normal
6681 <ul>
6682 <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
6683 title="normal, font-feature-settings"><strong>6.12</strong></a>
6685 <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
6686 font-kerning"><strong>6.3</strong></a>
6688 <li>font-language-override, <a
6689 href="#font-language-override-normal-value" title="normal,
6690 font-language-override"><strong>6.13</strong></a>
6692 <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
6693 font-stretch"><strong>3.3</strong></a>
6695 <li>font-style, <a href="#font-style-normal-value" title="normal,
6696 font-style"><strong>3.4</strong></a>
6698 <li>font-variant, <a href="#font-variant-normal-value" title="normal,
6699 font-variant"><strong>6.11</strong></a>
6701 <li>font-variant-alternates, <a
6702 href="#font-variant-alternates-normal-value" title="normal,
6703 font-variant-alternates"><strong>6.8</strong></a>
6705 <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
6706 title="normal, font-variant-caps"><strong>6.6</strong></a>
6708 <li>font-variant-east-asian, <a
6709 href="#font-variant-east-asian-normal-value" title="normal,
6710 font-variant-east-asian"><strong>6.10</strong></a>
6712 <li>font-variant-ligatures, <a
6713 href="#font-variant-ligatures-normal-value" title="normal,
6714 font-variant-ligatures"><strong>6.4</strong></a>
6716 <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
6717 title="normal, font-variant-numeric"><strong>6.7</strong></a>
6719 <li>font-variant-position, <a href="#font-variant-position-normal-value"
6720 title="normal, font-variant-position"><strong>6.5</strong></a>
6722 <li>font-weight, <a href="#font-weight-normal-value" title="normal,
6723 font-weight"><strong>3.2</strong></a>
6724 </ul>
6726 <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
6728 <li>oldstyle-nums, <a href="#oldstyle-nums"
6729 title=oldstyle-nums><strong>6.7</strong></a>
6731 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
6733 <li>ornaments, <a href="#ornaments"
6734 title=ornaments><strong>6.8</strong></a>
6736 <li>petite-caps, <a href="#petite-caps"
6737 title=petite-caps><strong>6.6</strong></a>
6739 <li>proportional-nums, <a href="#proportional-nums"
6740 title=proportional-nums><strong>6.7</strong></a>
6742 <li>proportional-width, <a href="#proportional-width"
6743 title=proportional-width><strong>6.10</strong></a>
6745 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
6747 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
6749 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
6750 definition of"><strong>#</strong></a>
6752 <li>semi-condensed, <a href="#semi-condensed-"
6753 title=semi-condensed><strong>3.3</strong></a>
6755 <li>semi-expanded, <a href="#semi-expanded"
6756 title=semi-expanded><strong>3.3</strong></a>
6758 <li>serif, definition of, <a href="#serif0" title="serif, definition
6759 of"><strong>#</strong></a>
6761 <li>simplified, <a href="#simplified"
6762 title=simplified><strong>6.10</strong></a>
6764 <li>slashed-zero, <a href="#slashed-zero"
6765 title=slashed-zero><strong>6.7</strong></a>
6767 <li>small-caps, <a href="#small-caps"
6768 title=small-caps><strong>6.6</strong></a>
6770 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
6772 <li>stacked-fractions, <a href="#stacked-fractions"
6773 title=stacked-fractions><strong>6.7</strong></a>
6775 <li>style sheet
6776 <ul>
6777 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
6778 conformance class"><strong>#</strong></a>
6779 </ul>
6781 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
6783 <li>stylistic, <a href="#stylistic"
6784 title=stylistic><strong>6.8</strong></a>
6786 <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
6788 <li>super, <a href="#super" title=super><strong>6.5</strong></a>
6790 <li>support, <a href="#support" title=support><strong>5.2</strong></a>
6792 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
6794 <li>system font fallback, <a href="#system-font-fallback" title="system
6795 font fallback"><strong>5.2</strong></a>
6797 <li>tabular-nums, <a href="#tabular-nums"
6798 title=tabular-nums><strong>6.7</strong></a>
6800 <li>titling-caps, <a href="#titling-caps"
6801 title=titling-caps><strong>6.6</strong></a>
6803 <li>traditional, <a href="#traditional"
6804 title=traditional><strong>6.10</strong></a>
6806 <li>ultra-condensed, <a href="#ultra-condensed"
6807 title=ultra-condensed><strong>3.3</strong></a>
6809 <li>ultra-expanded, <a href="#ultra-expanded"
6810 title=ultra-expanded><strong>3.3</strong></a>
6812 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
6814 <li>unicode-range, <a href="#descdef-unicode-range"
6815 title=unicode-range><strong>4.5</strong></a>
6817 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
6819 <li>width, <a href="#width" title=width><strong>2</strong></a>
6820 </ul>
6821 <!--end-index-->
6823 <h2 class=no-num id=property-index>Property index</h2>
6824 <!--begin-properties-->
6826 <table class=proptable>
6827 <thead>
6828 <tr>
6829 <th>Property
6831 <th>Values
6833 <th>Initial
6835 <th>Applies to
6837 <th>Inh.
6839 <th>Percentages
6841 <th>Media
6843 <tbody>
6844 <tr>
6845 <th><a class=property href="#propdef-font">font</a>
6847 <td>[ [ <‘font-style’> || <font-variant-css21> ||
6848 <‘font-weight’> || <‘font-stretch’ ]?
6849 <‘font-size’> [ / <‘line-height’> ]?
6850 <‘font-family’> ] | caption | icon | menu | message-box |
6851 small-caption | status-bar
6853 <td>see individual properties
6855 <td>all elements
6857 <td>yes
6859 <td>see individual properties
6861 <td>visual
6863 <tr>
6864 <th><span class=property>font-family</span>
6866 <td>[ <family-name> | <generic-family> ] #
6868 <td>depends on user agent
6870 <td>all elements
6872 <td>yes
6874 <td>N/A
6876 <td>visual
6878 <tr>
6879 <th><span class=property>font-feature-settings</span>
6881 <td>normal | <feature-tag-value> #
6883 <td>normal
6885 <td>all elements
6887 <td>yes
6889 <td>N/A
6891 <td>visual
6893 <tr>
6894 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
6896 <td>auto | normal | none
6898 <td>auto
6900 <td>all elements
6902 <td>yes
6904 <td>N/A
6906 <td>visual
6908 <tr>
6909 <th><a class=property
6910 href="#propdef-font-language-override">font-language-override</a>
6912 <td>normal | <string>
6914 <td>normal
6916 <td>all elements
6918 <td>yes
6920 <td>N/A
6922 <td>visual
6924 <tr>
6925 <th><a class=property href="#propdef-font-size">font-size</a>
6927 <td><absolute-size> | <relative-size> | <length> |
6928 <percentage>
6930 <td>medium
6932 <td>all elements
6934 <td>yes
6936 <td>refer to parent element's font size
6938 <td>visual
6940 <tr>
6941 <th><a class=property
6942 href="#propdef-font-size-adjust">font-size-adjust</a>
6944 <td>none | auto | <number>
6946 <td>none
6948 <td>all elements
6950 <td>yes
6952 <td>N/A
6954 <td>visual
6956 <tr>
6957 <th><span class=property>font-stretch</span>
6959 <td>normal | ultra-condensed | extra-condensed | condensed |
6960 semi-condensed | semi-expanded | expanded | extra-expanded |
6961 ultra-expanded
6963 <td>normal
6965 <td>all elements
6967 <td>yes
6969 <td>N/A
6971 <td>visual
6973 <tr>
6974 <th><span class=property>font-style</span>
6976 <td>normal | italic | oblique
6978 <td>normal
6980 <td>all elements
6982 <td>yes
6984 <td>N/A
6986 <td>visual
6988 <tr>
6989 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
6991 <td>none | [ weight || style ]
6993 <td>weight style
6995 <td>all elements
6997 <td>yes
6999 <td>N/A
7001 <td>visual
7003 <tr>
7004 <th><span class=property>font-variant</span>
7006 <td>normal | none | [ <common-lig-values> ||
7007 <discretionary-lig-values> || <historical-lig-values> ||
7008 <contextual-alt-values> || stylistic(<feature-value-name>)
7009 || historical-forms || styleset(<feature-value-name> #) ||
7010 character-variant(<feature-value-name> #) ||
7011 swash(<feature-value-name>) ||
7012 ornaments(<feature-value-name>) ||
7013 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7014 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7015 <numeric-figure-values> || <numeric-spacing-values> ||
7016 <numeric-fraction-values> || ordinal || slashed-zero ||
7017 <east-asian-variant-values> || <east-asian-width-values> ||
7018 ruby ]
7020 <td>normal
7022 <td>all elements
7024 <td>yes
7026 <td>see individual properties
7028 <td>visual
7030 <tr>
7031 <th><a class=property
7032 href="#propdef-font-variant-alternates">font-variant-alternates</a>
7034 <td>normal | [ stylistic(<feature-value-name>) || historical-forms
7035 || styleset(<feature-value-name> #) ||
7036 character-variant(<feature-value-name> #) ||
7037 swash(<feature-value-name>) ||
7038 ornaments(<feature-value-name>) ||
7039 annotation(<feature-value-name>) ]
7041 <td>normal
7043 <td>all elements
7045 <td>yes
7047 <td>N/A
7049 <td>visual
7051 <tr>
7052 <th><a class=property
7053 href="#propdef-font-variant-caps">font-variant-caps</a>
7055 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
7056 | unicase | titling-caps
7058 <td>normal
7060 <td>all elements
7062 <td>yes
7064 <td>N/A
7066 <td>visual
7068 <tr>
7069 <th><a class=property
7070 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
7072 <td>normal | [ <east-asian-variant-values> ||
7073 <east-asian-width-values> || ruby ]
7075 <td>normal
7077 <td>all elements
7079 <td>yes
7081 <td>N/A
7083 <td>visual
7085 <tr>
7086 <th><a class=property
7087 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
7089 <td>normal | none | [ <common-lig-values> ||
7090 <discretionary-lig-values> || <historical-lig-values> ||
7091 <contextual-alt-values> ]
7093 <td>normal
7095 <td>all elements
7097 <td>yes
7099 <td>N/A
7101 <td>visual
7103 <tr>
7104 <th><a class=property
7105 href="#propdef-font-variant-numeric">font-variant-numeric</a>
7107 <td>normal | [ <numeric-figure-values> ||
7108 <numeric-spacing-values> || <numeric-fraction-values> ||
7109 ordinal || slashed-zero ]
7111 <td>normal
7113 <td>all elements
7115 <td>yes
7117 <td>N/A
7119 <td>visual
7121 <tr>
7122 <th><a class=property
7123 href="#propdef-font-variant-position">font-variant-position</a>
7125 <td>normal | sub | super
7127 <td>normal
7129 <td>all elements
7131 <td>yes
7133 <td>N/A
7135 <td>visual
7137 <tr>
7138 <th><span class=property>font-weight</span>
7140 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
7141 | 700 | 800 | 900
7143 <td>normal
7145 <td>all elements
7147 <td>yes
7149 <td>N/A
7151 <td>visual
7152 </table>
7153 <!--end-properties-->
7154 <!--begin-descriptors-->
7156 <table class=proptable>
7157 <thead>
7158 <tr>
7159 <th>Descriptor
7161 <th>Value
7163 <th>Initial
7165 <th>Percentages
7167 <th>Media
7169 <tbody>
7170 <tr>
7171 <th><span class=property>font-family</span>
7173 <td><family-name>
7175 <td>N/A
7177 <tr>
7178 <th><span class=property>font-feature-settings</span>
7180 <td>normal | <feature-tag-value> #
7182 <td>normal
7184 <tr>
7185 <th><span class=property>font-stretch</span>
7187 <td>normal | ultra-condensed | extra-condensed | condensed |
7188 semi-condensed | semi-expanded | expanded | extra-expanded |
7189 ultra-expanded
7191 <td>normal
7193 <tr>
7194 <th><span class=property>font-style</span>
7196 <td>normal | italic | oblique
7198 <td>normal
7200 <tr>
7201 <th><span class=property>font-variant</span>
7203 <td>normal | none | [ <common-lig-values> ||
7204 <discretionary-lig-values> || <historical-lig-values> ||
7205 <contextual-alt-values> || stylistic(<feature-value-name>)
7206 || historical-forms || styleset(<feature-value-name> #) ||
7207 character-variant(<feature-value-name> #) ||
7208 swash(<feature-value-name>) ||
7209 ornaments(<feature-value-name>) ||
7210 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7211 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7212 <numeric-figure-values> || <numeric-spacing-values> ||
7213 <numeric-fraction-values> || ordinal || slashed-zero ||
7214 <east-asian-variant-values> || <east-asian-width-values> ||
7215 ruby ]
7217 <td>normal
7219 <tr>
7220 <th><span class=property>font-weight</span>
7222 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
7224 <td>normal
7226 <tr>
7227 <th><a class=property href="#descdef-src">src</a>
7229 <td>[ <url> [format(<string> #)]? | <font-face-name> ] #
7231 <td>N/A
7233 <tr>
7234 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
7236 <td><urange> #
7238 <td>U+0-10FFFF
7239 </table>
7240 <!--end-descriptors-->
7241 <script type="text/javascript">
7242 window.onload = function () {
7243 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
7244 var i, hiresElements = document.getElementsByClassName("hires");
7245 for (i = 0; i < hiresElements.length; i++) {
7246 var h = hiresElements[i];
7247 if (h.tagName != "IMG") continue;
7248 var src = h.getAttribute("src");
7249 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
7250 h.src = src2x;
7251 }
7252 }
7253 </script>
7254 </html>
7255 <!-- Keep this comment at the end of the file
7256 Local variables:
7257 mode: sgml
7258 sgml-declaration:"~/SGML/HTML4.decl"
7259 sgml-default-doctype-name:"html"
7260 sgml-minimize-attributes:t
7261 sgml-nofill-elements:("pre" "style" "br")
7262 sgml-live-element-indicator:t
7263 sgml-omittag:nil
7264 sgml-shorttag:nil
7265 sgml-namecase-general:t
7266 sgml-general-insert-case:lower
7267 sgml-always-quote-attributes:t
7268 sgml-indent-step:nil
7269 sgml-indent-data:t
7270 sgml-parent-document:nil
7271 sgml-exposed-tags:nil
7272 sgml-local-catalogs:nil
7273 sgml-local-ecat-files:nil
7274 End:
7275 -->
7276 <!--
7278 to do:
7280 - wording of OpenType family name handling
7281 - handling combining sequences in the font matching algorithm
7282 - fix-up fi ligature example
7284 -->