Fri, 24 May 2013 09:49:02 +0800
[css-fonts] remove quotes in unicode-range defn
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 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
14 <!-- I'm just experimenting here, don't get your bee in a bonnet -->
15 <script src="http://use.typekit.com/xon2bky.js"
16 type="text/javascript"></script>
17 <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
19 <style type="text/css">
21 body, th, td, h1, h2, h3, h4, h5, h6 {
22 font-family: "myriad-pro", sans-serif !important;
23 }
25 body {
26 padding: 2em 70px 2em 70px;
27 }
29 p + p, p.mtb {
30 margin-top: 0.8em;
31 text-indent: 0px;
32 }
34 #bolderlighter {
35 width: 40%;
36 }
38 #bolderlighter th {
39 text-align: center;
40 }
42 #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
43 padding-right: 2em;
44 text-align: left;
45 }
47 dd {
48 margin-bottom: 1em;
49 }
51 #authors dd {
52 margin-bottom: 0;
53 }
55 #fontstylematchingalg {
56 list-style-type: lower-alpha;
57 }
59 #fontmatchingalg ul, #fontmatchingalg ol {
60 margin-top: 0.8em;
61 }
63 #fontmatchingalg li + li {
64 margin-top: 0.8em;
65 }
67 div.example {
68 padding: 1em;
69 margin-top: 1em;
70 }
72 div.example + div.example {
73 margin-top: 2em;
74 }
76 div.figure {
77 page-break-inside: avoid;
78 }
80 pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
82 div.featex {
83 width: 700px;
84 }
86 div.featex img {
87 margin: auto;
88 display: block;
89 }
91 span.tag {
92 font-family: monospace;
93 font-size: 120%;
94 }
96 ol ol {
97 list-style-type: lower-alpha;
98 }
100 .idl-code {
101 font-weight: bold;
102 color: #c50;
103 }
104 </style>
105 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
106 type="text/css">
108 <body>
109 <div class=head> <!--begin-logo-->
110 <p><a href="http://www.w3.org/"><img alt=W3C height=48
111 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
113 <h1>CSS Fonts Module Level 3</h1>
115 <h2 class="no-num no-toc" id=editors-draft-24-may-2013>Editor's Draft 24
116 May 2013</h2>
118 <dl id=authors>
119 <dt>This version:
121 <dd><a
122 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
123 <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css3-fonts-20130524/">http://www.w3.org/TR/2013/ED-css3-fonts-20130524/</a> -->
126 <dt>Latest version:
128 <dd><a
129 href="http://www.w3.org/TR/css3-fonts/">http://www.w3.org/TR/css3-fonts/</a>
131 <dt>Latest editor's draft:
133 <dd><a
134 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
135 (<a
136 href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
137 log</a>)
139 <dt>Previous version:
141 <dd><a
142 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a>
144 <dt>Issues List:
146 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
147 issues in Tracker</a>
149 <dd><a
150 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
151 Fonts issues in Bugzilla</a>
153 <dt>Discussion:
155 <dd><a
156 href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
157 with subject line “<kbd>[css-fonts] <var>… message topic
158 …</var></kbd>” (<a
159 href="http://lists.w3.org/Archives/Public/www-style/"
160 rel=discussion>archives</a>)
162 <dt>Editor:
164 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
165 </dl>
166 <!--begin-copyright-->
167 <p class=copyright><a
168 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
169 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
170 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
171 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
172 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
173 title="European Research Consortium for Informatics and
174 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
175 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
176 <a
177 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
178 <a
179 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
180 and <a
181 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
182 use</a> rules apply.</p>
183 <!--end-copyright-->
184 <hr title="Separator for header">
185 </div>
187 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
189 <p>This CSS3 module describes how font properties are specified and how
190 font resources are loaded dynamically. The contents of this specification
191 are a consolidation of content previously divided into <a
192 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
193 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
194 Web Fonts</a> modules. The description of font load events was moved into
195 the <a href="http://dev.w3.org/csswg/css3-font-load-events/">CSS3 Font
196 Load Events</a> module.
198 <h2 class="no-num no-toc" id=status>Status of this document</h2>
199 <!--begin-status-->
201 <p>This is a public copy of the editors' draft. It is provided for
202 discussion only and may change at any moment. Its publication here does
203 not imply endorsement of its contents by W3C. Don't cite this document
204 other than as work in progress.
206 <p>The (<a
207 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
208 mailing list <a
209 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
210 www-style@w3.org</a> (see <a
211 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
212 discussion of this specification. When sending e-mail, please put the text
213 “css3-fonts” in the subject, preferably like this:
214 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
216 <p>This document was produced by the <a
217 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
218 the <a href="http://www.w3.org/Style/">Style Activity</a>).
220 <p>This document was produced by a group operating under the <a
221 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
222 2004 W3C Patent Policy</a>. W3C maintains a <a
223 href="http://www.w3.org/2004/01/pp-impl/32061/status"
224 rel=disclosure>public list of any patent disclosures</a> made in
225 connection with the deliverables of the group; that page also includes
226 instructions for disclosing a patent. An individual who has actual
227 knowledge of a patent which the individual believes contains <a
228 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
229 Claim(s)</a> must disclose the information in accordance with <a
230 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
231 6 of the W3C Patent Policy</a>.</p>
232 <!--end-status-->
233 <!--
234 <h3 class="no-num no-toc" id="atrisk">Features at risk</h3>
236 <p>The following features are at risk and may be removed when exiting CR:</p>
238 <ul>
239 </ul>
240 -->
242 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
243 <!--begin-toc-->
245 <ul class=toc>
246 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
248 <li><a href="#typography-background"><span class=secno>2 </span>Typography
249 Background</a>
251 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
252 Properties</a>
253 <ul class=toc>
254 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
255 family: the font-family property</a>
256 <ul class=toc>
257 <li><a href="#generic-font-families"><span class=secno>3.1.1
258 </span>Generic font families</a>
259 </ul>
261 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
262 weight: the font-weight property</a>
264 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
265 width: the font-stretch property</a>
267 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
268 the font-style property</a>
270 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
271 the font-size property</a>
273 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
274 </span>Relative sizing: the font-size-adjust property</a>
276 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
277 property: the font property</a>
279 <li><a href="#font-synthesis-prop"><span class=secno>3.8
280 </span>Controlling synthetic faces: the font-synthesis property</a>
281 </ul>
283 <li><a href="#font-resources"><span class=secno>4 </span>Font
284 Resources</a>
285 <ul class=toc>
286 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
287 <code>@font-face</code> rule</a>
289 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
290 family: the font-family descriptor</a>
292 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
293 src descriptor</a>
295 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
296 descriptors: the font-style, font-weight, font-stretch descriptors</a>
298 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
299 range: the unicode-range descriptor</a>
301 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
302 character ranges to define composite fonts</a>
304 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
305 features: the font-variant and font-feature-settings descriptors</a>
307 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
308 loading guidelines</a>
310 <li><a href="#same-origin-restriction"><span class=secno>4.9
311 </span>Same-origin restriction for fonts</a>
312 <ul class=toc>
313 <li><a href="#default-same-origin-restriction"><span class=secno>4.9.1
314 </span>Default same-origin restriction</a>
316 <li><a href="#allowing-cross-origin-font-loading"><span
317 class=secno>4.9.2 </span>Allowing cross-origin font loading</a>
318 </ul>
319 </ul>
321 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
322 Matching Algorithm</a>
323 <ul class=toc>
324 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
325 sensitivity of font family names</a>
327 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
328 font styles</a>
330 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
331 matching</a>
333 <li><a href="#char-handling-issues"><span class=secno>5.4
334 </span>Character handling issues</a>
336 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
337 matching changes since CSS 2.1</a>
339 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
340 matching examples</a>
341 </ul>
343 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
344 Properties</a>
345 <ul class=toc>
346 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
347 </span>Glyph selection and positioning</a>
349 <li><a href="#language-specific-support"><span class=secno>6.2
350 </span>Language-specific display</a>
352 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
353 the font-kerning property</a>
355 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
356 </span>Ligatures: the font-variant-ligatures property</a>
358 <li><a href="#font-variant-position-prop"><span class=secno>6.5
359 </span>Subscript and superscript forms: the font-variant-position
360 property</a>
362 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
363 </span>Capitalization: the font-variant-caps property</a>
365 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
366 </span>Numerical formatting: the font-variant-numeric property</a>
368 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
369 </span>Alternates and swashes: the font-variant-alternates property</a>
372 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
373 font specific alternates: the <code>@font-feature-values</code>
374 rule</a>
376 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
377 </span>East Asian text rendering: the font-variant-east-asian
378 property</a>
380 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
381 shorthand for font rendering: the font-variant property</a>
383 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
384 </span>Low-level font feature settings control: the
385 font-feature-settings property</a>
387 <li><a href="#font-language-override-prop"><span class=secno>6.13
388 </span>Font language override: the font-language-override property</a>
389 </ul>
391 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
392 Feature Resolution </a>
393 <ul class=toc>
394 <li><a href="#default-features"><span class=secno>7.1 </span>Default
395 features</a>
397 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
398 precedence</a>
400 <li><a href="#feature-precedence-examples"><span class=secno>7.3
401 </span>Feature precedence examples</a>
402 </ul>
404 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
405 <ul class=toc>
406 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
407 <code>CSSFontFaceRule</code> interface</a>
409 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
410 <code>CSSFontFeatureValuesRule</code> interface</a>
411 </ul>
413 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
414 platform font properties to CSS properties</a>
416 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
417 <ul class=toc>
418 <li class=no-num><a href="#recent-changes"> Changes from the February
419 2013 CSS3 Fonts Working Draft</a>
420 </ul>
422 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
424 <li class=no-num><a href="#conformance"> Conformance</a>
425 <ul class=toc>
426 <li class=no-num><a href="#conventions"> Document Conventions</a>
428 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
431 <li class=no-num><a href="#partial"> Partial Implementations</a>
433 <li class=no-num><a href="#experimental"> Experimental
434 Implementations</a>
436 <li class=no-num><a href="#testing"> Non-Experimental
437 Implementations</a>
438 </ul>
440 <li class=no-num><a href="#references">References</a>
441 <ul class=toc>
442 <li class=no-num><a href="#normative-references">Normative
443 References</a>
445 <li class=no-num><a href="#other-references">Other References</a>
446 </ul>
448 <li class=no-num><a href="#index">Index</a>
450 <li class=no-num><a href="#property-index">Property index</a>
451 </ul>
452 <!--end-toc-->
454 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
456 <p>A font provides a resource containing the visual representation of
457 characters. At the simplest level it contains information that maps
458 character codes to shapes (called glyphs) that represent these characters.
459 Fonts sharing a common design style are commonly grouped into font
460 families classified by a set of standard font properties. Within a family,
461 the shape displayed for a given character can vary by stroke weight, slant
462 or relative width, among others. An individual font face is described by a
463 unique combination of these properties. For a given range of text, CSS
464 font properties are used to select a font family and a specific font face
465 within that family to be used when rendering that text. As a simple
466 example, to use the bold form of Helvetica one could use:
468 <pre>body {
469 font-family: Helvetica;
470 font-weight: bold;
471 }</pre>
473 <p>Font resources may be installed locally on the system on which a user
474 agent is running or downloadable. For local font resources descriptive
475 information can be obtained directly from the font resource. For
476 downloadable font resources (sometimes referred to as web fonts), the
477 descriptive information is included with the reference to the font
478 resource.
480 <p>Families of fonts typically don't contain a single face for each
481 possible variation of font properties. The CSS font selection mechanism
482 describes how to match a given set of CSS font properties to a single font
483 face.
485 <h2 id=typography-background><span class=secno>2 </span>Typography
486 Background</h2>
488 <p><em>This section is non-normative.</em>
490 <p> Typographic traditions vary across the globe, so there is no unique way
491 to classify all fonts across languages and cultures. For even common Latin
492 letters, wide variations are possible:
494 <div class=figure><img alt="variations in glyphs for a single character"
495 src=aaaaaa.png>
496 <p class=caption>One character, many glyph variations
497 </div>
499 <p>Differences in the anatomy of letterforms is one way to distinguish
500 fonts. For Latin fonts, flourishes at the ends of a character's main
501 strokes, or serifs, can distinguish a font from those without. Similar
502 comparisons exist in non-Latin fonts between fonts with tapered strokes
503 and those using primarily uniform strokes:
505 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
506 <p class=caption>Letterforms with and without serifs
507 </div>
509 <div class=figure><img alt="serif vs. non-serifs for japanese"
510 src=minchovsgothic.png>
511 <p class=caption>Similar groupings for Japanese typefaces
512 </div>
514 <p>Fonts contain letterforms and the data needed to map characters to these
515 letterforms. Often this may be a simple one-to-one mapping, but more
516 complex mappings are also possible. The use of combining diacritic marks
517 creates many variations for an underlying letterform:
519 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
520 <p class=caption>Variations with diacritic marks
521 </div>
523 <p>A sequence of characters can be represented by a single glyph known as a
524 ligature:
526 <div class=figure><img alt="example of a fi ligature"
527 src=final-ligature.png>
528 <p class=caption>Ligature example
529 </div>
531 <p>Visual transformations based on textual context are often stylistic
532 option in European languages. They are required to correctly render
533 languages like Arabic, the lam and alef characters below <em>must</em> be
534 combined when they exist in sequence:
536 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
537 <p class=caption>Required Arabic ligature
538 </div>
540 <p>The relative complexity of these shaping transformations requires
541 additional data within the font.
543 <p>Sets of font faces with various stylistic variations are often grouped
544 together into font families. In the simplest case a regular face is
545 supplemented with bold and italic faces, but much more extensive groupings
546 are possible. Variations in the thickness of letterform strokes, the <dfn
547 id=weight>weight</dfn>, and the overall proportions of the letterform, the
548 <dfn id=width>width</dfn>, are most common. In the example below, each
549 letter uses a different font face within the Univers font family. The
550 width used increases from top to bottom and the weight increases from left
551 to right:
553 <div class=figure><img alt="various width and weight variations within a
554 single family" src=weightwidthvariations.png>
555 <p class=caption>Weight and width variations within a single font family
556 </div>
558 <p>Creating fonts that support multiple scripts is a difficult task;
559 designers need to understand the cultural traditions surrounding the use
560 of type in different scripts and come up with letterforms that somehow
561 share a common theme. Many languages often share a common script and each
562 of these languages may have noticeable stylistic differences. For example,
563 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
564 many languages, not just Russian.
566 <p>The <a href="#character-map"><em>character map</em></a> of a font
567 defines the mapping of characters to glyphs for that font. If a document
568 contains characters not supported by the <a href="#character-map"><em
569 title="character map">character maps</em></a> of the fonts contained in a
570 font family list, a user agent may use a system font fallback procedure to
571 locate an appropriate font that does. If no appropriate font can be found,
572 some form of "missing glyph" character will be rendered by the user agent.
573 System fallback can occur when the specified list of font families does
574 not include a font that supports a given character.
576 <p>Although the <a href="#character-map"><em>character map</em></a> of a
577 font maps a given character to a glyph for that character, modern font
578 technologies such as OpenType and AAT (Apple Advanced Typography) provide
579 ways of mapping a character to different glyphs based upon feature
580 settings. Fonts in these formats allow these features to be embedded in
581 the font itself and controlled by applications. Common typographic
582 features which can be specified this way include ligatures, swashes,
583 contextual alternates, proportional and tabular figures, and automatic
584 fractions, to list just a few. For a visual overview of OpenType features,
585 see the <a href="#OPENTYPE-FONT-GUIDE"
586 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
588 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
590 <p>The particular font face used to render a character is determined by the
591 font family and other font properties that apply to a given element. This
592 structure allows settings to be varied independent of each other.</p>
593 <!-- prop: font-family -->
595 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
596 href="#propdef-font-family">font-family</a> property</h3>
598 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
599 <tbody>
600 <tr>
601 <td>Name:
603 <td><dfn id=propdef-font-family>font-family</dfn>
605 <tr>
606 <td>Value:
608 <td>[ <a href="#family-name-value"><var><family-name></var></a> |
609 <a href="#generic-family-value"><var><generic-family></var></a> ]
610 #
612 <tr>
613 <td>Initial:
615 <td>depends on user agent
617 <tr>
618 <td>Applies to:
620 <td>all elements
622 <tr>
623 <td>Inherited:
625 <td>yes
627 <tr>
628 <td>Percentages:
630 <td>N/A
632 <tr>
633 <td>Media:
635 <td>visual
637 <tr>
638 <td>Computed value:
640 <td>as specified
642 <tr>
643 <td>Animatable:
645 <td>no
646 </table>
648 <p>This property specifies a prioritized list of font family names or
649 generic family names. A font family defines a set of faces that vary in
650 weight, width or slope. CSS uses the combination of a family name with
651 other style attributes to select an individual face. Using this selection
652 mechanism, rather than selecting a face via the style name as is often
653 done in design applications, allows some degree of regularity in textual
654 display when fallback occurs.
656 <p class=note>Designers should note that the CSS definition of font
657 attributes used for selection are explicitly not intended to define a font
658 taxonomy. A type designer's idea of a family may often extend to a set of
659 faces that vary along axes other than just the standard axes of weight,
660 width and slope. A family may extend to include both a set of serif faces
661 and a set of sans-serif faces or vary along axes that are unique to that
662 family. The CSS font selection mechanism merely provides a way to
663 determine the “closest” substitute when substitution is necessary.
665 <p>Unlike other CSS properties, component values are a comma-separated list
666 indicating alternatives. A user agent iterates through the list of family
667 names until it matches an available font that contains a glyph for the
668 character to be rendered. This allows for differences in available fonts
669 across platforms and for differences in the range of characters supported
670 by individual fonts.
672 <p>A font family name only specifies a name given to a set of font faces,
673 it does not specify an individual face. For example, given the
674 availability of the fonts below, Futura would match but Futura Medium
675 would not:
677 <div class=figure><img alt="family and face names"
678 src=familyvsfacename.png>
679 <p class=caption>Family and individual face names
680 </div>
682 <p>Consider the example below:
684 <div class=example>
685 <pre>body {
686 font-family: Helvetica, Verdana, sans-serif;
687 }</pre>
689 <p>If Helvetica is available it will be used when rendering. If neither
690 Helvetica nor Verdana is present, then the user-agent-defined sans serif
691 font will be used.</p>
692 </div>
694 <p>There are two types of font family names:
696 <dl>
697 <dt><dfn id=family-name-value><var><family-name></var></dfn>
699 <dd>The name of a font family of choice such as Helvetica or Verdana in
700 the previous example.
702 <dt><dfn id=generic-family-value><var><generic-family></var></dfn>
704 <dd> The following generic family keywords are defined: ‘<a
705 href="#serif"><code class=property>serif</code></a>’, ‘<a
706 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
707 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
708 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
709 href="#monospace"><code class=property>monospace</code></a>’. These
710 keywords can be used as a general fallback mechanism when an author's
711 desired font choices are not available. As keywords, they must not be
712 quoted. Authors are encouraged to append a generic font family as a last
713 alternative for improved robustness.
714 </dl>
716 <p>Font family names must either be given quoted as <a
717 href="//www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or unquoted
718 as a sequence of one or more <a
719 href="//www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
720 This means most punctuation characters and digits at the start of each
721 token must be escaped in unquoted font family names.
723 <p>To illustrate this, the following declarations are invalid:
725 <pre>
726 font-family: Red/Black, sans-serif;
727 font-family: "Lucida" Grande, sans-serif;
728 font-family: Ahem!, sans-serif;
729 font-family: test@foo, sans-serif;
730 font-family: #POUND, sans-serif;
731 font-family: Hawaii 5-0, sans-serif;
732 </pre>
734 <p>If a sequence of identifiers is given as a font family name, the
735 computed value is the name converted to a string by joining all the
736 identifiers in the sequence by single spaces.
738 <p>To avoid mistakes in escaping, it is recommended to quote font family
739 names that contain white space, digits, or punctuation characters other
740 than hyphens:
742 <pre>
743 body { font-family: "New Century Schoolbook", serif }
745 <BODY STYLE="font-family: '21st Century', fantasy">
746 </pre>
748 <p>Font family <em>names</em> that happen to be the same as a keyword value
749 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
750 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
751 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
752 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
753 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
754 class=property>cursive</code></a>’) must be quoted to prevent confusion
755 with the keywords with the same names. The keywords ‘<code
756 class=property>initial</code>’ and ‘<code
757 class=property>default</code>’ are reserved for future use and must also
758 be quoted when used as font names. UAs must not consider these keywords as
759 matching the <a
760 href="#family-name-value"><var><family-name></var></a> type.
762 <p>The precise way a set of fonts are grouped into font families varies
763 depending upon the platform font management API's. The Windows GDI API
764 only allows four faces to be grouped into a family while the DirectWrite
765 API and API's on OSX and other platforms support font families with a
766 variety of weights, widths and slopes (see <a
767 href="#platform-props-to-css">Appendix A</a> for more details).
769 <p>Some font formats allow fonts to carry multiple localizations of the
770 family name. User agents must recognize and correctly match all of these
771 names independent of the underlying platform localization, system API used
772 or document encoding:
774 <div class=figure><img alt="examples of localized family names"
775 src=localizedfamilynames.png>
776 <p class=caption>Localized family names
777 </div>
779 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
780 families</h4>
782 <p>All five generic font families are defined to exist in all CSS
783 implementations (they need not necessarily map to five distinct actual
784 fonts). User agents should provide reasonable default choices for the
785 generic font families, which express the characteristics of each family as
786 well as possible within the limits allowed by the underlying technology.
787 User agents are encouraged to allow users to select alternative choices
788 for the generic fonts.
790 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
791 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
793 <p>Serif fonts represent the formal text style for a script. This often
794 means but is not limited to glyphs that have finishing strokes, flared or
795 tapering ends, or have actual serifed endings (including slab serifs).
796 Serif fonts are typically proportionately-spaced. They often display a
797 greater variation between thick and thin strokes than fonts from the ‘<a
798 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
799 font family. CSS uses the term ‘<a href="#serif"><code
800 class=property>serif</code></a>’ to apply to a font for any script,
801 although other names may be more familiar for particular scripts, such as
802 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
803 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
804 class=property>serif</code></a>’ more due to its typographic role rather
805 than its actual design style. Any font that is so described may be used to
806 represent the generic ‘<a href="#serif"><code
807 class=property>serif</code></a>’ family.
809 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
810 <p class=caption>Sample serif fonts
811 </div>
813 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
814 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
815 id=sans-serif>sans-serif</dfn></a></span></h5>
817 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
818 low contrast (vertical and horizontal stems have the close to the same
819 thickness) and have stroke endings that are plain -- without any flaring,
820 cross stroke, or other ornamentation. Sans-serif fonts are typically
821 proportionately-spaced. They often have little variation between thick and
822 thin strokes, compared to fonts from the ‘<a href="#serif"><code
823 class=property>serif</code></a>’ family. CSS uses the term ‘<a
824 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
825 to a font for any script, although other names may be more familiar for
826 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
827 (Korean). Any font that is so described may be used to represent the
828 generic ‘<a href="#sans-serif"><code
829 class=property>sans-serif</code></a>’ family.
831 <div class=figure><img alt="sample sans-serif fonts"
832 src=sansserifexamples.png>
833 <p class=caption>Sample sans-serif fonts
834 </div>
836 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
837 title="cursive, definition of"> <a name=cursive-def><dfn
838 id=cursive>cursive</dfn></a></span></h5>
840 <p>Glyphs in cursive fonts generally use a more informal script style, and
841 the result looks more like handwritten pen or brush writing than printed
842 letterwork. CSS uses the term ‘<a href="#cursive"><code
843 class=property>cursive</code></a>’ to apply to a font for any script,
844 although other names such as Chancery, Brush, Swing and Script are also
845 used in font names.
847 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
848 <p class=caption>Sample cursive fonts
849 </div>
851 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
852 title="fantasy, definition of"> <a name=fantasy-def><dfn
853 id=fantasy>fantasy</dfn></a></span></h5>
855 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
856 playful representations of characters. These do not include Pi or Picture
857 fonts which do not represent actual characters.
859 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
860 <p class=caption>Sample fantasy fonts
861 </div>
863 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
864 title="monospace, definition of"> <a name=monospace-def><dfn
865 id=monospace>monospace</dfn></a></span></h5>
867 <p>The sole criterion of a monospace font is that all glyphs have the same
868 fixed width. This is often used to render samples of computer code.
870 <div class=figure><img alt="sample monospace fonts"
871 src=monospaceexamples.png>
872 <p class=caption>Sample monospace fonts
873 </div>
874 <!-- prop: font-weight -->
876 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
877 href="#propdef-font-weight">font-weight</a> property</h3>
879 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
880 <tbody>
881 <tr>
882 <td>Name:
884 <td><dfn id=propdef-font-weight>font-weight</dfn>
886 <tr>
887 <td>Value:
889 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
890 | 700 | 800 | 900
892 <tr>
893 <td>Initial:
895 <td>normal
897 <tr>
898 <td>Applies to:
900 <td>all elements
902 <tr>
903 <td>Inherited:
905 <td>yes
907 <tr>
908 <td>Percentages:
910 <td>N/A
912 <tr>
913 <td>Media:
915 <td>visual
917 <tr>
918 <td>Computed value:
920 <td>numeric weight value (see description)
922 <tr>
923 <td>Animatable:
925 <td>as <a
926 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
927 weight</a>
928 </table>
930 <p>The <a class=noxref href="#font-weight-prop"><span
931 class=property>‘<code class=property>font-weight</code>’</span></a>
932 property specifies the weight of glyphs in the font, their degree of
933 blackness or stroke thickness.
935 <p>Values have the following meanings:
937 <dl>
938 <dt>100 to 900
940 <dd>These values form an ordered sequence, where each number indicates a
941 weight that is at least as dark as its predecessor. These roughly
942 correspond to the commonly used weight names below:
943 </dl>
945 <ul>
946 <li>100 - Thin
948 <li>200 - Extra Light (Ultra Light)
950 <li>300 - Light
952 <li>400 - Normal
954 <li>500 - Medium
956 <li>600 - Semi Bold (Demi Bold)
958 <li>700 - Bold
960 <li>800 - Extra Bold (Ultra Bold)
962 <li>900 - Black (Heavy)
963 </ul>
965 <dl>
966 <dt><a href="#normal2"><strong>normal</strong></a>
968 <dd>Same as ‘<code class=css>400</code>’.
970 <dt><strong>bold</strong>
972 <dd>Same as ‘<code class=css>700</code>’.
974 <dt><strong>bolder</strong>
976 <dd>Specifies a bolder weight than the inherited value.
978 <dt><strong>lighter</strong>
980 <dd>Specifies a lighter weight than the inherited value.
981 </dl>
983 <p>Font formats that use a scale other than a nine-step scale should map
984 their scale onto the CSS scale so that 400 roughly corresponds with a face
985 that would be labeled as Regular, Book, Roman and 700 roughly matches a
986 face that would be labeled as Bold. Or weights may be inferred from the
987 style names, ones that correspond roughly with the scale above. The scale
988 is relative, so a face with a larger weight value must never appear
989 lighter. If style names are used to infer weights, care should be taken to
990 handle variations in style names across locales.
992 <p>Quite often there are only a few weights available for a particular font
993 family. When a weight is specified for which no face exists, a face with a
994 nearby weight is used. In general, bold weights map to faces with heavier
995 weights and light weights map to faces with lighter weights (see the <a
996 href="#font-matching-algorithm">font matching section below</a> for a
997 precise definition). The examples here illustrate which face is used for
998 different weights, grey indicates a face for that weight does not exist so
999 a face with a nearby weight is used:
1001 <div class=figure><img alt="weight mappings for a family with 400, 700 and
1002 900 weights" src=optimaweights.png>
1003 <p class=caption>Weight mappings for a font family with 400, 700 and 900
1004 weight faces
1005 </div>
1007 <div class=figure><img alt="weight mappings for a family with 300, 600
1008 weights" src=hiraginoweights.png>
1009 <p class=caption>Weight mappings for a font family with 300 and 600 weight
1010 faces
1011 </div>
1013 <p>Although the practice is not well-loved by typographers, bold faces are
1014 often synthesized by user agents for faces that lack actual bold faces.
1015 For the purposes of style matching, these faces must be treated as if they
1016 exist within the family. Authors can explicitly avoid this behavior by
1017 using the ‘<a href="#propdef-font-synthesis"><code
1018 class=property>font-synthesis</code></a>’ property.
1020 <p>Specified values of ‘<code class=property>bolder</code>’ and
1021 ‘<code class=property>lighter</code>’ indicate weights relative to the
1022 weight of the parent element. The computed weight is calculated based on
1023 the inherited ‘<a href="#propdef-font-weight"><code
1024 class=property>font-weight</code></a>’ value using the chart below.
1026 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
1027 <thead>
1028 <tr>
1029 <th>Inherited value
1031 <th>bolder
1033 <th>lighter
1035 <tbody>
1036 <tr>
1037 <th>100
1039 <td>400
1041 <td>100
1043 <tr>
1044 <th>200
1046 <td>400
1048 <td>100
1050 <tr>
1051 <th>300
1053 <td>400
1055 <td>100
1057 <tr>
1058 <th>400
1060 <td>700
1062 <td>100
1064 <tr>
1065 <th>500
1067 <td>700
1069 <td>100
1071 <tr>
1072 <th>600
1074 <td>900
1076 <td>400
1078 <tr>
1079 <th>700
1081 <td>900
1083 <td>400
1085 <tr>
1086 <th>800
1088 <td>900
1090 <td>700
1092 <tr>
1093 <th>900
1095 <td>900
1097 <td>700
1098 </table>
1100 <p>The table above is equivalent to selecting the next relative bolder or
1101 lighter face, given a font family containing normal and bold faces along
1102 with a thin and a heavy face. Authors who desire finer control over the
1103 exact weight values used for a given element may use numerical values
1104 instead of relative weights.</p>
1105 <!-- prop: font-stretch -->
1107 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
1108 href="#propdef-font-stretch">font-stretch</a> property</h3>
1110 <table class=propdef id=namefont-stretchvaluenormal-ultra-conden>
1111 <tbody>
1112 <tr>
1113 <td>Name:
1115 <td><dfn id=propdef-font-stretch>font-stretch</dfn>
1117 <tr>
1118 <td>Value:
1120 <td>normal | ultra-condensed | extra-condensed | condensed |
1121 semi-condensed | semi-expanded | expanded | extra-expanded |
1122 ultra-expanded
1124 <tr>
1125 <td>Initial:
1127 <td>normal
1129 <tr>
1130 <td>Applies to:
1132 <td>all elements
1134 <tr>
1135 <td>Inherited:
1137 <td>yes
1139 <tr>
1140 <td>Percentages:
1142 <td>N/A
1144 <tr>
1145 <td>Media:
1147 <td>visual
1149 <tr>
1150 <td>Computed value:
1152 <td>as specified
1154 <tr>
1155 <td>Animatable:
1157 <td>as <a href="#font-stretch-animation">font stretch</a>
1158 </table>
1160 <p>The <a class=noxref href="#font-stretch-prop"><span
1161 class=property>‘<code class=property>font-stretch</code>’</span></a>
1162 property selects a normal, condensed, or expanded face from a font family.
1163 Absolute keyword values have the following ordering, from narrowest to
1164 widest:
1166 <ul>
1167 <li><code>ultra-condensed</code>
1169 <li><code>extra-condensed</code>
1171 <li><code>condensed</code>
1173 <li><code>semi-condensed </code>
1175 <li><code>normal</code>
1177 <li><code>semi-expanded</code>
1179 <li><code>expanded</code>
1181 <li><code>extra-expanded</code>
1183 <li><code>ultra-expanded</code>
1184 </ul>
1186 <p>When a face does not exist for a given width, normal or condensed values
1187 map to a narrower face, otherwise a wider face. Conversely, expanded
1188 values map to a wider face, otherwise a narrower face. The figure below
1189 shows how the nine font-stretch property settings affect font selection
1190 for font family containing a variety of widths, grey indicates a width for
1191 which no face exists and a different width is substituted:
1193 <div class=figure><img alt="width mappings for a family with condensed,
1194 normal and expanded faces" src=universwidths.png>
1195 <p class=caption>Width mappings for a font family with condensed, normal
1196 and expanded width faces
1197 </div>
1199 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
1200 interpolated in discrete steps. The interpolation happens as though the
1201 ordered values are equally spaced real numbers. The interpolation result
1202 is rounded to the nearest value, with values exactly halfway between two
1203 values rounded towards the later value in the list above.</p>
1204 <!-- prop: font-style -->
1206 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
1207 href="#propdef-font-style">font-style</a> property</h3>
1209 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
1210 <tbody>
1211 <tr>
1212 <td>Name:
1214 <td><dfn id=propdef-font-style>font-style</dfn>
1216 <tr>
1217 <td>Value:
1219 <td>normal | italic | oblique
1221 <tr>
1222 <td>Initial:
1224 <td>normal
1226 <tr>
1227 <td>Applies to:
1229 <td>all elements
1231 <tr>
1232 <td>Inherited:
1234 <td>yes
1236 <tr>
1237 <td>Percentages:
1239 <td>N/A
1241 <tr>
1242 <td>Media:
1244 <td>visual
1246 <tr>
1247 <td>Computed value:
1249 <td>as specified
1251 <tr>
1252 <td>Animatable:
1254 <td>no
1255 </table>
1257 <p>The <a class=noxref href="#font-style-prop"><span
1258 class=property>‘<code class=property>font-style</code>’</span></a>
1259 property allows italic or oblique faces to be selected. Italic forms are
1260 generally cursive in nature while oblique faces are typically sloped
1261 versions of the regular face. Oblique faces can be simulated by
1262 artificially sloping the glyphs of the regular face. Compare the
1263 artificially sloped renderings of Palatino ‘<code
1264 class=property>a</code>’ and Baskerville ‘<code
1265 class=property>N</code>’ in grey with the actual italic versions:
1267 <div class=figure><img alt="artificial sloping vs. real italics"
1268 src=realvsfakeitalics.png>
1269 <p class=caption>Artificial sloping versus real italics
1270 </div>
1272 <p>A value of ‘<a href="#normal2"><code
1273 class=property>normal</code></a>’ selects a face that is classified as
1274 ‘<a href="#normal2"><code class=property>normal</code></a>’, while
1275 ‘<code class=property>oblique</code>’ selects a font that is labeled
1276 ‘<code class=property>oblique</code>’. A value of ‘<code
1277 class=property>italic</code>’ selects a font that is labeled ‘<code
1278 class=property>italic</code>’, or, if that is not available, one labeled
1279 ‘<code class=property>oblique</code>’. If no italic or oblique face is
1280 available, oblique faces can be synthesized by rendering non-obliqued
1281 faces with a right sloping transformation applied. When synthesizing these
1282 faces, the transformation should apply to all glyphs in the same way and
1283 not vary based on codepoint or due to horizontal or vertical line
1284 orientation.
1286 <p>Many scripts lack the tradition of mixing a cursive form within text
1287 rendered with a normal face. Chinese, Japanese and Korean fonts almost
1288 always lack italic or oblique faces. Fonts that support a mixture of
1289 scripts will sometimes omit specific scripts such as Arabic from the set
1290 of glyphs supported in the italic face. User agents should be careful
1291 about making <a href="#character-map"><em>character map</em></a>
1292 assumptions across faces.
1294 <p class=issue>For synthetic italics in vertical runs of Chinese, Japanese,
1295 or Korean text, is there a need to define explicitly the direction of the
1296 faux oblique for runs that include a mixture of ideographic and Latin
1297 text?</p>
1298 <!-- prop: font-size -->
1300 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
1301 href="#propdef-font-size">font-size</a> property</h3>
1303 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
1304 <tbody>
1305 <tr>
1306 <td>Name:
1308 <td><dfn id=propdef-font-size>font-size</dfn>
1310 <tr>
1311 <td>Value:
1313 <td><a href="#absolute-size-value"><var><absolute-size></var></a>
1314 | <a href="#relative-size-value"><var><relative-size></var></a> |
1315 <a href="#length-size-value"><var><length></var></a> | <a
1316 href="#percentage-size-value"><var><percentage></var></a>
1318 <tr>
1319 <td>Initial:
1321 <td>medium
1323 <tr>
1324 <td>Applies to:
1326 <td>all elements
1328 <tr>
1329 <td>Inherited:
1331 <td>yes
1333 <tr>
1334 <td>Percentages:
1336 <td>refer to parent element's font size
1338 <tr>
1339 <td>Media:
1341 <td>visual
1343 <tr>
1344 <td>Computed value:
1346 <td>absolute length
1348 <tr>
1349 <td>Animatable:
1351 <td>as <a
1352 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
1353 </table>
1355 <p>This property indicates the desired height of glyphs from the font. For
1356 scalable fonts, the font-size is a scale factor applied to the EM unit of
1357 the font. (Note that certain glyphs may bleed outside their EM box.) For
1358 non-scalable fonts, the font-size is converted into absolute units and
1359 matched against the declared font-size of the font, using the same
1360 absolute coordinate space for both of the matched values. Values have the
1361 following meanings:
1363 <dl>
1364 <dt><dfn id=absolute-size-value><var><absolute-size></var></dfn>
1366 <dd> An <a
1367 href="#absolute-size-value"><var><absolute-size></var></a> keyword
1368 refers to an entry in a table of font sizes computed and kept by the user
1369 agent. Possible values are:
1370 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
1372 <dt><dfn id=relative-size-value><var><relative-size></var></dfn>
1374 <dd> A <a href="#relative-size-value"><var><relative-size></var></a>
1375 keyword is interpreted relative to the table of font sizes and the
1376 computed ‘<a href="#propdef-font-size"><code
1377 class=property>font-size</code></a>’ of the parent element. Possible
1378 values are:
1379 <p> [ larger | smaller ]
1381 <p> For example, if the parent element has a font size of ‘<code
1382 class=property>medium</code>’, a value of ‘<code
1383 class=property>larger</code>’ will make the font size of the current
1384 element be ‘<code class=property>large</code>’. If the parent
1385 element's size is not close to a table entry, the user agent is free to
1386 interpolate between table entries or round off to the closest one. The
1387 user agent may have to extrapolate table values if the numerical value
1388 goes beyond the keywords.
1390 <dt><dfn id=length-size-value><var><length></var></dfn>
1392 <dd>A length value specifies an absolute font size (independent of the
1393 user agent's font table). Negative lengths are illegal.
1395 <dt><dfn id=percentage-size-value><var><percentage></var></dfn>
1397 <dd>A percentage value specifies an absolute font size relative to the
1398 parent element's font size. Use of percentage values, or values in
1399 ‘<code class=property>em</code>’s, leads to more robust and
1400 cascadable style sheets.
1401 </dl>
1403 <p>The following table provides user agent guidelines for the absolute-size
1404 scaling factor and their mapping to HTML heading and absolute font-sizes.
1405 The ‘<code class=property>medium</code>’ value is used as the
1406 reference middle value. The user agent may fine-tune these values for
1407 different fonts or different types of display devices.
1409 <table class=data>
1410 <thead>
1411 <tr>
1412 <th>CSS absolute-size values
1414 <th>xx-small
1416 <th>x-small
1418 <th>small
1420 <th>medium
1422 <th>large
1424 <th>x-large
1426 <th>xx-large
1428 <th>
1430 <tbody>
1431 <tr>
1432 <th>scaling factor
1434 <td>3/5
1436 <td>3/4
1438 <td>8/9
1440 <td>1
1442 <td>6/5
1444 <td>3/2
1446 <td>2/1
1448 <td>3/1
1450 <tr>
1451 <th>HTML headings
1453 <td>h6
1455 <td>
1457 <td>h5
1459 <td>h4
1461 <td>h3
1463 <td>h2
1465 <td>h1
1467 <td>
1469 <tr>
1470 <th>HTML font sizes
1472 <td>1
1474 <td>
1476 <td>2
1478 <td>3
1480 <td>4
1482 <td>5
1484 <td>6
1486 <td>7
1487 </table>
1489 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
1490 applying these guidelines should nevertheless avoid creating font-size
1491 resulting in less than 9 device pixels per EM unit on a computer display
1492 .</em>
1494 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
1495 factor between adjacent indexes was 1.5 which user experience proved to be
1496 too large. In CSS2, the suggested scaling factor for computer screen
1497 between adjacent indexes was 1.2 which still created issues for the small
1498 sizes. The new scaling factor varies between each index to provide a
1499 better readability.</em>
1501 <p>The actual value of this property may differ from the computed value due
1502 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
1503 class=property>font-size-adjust</code></a>’ and the unavailability of
1504 certain font sizes.
1506 <p>Child elements inherit the computed <a class=noxref
1507 href="#font-size-prop"> <span class=property>‘<code
1508 class=property>font-size</code>’</span></a> value (otherwise, the effect
1509 of <a class=noxref href="#font-size-adjust-prop"><span
1510 class=property>‘<code
1511 class=property>font-size-adjust</code>’</span></a> would compound).
1513 <div class=example>
1514 <p style="display:none">Example(s):
1516 <p>
1518 <pre>p { font-size: 12pt; }
1519 blockquote { font-size: larger }
1520 em { font-size: 150% }
1521 em { font-size: 1.5em }
1522 </pre>
1523 </div>
1524 <!-- prop: font-size-adjust -->
1526 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
1527 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
1529 <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
1530 <tbody>
1531 <tr>
1532 <td>Name:
1534 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
1536 <tr>
1537 <td>Value:
1539 <td>none | auto | <a
1540 href="#aspect-ratio-value"><var><number></var></a>
1542 <tr>
1543 <td>Initial:
1545 <td>none
1547 <tr>
1548 <td>Applies to:
1550 <td>all elements
1552 <tr>
1553 <td>Inherited:
1555 <td>yes
1557 <tr>
1558 <td>Percentages:
1560 <td>N/A
1562 <tr>
1563 <td>Media:
1565 <td>visual
1567 <tr>
1568 <td>Computed value:
1570 <td>as specified
1572 <tr>
1573 <td>Animatable:
1575 <td>as <a
1576 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
1577 </table>
1579 <p>For any given font size, the apparent size and legibility of text varies
1580 across fonts. For scripts such as Latin or Cyrillic that distinguish
1581 between upper and lowercase letters, the relative height of lowercase
1582 letters compared to their uppercase counterparts is a determining factor
1583 of legibility. This is commonly referred to as the <a class=index-def
1584 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
1585 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
1586 the x-height of a font divided by the font size.
1588 <p>In situations where font fallback occurs, fallback fonts may not share
1589 the same aspect ratio as the desired font family and will thus appear less
1590 readable. The font-size-adjust property is a way to preserve the
1591 readability of text when font fallback occurs. It does this by adjusting
1592 the font-size so that the x-height is the same regardless of the font
1593 used.
1595 <div class=example>
1596 <p>The style defined below defines Verdana as the desired font family, but
1597 if Verdana is not available Futura or Times will be used.</p>
1599 <pre>p {
1600 font-family: Verdana, Futura, Times;
1601 }
1603 <p>Lorem ipsum dolor sit amet, ...</p>
1604 </pre>
1606 <p>Verdana has a relatively high aspect ratio, lowercase letters are
1607 relatively tall compared to uppercase letters, so at small sizes text
1608 appears legible. Times has a lower aspect ratio and so if fallback
1609 occurs, the text will be less legible at small sizes than Verdana.</p>
1610 </div>
1612 <p>How text rendered in each of these fonts compares is shown below, the
1613 columns show text rendered in Verdana, Futura and Times. The same
1614 font-size value is used across cells within each row and red lines are
1615 included to show the differences in x-height. In the upper half each row
1616 is rendered in the same font-size value. The same is true for the lower
1617 half but in this half the font-size-adjust property is also set so that
1618 the actual font size is adjusted to preserve the x-height across each row.
1619 Note how small text remains relatively legible across each row in the
1620 lower half.
1622 <div class=figure><img alt="text with and without font-size-adjust"
1623 src=fontsizeadjust.png>
1624 <p class=caption>Text with and without the use of font-size-adjust
1625 </div>
1627 <p>This property allows authors to specify an aspect value for an element
1628 that will effectively preserve the x-height of the first choice font,
1629 whether it is substituted or not. Values have the following meanings:
1631 <dl>
1632 <dt><strong>none</strong>
1634 <dd>Do not preserve the font's x-height.
1636 <dt><strong>auto</strong>
1638 <dd>Behaves just like <number>, except the number used is the aspect
1639 value calculated by user agents for the first font in the list of fonts
1640 defined for the initial value of the ‘<a
1641 href="#descdef-font-family"><code
1642 class=property>font-family</code></a>’ property. Effectively this is
1643 the default font used when ‘<a href="#descdef-font-family"><code
1644 class=property>font-family</code></a>’ is not otherwise specified.
1645 <p>Authors can use this value to specify that font size should be
1646 normalized across fonts based on the x-height without the need to
1647 specify the aspect ratio explicitly.</p>
1649 <dt><dfn id=aspect-ratio-value><var><number></var></dfn>
1651 <dd>Specifies the aspect value used in the calculation below to calculate
1652 the adjusted font size:
1653 <pre>c = ( a / a' ) s
1654 </pre>
1656 <p>where:</p>
1658 <pre>s = font-size value
1659 a = aspect value as specified by the font-size-adjust property
1660 a' = aspect value of actual font
1661 c = adjusted font-size to use
1662 </pre>
1664 <p>This value applies to any font that is selected but in typical usage
1665 it should be based on the aspect value of the first font in the
1666 font-family list. If this is specified accurately, the <tt>(a/a')</tt>
1667 term in the formula above is effectively 1 for the first font and no
1668 adjustment occurs. If the value is specified inaccurately, text rendered
1669 using the first font in the family list will display differently in
1670 older user agents that don't support font-size-adjust.</p>
1671 </dl>
1673 <p>Authors can calculate the aspect value for a given font by comparing
1674 spans with the same content but different font-size-adjust properties. If
1675 the same font-size is used, the spans will match when the font-size-adjust
1676 value is accurate for the given font.
1678 <div class=example>
1679 <p>Two spans with borders are used to determine the aspect value of a
1680 font. The font-size is the same for both spans but the font-size-adjust
1681 property is specified only for the right span. Starting with a value of
1682 0.5, the aspect value can be adjusted until the borders around the two
1683 letters line up.</p>
1685 <pre>p {
1686 font-family: Futura;
1687 font-size: 500px;
1688 }
1690 span {
1691 border: solid 1px red;
1692 }
1694 .adjust {
1695 font-size-adjust: 0.5;
1696 }
1698 <p><span>b</span><span class="adjust">b</span></p>
1699 </pre>
1701 <div class=figure><img alt="Futura with an aspect value of 0.5"
1702 src=beforefontsizeadjust.png>
1703 <p class=caption>Futura with an aspect value of 0.5
1704 </div>
1706 <p>The box on the right is a bit bigger than the one on the left, so the
1707 aspect value of this font is something less than 0.5. Adjust the value
1708 until the boxes align.</p>
1709 </div>
1710 <!-- prop: font -->
1711 <!-- jtdfix, crap, preprocessor is inserting links to descriptors rather than properties. bert, make it stop... -->
1712 <!-- <a href="#font-stretch-prop" class="noxref"><span class="property">'font-stretch'</span></a> -->
1714 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
1715 <a href="#propdef-font">font</a> property</h3>
1717 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
1718 <tbody>
1719 <tr>
1720 <td>Name:
1722 <td><dfn id=propdef-font>font</dfn>
1724 <tr>
1725 <td>Value:
1727 <td>[ [ <var><‘<a href="#propdef-font-style"><code
1728 class=property>font-style</code></a>’></var> || <a
1729 href="#font-variant-css21-values"><var><font-variant-css21></var></a>
1730 || <var><‘<a href="#propdef-font-weight"><code
1731 class=property>font-weight</code></a>’></var> || <var><‘<a
1732 href="#propdef-font-stretch"><code
1733 class=property>font-stretch</code></a>’</var> ]? <var><‘<a
1734 href="#propdef-font-size"><code
1735 class=property>font-size</code></a>’></var> [ / <var><‘<code
1736 class=property>line-height</code>’></var> ]? <var><‘<a
1737 href="#descdef-font-family"><code
1738 class=property>font-family</code></a>’></var> ] | caption | icon |
1739 menu | message-box | small-caption | status-bar
1741 <tr>
1742 <td>Initial:
1744 <td>see individual properties
1746 <tr>
1747 <td>Applies to:
1749 <td>all elements
1751 <tr>
1752 <td>Inherited:
1754 <td>yes
1756 <tr>
1757 <td>Percentages:
1759 <td>see individual properties
1761 <tr>
1762 <td>Media:
1764 <td>visual
1766 <tr>
1767 <td>Computed value:
1769 <td>see individual properties
1771 <tr>
1772 <td>Animatable:
1774 <td>see individual properties
1775 </table>
1777 <p>The <span class=property>‘<a href="#propdef-font"><code
1778 class=property>font</code></a>’</span> property is, except as described
1779 below, a shorthand property for setting ‘<a
1780 href="#propdef-font-style"><code class=property>font-style</code></a>’,
1781 <span class=property>‘<a href="#propdef-font-variant"><code
1782 class=property>font-variant</code></a>’</span>, <span
1783 class=property>‘<a href="#propdef-font-weight"><code
1784 class=property>font-weight</code></a>’</span>, <span
1785 class=property>‘<a href="#propdef-font-stretch"><code
1786 class=property>font-stretch</code></a>’</span>, <span
1787 class=property>‘<a href="#propdef-font-size"><code
1788 class=property>font-size</code></a>’</span>, ‘<code
1789 class=property>line-height</code>’, <span class=property>‘<a
1790 href="#descdef-font-family"><code
1791 class=property>font-family</code></a>’</span> at the same place in the
1792 stylesheet. Values for the <span class=property>‘<a
1793 href="#propdef-font-variant"><code
1794 class=property>font-variant</code></a>’</span> property may also be
1795 included but only those supported in CSS 2.1, none of the font-variant
1796 values added in this specification can be used in the <span
1797 class=property>‘<a href="#propdef-font"><code
1798 class=property>font</code></a>’</span> shorthand:
1800 <pre
1801 class=prod><dfn id=font-variant-css21-values><var><font-variant-css21></var></dfn> = [normal | small-caps]</pre>
1803 <p>The syntax of this property is based on a traditional typographical
1804 shorthand notation to set multiple properties related to fonts.
1806 <p>All subproperties of the ‘<a href="#propdef-font"><code
1807 class=property>font</code></a>’ property are first reset to their
1808 initial values, including those listed above plus <span
1809 class=property>‘<a href="#propdef-font-size-adjust"><code
1810 class=property>font-size-adjust</code></a>’</span>, <span
1811 class=property>‘<a href="#propdef-font-kerning"><code
1812 class=property>font-kerning</code></a>’</span>, subproperties of <span
1813 class=property>‘<a href="#propdef-font-variant"><code
1814 class=property>font-variant</code></a>’</span> and and <span
1815 class=property>‘<a href="#propdef-font-language-override"><code
1816 class=property>font-language-override</code></a>’</span>. Then, those
1817 properties that are given explicit values in the <span
1818 class=property>‘<a href="#propdef-font"><code
1819 class=property>font</code></a>’</span> shorthand are set to those
1820 values. For a definition of allowed and initial values, see the previously
1821 defined properties. For reasons of backwards compatibility, it is not
1822 possible to set <span class=property>‘<a
1823 href="#propdef-font-size-adjust"><code
1824 class=property>font-size-adjust</code></a>’</span> to anything other
1825 than its initial value using the <span class=property>‘<a
1826 href="#propdef-font"><code class=property>font</code></a>’</span>
1827 shorthand property; instead, use the individual property.
1829 <div class=example>
1830 <p style="display:none">Example(s):
1832 <p>
1834 <pre>p { font: 12pt/14pt sans-serif }
1835 p { font: 80% sans-serif }
1836 p { font: x-large/110% "new century schoolbook", serif }
1837 p { font: bold italic large Palatino, serif }
1838 p { font: normal small-caps 120%/120% fantasy }
1839 p { font: condensed oblique 12pt "Helvetica Neue", serif; }
1840 </pre>
1842 <p> In the second rule, the font size percentage value (‘<code
1843 class=css>80%</code>’) refers to the computed ‘<a
1844 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
1845 the parent element. In the third rule, the line height percentage
1846 (‘<code class=css>110%</code>’) refers to the font size of the
1847 element itself.
1849 <p>The first three rules do not specify the <span class=property>‘<a
1850 href="#propdef-font-variant"><code
1851 class=property>font-variant</code></a>’</span> and <span
1852 class=property>‘<a href="#propdef-font-weight"><code
1853 class=property>font-weight</code></a>’</span> explicitly, so these
1854 properties receive their initial values (‘<a href="#normal2"><code
1855 class=property>normal</code></a>’). Notice that the font family name
1856 "new century schoolbook", which contains spaces, is enclosed in quotes.
1857 The fourth rule sets the <span class=property>‘<a
1858 href="#propdef-font-weight"><code
1859 class=property>font-weight</code></a>’</span> to ‘<code
1860 class=property>bold</code>’, the <span class=property>‘<a
1861 href="#propdef-font-style"><code
1862 class=property>font-style</code></a>’</span> to ‘<code
1863 class=property>italic</code>’, and implicitly sets <span
1864 class=property>‘<a href="#propdef-font-variant"><code
1865 class=property>font-variant</code></a>’</span> to ‘<a
1866 href="#normal2"><code class=property>normal</code></a>’.
1868 <p> The fifth rule sets the <span class=property>‘<a
1869 href="#propdef-font-variant"><code
1870 class=property>font-variant</code></a>’</span> (‘<a
1871 href="#small-caps"><code class=property>small-caps</code></a>’), the
1872 <span class=property>‘<a href="#propdef-font-size"><code
1873 class=property>font-size</code></a>’</span> (120% of the parent's font
1874 size), the <span class=property>‘<code
1875 class=property>line-height</code>’</span> (120% of the font size) and
1876 the <span class=property>‘<a href="#descdef-font-family"><code
1877 class=property>font-family</code></a>’</span> (‘<a
1878 href="#fantasy"><code class=property>fantasy</code></a>’). It follows
1879 that the keyword ‘<a href="#normal2"><code
1880 class=property>normal</code></a>’ applies to the two remaining
1881 properties: <span class=property>‘<a href="#propdef-font-style"><code
1882 class=property>font-style</code></a>’</span> and <span
1883 class=property>‘<a href="#propdef-font-weight"><code
1884 class=property>font-weight</code></a>’</span>.
1886 <p>The sixth rule sets the <span class=property>‘<a
1887 href="#propdef-font-style"><code
1888 class=property>font-style</code></a>’</span>, <span
1889 class=property>‘<a href="#propdef-font-stretch"><code
1890 class=property>font-stretch</code></a>’</span>, <span
1891 class=property>‘<a href="#propdef-font-size"><code
1892 class=property>font-size</code></a>’</span>, and <span
1893 class=property>‘<a href="#descdef-font-family"><code
1894 class=property>font-family</code></a>’</span>, the other font
1895 properties being set to their initial values.
1896 </div>
1898 <p>Since the ‘<a href="#propdef-font-stretch"><code
1899 class=property>font-stretch</code></a>’ property was not defined in CSS
1900 2.1, when using ‘<a href="#propdef-font-stretch"><code
1901 class=property>font-stretch</code></a>’ values within ‘<a
1902 href="#propdef-font"><code class=property>font</code></a>’ rules,
1903 authors should include a extra version compatible with older user agents:
1905 <pre>p {
1906 font: 80% sans-serif; /* for older user agents */
1907 font: condensed 80% sans-serif;
1908 }</pre>
1910 <p>The following values refer to system fonts:
1912 <dl>
1913 <dt><strong>caption</strong>
1915 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
1916 etc.).
1918 <dt><strong>icon</strong>
1920 <dd>The font used to label icons.
1922 <dt><strong>menu</strong>
1924 <dd>The font used in menus (e.g., dropdown menus and menu lists).
1926 <dt><strong>message-box</strong>
1928 <dd>The font used in dialog boxes.
1930 <dt><strong>small-caption</strong>
1932 <dd>The font used for labeling small controls.
1934 <dt><strong>status-bar</strong>
1936 <dd>The font used in window status bars.
1937 </dl>
1939 <p>System fonts may only be set as a whole; that is, the font family, size,
1940 weight, style, etc. are all set at the same time. These values may then be
1941 altered individually if desired. If no font with the indicated
1942 characteristics exists on a given platform, the user agent should either
1943 intelligently substitute (e.g., a smaller version of the ‘<code
1944 class=property>caption</code>’ font might be used for the ‘<code
1945 class=property>small-caption</code>’ font), or substitute a user agent
1946 default font. As for regular fonts, if, for a system font, any of the
1947 individual properties are not part of the operating system's available
1948 user preferences, those properties should be set to their initial values.
1950 <p>That is why this property is "almost" a shorthand property: system fonts
1951 can only be specified with this property, not with <span
1952 class=property>‘<a href="#descdef-font-family"><code
1953 class=property>font-family</code></a>’</span> itself, so <span
1954 class=property>‘<a href="#propdef-font"><code
1955 class=property>font</code></a>’</span> allows authors to do more than
1956 the sum of its subproperties. However, the individual properties such as
1957 <span class=property>‘<a href="#propdef-font-weight"><code
1958 class=property>font-weight</code></a>’</span> are still given values
1959 taken from the system font, which can be independently varied.
1961 <p>Note that the keywords used for the system fonts listed above are only
1962 treated as keywords when they occur in the initial position, in other
1963 positions the same string is treated as part of the font family name:
1965 <pre> font: menu; /* use the font settings for system menus */
1966 font: large menu; /* use a font family named "menu" */</pre>
1968 <div class=example>
1969 <p style="display:none">Example(s):
1971 <p>
1973 <pre>button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
1974 button p { font: menu }
1975 button p em { font-weight: bolder }
1976 </pre>
1978 <p>If the font used for dropdown menus on a particular system happened to
1979 be, for example, 9-point Charcoal, with a weight of 600, then P elements
1980 that were descendants of BUTTON would be displayed as if this rule were
1981 in effect:
1983 <pre>button p { font: 600 9pt Charcoal }
1984 </pre>
1986 <p>Because the <span class=property>‘<a href="#propdef-font"><code
1987 class=property>font</code></a>’</span> shorthand resets to its initial
1988 value any property not explicitly given a value, this has the same effect
1989 as this declaration:
1991 <pre>button p {
1992 font-style: normal;
1993 font-variant: normal;
1994 font-weight: 600;
1995 font-size: 9pt;
1996 line-height: normal;
1997 font-family: Charcoal
1998 }
1999 </pre>
2000 </div>
2001 <!-- prop: font-synthesis -->
2003 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
2004 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
2005 property</h3>
2007 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
2008 <tbody>
2009 <tr>
2010 <td>Name:
2012 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
2014 <tr>
2015 <td>Value:
2017 <td>none | [ weight || style ]
2019 <tr>
2020 <td>Initial:
2022 <td>weight style
2024 <tr>
2025 <td>Applies to:
2027 <td>all elements
2029 <tr>
2030 <td>Inherited:
2032 <td>yes
2034 <tr>
2035 <td>Percentages:
2037 <td>N/A
2039 <tr>
2040 <td>Media:
2042 <td>visual
2044 <tr>
2045 <td>Computed value:
2047 <td>as specified
2049 <tr>
2050 <td>Animatable:
2052 <td>no
2053 </table>
2055 <p>This property controls whether user agents are allowed to synthesize
2056 bold or oblique font faces when a font family lacks bold or italic faces.
2057 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
2058 specified, user agents must not synthesize bold faces and if ‘<code
2059 class=property>style</code>’ is not specified user agents must not
2060 synthesize italic faces. A value of ‘<code class=property>none</code>’
2061 disallows all synthetic faces.
2063 <div class=example>
2064 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
2066 <pre>*:lang(ar) { font-synthesis: none; }
2067 </pre>
2068 </div>
2070 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
2072 <h3 id=font-face-rule><span class=secno>4.1 </span>The
2073 <code>@font-face</code> rule</h3>
2075 <p>The <code>@font-face</code> rule allows for linking to fonts that are
2076 automatically fetched and activated when needed. This allows authors to
2077 select a font that closely matches the design goals for a given page
2078 rather than limiting the font choice to a set of fonts available on all
2079 platforms. A set of font descriptors define the location of a font
2080 resource, either locally or externally, along with the style
2081 characteristics of an individual face. Multiple <code>@font-face</code>
2082 rules can be used to construct font families with a variety of faces.
2083 Using CSS font matching rules, a user agent can selectively download only
2084 those faces that are needed for a given piece of text.
2086 <p>The @font-face rule consists of the @font-face at-keyword followed by a
2087 block of descriptor declarations. In terms of the grammar, this
2088 specification defines the following productions:
2090 <pre><dfn id=fontfacerule>font_face_rule</dfn>
2091 : <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>*
2092 ;
2094 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
2095 : <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>
2096 ;</pre>
2098 <p>The following new definitions are introduced:
2100 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
2101 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
2103 <p>The following new token is introduced:
2105 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
2107 <p>Each <span class=index-inst id=font-face
2108 title="@font-face"><code>@font-face</code></span> rule specifies a value
2109 for every font descriptor, either implicitly or explicitly. Those not
2110 given explicit values in the rule take the initial value listed with each
2111 descriptor in this specification. These descriptors apply solely within
2112 the context of the <code>@font-face</code> rule in which they are defined,
2113 and do not apply to document language elements. There is no notion of
2114 which elements the descriptors apply to or whether the values are
2115 inherited by child elements. When a given descriptor occurs multiple times
2116 in a given <code>@font-face</code> rule, only the last descriptor
2117 declaration is used and all prior declarations for that descriptor are
2118 ignored.
2120 <div class=example>
2121 <p>To use a downloadable font called Gentium:</p>
2123 <pre>
2124 @font-face {
2125 font-family: Gentium;
2126 src: url(http://example.com/fonts/Gentium.ttf);
2127 }
2129 p { font-family: Gentium, serif; }
2130 </pre>
2132 <p>The user agent will download Gentium and use it when rendering text
2133 within paragraph elements. If for some reason the site serving the font
2134 is unavailable, the default serif font will be used.</p>
2135 </div>
2137 <p>A given set of <code>@font-face</code> rules define a set of fonts
2138 available for use within the documents that contain these rules. When font
2139 matching is done, fonts defined using these rules are considered before
2140 other available fonts on a system.
2142 <p>Downloaded fonts are only available to documents that reference them.
2143 The process of activating these fonts must not make them available to
2144 other applications or to documents that don't directly link to the same
2145 font. User agent implementers might consider it convenient to use
2146 downloaded fonts when rendering characters in other documents for which no
2147 other available font exists as part of the system font fallback procedure.
2148 However, this would cause a security leak since the contents of one page
2149 would be able to affect other pages, something an attacker could use as an
2150 attack vector. These restrictions do not affect caching behavior, fonts
2151 are cached the same way other web resources are cached.
2153 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
2154 properties in a declaration block, declarations of any descriptors that
2155 are not supported by the user agent must be ignored.
2156 <code>@font-face</code> rules require a font-family and src descriptor; if
2157 either of these are missing, the <code>@font-face</code> rule is invalid
2158 and must be ignored entirely.
2160 <p>In cases where user agents have limited platform resources or implement
2161 the ability to disable downloadable font resources,
2162 <code>@font-face</code> rules must simply be ignored; the behavior of
2163 individual descriptors as defined in this specification should not be
2164 altered.
2166 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
2167 href="#descdef-font-family">font-family</a> descriptor</h3>
2169 <table class=descdef>
2170 <tbody>
2171 <tr>
2172 <td>Name:
2174 <td><dfn id=descdef-font-family>font-family</dfn>
2176 <tr>
2177 <td>Value:
2179 <td><a href="#family-name-value"><var><family-name></var></a>
2181 <tr>
2182 <td><em>Initial:</em>
2184 <td>N/A
2185 </table>
2187 <p>This descriptor defines the font family name that will be used in all
2188 CSS font family name matching. It is required for the @font-face rule to
2189 be valid. It overrides the font family names contained in the underlying
2190 font data. If the font family name is the same as a font family available
2191 in a given user's environment, it effectively hides the underlying font
2192 for documents that use the stylesheet. This permits a web author to freely
2193 choose font-family names without worrying about conflicts with font family
2194 names present in a given user's environment. Likewise, platform
2195 substitutions for a given font family name must not be used.
2197 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
2198 href="#descdef-src">src</a> descriptor</h3>
2200 <table class=descdef>
2201 <tbody>
2202 <tr>
2203 <td>Name:
2205 <td><dfn id=descdef-src>src</dfn>
2207 <tr>
2208 <td>Value:
2210 <td>[ <url> [format(<string> #)]? | <a
2211 href="#font-face-name-value"><var><font-face-name></var></a> ] #
2213 <tr>
2214 <td><em>Initial:</em>
2216 <td>N/A
2217 </table>
2219 <p>This descriptor specifies the resource containing font data. It is
2220 required for the <code>@font-face</code> rule to be valid. Its value is a
2221 prioritized, comma-separated list of external references or locally
2222 installed font face names. When a font is needed the user agent iterates
2223 over the set of references listed, using the first one it can successfully
2224 activate. Fonts containing invalid data or local font faces that are not
2225 found are ignored and the user agent loads the next font in the list.
2227 <p>As with other URLs in CSS, the URL may be partial, in which case it is
2228 resolved relative to the location of the style sheet containing the <span
2229 class=index-inst id=font-face0
2230 title="@font-face"><code>@font-face</code></span> rule. In the case of SVG
2231 fonts, the URL points to an element within a document containing SVG font
2232 definitions. If the element reference is omitted, a reference to the first
2233 defined font is implied. Similarly, font container formats that can
2234 contain more than one font must load one and only one of the fonts for a
2235 given <code>@font-face</code> rule. Fragment identifiers are used to
2236 indicate which font to load. If a container format lacks a defined
2237 fragment identifier scheme, implementations should use a simple 1-based
2238 indexing scheme (e.g. "font-collection#1" for the first font,
2239 "font-collection#2" for the second font).
2241 <pre>
2242 src: url(fonts/simple.ttf); /* load simple.ttf relative to stylesheet location */
2243 src: url(/fonts/simple.ttf); /* load simple.ttf from absolute location */
2244 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
2245 </pre>
2247 <p>External references consist of a URL, followed by an optional hint
2248 describing the format of the font resource referenced by that URL. The
2249 format hint contains a comma-separated list of format strings that denote
2250 well-known font formats. Conformant user agents must skip downloading a
2251 font resource if the format hints indicate only unsupported or unknown
2252 font formats. If no format hints are supplied, the user agent should
2253 download the font resource.
2255 <pre>
2256 /* load WOFF font if possible, otherwise use OpenType font */
2257 @font-face {
2258 font-family: bodytext;
2259 src: url(ideal-sans-serif.woff) format("woff"),
2260 url(basic-sans-serif.ttf) format("opentype");
2261 }
2262 </pre>
2264 <p>Format strings defined by this specification:
2266 <table class=data id=fontformats>
2267 <thead>
2268 <tr>
2269 <th>String
2271 <th>Font Format
2273 <th>Common extensions
2275 <tbody>
2276 <tr>
2277 <th>"woff"
2279 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
2281 <td>.woff
2283 <tr>
2284 <th>"truetype"
2286 <td><a
2287 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
2289 <td>.ttf
2291 <tr>
2292 <th>"opentype"
2294 <td><a
2295 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
2297 <td>.ttf, .otf
2299 <tr>
2300 <th>"embedded-opentype"
2302 <td><a
2303 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
2304 OpenType</a>
2306 <td>.eot
2308 <tr>
2309 <th>"svg"
2311 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
2313 <td>.svg, .svgz
2314 </table>
2316 <p>Given the overlap in common usage between TrueType and OpenType, the
2317 format hints "truetype" and "opentype" must be considered as synonymous; a
2318 format hint of "opentype" does not imply that the font contains Postscript
2319 CFF style glyph data or that it contains OpenType layout information (see
2320 <a href="#platform-props-to-css">Appendix A</a> for more background on
2321 this).
2323 <p>When authors would prefer to use a locally available copy of a given
2324 font and download it if it's not, <code>local()</code> can be used. The
2325 locally-installed <dfn
2326 id=font-face-name-value><var><font-face-name></var></dfn> argument
2327 is a format-specific string that uniquely identifies a single font face
2328 within a larger family. The syntax for a <a
2329 href="#font-face-name-value"><var><font-face-name></var></a> is a
2330 unique font face name enclosed by "local(" and ")". The name can
2331 optionally be enclosed in quotes. If unquoted, the unquoted font family
2332 name processing conventions apply; the name must be a sequence of
2333 identifiers separated by whitespace which is converted to a string by
2334 joining the identifiers together separated by a single space.
2336 <pre>
2337 /* regular face of Gentium */
2338 @font-face {
2339 font-family: MyGentium;
2340 src: local(Gentium), /* use locally available Gentium */
2341 url(Gentium.ttf); /* otherwise, download it */
2342 }
2343 </pre>
2345 <p>For OpenType and TrueType fonts, this string is used to match only the
2346 Postscript name or the full font name in the name table of locally
2347 available fonts. Which type of name is used varies by platform and font,
2348 so authors should include both of these names to assure proper matching
2349 across platforms. Platform substitutions for a given font name must not be
2350 used.
2352 <pre>
2353 /* bold face of Gentium */
2354 @font-face {
2355 font-family: MyGentium;
2356 src: local(Gentium Bold), /* full font name */
2357 local(Gentium-Bold), /* Postscript name */
2358 url(GentiumBold.ttf); /* otherwise, download it */
2359 font-weight: bold;
2360 }
2361 </pre>
2363 <p>Just as a <code>@font-face</code> rule specifies the characteristics of
2364 a single font within a family, the unique name used with
2365 <code>local()</code> specifies a single font, not an entire font family.
2366 Defined in terms of OpenType font data, the Postscript name is found in
2367 the font's <a
2368 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
2369 in the name record with nameID = 6 (see <a href="#OPENTYPE"
2370 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
2371 Postscript name is the commonly used key for all fonts on OSX and for
2372 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
2373 used as a unique key for fonts with TrueType glyphs on Windows.
2375 <p>For OpenType fonts with multiple localizations of the full font name,
2376 the US English version is used (language ID = 0x409 for Windows and
2377 language ID = 0 for Macintosh) or the first localization when a US English
2378 full font name is not available (the OpenType specification recommends
2379 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
2380 fonts minimally include US English names</a>). User agents that also match
2381 other full font names, e.g. matching the Dutch name when the current
2382 system locale is set to Dutch, are considered non-conformant. This is done
2383 not to prefer English but to avoid matching inconsistencies across font
2384 versions and OS localizations, since font style names (e.g. "Bold") are
2385 frequently localized into many languages and the set of localizations
2386 available varies widely across platform and font version. User agents that
2387 match a concatenation of family name (nameID = 1) with style name (nameID
2388 = 2) are considered non-conformant.
2390 <p>This also allows for referencing faces that belong to larger families
2391 that cannot otherwise be referenced.
2393 <div class=example>
2394 <p>Use a local font or reference an SVG font in another document:</p>
2396 <pre>
2397 @font-face {
2398 font-family: Headline;
2399 src: local(Futura-Medium),
2400 url(fonts.svg#MyGeometricModern) format("svg");
2401 }
2402 </pre>
2404 <p>Create an alias for local Japanese fonts on different platforms:</p>
2406 <pre>
2407 @font-face {
2408 font-family: jpgothic;
2409 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
2410 }
2411 </pre>
2413 <p>Reference a font face that cannot be matched within a larger family:</p>
2415 <pre>
2416 @font-face {
2417 font-family: Hoefler Text Ornaments;
2418 /* has the same font properties as Hoefler Text Regular */
2419 src: local(HoeflerText-Ornaments);
2420 }
2421 </pre>
2423 <p>Since localized fullnames never match, a document with the header style
2424 rules below would always render using the default serif font, regardless
2425 whether a particular system locale parameter is set to Finnish or not:</p>
2427 <pre>
2428 @font-face {
2429 font-family: SectionHeader;
2430 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
2431 font-weight: bold;
2432 }
2434 h2 { font-family: SectionHeader, serif; }
2435 </pre>
2437 <p>A conformant user agent would never load the font ‘<code
2438 class=css>gentium.eot</code>’ in the example below, since it is
2439 included in the first definition of the ‘<a href="#descdef-src"><code
2440 class=property>src</code></a>’ descriptor which is overridden by the
2441 second definition in the same <code>@font-face</code> rule:</p>
2443 <pre>
2444 @font-face {
2445 font-family: MainText;
2446 src: url(gentium.eot); /* for use with older non-conformant user agents */
2447 src: local("Gentium"), url(gentium.ttf); /* Overrides src definition */
2448 }
2449 </pre>
2450 </div>
2452 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
2453 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
2454 href="#descdef-font-weight">font-weight</a>, <a
2455 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
2457 <table class=descdef>
2458 <tbody>
2459 <tr>
2460 <td>Name:
2462 <td><dfn id=descdef-font-style title="font-style
2463 (descriptor)">font-style</dfn>
2465 <tr>
2466 <td>Value:
2468 <td>normal | italic | oblique
2470 <tr>
2471 <td><em>Initial:</em>
2473 <td>normal
2474 </table>
2476 <table class=descdef>
2477 <tbody>
2478 <tr>
2479 <td>Name:
2481 <td><dfn id=descdef-font-weight title="font-weight
2482 (descriptor)">font-weight</dfn>
2484 <tr>
2485 <td>Value:
2487 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
2489 <tr>
2490 <td><em>Initial:</em>
2492 <td>normal
2493 </table>
2495 <table class=descdef>
2496 <tbody>
2497 <tr>
2498 <td>Name:
2500 <td><dfn id=descdef-font-stretch title="font-stretch
2501 (descriptor)">font-stretch</dfn>
2503 <tr>
2504 <td>Value:
2506 <td>normal | ultra-condensed | extra-condensed | condensed |
2507 semi-condensed | semi-expanded | expanded | extra-expanded |
2508 ultra-expanded
2510 <tr>
2511 <td><em>Initial:</em>
2513 <td>normal
2514 </table>
2516 <p>These descriptors define the characteristics of a font face and are used
2517 in the process of matching styles to specific faces. For a font family
2518 defined with several <code>@font-face</code> rules, user agents can either
2519 download all faces in the family or use these descriptors to selectively
2520 download font faces that match actual styles used in document. The values
2521 for these descriptors are the same as those for the corresponding font
2522 properties except that relative keywords are not allowed, ‘<code
2523 class=property>bolder</code>’ and ‘<code
2524 class=property>lighter</code>’. If these descriptors are omitted,
2525 initial values are assumed.
2527 <p>The value for these font face style attributes is used in place of the
2528 style implied by the underlying font data. This allows authors to combine
2529 faces in flexible combinations, even in situations where the original font
2530 data was arranged differently. User agents that implement synthetic
2531 bolding and obliqueing must only apply synthetic styling in cases where
2532 the font descriptors imply this is needed, rather than based on the style
2533 attributes implied by the font data.
2535 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
2536 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
2538 <table class=descdef>
2539 <tbody>
2540 <tr>
2541 <td>Name:
2543 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
2545 <tr>
2546 <td>Value:
2548 <td><a href="#urange-value"><var><urange></var></a> #
2550 <tr>
2551 <td><em>Initial:</em>
2553 <td>U+0-10FFFF
2554 </table>
2556 <p>This descriptor defines the set of Unicode codepoints that may be
2557 supported by the font face for which it is declared. The descriptor value
2558 is a comma-delimited list of Unicode range (<a
2559 href="#urange-value"><var><urange></var></a>) values. The union of
2560 these ranges defines the set of codepoints that serves as a hint for user
2561 agents when deciding whether or not to download a font resource for a
2562 given text run.
2564 <p>Each <dfn id=urange-value><var><urange></var></dfn> value is a <a
2565 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2566 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
2567 "U+" or "u+" prefix followed by a codepoint range in one of the three
2568 forms listed below. Ranges that do not fit one of the these forms are
2569 invalid and cause the declaration to be ignored.
2571 <dl>
2572 <dt>single codepoint (e.g. U+416)
2574 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
2575 digits
2577 <dt>interval range (e.g. U+400-4ff)
2579 <dd>represented as two hyphen-separated valid Unicode codepoints
2580 indicating the inclusive start and end codepoints of a range
2582 <dt>wildcard range (e.g. U+4??)
2584 <dd>defined by the set of codepoints implied when trailing ‘<code
2585 class=css>?</code>’ characters signify any hexadeximal digit
2586 </dl>
2588 <p>Individual codepoints are written using hexadecimal values that
2589 correspond to <a href="http://www.unicode.org/charts/">Unicode character
2590 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
2591 inclusive. Digit values of codepoints are ASCII case-insensitive. For
2592 interval ranges, the start and end codepoints must be valid Unicode values
2593 and the end codepoint must be greater than or equal to the start
2594 codepoint.
2596 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
2597 "U+???") are valid and equivalent to a wildcard range with an initial zero
2598 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
2599 the range of valid Unicode codepoints are invalid. Because of this, the
2600 maximum number of trailing ‘<code class=css>?</code>’ wildcard
2601 characters is four, even though the <a
2602 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2603 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
2605 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
2606 href="#descdef-unicode-range"><code
2607 class=property>unicode-range</code></a>’ descriptor declaration, ranges
2608 may overlap. The union of these ranges defines the set of codepoints for
2609 which the corresponding font may be used. User agents must not download or
2610 use the font for codepoints outside this set. User agents may normalize
2611 the list of ranges into a list that is different but represents the same
2612 set of codepoints.
2614 <p>The associated font may not contain glyphs for the entire set of
2615 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
2616 class=property>unicode-range</code></a>’ descriptor. When the font is
2617 used the effective <a href="#character-map"><em>character map</em></a> is
2618 the intersection of the codepoints defined by ‘<a
2619 href="#descdef-unicode-range"><code
2620 class=property>unicode-range</code></a>’ with the font's <a
2621 href="#character-map"><em>character map</em></a>. This allows authors to
2622 define supported ranges in terms of broad ranges without worrying about
2623 the precise codepoint ranges supported by the underlying font.
2625 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
2626 to define composite fonts</h3>
2628 <p>Multiple <code>@font-face</code> rules with different unicode ranges for
2629 the same family and style descriptor values can be used to create
2630 composite fonts that mix the glyphs from different fonts for different
2631 scripts. This can be used to combine fonts that only contain glyphs for a
2632 single script (e.g. Latin, Greek, Cyrillic) or it can be used by authors
2633 as a way of segmenting a font into fonts for commonly used characters and
2634 less frequently used characters. Since the user agent will only pull down
2635 the fonts it needs this helps reduce page bandwidth.
2637 <p>If the unicode ranges overlap for a set of <code>@font-face</code> rules
2638 with the same family and style descriptor values, the rules are ordered in
2639 the reverse order they were defined; the last rule defined is the first to
2640 be checked for a given character.
2642 <p>Example ranges for specific languages or characters:
2644 <dl>
2645 <dt>unicode-range: U+A5;
2647 <dd>a single code point, the yen/yuan symbol
2649 <dt>unicode-range: U+0-7F;
2651 <dd>code range for basic ASCII characters
2653 <dt>unicode-range: U+590-5ff;
2655 <dd>code range for Hebrew characters
2657 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
2659 <dd>code range for Japanese kanji, hiragana and katakana characters plus
2660 yen/yuan symbol
2661 </dl>
2663 <div class=example>
2664 <p>The BBC provides news services in a wide variety of languages, many
2665 that are not well supported across all platforms. Using an
2666 <code>@font-face</code> rule, the BBC could provide a font for any of
2667 these languages, as it already does via a manual font download.</p>
2669 <pre>
2670 @font-face {
2671 font-family: BBCBengali;
2672 src: url(fonts/BBCBengali.ttf) format("opentype");
2673 unicode-range: U+00-FF, U+980-9FF;
2674 }
2675 </pre>
2676 </div>
2678 <div class=example>
2679 <p>Technical documents often require a wide range of symbols. The STIX
2680 Fonts project is one project aimed at providing fonts to support a wide
2681 range of technical typesetting in a standardized way. The example below
2682 shows the use of a font that provides glyphs for many of the mathematical
2683 and technical symbol ranges within Unicode:</p>
2685 <pre>
2686 @font-face {
2687 font-family: STIXGeneral;
2688 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
2689 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
2690 }
2691 </pre>
2692 </div>
2694 <div class=example>
2695 <p>This example shows how an author can override the glyphs used for Latin
2696 characters in a Japanese font with glyphs from a different font. The
2697 first rule specifies no range so it defaults to the entire range. The
2698 range specified in the second rule overlaps but takes precedence because
2699 it is defined later.</p>
2701 <pre>
2702 @font-face {
2703 font-family: JapaneseWithGentium;
2704 src: local(MSMincho);
2705 /* no range specified, defaults to entire range */
2706 }
2708 @font-face {
2709 font-family: JapaneseWithGentium;
2710 src: url(../fonts/Gentium.ttf);
2711 unicode-range: U+0-2FF;
2712 }
2713 </pre>
2714 </div>
2716 <div class=example>
2717 <p>Consider a family constructed to optimize bandwidth by separating out
2718 Latin, Japanese and other characters into different font files:</p>
2720 <pre>
2721 /* fallback font - size: 4.5MB */
2722 @font-face {
2723 font-family: DroidSans;
2724 src: url(DroidSansFallback.ttf);
2725 /* no range specified, defaults to entire range */
2726 }
2728 /* Japanese glyphs - size: 1.2MB */
2729 @font-face {
2730 font-family: DroidSans;
2731 src: url(DroidSansJapanese.ttf);
2732 unicode-range: U+3000-9FFF, U+ff??;
2733 }
2735 /* Latin, Greek, Cyrillic along with some
2736 punctuation and symbols - size: 190KB */
2737 @font-face {
2738 font-family: DroidSans;
2739 src: url(DroidSans.ttf);
2740 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
2741 }
2742 </pre>
2744 <p>For simple Latin text, only the font for Latin characters is
2745 downloaded:</p>
2747 <pre>
2748 body { font-family: DroidSans; }
2750 <p>This is that</p>
2751 </pre>
2753 <p>In this case the user agent first checks the unicode-range for the font
2754 containing Latin characters (DroidSans.ttf). Since all the characters
2755 above are in the range U+0-5FF, the user agent downloads the font and
2756 renders the text with that font.</p>
2758 <p>Next, consider text that makes use of an arrow character (⇨):</p>
2760 <pre>
2761 <p>This &#x21e8; that<p>
2762 </pre>
2764 <p>The user agent again first checks the unicode-range of the font
2765 containing Latin characters. Since U+2000-2300 includes the arrow code
2766 point (U+21E8), the user agent downloads the font. For this character
2767 however the Latin font does not have a matching glyph, so the effective
2768 unicode-range used for font matching excludes this code point. Next, the
2769 user agent evaluates the Japanese font. The unicode-range for the
2770 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
2771 user agent does not download the Japanese font. Next the fallback font is
2772 considered. The <code>@font-face</code> rule for the fallback font does
2773 not define unicode-range so its value defaults to the range of all
2774 Unicode code points. The fallback font is downloaded and used to render
2775 the arrow character.</p>
2776 </div>
2778 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
2779 href="#descdef-font-variant">font-variant</a> and <a
2780 href="#descdef-font-feature-settings">font-feature-settings</a>
2781 descriptors</h3>
2783 <table class=descdef>
2784 <tbody>
2785 <tr>
2786 <td>Name:
2788 <td><dfn id=descdef-font-variant title="font-variant
2789 (descriptor)">font-variant</dfn>
2791 <tr>
2792 <td>Value:
2794 <td>normal | none | [ <a
2795 href="#common-lig-values"><var><common-lig-values></var></a> ||
2796 <a
2797 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
2798 || <a
2799 href="#historical-lig-values"><var><historical-lig-values></var></a>
2800 || <a
2801 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
2802 || <a href="#stylistic"><var
2803 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
2804 href="#historical-forms"><var>historical-forms</var></a> || <a
2805 href="#styleset"><var
2806 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
2807 href="#character-variant"><var
2808 title=character-variant>character-variant(<feature-value-name>
2809 #)</var></a> || <a href="#swash"><var
2810 title=swash>swash(<feature-value-name>)</var></a> || <a
2811 href="#ornaments"><var
2812 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
2813 href="#annotation"><var
2814 title=annotation>annotation(<feature-value-name>)</var></a> || [
2815 <a href="#small-caps"><i>small-caps</i></a> | <a
2816 href="#all-small-caps"><i>all-small-caps</i></a> | <a
2817 href="#petite-caps"><i>petite-caps</i></a> | <a
2818 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
2819 href="#unicase"><i>unicase</i></a> | <a
2820 href="#titling-caps"><i>titling-caps</i></a> ] || <a
2821 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
2822 || <a
2823 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
2824 || <a
2825 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
2826 || <a href="#ordinal"><i>ordinal</i></a> || <a
2827 href="#slashed-zero"><i>slashed-zero</i></a> || <a
2828 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
2829 || <a
2830 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
2831 || <a href="#ruby"><i>ruby</i></a> ]
2833 <tr>
2834 <td><em>Initial:</em>
2836 <td>normal
2837 </table>
2839 <table class=descdef>
2840 <tbody>
2841 <tr>
2842 <td>Name:
2844 <td><dfn id=descdef-font-feature-settings title="font-feature-settings
2845 (descriptor)">font-feature-settings</dfn>
2847 <tr>
2848 <td>Value:
2850 <td>normal | <a
2851 href="#feature-tag-value"><var><feature-tag-value></var></a> #
2853 <tr>
2854 <td><em>Initial:</em>
2856 <td>normal
2857 </table>
2859 <p>These descriptors define initial settings that apply when the font
2860 defined by an <code>@font-face</code> rule is rendered. They do not affect
2861 font selection. Values are identical to those defined for the
2862 corresponding ‘<a href="#propdef-font-variant"><code
2863 class=property>font-variant</code></a>’ and ‘<a
2864 href="#propdef-font-feature-settings"><code
2865 class=property>font-feature-settings</code></a>’ properties defined
2866 below except that the value ‘<code class=property>inherit</code>’ is
2867 omitted. When multiple font feature descriptors or properties are used,
2868 the cumulative effect on text rendering is detailed in the section <a
2869 href="#font-feature-resolution">Font Feature Resolution</a> below. In
2870 cases where specific values define synthesized fallback for certain ‘<a
2871 href="#propdef-font-variant"><code
2872 class=property>font-variant</code></a>’ subproperties, the same
2873 synthesized fallback applies when used within those values are used with
2874 the <a href="#descdef-font-variant">‘<code
2875 class=property>font-variant</code>’</a> descriptor.
2877 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
2878 guidelines</h3>
2880 <p>The <code>@font-face</code> rule is designed to allow lazy loading of
2881 fonts, fonts are only downloaded when needed for use within a document. A
2882 stylesheet can include <code>@font-face</code> rules for a library of
2883 fonts of which only a select set are used; user agents must only download
2884 those fonts that are referred to within the style rules applicable to a
2885 given page. User agents that download all fonts defined in
2886 <code>@font-face</code> rules without considering whether those fonts are
2887 in fact used within a page are considered non-conformant. In cases where a
2888 font might be downloaded in character fallback cases, user agents may
2889 download a font if it's listed in a font list but is not actually used for
2890 a given text run.
2892 <pre>
2893 @font-face {
2894 font-family: GeometricModern;
2895 src: url(font.ttf);
2896 }
2898 p {
2899 /* font will be downloaded for pages with p elements */
2900 font-family: GeometricModern, sans-serif;
2901 }
2903 h2 {
2904 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
2905 font-family: Futura, GeometricModern, sans-serif;
2906 }
2907 </pre>
2909 <p>In cases where textual content is loaded before downloadable fonts are
2910 available, user agents may render text as it would be rendered if
2911 downloadable font resources are not available or they may render text
2912 transparently with fallback fonts to avoid a flash of text using a
2913 fallback font. In cases where the font download fails user agents must
2914 display text, simply leaving transparent text is considered non-conformant
2915 behavior. Authors are advised to use fallback fonts in their font lists
2916 that closely match the vertical metrics of the downloadable fonts to avoid
2917 large page reflows where possible.
2919 <h3 id=same-origin-restriction><span class=secno>4.9 </span>Same-origin
2920 restriction for fonts</h3>
2922 <h4 id=default-same-origin-restriction><span class=secno>4.9.1
2923 </span>Default same-origin restriction</h4>
2924 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
2925 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
2926 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
2927 -->
2929 <p>User agents must implement a same-origin restriction when loading fonts
2930 via the <code>@font-face</code> mechanism. This restriction limits the
2931 loading of fonts for a given document to fonts loaded from the same
2932 origin. Fonts can only be loaded via the same host, port, and method
2933 combination as the containing document, using the <a
2934 href="http://www.w3.org/TR/html5/browsers.html#origin">origin matching
2935 algorithm</a> described in the <a href="#HTML5"
2936 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification. The origin of
2937 the stylesheet containing <code>@font-face</code> rules is not used when
2938 deciding whether a font is same origin or not, only the origin of the
2939 containing document is used. The restriction applies to all font types.
2941 <p>Given a document located at http://example.com/page.html, fonts defined
2942 with ‘<a href="#descdef-src"><code class=property>src</code></a>’
2943 definitions considered cross origin must not be loaded:
2945 <pre>
2946 /* same origin (i.e. domain, protocol, port match document) */
2947 src: url(fonts/simple.ttf);
2948 src: url(//fonts/simple.ttf);
2950 /* cross origin, different protocol */
2951 src: url(https://example.com/fonts/simple.ttf);
2953 /* cross origin, different domain */
2954 src: url(http://another.example.com/fonts/simple.ttf);
2955 </pre>
2957 <h4 id=allowing-cross-origin-font-loading><span class=secno>4.9.2
2958 </span>Allowing cross-origin font loading</h4>
2960 <p>User agents must also implement the ability to relax this restriction
2961 using cross-site origin controls <a href="#CORS"
2962 rel=biblioentry>[CORS]<!--{{!CORS}}--></a> for fonts loaded via HTTP.
2963 Sites can explicitly allow cross-site downloading of font data using the
2964 <code>Access-Control-Allow-Origin</code> HTTP header. For other protocols,
2965 no explicit relaxation mechanism is defined or required.
2967 <p>For font loads over HTTP, cross-origin requests must be made with the
2968 following parameter settings which are used in conjunction with the <a
2969 href="http://www.w3.org/TR/cors/#cross-origin-request-0"> <em>cross-origin
2970 request algorithm</em></a> <a href="#CORS"
2971 rel=biblioentry>[CORS]<!--{{!CORS}}--></a>:
2973 <ul>
2974 <li><em>request URL</em> — the URL of the font resource in the <a
2975 href="#descdef-src"><code>src</code></a> descriptor
2977 <li><em>request method</em> — GET
2979 <li><em>author request headers</em> — none
2981 <li><em>request entity body</em> — empty
2983 <li><em>source origin</em> — the origin of the page which linked to the
2984 stylesheet
2986 <li><em>manual redirect flag</em> — false
2988 <li><em>omit credentials flag</em> — true
2990 <li><em>force preflight flag</em> — false
2991 </ul>
2993 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
2994 Algorithm</h2>
2996 <p>The algorithm below describes how fonts are associated with individual
2997 runs of text. For each character in the run a font family is chosen and a
2998 particular font face is selected containing a glyph for that character.
3000 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
3001 font family names</h3>
3003 <p>As part of the font matching algorithm outlined below, user agents must
3004 match font family names used in style rules with actual font family names
3005 contained in fonts available in a given environment or defined via
3006 <code>@font-face</code> rules. User agents must match these names case
3007 insensitively, using the "Default Caseless Matching" algorithm outlined in
3008 the Unicode specification <a href="#UNICODE6"
3009 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
3010 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
3011 the algorithm must be applied without normalizing the strings involved and
3012 without applying any language-specific tailorings. The case folding method
3013 specified by this algorithm uses the case mappings with status field
3014 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
3015 in the CaseFolding.txt file of the Unicode Character Database.
3017 <p class=note> Implementors should take care to verify that a given
3018 caseless string comparison implementation uses this precise algorithm and
3019 not assume that a given platform string matching routine follows it, as
3020 many of these have locale-specific behavior or use some level of string
3021 normalization.
3023 <p class=note> For authors this means that font family names are matched
3024 case insensitively, whether or not those names exist in a platform font or
3025 in the <code>@font-face</code> rules contained in a stylesheet. Authors
3026 should take care to ensure that names use a character sequence consistent
3027 with the actual font family name, particularly when using combining
3028 characters such as diacritical marks. For example, a family name that
3029 contains an uppercase A (U+0041) followed by a combining ring (U+030A)
3030 will <strong>not</strong> match a name that looks identical but which uses
3031 the precomposed lowercase a-ring character (U+00E5) instead of the
3032 combining sequence.
3034 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
3035 styles</h3>
3037 <p>The procedure for choosing fonts consists of iterating over the font
3038 families determined by the font-family property, selecting a font face
3039 with the appropriate style based on other font properties and then
3040 determining whether a glyph exists for a given character. This is done
3041 using the <dfn id=character-map>character map</dfn> of the font, data
3042 which maps characters to the default glyph for that character. Codepoint
3043 sequences consisting of a base character followed by a sequence of
3044 combining characters are treated slightly differently, see the section on
3045 <a href="#cluster-matching">cluster matching</a> below.
3047 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
3048 given font family is defined to be the face that would be selected if all
3049 font style properties were set to their initial value.
3051 <ol id=fontmatchingalg>
3052 <li>Using the computed font property values for a given element, the user
3053 agent starts with the first family name in the fontlist specified by the
3054 <span class=property>‘<a href="#descdef-font-family"><code
3055 class=property>font-family</code></a>’</span> property.
3057 <li>If the family name is unquoted and is a generic family name, the user
3058 agent looks up the appropriate font family name to be used. User agents
3059 may choose the generic font family to use based on the language of the
3060 containing element or the Unicode range of the character.
3062 <li>For other family names, the user agent attempts to find the family
3063 name among fonts defined via <code>@font-face</code> rules and then among
3064 available system fonts, matching names with a case-insensitive comparison
3065 as outlined <a href="#font-family-casing">in the section above</a>. On
3066 systems containing fonts with multiple localized font family names, user
3067 agents must match any of these names independent of the underlying system
3068 locale or platform API used. If the font resources defined for a given
3069 face in an @font-face rule are either not available or contain invalid
3070 font data, then the face should be treated as not present in the family.
3071 If no faces are present for a family defined via @font-face rules, the
3072 family should be treated as missing; matching a platform font with the
3073 same name must not occur in this case.
3075 <li>If a font family match occurs, the user agent assembles the set of
3076 font faces in that family and then narrows the set to a single face using
3077 other font properties in the order given below:
3078 <ol id=fontstylematchingalg>
3079 <li><span class=property>‘<a href="#propdef-font-stretch"><code
3080 class=property>font-stretch</code></a>’</span> is tried first. If the
3081 matching set contains faces with width values matching the ‘<a
3082 href="#propdef-font-stretch"><code
3083 class=property>font-stretch</code></a>’ value, faces with other width
3084 values are removed from the matching set. If there is no face that
3085 exactly matches the width value the nearest width is used instead. If
3086 the value of ‘<a href="#propdef-font-stretch"><code
3087 class=property>font-stretch</code></a>’ is ‘<a
3088 href="#normal2"><code class=property>normal</code></a>’ or one of the
3089 condensed values, narrower width values are checked first, then wider
3090 values. If the value of ‘<a href="#propdef-font-stretch"><code
3091 class=property>font-stretch</code></a>’ is one of the expanded
3092 values, wider values are checked first, followed by narrower values.
3093 Once the closest matching width has been determined by this process,
3094 faces with other widths are removed from the matching set.
3096 <li><span class=property>‘<a href="#propdef-font-style"><code
3097 class=property>font-style</code></a>’</span> is tried next. If the
3098 value of ‘<a href="#propdef-font-style"><code
3099 class=property>font-style</code></a>’ is ‘<code
3100 class=property>italic</code>’, italic faces are checked first, then
3101 oblique, then normal faces. If the value is ‘<code
3102 class=property>oblique</code>’, oblique faces are checked first, then
3103 italic faces and then normal faces. If the value is ‘<a
3104 href="#normal2"><code class=property>normal</code></a>’, normal faces
3105 are checked first, then oblique faces, then italic faces. Faces with
3106 other style values are excluded from the matching set. User agents are
3107 permitted to distinguish between italic and oblique faces within
3108 platform font families but this is not required, they may treat all
3109 italic or oblique faces as italic faces. However, within font families
3110 defined via <code>@font-face</code> rules, italic and oblique faces
3111 must be distinguished using the value of the ‘<a
3112 href="#propdef-font-style"><code
3113 class=property>font-style</code></a>’ descriptor.
3115 <li><span class=property>‘<a href="#propdef-font-weight"><code
3116 class=property>font-weight</code></a>’</span> is matched next, it
3117 will always reduce the matching set to a single font face. If
3118 bolder/lighter relative weights are used, the effective weight is
3119 calculated based on the inherited weight value, as described in the
3120 definition of the ‘<a href="#propdef-font-weight"><code
3121 class=property>font-weight</code></a>’ property. Given the desired
3122 weight and the weights of faces in the matching set after the steps
3123 above, if the desired weight is available that face matches. Otherwise,
3124 a weight is chosen using the rules below:
3125 <ul>
3126 <li>If the desired weight is less than 400, weights below the desired
3127 weight are checked in descending order followed by weights above the
3128 desired weight in ascending order until a match is found.
3130 <li>If the desired weight is greater than 500, weights above the
3131 desired weight are checked in ascending order followed by weights
3132 below the desired weight in descending order until a match is found.
3134 <li>If the desired weight is 400, 500 is checked first and then the
3135 rule for desired weights less than 400 is used.
3137 <li>If the desired weight is 500, 400 is checked first and then the
3138 rule for desired weights less than 400 is used.
3139 </ul>
3141 <li><span class=property>‘<a href="#propdef-font-size"><code
3142 class=property>font-size</code></a>’</span> must be matched within a
3143 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
3144 are rounded to the nearest whole pixel, while the tolerance for
3145 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
3146 by ‘<code class=property>em</code>’ values in other properties, are
3147 based on the <span class=property>‘<a href="#propdef-font-size"><code
3148 class=property>font-size</code></a>’</span> value that is used, not
3149 the one that is specified.
3150 </ol>
3152 <li>
3153 <p>If no matching face exists or the matched face does not contain a
3154 glyph for the character to be rendered, the next family name is selected
3155 and the previous two steps repeated. Glyphs from other faces in the
3156 family are not considered. The only exception is that user agents may
3157 optionally substitute a synthetic version of the <a
3158 href="#default-face"><em>default face</em></a> if that face supports a
3159 given glyph (e.g. a synthetic italic version of the regular face may be
3160 used if the italic face doesn't support glyphs for Arabic).</p>
3161 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
3163 <p>If the matched font is defined via an <code>@font-face</code> rule and
3164 needs to be downloaded, the font resource is downloaded. While the
3165 download occurs, the user agent can either wait until the font is
3166 downloaded or render once with substituted font metrics and render again
3167 once the font is downloaded.</p>
3169 <li>If there are no more font families to be evaluated and no matching
3170 face has been found, then the user agent performs a <em>system font
3171 fallback</em> procedure to find the best match for the character to be
3172 rendered. The result of this procedure may vary across user agents.
3174 <li>If a particular character cannot be displayed using any font, the user
3175 agent should indicate by some means that a character is not being
3176 displayed, displaying either a symbolic representation of the missing
3177 glyph (e.g. using a <a
3178 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
3179 Font</a>) or using the missing character glyph from a default font.
3180 </ol>
3182 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
3184 <p>When text contains characters such as combining diacritics, ideally the
3185 base character should be rendered using the same font as the diacritic,
3186 this assures proper placement of the diacritic. For this reason, the font
3187 matching algorithm for clusters is more specialized than the general case
3188 of matching a single character by itself. For sequences containing
3189 variation selectors, which indicate the precise glyph to be used for a
3190 given character, user agents always attempt system font fallback to find
3191 the appropriate glyph before using the default glyph of the base
3192 character.
3194 <p>A font is considered to <em>support</em> a given character if (1) the
3195 character is contained in the font's <a
3196 href="#character-map"><em>character map</em></a> and (2) if required by
3197 the containing script, shaping information is available for that
3198 character. Some legacy fonts may include a given character in the <a
3199 href="#character-map"><em>character map</em></a> but lack the shaping
3200 information (e.g. <a
3201 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
3202 layout tables</a> or <a
3203 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_techAbout">Graphite
3204 tables</a>) necessary for correctly rendering text runs containing that
3205 character.
3207 <p>A sequence of codepoints containing combining diacritics or other
3208 modifiers is termed a grapheme cluster (see <a href="#CSS3TEXT"
3209 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
3210 description). For a given cluster containing a base character, <em>b</em>
3211 and a sequence of combining characters <em>c1, c2…</em>, the entire
3212 cluster is matched using these steps:
3214 <ol>
3215 <li>For each family in the font list, a face is chosen using the style
3216 selection rules defined in the previous section.
3217 <ol>
3218 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
3219 completely supported by the font, select this font for the sequence.
3221 <li>If a sequence of multiple codepoints is canonically equivalent to a
3222 single character and the font supports that character, select this font
3223 for the sequence.
3224 </ol>
3226 <li>If no font was found in the font list in step 1:
3227 <ol>
3228 <li>If <em>c1</em> is a variation selector, system fallback must be used
3229 to find a font that supports the full sequence of <em>b + c1</em>. If
3230 no font on the system supports the full sequence, match the single
3231 character <em>b</em> using the normal procedure for matching single
3232 characters and ignore the variation selector. Note: a sequence with
3233 more than one variation selector is treated as an encoding error and
3234 the trailing selectors are ignored.
3236 <li>Otherwise, the user agent may optionally use system font fallback to
3237 match a font that supports the entire cluster.
3238 </ol>
3240 <li>If no font is found in step 2, use the matching sequence from step 1
3241 to determine the longest sequence that is completely matched by a font in
3242 the font list and attempt to match the remaining combining characters
3243 separately using the rules for single characters.
3244 </ol>
3246 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
3247 issues</h3>
3249 <p>The procedure above is always performed on text runs containing Unicode
3250 characters, documents using legacy encodings are assumed to have been
3251 transcoded before matching fonts. For fonts containing <a
3252 href="#character-map"><em title="character map">character maps</em></a>
3253 for both legacy encodings and Unicode, the contents of the legacy encoding
3254 <a href="#character-map"><em>character map</em></a> must have no effect on
3255 the results of the font matching process.
3257 <p>The font matching process does not assume that text runs are in either
3258 normalized or denormalized form (see <a href="#CHARMOD-NORM"
3259 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
3260 details). Layout engines often convert base character plus combining
3261 character sequences into precomposed characters if they exist. The font
3262 matching algorithm outlined here supports both ways and fonts can
3263 generally support either but variations can occur. Authors should always
3264 tailor their choice of fonts to their content, including whether that
3265 content contains normalized or denormalized character streams.
3267 <p>If a given character is a Private-Use Area Unicode codepoint and none of
3268 the fonts in the fontlist contain a glyph for that codepoint, user agents
3269 must display some form of missing glyph symbol for that character rather
3270 than attempting system font fallback for that codepoint. When matching the
3271 replacement character U+FFFD, user agents may skip the font matching
3272 process and immediately display some form of missing glyph symbol, they
3273 are not required to display the glyph from the font that would be selected
3274 by the font matching process.
3276 <p>In general, the fonts for a given family will all have the same or
3277 similar <a href="#character-map"><em title="character map">character
3278 maps</em></a>. The process outlined here is designed to handle even font
3279 families containing faces with widely variant <a href="#character-map"><em
3280 title="character map">character maps</em></a>. However, authors are
3281 cautioned that the use of such families can lead to unexpected results.
3283 <p>Optimizations of this process are allowed provided that an
3284 implementation behaves as if the algorithm had been followed exactly.
3285 Matching occurs in a well-defined order to insure that the results are as
3286 consistent as possible across user agents, given an identical set of
3287 available fonts and rendering technology.
3289 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
3290 changes since CSS 2.1</h3>
3292 <p>The algorithm above is different from CSS 2.1 in a number of key places.
3293 These changes were made to better reflect actual font matching behavior
3294 across user agent implementations.
3296 <p>Differences compared to the font matching algorithm in CSS 2.1:
3298 <ul>
3299 <li>The algorithm includes font-stretch matching.
3301 <li>All possible font-style matching scenarios are delineated.
3303 <li>Small-caps fonts are not matched as part of the font matching process,
3304 they are now handled via font features.
3306 <li>Unicode variation selector matching is required.
3308 <li>Cluster sequences are matched as a unit.
3309 </ul>
3311 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
3312 examples</h3>
3314 <div class=example>
3315 <p>It's useful to note that the CSS selector syntax may be used to create
3316 language-sensitive typography. For example, some Chinese and Japanese
3317 characters are unified to have the same Unicode code point, although the
3318 abstract glyphs are not the same in the two languages.
3320 <pre>*:lang(ja-jp) { font: 900 14pt/16pt "Heisei Mincho W9", serif; }
3321 *:lang(zh-tw) { font: 800 14pt/16.5pt "Li Sung", serif; }
3322 </pre>
3324 <p>This selects any element that has the given language - Japanese or
3325 Traditional Chinese - and uses the appropriate font.
3326 </div>
3328 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
3330 <p>Modern font technologies support a variety of advanced typographic and
3331 language-specific font features. Using these features, a single font can
3332 provide glyphs for a wide range of ligatures, contextual and stylistic
3333 alternates, tabular and old-style figures, small capitals, automatic
3334 fractions, swashes, and alternates specific to a given language. To allow
3335 authors control over these font capabilities, the font-variant property
3336 has been expanded for CSS3, it now functions as a shorthand for a set of
3337 properties that provide control over stylistic font features.
3339 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
3340 selection and positioning</h3>
3342 <p>Simple fonts used for displaying Latin text use a very basic processing
3343 model, fonts contain a <a href="#character-map"><em>character map</em></a>
3344 which maps a given character to a glyph for that character. Glyphs for
3345 subsequent characters are simply placed next in line along a run of text.
3346 Font formats such as OpenType and AAT (Apple Advanced Typography) use a
3347 richer processing model, the glyph for a given character can be chosen and
3348 positioned not just based on a single character, but also based on
3349 surrounding characters along with the language, script, and features
3350 enabled for the text. Font features may be required for specific scripts,
3351 or recommended as enabled by default or they may be stylistic features
3352 meant to be used under author control.
3354 <p>For a good visual overview of these features, see the <a
3355 href="#OPENTYPE-FONT-GUIDE"
3356 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
3357 For a detailed description of glyph processing for OpenType fonts, see <a
3358 href="#WINDOWS-GLYPH-PROC"
3359 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
3361 <p>Stylistic font features can be classified into two broad categories,
3362 ones that affect the harmonization of glyph shapes with the surrounding
3363 context, such as kerning and ligature features, and those such as the
3364 small-caps, subscript/superscript and alternate features that affect shape
3365 selection.
3367 <p>The subproperties of font-variant listed below are used to control these
3368 stylistic font features; they do not control features that are required
3369 for displaying certain scripts, such as the OpenType features used when
3370 displaying Arabic or Indic language text. They affect glyph selection and
3371 positioning, they do not affect font selection as described in the font
3372 matching section (except in cases required for compatibility with CSS
3373 2.1).
3375 <p>To assure consistent behavior across user agents, the equivalent
3376 OpenType property settings are listed for individual properties and must
3377 be considered normative. When using other font formats these should be
3378 used as a guideline to map CSS font feature property values to specific
3379 font features.
3381 <h3 id=language-specific-support><span class=secno>6.2
3382 </span>Language-specific display</h3>
3384 <p>OpenType also supports language-specific glyph selection and
3385 positioning, so that text can be displayed correctly in cases where the
3386 language dictates a specific display behavior. Languages often share a
3387 common script but the shape of certain letters may vary across those
3388 languages, such as the variations in certain Cyrillic letters used in
3389 Russian and Bulgarian text. In Latin text, it's common to render "fi" with
3390 an explicit fi-ligature that lacks a dot on the "i". However, in languages
3391 such as Turkish which uses both a dotted-i and a dotless-i, it's important
3392 to not use this ligature or use a specialized version that contains a dot
3393 over the "i". The example below shows language-specific variations based
3394 on stylistic traditions found in Spanish, Italian and French orthography:
3396 <div class=featex><img alt="language specific forms, spanish"
3397 src=locl-1.png></div>
3399 <div class=featex><img alt="language specific forms, italian"
3400 src=locl-2.png></div>
3402 <div class=featex><img alt="language specific forms, french"
3403 src=locl-3.png></div>
3405 <p>If the content language of the element is known, according to the rules
3406 of the <a
3407 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
3408 language</a>, user agents are required to infer the OpenType language
3409 system from the content language and use that when selecting and
3410 positioning glyphs using an OpenType font.
3412 <p>For OpenType fonts, in some cases it may be necessary to explicitly
3413 declare the OpenType language to be used, for example when displaying text
3414 in a given language that uses the typographic conventions of another
3415 language or when the font does not explicitly support a given language but
3416 supports a language that shares common typographic conventions. The ‘<a
3417 href="#propdef-font-language-override"><code
3418 class=property>font-language-override</code></a>’ property is used for
3419 this purpose.</p>
3420 <!-- prop: font-kerning -->
3422 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
3423 href="#propdef-font-kerning">font-kerning</a> property</h3>
3425 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
3426 <tbody>
3427 <tr>
3428 <td>Name:
3430 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
3432 <tr>
3433 <td>Value:
3435 <td>auto | normal | none
3437 <tr>
3438 <td>Initial:
3440 <td>auto
3442 <tr>
3443 <td>Applies to:
3445 <td>all elements
3447 <tr>
3448 <td>Inherited:
3450 <td>yes
3452 <tr>
3453 <td>Percentages:
3455 <td>N/A
3457 <tr>
3458 <td>Media:
3460 <td>visual
3462 <tr>
3463 <td>Computed value:
3465 <td>as specified
3467 <tr>
3468 <td>Animatable:
3470 <td>no
3471 </table>
3473 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
3474 property controls metric kerning, kerning that utilizes adjustment data
3475 contained in the font. The value ‘<a href="#normal2"><code
3476 class=property>normal</code></a>’ implies that kerning is applied while
3477 the value ‘<code class=property>none</code>’ implies that kerning is
3478 not applied when rendering text. If the value is ‘<code
3479 class=property>auto</code>’, a user agent is free to choose whether
3480 kerning is enabled or not by default and to vary that default based on the
3481 underlying text script.
3483 <p>For fonts that do not include kerning data this property will have no
3484 visible effect. When rendering with OpenType fonts, the <a
3485 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
3486 specification suggests that kerning be enabled by default. When kerning is
3487 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
3488 vertical text runs the <span class=tag>vkrn</span> feature is enabled).
3489 User agents must also support fonts that only support kerning via data
3490 contained in a ‘<code class=property>kern</code>’ font table, as
3491 detailed in the OpenType specification. Authors may prefer to disable
3492 kerning in situations where performance is more important that precise
3493 appearance. If the ‘<code class=property>letter-spacing</code>’
3494 property is defined, kerning adjustments are considered part of the
3495 default spacing, letter spacing adjustments are made after kerning has
3496 been applied.</p>
3497 <!-- prop: font-variant-ligatures -->
3499 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
3500 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
3501 property</h3>
3503 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
3504 <tbody>
3505 <tr>
3506 <td>Name:
3508 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
3510 <tr>
3511 <td>Value:
3513 <td>normal | none | [ <a
3514 href="#common-lig-values"><var><common-lig-values></var></a> ||
3515 <a
3516 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
3517 || <a
3518 href="#historical-lig-values"><var><historical-lig-values></var></a>
3519 || <a
3520 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
3521 ]
3523 <tr>
3524 <td>Initial:
3526 <td>normal
3528 <tr>
3529 <td>Applies to:
3531 <td>all elements
3533 <tr>
3534 <td>Inherited:
3536 <td>yes
3538 <tr>
3539 <td>Percentages:
3541 <td>N/A
3543 <tr>
3544 <td>Media:
3546 <td>visual
3548 <tr>
3549 <td>Computed value:
3551 <td>as specified
3553 <tr>
3554 <td>Animatable:
3556 <td>no
3557 </table>
3559 <p>Ligatures and contextual forms are ways of combining glyphs to produce
3560 more harmonized forms. A value of ‘<a href="#normal2"><code
3561 class=property>normal</code></a>’ implies that common default features
3562 are enabled, <a href="#font-feature-resolution">as described in detail in
3563 the next section</a>. For OpenType fonts, common ligatures and contextual
3564 forms are on by default, discretionary and historical ligatures are not. A
3565 value of ‘<code class=property>none</code>’ implies that all types of
3566 ligatures and contextual forms covered by this property are explicitly
3567 disabled. In situations where ligatures are not considered necessary, this
3568 may improve the speed of text rendering.
3570 <pre
3571 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>
3573 <pre
3574 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>
3576 <pre
3577 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>
3579 <pre
3580 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>
3582 <p>Individual values have the following meanings:
3584 <dl>
3585 <dt><dfn id=common-ligatures>common-ligatures</dfn>
3587 <dd>Enables display of common ligatures (OpenType features: <span
3588 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
3589 enabled by default.
3590 </dl>
3592 <div class=featex><img alt="common ligature example" src=liga.png></div>
3594 <dl>
3595 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
3597 <dd>Disables display of common ligatures (OpenType features: <span
3598 class=tag>liga, clig</span>).
3600 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
3602 <dd>Enables display of discretionary ligatures (OpenType feature: <span
3603 class=tag>dlig</span>). Which ligatures are discretionary, or optional,
3604 is decided by the type designer so authors will need to refer to the
3605 documentation of a given font to understand which ligatures are
3606 considered discretionary.
3607 </dl>
3609 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
3611 <dl>
3612 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
3614 <dd>Disables display of discretionary ligatures (OpenType feature: <span
3615 class=tag>dlig</span>).
3617 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
3619 <dd>Enables display of historical ligatures (OpenType feature: <span
3620 class=tag>hlig</span>).
3621 </dl>
3623 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
3625 <dl>
3626 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
3628 <dd>Disables display of historical ligatures (OpenType feature: <span
3629 class=tag>hlig</span>).
3631 <dt><dfn id=contextual>contextual</dfn>
3633 <dd>Enables display of contextual alternates (OpenType feature: <span
3634 class=tag>calt</span>). Although not strictly a ligature feature, like
3635 ligatures this feature is commonly used to harmonize the shapes of glyphs
3636 with the surrounding context. For OpenType fonts, this feature is on by
3637 default.
3638 </dl>
3640 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
3642 <dl>
3643 <dt><dfn id=no-contextual>no-contextual</dfn>
3645 <dd>Disables display of contextual alternates (OpenType feature: <span
3646 class=tag>calt</span>).
3647 </dl>
3649 <p>Required ligatures, needed for correctly rendering complex scripts, are
3650 not affected by the settings above, including ‘<code
3651 class=property>none</code>’ (OpenType feature: <span
3652 class=tag>rlig</span>).</p>
3653 <!-- prop: font-variant-position -->
3655 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
3656 and superscript forms: the <a
3657 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
3659 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
3660 <tbody>
3661 <tr>
3662 <td>Name:
3664 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
3666 <tr>
3667 <td>Value:
3669 <td>normal | sub | super
3671 <tr>
3672 <td>Initial:
3674 <td>normal
3676 <tr>
3677 <td>Applies to:
3679 <td>all elements
3681 <tr>
3682 <td>Inherited:
3684 <td>yes
3686 <tr>
3687 <td>Percentages:
3689 <td>N/A
3691 <tr>
3692 <td>Media:
3694 <td>visual
3696 <tr>
3697 <td>Computed value:
3699 <td>as specified
3701 <tr>
3702 <td>Animatable:
3704 <td>no
3705 </table>
3707 <p>This property is used to enable typographic subscript and superscript
3708 glyphs. These are alternate glyphs designed within the same em-box as
3709 default glyphs and are intended to be laid out on the same baseline as the
3710 default glyphs, with no resizing or repositioning of the baseline. They
3711 are explicitly designed to match the surrounding text and to be more
3712 readable without affecting the line height.
3714 <div class=figure><img alt="comparison between real subscript glyphs and
3715 synthesized ones" src=realsubscripts.png>
3716 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
3717 (bottom)
3718 </div>
3720 <p>The values ‘<code class=property>sub</code>’ and ‘<code
3721 class=property>super</code>’ imply the appropriate variant glyph is
3722 displayed when available in the font (OpenType features: <span
3723 class=tag>subs, sups</span>). A value of ‘<a href="#normal2"><code
3724 class=property>normal</code></a>’ implies neither of these alternate
3725 glyphs are substituted.
3727 <p>Because of the semantic nature of subscripts and superscripts, when the
3728 value is either ‘<code class=property>sub</code>’ or ‘<code
3729 class=property>super</code>’ for a given contiguous run of text, if a
3730 variant glyph is not available for all the characters in the run,
3731 simulated glyphs must be synthesized for all characters using reduced
3732 forms of the glyphs that would be used without this feature applied. This
3733 is done to avoid a mixture of variant glyphs and synthesized ones that
3734 would not align correctly.
3736 <p>In the case of OpenType fonts that lack subscript or superscript glyphs
3737 for a given character, user agents must use the appropriate subscript and
3738 superscript metrics specified in the selected font's <a
3739 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
3740 table</a> <a href="#OPENTYPE"
3741 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
3742 and offset of the synthesized substitutes.
3744 <p>In the past, user agents have used font-size and vertical-align to
3745 simulate subscripts and superscripts for the <span class=tag>sub</span>
3746 and <span class=tag>sup</span> elements. To allow a backwards compatible
3747 way of defining subscripts and superscripts, it is recommended that
3748 authors use conditional rules <a href="#CSS3-CONDITIONAL"
3749 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
3750 older user agents will still render subscripts and superscripts via the
3751 older mechanism.
3753 <p>Authors should note that fonts typically only provide subscript and
3754 superscript glyphs for a subset of all characters supported by the font.
3755 While subscript and superscript glyphs are often available for Latin
3756 numbers, glyphs for punctuation and letter characters are less frequently
3757 provided. The synthetic fallback rules defined for this property assure
3758 that subscripts and superscripts will always appear but the appearance may
3759 not match author expectations if the font used does not provide the
3760 appropriate alternate glyph for all characters contained in a subscript or
3761 superscript.
3763 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
3764 using superscript metrics" src=superscript-alt-synth.png>
3765 <p class=caption>Superscript alternate glyph (left), synthesized
3766 superscript glyphs (middle), and incorrect mixture of the two (right)
3767 </div>
3769 <p>This property is not cumulative, applying it to subelements within a
3770 subscript or superscript won't nest the placement of a subscript or
3771 superscript glyph. Images contained within text runs where the value of
3772 this property is ‘<code class=property>sub</code>’ or ‘<code
3773 class=property>super</code>’ will be drawn just as they would if the
3774 value was ‘<a href="#normal2"><code class=property>normal</code></a>’.
3775 Likewise, text decorations such as underlines or emphasis marks will
3776 render in the same position as they would for the default glyphs, since
3777 this property does not affect the baseline position.
3779 <p>Because of these limitations, font-variant-position is not recommended
3780 for use in user agent stylesheets. Authors should use it in cases where
3781 subscripts or superscripts will only contain the narrow range of
3782 characters supported by the fonts specified.
3784 <div class=example>
3785 <p>A typical user agent default style for the <span class=tag>sub</span>
3786 element:</p>
3788 <pre>sub {
3789 vertical-align: sub;
3790 font-size: smaller;
3791 line-height: normal;
3792 }
3793 </pre>
3795 <p>Using font-variant-position to specify typographic subscripts in a way
3796 that will still show subscripts in older user agents:</p>
3798 <pre>@supports ( font-variant-position: sub ) {
3800 sub {
3801 vertical-align: inherit;
3802 font-size: 100%;
3803 line-height: inherit;
3804 font-variant-position: sub;
3805 }
3807 }
3808 </pre>
3810 <p>User agents that support the ‘<a
3811 href="#propdef-font-variant-position"><code
3812 class=property>font-variant-position</code></a>’ property will select a
3813 subscript variant glyph and render this without adjusting the baseline or
3814 font-size. Older user agents will ignore the ‘<a
3815 href="#propdef-font-variant-position"><code
3816 class=property>font-variant-position</code></a>’ property definition
3817 and use the standard defaults for subscripts.</p>
3818 </div>
3819 <!-- prop: font-variant-caps -->
3821 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
3822 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
3824 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
3825 <tbody>
3826 <tr>
3827 <td>Name:
3829 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
3831 <tr>
3832 <td>Value:
3834 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
3835 | unicase | titling-caps
3837 <tr>
3838 <td>Initial:
3840 <td>normal
3842 <tr>
3843 <td>Applies to:
3845 <td>all elements
3847 <tr>
3848 <td>Inherited:
3850 <td>yes
3852 <tr>
3853 <td>Percentages:
3855 <td>N/A
3857 <tr>
3858 <td>Media:
3860 <td>visual
3862 <tr>
3863 <td>Computed value:
3865 <td>as specified
3867 <tr>
3868 <td>Animatable:
3870 <td>no
3871 </table>
3873 <p>Specifies control over capitalized forms.
3875 <p>Individual values have the following meanings:
3877 <dl>
3878 <dt><dfn id=normal>normal</dfn>
3880 <dd>None of the features listed below are enabled.
3882 <dt><dfn id=small-caps>small-caps</dfn>
3884 <dd>Enables display of small capitals (OpenType feature: <span
3885 class=tag>smcp</span>). Small-caps glyphs typically use the form of
3886 uppercase letters but are reduced to the size of lowercase letters.
3887 </dl>
3889 <div class=featex><img alt="small-caps example" src=smcp.png></div>
3891 <dl>
3892 <dt><dfn id=all-small-caps>all-small-caps</dfn>
3894 <dd>Enables display of small capitals for both upper and lowercase letters
3895 (OpenType features: <span class=tag>c2sc, smcp</span>).
3897 <dt><dfn id=petite-caps>petite-caps</dfn>
3899 <dd>Enables display of petite capitals (OpenType feature: <span
3900 class=tag>pcap</span>).
3902 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
3904 <dd>Enables display of petite capitals for both upper and lowercase
3905 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
3907 <dt><dfn id=unicase>unicase</dfn>
3909 <dd>Enables display of mixture of small capitals for uppercase letters
3910 with normal lowercase letters (OpenType feature: <span
3911 class=tag>unic</span>).
3913 <dt><dfn id=titling-caps>titling-caps</dfn>
3915 <dd>Enables display of titling capitals (OpenType feature: <span
3916 class=tag>titl</span>). Uppercase letter glyphs are often designed for
3917 use with lowercase letters. When used in all uppercase titling sequences
3918 they can appear too strong. Titling capitals are designed specifically
3919 for this situation.
3920 </dl>
3922 <p>This property allows the selection of alternate glyphs used for small or
3923 petite capitals or for titling. These glyphs are specifically designed to
3924 blend well with the surrounding normal glyphs, to maintain the weight and
3925 readability which suffers when text is simply resized to fit this purpose.
3927 <p>The availability of these glyphs is based on whether a given feature is
3928 defined or not in the feature list of the font. User agents can optionally
3929 decide this on a per-script basis but should explicitly not decide this on
3930 a per-character basis.
3932 <p>Some fonts may only support a subset or none of the features described
3933 for this property. For backwards compatibility with CSS 2.1, if ‘<a
3934 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
3935 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
3936 is specified but small-caps glyphs are not available for a given font,
3937 user agents should simulate a small-caps font, for example by taking a
3938 normal font and replacing the glyphs for lowercase letters with scaled
3939 versions of the glyphs for uppercase characters (replacing the glyphs for
3940 both upper and lowercase letters in the case of ‘<a
3941 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
3943 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
3944 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
3945 width=512px>
3946 <p class=caption>Synthetic vs. real small-caps
3947 </div>
3949 <p>To match the surrounding text, a font may provide alternate glyphs for
3950 caseless characters when these features are enabled but when a user agent
3951 simulates small capitals, it must not attempt to simulate alternates for
3952 codepoints which are considered caseless.
3954 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
3955 characters with small-caps, all-small-caps enabled" class=hires
3956 src=small-capitals-variations.png width=418px>
3957 <p class=caption>Caseless characters with small-caps, all-small-caps
3958 enabled
3959 </div>
3961 <p>If either ‘<a href="#petite-caps"><code
3962 class=property>petite-caps</code></a>’ or ‘<a
3963 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
3964 is specified for a font that doesn't support these features, the property
3965 behaves as if ‘<a href="#small-caps"><code
3966 class=property>small-caps</code></a>’ or ‘<a
3967 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
3968 respectively, had been specified. If ‘<a href="#unicase"><code
3969 class=property>unicase</code></a>’ is specified for a font that doesn't
3970 support that feature, the property behaves as if ‘<a
3971 href="#small-caps"><code class=property>small-caps</code></a>’ was
3972 applied only to lowercased uppercase letters. If ‘<a
3973 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
3974 specified with a font that does not support this feature, this property
3975 has no visible effect. When simulated small capital glyphs are used, for
3976 scripts that lack uppercase and lowercase letters, ‘<a
3977 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
3978 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
3979 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
3980 ‘<a href="#all-petite-caps"><code
3981 class=property>all-petite-caps</code></a>’ and ‘<a
3982 href="#unicase"><code class=property>unicase</code></a>’ have no visible
3983 effect.
3985 <p>When casing transforms are used to simulate small capitals, the casing
3986 transformations should match those used for the <span
3987 class=property>‘<code class=property>text-transform</code>’</span>
3988 property.
3990 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
3991 replace glyphs in a small-caps font so that the text appears in all
3992 uppercase letters.
3994 <div class=figure style="padding: 0; margin: auto;"><img alt="using
3995 all-small-caps in acronym-laden text" class=hires
3996 src=acronym-laden-text.png width=596px>
3997 <p class=caption>Using small capitals to improve readability in
3998 acronym-laden text
3999 </div>
4001 <div class=example>
4002 <p>Quotes rendered italicised, with small-caps on the first line:</p>
4004 <pre>blockquote { font-style: italic; }
4005 blockquote:first-line { font-variant: small-caps; }
4007 <blockquote><a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/0036.html" style="text-decoration: none">I'll be honor-bound to slap them like a haddock.</a></blockquote>
4008 </pre>
4009 </div>
4010 <!-- prop: font-variant-numeric -->
4012 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
4013 formatting: the <a
4014 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
4016 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
4017 <tbody>
4018 <tr>
4019 <td>Name:
4021 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
4023 <tr>
4024 <td>Value:
4026 <td>normal | [ <a
4027 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
4028 || <a
4029 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
4030 || <a
4031 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
4032 || <a href="#ordinal">ordinal</a> || <a
4033 href="#slashed-zero">slashed-zero</a> ]
4035 <tr>
4036 <td>Initial:
4038 <td>normal
4040 <tr>
4041 <td>Applies to:
4043 <td>all elements
4045 <tr>
4046 <td>Inherited:
4048 <td>yes
4050 <tr>
4051 <td>Percentages:
4053 <td>N/A
4055 <tr>
4056 <td>Media:
4058 <td>visual
4060 <tr>
4061 <td>Computed value:
4063 <td>as specified
4065 <tr>
4066 <td>Animatable:
4068 <td>no
4069 </table>
4071 <p>Specifies control over numerical forms.
4073 <pre
4074 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>
4076 <pre
4077 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>
4079 <pre
4080 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>
4082 <p>Individual values have the following meanings:
4084 <dl>
4085 <dt><dfn id=normal0>normal</dfn>
4087 <dd>None of the features listed below are enabled.
4089 <dt><dfn id=lining-nums>lining-nums</dfn>
4091 <dd>Enables display of lining numerals (OpenType feature: <span
4092 class=tag>lnum</span>).
4094 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
4096 <dd>Enables display of old-style numerals (OpenType feature: <span
4097 class=tag>onum</span>).
4099 <dt><dfn id=proportional-nums>proportional-nums</dfn>
4101 <dd>Enables display of proportional numerals (OpenType feature: <span
4102 class=tag>pnum</span>).
4104 <dt><dfn id=tabular-nums>tabular-nums</dfn>
4106 <dd>Enables display of tabular numerals (OpenType feature: <span
4107 class=tag>tnum</span>).
4108 </dl>
4110 <p>The example below shows how these different properties can be combined
4111 to influence the rendering of tabular data with fonts that support these
4112 features. Within normal paragraph text, proportional numbers are used
4113 while tabular numbers are used so that columns of numbers line up
4114 properly:
4116 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
4117 number styles" src=numberstyles.png>
4118 <p class=caption>Using number styles
4119 </div>
4121 <dl>
4122 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
4124 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
4125 class=tag>frac</span>).
4126 </dl>
4128 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
4130 <dl>
4131 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
4133 <dd>Enables display of lining stacked fractions (OpenType feature: <span
4134 class=tag>afrc</span>).
4135 </dl>
4137 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
4139 <dl>
4140 <dt><dfn id=ordinal>ordinal</dfn>
4142 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
4143 <span class=tag>ordn</span>).
4145 <dt><dfn id=slashed-zero>slashed-zero</dfn>
4147 <dd>Enables display of slashed zeros (OpenType feature: <span
4148 class=tag>zero</span>).
4149 </dl>
4151 <div class=featex><img alt="slashed zero example" src=zero.png></div>
4153 <div class=example id=steak-marinade>
4154 <p>A simple flank steak marinade recipe, rendered with automatic fractions
4155 and old-style numerals:</p>
4157 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
4159 <h4>Steak marinade:</h4>
4160 <ul>
4161 <li><span class="amount">2</span> tbsp olive oil</li>
4162 <li><span class="amount">1</span> tbsp lemon juice</li>
4163 <li><span class="amount">1</span> tbsp soy sauce</li>
4164 <li><span class="amount">1 1/2</span> tbsp dry minced onion</li>
4165 <li><span class="amount">2 1/2</span> tsp italian seasoning</li>
4166 <li>Salt &amp; pepper</li>
4167 </ul>
4169 <p>Mix the meat with the marinade and let it sit covered in the refrigerator
4170 for a few hours or overnight.</p>
4171 </pre>
4172 </div>
4173 <!-- prop: font-variant-alternates -->
4175 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
4176 and swashes: the <a
4177 href="#propdef-font-variant-alternates">font-variant-alternates</a>
4178 property</h3>
4180 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
4181 <tbody>
4182 <tr>
4183 <td>Name:
4185 <td><dfn
4186 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
4188 <tr>
4189 <td>Value:
4191 <td>normal | [ <a href="#stylistic"
4192 title=stylistic>stylistic(<feature-value-name>)</a> || <a
4193 href="#historical-forms">historical-forms</a> || <a href="#styleset"
4194 title=styleset>styleset(<feature-value-name> #)</a> || <a
4195 href="#character-variant"
4196 title=character-variant>character-variant(<feature-value-name>
4197 #)</a> || <a href="#swash"
4198 title=swash>swash(<feature-value-name>)</a> || <a
4199 href="#ornaments"
4200 title=ornaments>ornaments(<feature-value-name>)</a> || <a
4201 href="#annotation"
4202 title=annotation>annotation(<feature-value-name>)</a> ]
4204 <tr>
4205 <td>Initial:
4207 <td>normal
4209 <tr>
4210 <td>Applies to:
4212 <td>all elements
4214 <tr>
4215 <td>Inherited:
4217 <td>yes
4219 <tr>
4220 <td>Percentages:
4222 <td>N/A
4224 <tr>
4225 <td>Media:
4227 <td>visual
4229 <tr>
4230 <td>Computed value:
4232 <td>as specified
4234 <tr>
4235 <td>Animatable:
4237 <td>no
4238 </table>
4240 <p>For any given character, fonts can provide a variety of alternate glyphs
4241 in addition to the default glyph for that character. This property
4242 provides control over the selection of these alternate glyphs.
4244 <p>In cases where multiple alternates are possible, authors define a
4245 <code><feature-value-name></code> using the
4246 <code>@font-feature-values</code> rule described below to indicate the
4247 specific alternate to be used. The nature of these alternates is font
4248 specific, so the rule defines values for a specific font family or set of
4249 families. When a particular value has not been defined for a given family,
4250 the named value is treated as if the feature had omitted from the style
4251 rule. If a given value is outside the range supported by a given font, the
4252 value is ignored. These values never apply to generic font families, nor
4253 to families selected as part of system font fallback. Values that behave
4254 this way are marked as <em>font specific</em>.
4256 <p>Individual values have the following meanings:
4258 <dl>
4259 <dt><dfn id=normal1>normal</dfn>
4261 <dd>None of the features listed below are enabled.
4263 <dt><dfn id=stylistic
4264 title=stylistic>stylistic(<feature-value-name>)</dfn>
4266 <dd>Enables display of stylistic alternates (<em>font specific</em>,
4267 OpenType feature: <span class=tag>salt
4268 <feature-value-name></span>).
4269 </dl>
4271 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
4273 <dl>
4274 <dt><dfn id=historical-forms>historical-forms</dfn>
4276 <dd>Enables display of historical forms (OpenType feature: <span
4277 class=tag>hist</span>).
4278 </dl>
4280 <div class=featex><img alt="historical form example" src=hist.png></div>
4282 <dl>
4283 <dt><dfn id=styleset title=styleset>styleset(<feature-value-name>
4284 #)</dfn>
4286 <dd>Enables display with stylistic sets (<em>font specific</em>, OpenType
4287 feature: <span class=tag>ss<feature-index></span> OpenType
4288 currently defines <span class=tag>ss01</span> through <span
4289 class=tag>ss20</span>).
4290 </dl>
4292 <div class=featex><img alt="styleset example" src=ssnn.png></div>
4294 <dl>
4295 <dt><dfn id=character-variant
4296 title=character-variant>character-variant(<feature-value-name>
4297 #)</dfn>
4299 <dd>Enables display of specific character variants (<em>font
4300 specific</em>, OpenType feature: <span
4301 class=tag>cv<feature-index></span> OpenType currently defines <span
4302 class=tag>cv01</span> through <span class=tag>cv99</span>).
4304 <dt><dfn id=swash title=swash>swash(<feature-value-name>)</dfn>
4306 <dd>Enables display of swash glyphs (<em>font specific</em>, OpenType
4307 feature: <span class=tag>swsh <feature-index>, cswh
4308 <feature-index></span>).
4309 </dl>
4311 <div class=featex><img alt="swash example" src=swsh.png></div>
4313 <dl>
4314 <dt><dfn id=ornaments
4315 title=ornaments>ornaments(<feature-value-name>)</dfn>
4317 <dd>Enables replacement of default glyphs with ornaments, if provided in
4318 the font (<em>font specific</em>, OpenType feature: <span class=tag>ornm
4319 <feature-index></span>). Some fonts may offer ornament glyphs as
4320 alternates for a wide collection of characters; however, displaying
4321 arbitrary characters (e.g., alphanumerics) as ornaments is poor practice
4322 as it distorts the semantics of the data. Font designers are encouraged
4323 to encode all ornaments (except those explicitly encoded in the Unicode
4324 Dingbats blocks, etc.) as alternates for the bullet character (U+2022) to
4325 allow authors to select the desired glyph using
4326 <feature-value-name>.
4327 </dl>
4329 <div class=featex><img alt="ornaments example" src=ornm.png></div>
4331 <dl>
4332 <dt><dfn id=annotation
4333 title=annotation>annotation(<feature-value-name>)</dfn>
4335 <dd>Enables display of alternate annotation forms (<em>font specific</em>,
4336 OpenType feature: <span class=tag>nalt <feature-index></span>).
4337 </dl>
4339 <div class=featex><img alt="alternate annotation form example"
4340 src=nalt.png></div>
4342 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
4343 specific alternates: the <code>@font-feature-values</code> rule</h3>
4345 <p>Several of the possible values of ‘<a
4346 href="#propdef-font-variant-alternates"><code
4347 class=property>font-variant-alternates</code></a>’ listed above are
4348 labeled as "font specific". For these features fonts may define not just a
4349 single glyph but a set of alternate glyphs with an index to select a given
4350 alternate. Since these are font family specific, the
4351 <code>@font-feature-values</code> rule is used to define named-values for
4352 these indices for a given family.
4354 <p>In the case of the swash Q in the example shown above, the swash could
4355 be specified using these style rules:
4357 <pre>
4359 @font-feature-values Jupiter Sans {
4360 @swash {
4361 delicate: 1;
4362 flowing: 2;
4363 }
4364 }
4366 h2 { font-family: Jupiter Sans, sans-serif; }
4368 /* show the second swash variant in h2 headings */
4369 h2:first-letter { font-variant-alternates: swash(flowing); }
4371 <h2>Quick</h2></pre>
4373 <p>When Jupiter Sans is present, the second alternate swash alternate will
4374 be displayed. When not present, no swash character will be shown, since
4375 the specific named-value "flowing" is only defined for the Jupiter Sans
4376 family. The @-mark indicates the name of the property value for which a
4377 named-value can be used. The name "flowing" is chosen by the author, the
4378 values specified within a given font's data.
4380 <p>In terms of the grammar, this specification defines the following
4381 productions:</p>
4382 <!--
4383 <pre><dfn>supports_rule</dfn>
4384 : <i>SUPPORTS_SYM</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>group_rule_body</i>
4385 ;
4387 <dfn>supports_condition</dfn>
4388 : <i>supports_negation</i> | <i>supports_conjunction</i> | <i>supports_disjunction</i> |
4389 <i>supports_condition_in_parens</i>
4390 ;
4392 <dfn>supports_condition_in_parens</dfn>
4393 : ( '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ')' ) | <i>supports_declaration_condition</i> |
4394 <i>general_enclosed</i>
4395 ;
4397 <dfn>supports_negation</dfn>
4398 : <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>NOT</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i>
4399 ;
4401 <dfn>supports_conjunction</dfn>
4402 : <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>AND</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
4403 ;
4405 <dfn>supports_disjunction</dfn>
4406 : <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>OR</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
4407 ;
4409 <dfn>supports_declaration_condition</dfn>
4410 : '(' <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>declaration</i></a> ')'
4411 ;
4413 <dfn>general_enclosed</dfn>
4414 : ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>FUNCTION</i></a> | '(' ) ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>any</i></a> | <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>unused</i></a> )* ')'
4415 ;
4416 </pre>
4418 -->
4420 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
4421 : <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>*
4422 '{' <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>*
4423 ;
4425 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
4426 : <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> ]*
4427 ;
4429 <dfn id=fontfamilyname>font_family_name</dfn>
4430 : <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> ]* ]
4431 ;
4433 <dfn id=featurevalueblock>feature_value_block</dfn>
4434 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
4435 '{' <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>*
4436 ;
4438 <dfn id=featuretype>feature_type</dfn>:
4439 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
4440 ;
4442 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
4443 : <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> ]*
4444 ;
4445 </pre>
4447 <p>The following new token is introduced:
4449 <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>;}
4450 </pre>
4452 <p>Feature value blocks are treated <a
4453 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">similar to
4454 at-rules</a>, they consist of everything up to the next block or
4455 semi-colon, whichever comes first.
4457 <p>Font feature values rules define a set of values for a specific font
4458 feature as used for a given set of families. Effectively, they define a
4459 mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
4460 ⟨values⟩ are the indices used for specific features defined for a
4461 given font.
4463 <p>The font family list uses the same syntax as that used for the ‘<a
4464 href="#descdef-font-family"><code class=property>font-family</code></a>’
4465 property. Within feature value blocks, the feature type is ‘<code
4466 class=css>@</code>’ followed by the name of the font-specific property
4467 value (e.g. <a href="#swash"><code>@swash</code></a>). The feature type
4468 must match, using an ASCII case-insensitive comparison, one of the
4469 <em>font specific</em> values of the <a
4470 href="#propdef-font-variant-alternates"><code>font-variant-alternates</code></a>
4471 property. The values associated with a given idenitifier are limited to
4472 integer values 0 or greater.
4474 <p>If syntax errors occur within the font family list, the entire rule must
4475 be ignored. When syntax errors occur within a feature value definition,
4476 such as invalid identifiers or values, the entire feature value definition
4477 must be omitted, similar to the way syntax errors in style declarations
4478 are handled. When the <code><feature-type></code> is invalid, the
4479 entire associated feature value block must be ignored.
4481 <pre>@font-feature-values Bongo {
4482 @swash { ornate: 1; }
4483 annotation { boxed: 4; } /* should be @annotation! */
4484 @swash { double-loops: 1; flowing: -1; } /* negative value */
4485 @ornaments ; /* incomplete definition */
4486 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
4487 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none;">redrum</a> /* random editing mistake */
4488 }</pre>
4490 <p>The example above is equivalent to:
4492 <pre>@font-feature-values Bongo {
4493 @swash { ornate: 1; }
4494 @swash { double-loops: 1; }
4495 @styleset { double-W: 14; sharp-terminals: 16 1; }
4496 }</pre>
4498 <p>If multiple <code>@font-feature-values</code> rules are defined for a
4499 given family, the resulting values defined are the union of these rules.
4500 This allows a set of named-values to be defined for a given font family
4501 globally for a site and specific additions made per-page. If the same
4502 <feature-value-name> is defined mulitple times for a given
4503 font-variant value, the last defined value is used.
4505 <pre>
4506 site.css:
4508 @font-feature-values Mercury Serif {
4509 @styleset {
4510 stacked-g: 3; /* "two-storey" versions of g, a */
4511 stacked-a: 4;
4512 }
4513 }
4515 page.css:
4517 @font-feature-values Mercury Serif {
4518 @styleset {
4519 geometric-m: 7; /* alternate version of m */
4520 }
4521 }
4523 body {
4524 font-family: Mercury Serif, serif;
4526 /* enable both the use of stacked g and alternate m */
4527 font-variant-alternates: styleset(stacked-g, geometric-m);
4528 }</pre>
4530 <p>Only named font families are allowed for <font-family>, rules that
4531 include generic or system fonts in the list of font families are
4532 considered syntax errors and the contents of the rules are ignored.
4533 However, if a user agent defines a generic font to be a specific named
4534 font (e.g. Helvetica), the settings associated with that family name will
4535 be used.
4537 <p>For <font-variant-property-value>, only font specific property value
4538 names supported by the ‘<a href="#propdef-font-variant"><code
4539 class=property>font-variant</code></a>’ property are recognized,
4540 definitions for other value names cause a syntax error and are ignored.
4541 Each property value that is font specific is clearly marked as such.
4542 Feature value names follow the rules of CSS user identifiers and are
4543 case-sensitive. They are unique only for a given set of font families and
4544 font-variant property value; the same identifier used with a different
4545 font-variant property value is treated as a separate and distinct value.
4547 <p>Using a commonly named value allows authors to use a single style rule
4548 to cover a set of fonts for which the underlying selector is different for
4549 each font. If either font in the example below is found, a circled number
4550 glyph will be used:
4552 <pre>@font-feature-values Taisho Gothic {
4553 @annotation { boxed: 1; circled: 4; }
4554 }
4556 @font-feature-values Otaru Kisa {
4557 @annotation { circled: 1; black-boxed: 3; }
4558 }
4560 h3.title {
4561 /* circled form defined for both fonts */
4562 font-family: Taisho Gothic, Otaru Kisa;
4563 font-variant: annotation(circled);
4564 }</pre>
4566 <p>Most font specific font-variant property values take a single value
4567 (e.g. swash). The character-variant property value allows two values and
4568 styleset allows an unlimited number. If a larger number of values are
4569 assigned to a given name, a syntax error occurs and the entire
4570 <font-feature-values-declaration> is ignored.
4572 <p>For the styleset property value, multiple values indicate the style sets
4573 to be enabled. Values between 1 and 99 enable OpenType features <span
4574 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
4575 OpenType standard only officially defines <span class=tag>ss01</span>
4576 through <span class=tag>ss20</span>. Values greater than 99 or equal to 0
4577 are ignored but do not generate a syntax error when parsed.
4579 <pre>@font-feature-values Mars Serif {
4580 @styleset {
4581 alt-g: 1; /* implies ss01 = 1 */
4582 curly-quotes: 3; /* implies ss03 = 1 */
4583 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
4584 }
4586 @styleset {
4587 dumb: 125; /* >99, ignored */
4588 }
4590 @swash {
4591 swishy: 3 5; /* more than 1 value for swash, syntax error */
4592 }
4593 }
4595 p.codeblock {
4596 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
4597 font-variant-alternates: styleset(curly-quotes, code);
4598 }</pre>
4600 <p>For character-variant, a single value between 1 and 99 indicates the
4601 enabling of OpenType feature <span class=tag>cv01</span> through <span
4602 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
4603 to 0 are ignored but do not generate a syntax error when parsed. When two
4604 values are listed, the first value indicates the feature used and the
4605 second the value passed for that feature. When two value names imply
4606 different settings for the same underlying feature the last setting is
4607 used.
4609 <pre>@font-feature-values MM Greek {
4610 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
4611 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
4612 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, ignored */
4613 @character-variant { gamma: 12; } /* implies cv12 = 1 */
4614 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
4615 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
4616 @character-variant { silly: 105; } /* >99, ignored */
4617 @character-variant { dumb: 323 3; } /* >99, ignored */
4618 }
4620 #title {
4621 /* use the third alternate beta, first alternate gamma */
4622 font-variant-alternates: character-variant(beta-3, gamma);
4623 }
4625 p {
4626 /* zeta-2 follows zeta, implies cv20 = 2 */
4627 font-variant-alternates: character-variant(zeta, zeta-2);
4628 }
4630 .special {
4631 /* zeta follows zeta-2, implies cv20 = 3 */
4632 font-variant-alternates: character-variant(zeta-2, zeta);
4633 }</pre>
4635 <p>See the <a href="#om-fontfeaturevalues">object model reference
4636 section</a> for a description of the interfaces used to modify these rules
4637 via the CSS Object Model.
4639 <div class=figure><img alt="Matching text on Byzantine seals using
4640 character variants" src=byzantineseal.png>
4641 <p class=caption>Byzantine seal text displayed with character variants
4642 </div>
4644 <div class=example>
4645 <p>In the figure above, the text in red is rendered using a font
4646 containing character variants that mimic the character forms found on a
4647 Byzantine seal from the 8th century A.D. Two lines below is the same text
4648 displayed in a font without variants. Note the two variants for U and N
4649 used on the seal.</p>
4651 <pre>@font-feature-values Athena Ruby {
4652 @character-variant {
4653 leo-B: 2 1;
4654 leo-M: 13 3;
4655 leo-alt-N: 14 1;
4656 leo-N: 14 2;
4657 leo-T: 20 1;
4658 leo-U: 21 2;
4659 leo-alt-U: 21 4;
4660 }
4661 }
4663 p {
4664 font-variant: discretionary-ligatures,
4665 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
4666 }
4668 span.alt-N {
4669 font-variant-alternates: character-variant(leo-alt-N);
4670 }
4672 span.alt-U {
4673 font-variant-alternates: character-variant(leo-alt-U);
4674 }
4676 <p>ENO....UP͞RSTU<span class="alt-U">U</span>͞<span class="alt-U">U</span>ΚΑΙTỤẠG̣IUPNS</p>
4678 <p>LEON|ΚΑΙCONSTA|NTI<span class="alt-N">N</span>OS..|STOIBAṢ.|LIṢROM|AIO<span class="alt-N">N</span></p>
4679 </pre>
4680 </div>
4682 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
4683 Asian text rendering: the <a
4684 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
4685 property</h3>
4687 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
4688 <tbody>
4689 <tr>
4690 <td>Name:
4692 <td><dfn
4693 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
4695 <tr>
4696 <td>Value:
4698 <td>normal | [ <a
4699 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
4700 || <a
4701 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
4702 || <a href="#ruby">ruby</a> ]
4704 <tr>
4705 <td>Initial:
4707 <td>normal
4709 <tr>
4710 <td>Applies to:
4712 <td>all elements
4714 <tr>
4715 <td>Inherited:
4717 <td>yes
4719 <tr>
4720 <td>Percentages:
4722 <td>N/A
4724 <tr>
4725 <td>Media:
4727 <td>visual
4729 <tr>
4730 <td>Computed value:
4732 <td>as specified
4734 <tr>
4735 <td>Animatable:
4737 <td>no
4738 </table>
4740 <p>Allows control of glyph substitution and sizing in East Asian text.
4742 <pre
4743 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>
4745 <pre
4746 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>
4748 <p>Individual values have the following meanings:
4750 <dl>
4751 <dt><dfn id=normal2>normal</dfn>
4753 <dd>None of the features listed below are enabled.
4755 <dt><dfn id=jis78>jis78</dfn>
4757 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
4758 class=tag>jp78</span>).
4759 </dl>
4761 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
4763 <dl>
4764 <dt><dfn id=jis83>jis83</dfn>
4766 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
4767 class=tag>jp83</span>).
4769 <dt><dfn id=jis90>jis90</dfn>
4771 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
4772 class=tag>jp90</span>).
4774 <dt><dfn id=jis04>jis04</dfn>
4776 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
4777 class=tag>jp04</span>).
4778 <p>The various JIS variants reflect the glyph forms defined in different
4779 Japanese national standards. Fonts generally include glyphs defined by
4780 the most recent national standard but it's sometimes necessary to use
4781 older variants, to match signage for example.</p>
4783 <dt><dfn id=simplified>simplified</dfn>
4785 <dd>Enables rendering of simplified forms (OpenType feature: <span
4786 class=tag>smpl</span>).
4787 <p>The ‘<a href="#simplified"><code
4788 class=property>simplified</code></a>’ and ‘<a
4789 href="#traditional"><code class=property>traditional</code></a>’
4790 values allow control over the glyph forms for characters which have been
4791 simplified over time but for which the older, traditional form is still
4792 used in some contexts. The exact set of characters and glyph forms will
4793 vary to some degree by context for which a given font was designed.</p>
4795 <dt><dfn id=traditional>traditional</dfn>
4797 <dd>Enables rendering of traditional forms (OpenType feature: <span
4798 class=tag>trad</span>).
4799 </dl>
4801 <div class=featex><img alt="tradtional form example" src=trad.png></div>
4803 <dl>
4804 <dt><dfn id=full-width>full-width</dfn>
4806 <dd>Enables rendering of full-width variants (OpenType feature: <span
4807 class=tag>fwid</span>).
4809 <dt><dfn id=proportional-width>proportional-width</dfn>
4811 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
4812 <span class=tag>pwid</span>).
4813 </dl>
4815 <div class=featex><img alt="proportionally spaced Japanese example"
4816 src=pwid.png></div>
4818 <dl>
4819 <dt><dfn id=ruby>ruby</dfn>
4821 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
4822 class=tag>ruby</span>). Since ruby text is generally smaller than the
4823 associated body text, font designers can design special glyphs for use
4824 with ruby that are more readable than scaled down versions of the default
4825 glyphs. Only glyph selection is affected, there is no associated font
4826 scaling or other change that affects line layout. The red ruby text below
4827 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
4828 Note the slight difference in stroke thickness.
4829 </dl>
4831 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
4833 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
4834 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
4835 property</h3>
4837 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
4838 <tbody>
4839 <tr>
4840 <td>Name:
4842 <td><dfn id=propdef-font-variant>font-variant</dfn>
4844 <tr>
4845 <td>Value:
4847 <td>normal | none | [ <a
4848 href="#common-lig-values"><var><common-lig-values></var></a> ||
4849 <a
4850 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
4851 || <a
4852 href="#historical-lig-values"><var><historical-lig-values></var></a>
4853 || <a
4854 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
4855 || <a href="#stylistic"><var
4856 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
4857 href="#historical-forms"><var>historical-forms</var></a> || <a
4858 href="#styleset"><var
4859 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
4860 href="#character-variant"><var
4861 title=character-variant>character-variant(<feature-value-name>
4862 #)</var></a> || <a href="#swash"><var
4863 title=swash>swash(<feature-value-name>)</var></a> || <a
4864 href="#ornaments"><var
4865 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
4866 href="#annotation"><var
4867 title=annotation>annotation(<feature-value-name>)</var></a> || [
4868 <a href="#small-caps"><i>small-caps</i></a> | <a
4869 href="#all-small-caps"><i>all-small-caps</i></a> | <a
4870 href="#petite-caps"><i>petite-caps</i></a> | <a
4871 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
4872 href="#unicase"><i>unicase</i></a> | <a
4873 href="#titling-caps"><i>titling-caps</i></a> ] || <a
4874 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
4875 || <a
4876 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
4877 || <a
4878 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
4879 || <a href="#ordinal"><i>ordinal</i></a> || <a
4880 href="#slashed-zero"><i>slashed-zero</i></a> || <a
4881 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
4882 || <a
4883 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
4884 || <a href="#ruby"><i>ruby</i></a> ]
4886 <tr>
4887 <td>Initial:
4889 <td>normal
4891 <tr>
4892 <td>Applies to:
4894 <td>all elements
4896 <tr>
4897 <td>Inherited:
4899 <td>yes
4901 <tr>
4902 <td>Percentages:
4904 <td>see individual properties
4906 <tr>
4907 <td>Media:
4909 <td>visual
4911 <tr>
4912 <td>Computed value:
4914 <td>see individual properties
4916 <tr>
4917 <td>Animatable:
4919 <td>see individual properties
4920 </table>
4922 <p>The value ‘<a href="#normal2"><code
4923 class=property>normal</code></a>’ resets all other font feature
4924 properties to their inital value. The ‘<code
4925 class=property>none</code>’ value sets ‘<a
4926 href="#propdef-font-variant-ligatures"><code
4927 class=property>font-variant-ligatures</code></a>’ to ‘<code
4928 class=property>none</code>’ and resets all other font feature properties
4929 to their initial value. Like other shorthands, using ‘<a
4930 href="#propdef-font-variant"><code
4931 class=property>font-variant</code></a>’ resets unspecified font-variant
4932 subproperties to their initial values. It does not reset the values of
4933 either ‘<a href="#propdef-font-language-override"><code
4934 class=property>font-language-override</code></a>’ or ‘<a
4935 href="#propdef-font-feature-settings"><code
4936 class=property>font-feature-settings</code></a>’.
4938 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
4939 font feature settings control: the <a
4940 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
4942 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
4943 <tbody>
4944 <tr>
4945 <td>Name:
4947 <td><dfn id=propdef-font-feature-settings>font-feature-settings</dfn>
4949 <tr>
4950 <td>Value:
4952 <td>normal | <a
4953 href="#feature-tag-value"><var><feature-tag-value></var></a> #
4955 <tr>
4956 <td>Initial:
4958 <td>normal
4960 <tr>
4961 <td>Applies to:
4963 <td>all elements
4965 <tr>
4966 <td>Inherited:
4968 <td>yes
4970 <tr>
4971 <td>Percentages:
4973 <td>N/A
4975 <tr>
4976 <td>Media:
4978 <td>visual
4980 <tr>
4981 <td>Computed value:
4983 <td>as specified
4985 <tr>
4986 <td>Animatable:
4988 <td>no
4989 </table>
4991 <p>This property provides low-level control over OpenType font features. It
4992 is intended as a way of providing access to font features that are not
4993 widely used but are needed for a particular use case. A value of ‘<a
4994 href="#normal2"><code class=property>normal</code></a>’ means that no
4995 change in glyph selection or positioning occurs due to this property.
4997 <p>
4999 <pre>/* enable small caps and use second swash alternate */
5000 font-feature-settings: "smcp", "swsh" 2;</pre>
5002 <p>Feature tag values have the following syntax:
5004 <pre
5005 class=prod><dfn id=feature-tag-value><var><feature-tag-value></var></dfn> = <string> [ <integer> | on | off ]?</pre>
5007 <p>The <string> is a case-sensitive OpenType feature tag. As
5008 specified in the OpenType specification, feature tags contain four ASCII
5009 characters. Tag strings longer or shorter than four characters, or
5010 containing characters outside the U+20–7E codepoint range are invalid.
5011 User agents must not use a feature tag created by truncating or padding
5012 the string to four characters. Feature tags need only match a feature tag
5013 defined in the font, they are not limited to explicitly registered
5014 OpenType features. Fonts defining custom feature tags should follow the <a
5015 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
5016 rules</a> defined in the OpenType specification <a
5017 href="#OPENTYPE-FEATURES"
5018 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
5019 Feature tags not present in the font are ignored; a user agent must not
5020 attempt to synthesize fallback behavior based on these feature tags.
5022 <p>This means that explicitly disabling the <span class=tag>kern</span>
5023 feature will not affect the application of kerning data found in the
5024 ‘<code class=property>kern</code>’ table (as opposed to kerning data
5025 associated with the <span class=tag>kern</span> feature in the ‘<code
5026 class=property>GPOS</code>’ table). Authors should use the ‘<a
5027 href="#propdef-font-kerning"><code
5028 class=property>font-kerning</code></a>’ property to explictly enable or
5029 disable kerning since this property affects both types of kerning.
5031 <p>If present, a value indicates an index used for glyph selection. An
5032 <integer> value must be 0 or greater. A value of 0 indicates that
5033 the feature is disabled. For boolean features, a value of 1 enables the
5034 feature. For non-boolean features, a value of 1 or greater enables the
5035 feature and indicates the feature selection index. A value of ‘<code
5036 class=property>on</code>’ is synonymous with 1 and ‘<code
5037 class=property>off</code>’ is synonymous with 0. If the value is
5038 omitted, a value of 1 is assumed.
5040 <pre>
5041 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
5042 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
5043 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
5044 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
5045 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
5046 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
5047 font-feature-settings: "palin" off; /* good idea but invalid tagname */
5048 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
5049 font-feature-settings: dlig; /* invalid, tag must be a string */
5050 </pre>
5052 <p>Authors should generally use ‘<a href="#propdef-font-variant"><code
5053 class=property>font-variant</code></a>’ and its related subproperties
5054 whenever possible and only use this property for special cases where its
5055 use is the only way of accessing a particular infrequently used font
5056 feature.
5058 <p>Although specifically defined for OpenType feature tags, feature tags
5059 for other modern font formats that support font features may be added in
5060 the future. Where possible, features defined for other font formats should
5061 attempt to follow the pattern of registered OpenType tags.
5063 <div class=example>
5064 <p>The Japanese text below will be rendered with half-width kana
5065 characters:</p>
5067 <pre lang=ja>
5068 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
5070 <p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p>
5071 </pre>
5072 </div>
5074 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
5075 language override: the <a
5076 href="#propdef-font-language-override">font-language-override</a> property</h3>
5078 <table class=propdef id=namefont-language-overridevaluenormal-lt>
5079 <tbody>
5080 <tr>
5081 <td>Name:
5083 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
5085 <tr>
5086 <td>Value:
5088 <td>normal | <string>
5090 <tr>
5091 <td>Initial:
5093 <td>normal
5095 <tr>
5096 <td>Applies to:
5098 <td>all elements
5100 <tr>
5101 <td>Inherited:
5103 <td>yes
5105 <tr>
5106 <td>Percentages:
5108 <td>N/A
5110 <tr>
5111 <td>Media:
5113 <td>visual
5115 <tr>
5116 <td>Computed value:
5118 <td>as specified
5120 <tr>
5121 <td>Animatable:
5123 <td>no
5124 </table>
5126 <p>The value of ‘<a href="#normal2"><code
5127 class=property>normal</code></a>’ implies that when rendering with
5128 OpenType fonts the language of the document is used to infer the OpenType
5129 language system, used to select language specific features when rendering.
5130 The value of the <string> is a single three-letter OpenType <a
5131 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
5132 system tag</a>, defined in the layout tag registry of the OpenType
5133 specification.
5135 <div class=example>
5136 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
5137 Declaration of Human Rights</a> has been translated into a wide variety
5138 of languages. In Turkish, Article 9 of this document might be marked up
5139 as below:</p>
5141 <pre lang=tr><body lang="tr">
5143 <h4>Madde 9</h4>
5144 <p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.</p>
5145 </pre>
5147 <p>Here the user agent uses the value of the ‘<code
5148 class=property>lang</code>’ attribute when rendering text and
5149 appropriately renders this text without ‘<code
5150 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
5151 href="#propdef-font-language-override"><code
5152 class=property>font-language-override</code></a>’ property.</p>
5154 <p>However, a given font may lack support for a specific language. In this
5155 situation authors may need to use the typographic conventions of a
5156 related language that are supported by that font:</p>
5158 <pre lang=mk><body lang="mk"> <!-- Macedonian lang code -->
5160 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
5162 <h4>Члeн 9</h4>
5163 <p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
5165 </pre>
5167 <p>The Macedonian text here will be rendered using Serbian typographic
5168 conventions, with the assumption that the font specified supports
5169 Serbian.</p>
5170 </div>
5172 <p><a id=rendering-considerations></a>
5174 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
5175 Resolution</h2>
5177 <p>As described in the previous section, font features can be enabled in a
5178 variety of ways, either via the use of ‘<a
5179 href="#propdef-font-variant"><code
5180 class=property>font-variant</code></a>’ or ‘<a
5181 href="#propdef-font-feature-settings"><code
5182 class=property>font-feature-settings</code></a>’ in a style rule or
5183 within an <code>@font-face</code> rule. The resolution order for the union
5184 of these settings is defined below. Features defined via CSS properties
5185 are applied on top of layout engine default features.
5187 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
5189 <p>For OpenType fonts, user agents must enable the default features defined
5190 in the OpenType documentation for a given script and writing mode.
5191 Required ligatures, common ligatures and contextual forms must be enabled
5192 by default (OpenType features: <span class=tag>rlig, liga, clig,
5193 calt</span>), along with localized forms (OpenType feature: <span
5194 class=tag>locl</span>), and features required for proper display of
5195 composed characters and marks (OpenType features: <span class=tag>ccmp,
5196 mark, mkmk</span>). These features must always be enabled, even when the
5197 value of the ‘<a href="#propdef-font-variant"><code
5198 class=property>font-variant</code></a>’ and ‘<a
5199 href="#propdef-font-feature-settings"><code
5200 class=property>font-feature-settings</code></a>’ properties is ‘<a
5201 href="#normal2"><code class=property>normal</code></a>’. Individual
5202 features are only disabled when explicitly overridden by the author, as
5203 when ‘<a href="#propdef-font-variant-ligatures"><code
5204 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
5205 href="#no-common-ligatures"><code
5206 class=property>no-common-ligatures</code></a>’. For handling complex
5207 scripts such as <a
5208 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
5209 <a
5210 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
5211 or <a
5212 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
5213 additional features are required. For upright text within vertical text
5214 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
5215 must be enabled.
5217 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
5219 <p>General and font specific font feature property settings are resolved in
5220 the order below, in ascending precedence order. This ordering is used to
5221 construct a combined list of font features that affect a given text run.
5223 <ol>
5224 <li>Font features enabled by default, including features required for a
5225 given script.
5227 <li>If the font is defined via an <code>@font-face</code> rule, the font
5228 features implied by the font-variant descriptor in the
5229 <code>@font-face</code> rule.
5231 <li>If the font is defined via an <code>@font-face</code> rule, the font
5232 features implied by the font-feature-settings descriptor in the
5233 <code>@font-face</code> rule.
5235 <li>Feature settings determined by properties other than ‘<a
5236 href="#propdef-font-variant"><code
5237 class=property>font-variant</code></a>’ or ‘<a
5238 href="#propdef-font-feature-settings"><code
5239 class=property>font-feature-settings</code></a>’. For example, setting
5240 a non-default value for the ‘<code
5241 class=property>letter-spacing</code>’ property disables ligatures.
5243 <li>Font features implied by the value of the ‘<a
5244 href="#propdef-font-variant"><code
5245 class=property>font-variant</code></a>’ property, the related
5246 font-variant subproperties and any other CSS property that may use
5247 OpenType features (e.g. the ‘<a href="#propdef-font-kerning"><code
5248 class=property>font-kerning</code></a>’ property).
5250 <li>Font features implied by the value of ‘<a
5251 href="#propdef-font-feature-settings"><code
5252 class=property>font-feature-settings</code></a>’ property.
5253 </ol>
5255 <p>This ordering allows authors to set up a general set of defaults for
5256 fonts within their <code>@font-face</code> rules, then override them with
5257 property settings for specific elements. General property settings
5258 override the settings in <code>@font-face</code> rules and low-level font
5259 feature settings override ‘<a href="#propdef-font-variant"><code
5260 class=property>font-variant</code></a>’ property settings.
5262 <p>For situations where the combined list of font feature settings contains
5263 more than one value for the same feature, the last value is used. When a
5264 font lacks support for a given underlying font feature, text is simply
5265 rendered as if that font feature was not enabled; font fallback does not
5266 occur and no attempt is made to synthesize the feature except where
5267 explicitly noted for specific properties.
5269 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
5270 precedence examples</h3>
5272 <div class=example>
5273 <p>With the styles below, numbers are rendered proportionally when used
5274 within a paragraph but are shown in tabular form within tables of prices:</p>
5276 <pre>body {
5277 font-variant-numeric: proportional-nums;
5278 }
5280 table.prices td {
5281 font-variant-numeric: tabular-nums;
5282 }
5283 </pre>
5284 </div>
5286 <div class=example>
5287 <p>When the font-variant descriptor is used within an
5288 <code>@font-face</code> rule, it only applies to the font defined by that
5289 rule.</p>
5291 <pre>@font-face {
5292 font-family: MainText;
5293 src: url(http://example.com/font.ttf);
5294 font-variant: oldstyle-nums proportional-nums styleset(1,3);
5295 }
5297 body {
5298 font-family: MainText, Helvetica;
5299 }
5301 table.prices td {
5302 font-variant-numeric: tabular-nums;
5303 }
5304 </pre>
5306 <p>In this case, old-style numerals will be used throughout but only where
5307 the font "MainText" is used. Just as in the previous example, tabular
5308 values will be used in price tables since ‘<a
5309 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
5310 appears in a general style rule and its use is mutually exclusive with
5311 ‘<a href="#proportional-nums"><code
5312 class=property>proportional-nums</code></a>’. Stylistic alternate sets
5313 will only be used where MainText is used.</p>
5314 </div>
5316 <div class=example>
5317 <p>The <code>@font-face</code> rule can also be used to access font
5318 features in locally available fonts via the use of <code>local()</code>
5319 in the ‘<a href="#descdef-src"><code class=property>src</code></a>’
5320 descriptor of the <code>@font-face</code> definition:</p>
5322 <pre>@font-face {
5323 font-family: BodyText;
5324 src: local("HiraMaruPro-W4");
5325 font-variant: proportional-width;
5326 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
5327 }
5329 body { font-family: BodyText, serif; }
5330 </pre>
5332 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
5333 text rendering occurs, Japanese kana will be proportionally spaced and
5334 Latin text will be italicised. Text rendered with the fallback serif font
5335 will use default rendering properties.</p>
5336 </div>
5338 <div class=example>
5339 <p>In the example below, discretionary ligatures are enabled only for a
5340 downloadable font but are disabled within spans of class "special":</p>
5342 <pre>@font-face {
5343 font-family: main;
5344 src: url(fonts/ffmeta.woff) format("woff");
5345 font-variant: discretionary-ligatures;
5346 }
5348 body { font-family: main, Helvetica; }
5349 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5350 </pre>
5352 <p>Adding an discretionary style rule with the <code>@font-face</code>
5353 above:</p>
5355 <pre>body { font-family: main, Helvetica; }
5356 span { font-feature-settings: "dlig"; }
5357 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5358 </pre>
5360 <p>Within spans of class "special", discretionary ligatures <em>will</em>
5361 be rendered. This is because both the ‘<a
5362 href="#propdef-font-feature-settings"><code
5363 class=property>font-feature-settings</code></a>’ and ‘<a
5364 href="#propdef-font-variant-ligatures"><code
5365 class=property>font-variant-ligatures</code></a>’ properties apply to
5366 these spans. Although the ‘<code class=css>no-discretionary
5367 ligatures</code>’ setting of ‘<a
5368 href="#propdef-font-variant-ligatures"><code
5369 class=property>font-variant-ligatures</code></a>’ effectively disables
5370 the OpenType <span class=tag>dlig</span> feature, because the ‘<a
5371 href="#propdef-font-feature-settings"><code
5372 class=property>font-feature-settings</code></a>’ is resolved after
5373 that, the ‘<code class=property>dlig</code>’ value reenables
5374 discretionary ligatures.</p>
5375 </div>
5377 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
5379 <p>The contents of <code>@font-face</code> and
5380 <code>@font-feature-values</code> rules can be accessed via the following
5381 extensions to the CSS Object Model.
5383 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
5384 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
5386 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
5387 <code>@font-face</code> rule.
5389 <pre class=idl>
5390 interface CSSFontFaceRule : CSSRule {
5391 attribute DOMString family;
5392 attribute DOMString src;
5393 attribute DOMString style;
5394 attribute DOMString weight;
5395 attribute DOMString stretch;
5396 attribute DOMString unicodeRange;
5397 attribute DOMString variant;
5398 attribute DOMString featureSettings;
5399 }</pre>
5401 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
5402 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
5403 defined a different variant of this rule. This definition supercedes that
5404 one.
5406 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
5407 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5408 interface</h3>
5410 <p>The <code>CSSRule</code> interface is extended as follows:
5412 <pre class=idl>partial interface CSSRule {
5413 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
5414 }</pre>
5416 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
5417 interface represents a <code>@font-feature-values</code> rule.
5419 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
5420 readonly attribute DOMString familyList;
5421 readonly attribute DOMString valueText;
5422 };</pre>
5424 <dl class=idl-attributes>
5425 <dt><var>familyList</var> of type <code>DOMString</code>, readonly
5427 <dd>The list of one or more font families for which a given set of feature
5428 values is defined.
5430 <dt><var>valueText</var> of type <code>DOMString</code>, readonly
5432 <dd>Serialized set of feature values.
5433 </dl>
5435 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
5436 properties to CSS properties</h2>
5438 <p><em>This appendix is included as background for some of the problems and
5439 situations that are described in other sections. It should be viewed as
5440 informative only.</em>
5442 <p>Font properties in CSS are designed to be independent of the underlying
5443 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
5444 SVG fonts in addition to the common TrueType and OpenType fonts. But there
5445 are facets of the TrueType and OpenType formats that often cause confusion
5446 for authors and present challenges to implementers on different platforms.
5448 <p>Originally developed at Apple, TrueType was designed as an outline font
5449 format for both screen and print. Microsoft joined Apple in developing the
5450 TrueType format and both platforms have supported TrueType fonts since
5451 then. Font data in the TrueType format consists of a set of tables
5452 distinguished with common four-letter tag names, each containing a
5453 specific type of data. For example, naming information, including
5454 copyright and license information, is stored in the ‘<code
5455 class=property>name</code>’ table. The <a
5456 href="#character-map"><em>character map</em></a> (‘<code
5457 class=property>cmap</code>’) table contains a mapping of character
5458 encodings to glyphs. Apple later added additional tables for supporting
5459 enhanced typographic functionality; these are now called Apple Advanced
5460 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
5461 tables for advanced typography and called their format OpenType <a
5462 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
5464 <p>In many cases the font data used under Microsoft Windows or Linux is
5465 slightly different from the data used under Apple's Mac OS X because the
5466 TrueType format allowed for explicit variation across platforms. This
5467 includes font metrics, names and <a href="#character-map"><em>character
5468 map</em></a> data.
5470 <p>Specifically, font family name data is handled differently across
5471 platforms. For TrueType and OpenType fonts these names are contained in
5472 the ‘<code class=property>name</code>’ table, in name records with
5473 name ID 1. Mulitple names can be stored for different locales but
5474 Microsoft recommends fonts always include at least a US English version of
5475 the name. On Windows, Microsoft made the decision for backwards
5476 compatibility to limit this family name to a maximum of four faces; for
5477 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
5478 ID 21) can be used. Other platforms such as OSX don't have this
5479 limitation, the family name is used to define all possible groupings.
5481 <p>Other name table data provides names used to uniquely identify a
5482 specific face within a family. The full font name (name ID 4) and the
5483 Postscript name (name ID 6) describe a single face uniquely. The bold face
5484 of the Gill Sans family has a fullname of "Gill Sans Bold" and a
5485 Postscript name of "GillSans-Bold". There can be multiple localized
5486 versions of the fullname for a given face but the Postscript name is
5487 always a unique name made from a limited set of ASCII characters.
5489 <p>On various platforms, different names are used to search for a font. For
5490 example, with the Windows GDI CreateIndirectFont API, either a family or
5491 fullname can be used to lookup a face while on Mac OS X the
5492 CTFontCreateWithName API call is used to lookup a given face using the
5493 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
5494 to be searched using any of these names. In situations where platform
5495 API's automatically substitute other font choices, it may be necessary to
5496 verify a returned font matches a given name.
5498 <p>The weight of a given face can be determined via the usWeightClass field
5499 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
5500 the width can be determined via the usWidthClass of the OS/2 table or
5501 inferred from the style name. For historical reasons related to synthetic
5502 bolding at weights 200 or lower with the Windows GDI API, font designers
5503 have sometimes skewed values in the OS/2 table to avoid these weights.
5505 <p>Rendering complex scripts that use contextual shaping such as Thai,
5506 Arabic and Devanagari requires features present only in OpenType or AAT
5507 fonts. Currently, complex script rendering is supported on Windows and
5508 Linux using OpenType font features while both OpenType and AAT font
5509 features are used under Mac OS X.
5511 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
5513 <h3 class=no-num id=recent-changes> Changes from the <a
5514 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">February 2013
5515 CSS3 Fonts Working Draft</a></h3>
5517 <p>Major changes include:
5519 <ul>
5520 <li>Moved font load events into a separate <a
5521 href="http://dev.w3.org/csswg/css3-font-load-events/">spec</a>
5523 <li>Tightened error handling rules for <code>@font-feature-values</code>
5524 rules
5526 <li>Added grammar productions for <code>@font-face</code> and
5527 <code>@font-feature-values</code> rules
5529 <li>Tightened definition of synthetic oblique
5531 <li>Revised definition of ‘<a href="#descdef-unicode-range"><code
5532 class=property>unicode-range</code></a>’ descriptor
5533 </ul>
5535 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
5537 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
5538 their help and feedback. John Hudson was kind enough to take the time to
5539 explain the subtleties of OpenType language tags and provided the example
5540 of character variant usage for displaying text on Byzantine seals. Ken
5541 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
5542 and Unicode variation selectors. The idea for supporting font features by
5543 using font-variant subproperties originated with Håkon Wium Lie, Adam
5544 Twardoch and Tal Leming. Elika Etemad supplied some of the initial design
5545 ideas for the <code>@font-feature-values</code> rule. Thanks also to House
5546 Industries for allowing the use of Ed Interlock in the discretionary
5547 ligatures example.
5549 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
5550 that is <em>The Elements of Typographic Style</em>.
5552 <h2 class=no-num id=conformance> Conformance</h2>
5554 <h3 class=no-num id=conventions> Document Conventions</h3>
5556 <p>Conformance requirements are expressed with a combination of descriptive
5557 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
5558 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
5559 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
5560 normative parts of this document are to be interpreted as described in RFC
5561 2119. However, for readability, these words do not appear in all uppercase
5562 letters in this specification.
5564 <p>All of the text of this specification is normative except sections
5565 explicitly marked as non-normative, examples, and notes. <a
5566 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
5568 <p>Examples in this specification are introduced with the words “for
5569 example” or are set apart from the normative text with
5570 <code>class="example"</code>, like this:
5572 <div class=example>
5573 <p>This is an example of an informative example.
5574 </div>
5576 <p>Informative notes begin with the word “Note” and are set apart from
5577 the normative text with <code>class="note"</code>, like this:
5579 <p class=note>Note, this is an informative note.
5581 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
5583 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
5584 classes:
5586 <dl>
5587 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
5588 sheet</dfn>
5590 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
5591 style sheet</a>.
5593 <dt><dfn id=renderer>renderer</dfn>
5595 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5596 that interprets the semantics of a style sheet and renders documents that
5597 use them.
5599 <dt><dfn id=authoring-tool>authoring tool</dfn>
5601 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5602 that writes a style sheet.
5603 </dl>
5605 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
5606 declarations that use properties defined in this module have values that
5607 are valid according to the generic CSS grammar and the individual grammars
5608 of each property as given in this module.
5610 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
5611 interpreting the style sheet as defined by the appropriate specifications,
5612 it supports all the features defined by CSS Fonts Level 3 Module by
5613 parsing them correctly and rendering the document accordingly. However,
5614 the inability of a UA to correctly render a document due to limitations of
5615 the device does not make the UA non-conformant. (For example, a UA is not
5616 required to render color on a monochrome monitor.)
5618 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
5619 style sheets that are syntactically correct according to the generic CSS
5620 grammar and the individual grammars of each feature in this module, and
5621 meet all other conformance requirements of style sheets as described in
5622 this module.
5624 <h3 class=no-num id=partial> Partial Implementations</h3>
5626 <p>So that authors can exploit the forward-compatible parsing rules to
5627 assign fallback values, CSS renderers <strong>must</strong> treat as
5628 invalid (and <a
5629 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
5630 appropriate</a>) any at-rules, properties, property values, keywords, and
5631 other syntactic constructs for which they have no usable level of support.
5632 In particular, user agents <strong>must not</strong> selectively ignore
5633 unsupported component values and honor supported values in a single
5634 multi-value property declaration: if any value is considered invalid (as
5635 unsupported values must be), CSS requires that the entire declaration be
5636 ignored.
5638 <h3 class=no-num id=experimental> Experimental Implementations</h3>
5640 <p>To avoid clashes with future CSS features, the CSS2.1 specification
5641 reserves a <a
5642 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
5643 syntax</a> for proprietary and experimental extensions to CSS.
5645 <p>Prior to a specification reaching the Candidate Recommendation stage in
5646 the W3C process, all implementations of a CSS feature are considered
5647 experimental. The CSS Working Group recommends that implementations use a
5648 vendor-prefixed syntax for such features, including those in W3C Working
5649 Drafts. This avoids incompatibilities with future changes in the draft.
5651 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
5653 <p>Once a specification reaches the Candidate Recommendation stage,
5654 non-experimental implementations are possible, and implementors should
5655 release an unprefixed implementation of any CR-level feature they can
5656 demonstrate to be correctly implemented according to spec.
5658 <p>To establish and maintain the interoperability of CSS across
5659 implementations, the CSS Working Group requests that non-experimental CSS
5660 renderers submit an implementation report (and, if necessary, the
5661 testcases used for that implementation report) to the W3C before releasing
5662 an unprefixed implementation of any CSS features. Testcases submitted to
5663 W3C are subject to review and correction by the CSS Working Group.
5665 <p>Further information on submitting testcases and implementation reports
5666 can be found from on the CSS Working Group's website at <a
5667 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
5668 Questions should be directed to the <a
5669 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
5670 mailing list.
5672 <h2 class=no-num id=references>References</h2>
5674 <h3 class=no-num id=normative-references>Normative References</h3>
5675 <!--begin-normative-->
5676 <!-- Sorted by label -->
5678 <dl class=bibliography>
5679 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
5680 <!---->
5682 <dt id=CHARMOD>[CHARMOD]
5684 <dd>Martin J. Dürst; et al. <a
5685 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
5686 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
5687 2005. W3C Recommendation. URL: <a
5688 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
5689 </dd>
5690 <!---->
5692 <dt id=CORS>[CORS]
5694 <dd>Anne van Kesteren. <a
5695 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
5696 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
5697 Recommendation. (Work in progress.) URL: <a
5698 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
5699 </dd>
5700 <!---->
5702 <dt id=CSS21>[CSS21]
5704 <dd>Bert Bos; et al. <a
5705 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
5706 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
5707 2011. W3C Recommendation. URL: <a
5708 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
5709 </dd>
5710 <!---->
5712 <dt id=CSS3VAL>[CSS3VAL]
5714 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
5715 href="http://www.w3.org/TR/2012/CR-css3-values-20120828/"><cite>CSS
5716 Values and Units Module Level 3.</cite></a> 28 August 2012. W3C Candidate
5717 Recommendation. (Work in progress.) URL: <a
5718 href="http://www.w3.org/TR/2012/CR-css3-values-20120828/">http://www.w3.org/TR/2012/CR-css3-values-20120828/</a>
5719 </dd>
5720 <!---->
5722 <dt id=HTML5>[HTML5]
5724 <dd>Ian Hickson. <a
5725 href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
5726 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
5727 <a
5728 href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
5729 </dd>
5730 <!---->
5732 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
5734 <dd><a
5735 href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip"><cite>Information
5736 technology — Coding of audio-visual objects — Part 22: Open Font
5737 Format.</cite></a> International Organization for Standardization.
5738 ISO/IEC 14496-22:2009. URL: <a
5739 href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip</a>
5740 </dd>
5741 <!---->
5743 <dt id=OPENTYPE>[OPENTYPE]
5745 <dd><a
5746 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
5747 specification.</cite></a> Microsoft. URL: <a
5748 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
5749 </dd>
5750 <!---->
5752 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
5754 <dd><a
5755 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
5756 feature registry.</cite></a> Microsoft. URL: <a
5757 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
5758 </dd>
5759 <!---->
5761 <dt id=RFC2119>[RFC2119]
5763 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
5764 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
5765 RFC 2119. URL: <a
5766 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
5767 </dd>
5768 <!---->
5770 <dt id=UAX15>[UAX15]
5772 <dd>Mark Davis; Ken Whistler. <a
5773 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
5774 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
5775 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
5776 </dd>
5777 <!---->
5779 <dt id=UAX29>[UAX29]
5781 <dd>Mark Davis. <a
5782 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
5783 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
5784 URL: <a
5785 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
5786 </dd>
5787 <!---->
5789 <dt id=UNICODE6>[UNICODE6]
5791 <dd>The Unicode Consortium. <a
5792 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
5793 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
5794 Version 6.2.0 URL: <a
5795 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
5796 </dd>
5797 <!---->
5798 </dl>
5799 <!--end-normative-->
5800 <!--{{!CSS21}}-->
5801 <!--{{!CSS3VAL}}-->
5802 <!--{{!OPENTYPE}}-->
5803 <!--{{!OPENTYPE-FEATURES}}-->
5804 <!--{{!OPEN-FONT-FORMAT}}-->
5805 <!--{{!UNICODE6}}-->
5806 <!--{{!UAX15}}-->
5807 <!--{{!UAX29}}-->
5808 <!--{{!CORS}}-->
5809 <!--{{!HTML5}}-->
5810 <!--{{!CHARMOD}}-->
5812 <h3 class=no-num id=other-references>Other References</h3>
5813 <!--begin-informative-->
5814 <!-- Sorted by label -->
5816 <dl class=bibliography>
5817 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
5818 <!---->
5820 <dt id=AAT-FEATURES>[AAT-FEATURES]
5822 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
5823 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
5824 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
5825 </dd>
5826 <!---->
5828 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
5830 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
5831 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
5832 <!---->
5834 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
5836 <dd>François Yergeau; et al. <a
5837 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
5838 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
5839 W3C Working Draft. (Work in progress.) URL: <a
5840 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
5841 </dd>
5842 <!---->
5844 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
5846 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
5847 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
5848 <!---->
5850 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
5852 <dd>L. David Baron. <a
5853 href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/"><cite>CSS
5854 Conditional Rules Module Level 3.</cite></a> 13 December 2012. W3C
5855 Working Draft. (Work in progress.) URL: <a
5856 href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">http://www.w3.org/TR/2012/WD-css3-conditional-20121213/</a>
5857 </dd>
5858 <!---->
5860 <dt id=CSS3TEXT>[CSS3TEXT]
5862 <dd>Elika J. Etemad; Koji Ishii. <a
5863 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
5864 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
5865 progress.) URL: <a
5866 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
5867 </dd>
5868 <!---->
5870 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
5872 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
5873 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
5874 ISBN 0-201-17633-5.</dd>
5875 <!---->
5877 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
5879 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
5880 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
5881 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
5882 2000. W3C Recommendation. URL: <a
5883 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>
5884 </dd>
5885 <!---->
5887 <dt id=ELEMTYPO>[ELEMTYPO]
5889 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
5890 4.</cite> Hartley & Marks. 2013. ISBN 0-88179-212-8.</dd>
5891 <!---->
5893 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
5895 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
5896 ISBN 1-932026-01-0.</dd>
5897 <!---->
5899 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
5901 <dd><a
5902 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
5903 User Guide.</cite></a> FontShop International. URL: <a
5904 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
5905 </dd>
5906 <!---->
5908 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
5910 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
5911 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
5912 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
5913 <!---->
5915 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
5917 <dd>John Hudson. <a
5918 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
5919 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
5920 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
5921 </dd>
5922 <!---->
5923 </dl>
5924 <!--end-informative-->
5925 <!--{{ARABIC-TYPO}}-->
5926 <!--{{CJKV-INFO-PROCESSING}}-->
5927 <!--{{DIGITAL-TYPOGRAPHY}}-->
5928 <!--{{DOM-LEVEL-2-STYLE}}-->
5929 <!--{{ELEMTYPO}}-->
5930 <!--{{LANGCULTTYPE}}-->
5931 <!--{{OPENTYPE-FONT-GUIDE}}-->
5932 <!--{{RASTER-TRAGEDY}}-->
5933 <!--{{WINDOWS-GLYPH-PROC}}-->
5934 <!--{{CHARMOD-NORM}}-->
5935 <!--{{AAT-FEATURES}}-->
5936 <!--{{CSS3-CONDITIONAL}}-->
5937 <!--{{CSS3TEXT}}-->
5939 <h2 class=no-num id=index>Index</h2>
5940 <!--begin-index-->
5942 <ul class=indexlist>
5943 <li><var><absolute-size></var>, <a href="#absolute-size-value"
5944 title="<absolute-size>"><strong>3.5</strong></a>
5946 <li><var><common-lig-values></var>, <a href="#common-lig-values"
5947 title="<common-lig-values>"><strong>6.4</strong></a>
5949 <li><var><contextual-alt-values></var>, <a
5950 href="#contextual-alt-values"
5951 title="<contextual-alt-values>"><strong>6.4</strong></a>
5953 <li><var><discretionary-lig-values></var>, <a
5954 href="#discretionary-lig-values"
5955 title="<discretionary-lig-values>"><strong>6.4</strong></a>
5957 <li><var><east-asian-variant-values></var>, <a
5958 href="#east-asian-variant-values"
5959 title="<east-asian-variant-values>"><strong>6.10</strong></a>
5961 <li><var><east-asian-width-values></var>, <a
5962 href="#east-asian-width-values"
5963 title="<east-asian-width-values>"><strong>6.10</strong></a>
5965 <li><var><family-name></var>, <a href="#family-name-value"
5966 title="<family-name>"><strong>3.1</strong></a>
5968 <li><var><feature-tag-value></var>, <a href="#feature-tag-value"
5969 title="<feature-tag-value>"><strong>6.12</strong></a>
5971 <li><var><font-face-name></var>, <a href="#font-face-name-value"
5972 title="<font-face-name>"><strong>4.3</strong></a>
5974 <li><var><font-variant-css21></var>, <a
5975 href="#font-variant-css21-values"
5976 title="<font-variant-css21>"><strong>3.7</strong></a>
5978 <li><var><generic-family></var>, <a href="#generic-family-value"
5979 title="<generic-family>"><strong>3.1</strong></a>
5981 <li><var><historical-lig-values></var>, <a
5982 href="#historical-lig-values"
5983 title="<historical-lig-values>"><strong>6.4</strong></a>
5985 <li><var><length></var>, <a href="#length-size-value"
5986 title="<length>"><strong>3.5</strong></a>
5988 <li><var><number></var>, <a href="#aspect-ratio-value"
5989 title="<number>"><strong>3.6</strong></a>
5991 <li><var><numeric-figure-values></var>, <a
5992 href="#numeric-figure-values"
5993 title="<numeric-figure-values>"><strong>6.7</strong></a>
5995 <li><var><numeric-fraction-values></var>, <a
5996 href="#numeric-fraction-values"
5997 title="<numeric-fraction-values>"><strong>6.7</strong></a>
5999 <li><var><numeric-spacing-values></var>, <a
6000 href="#numeric-spacing-values"
6001 title="<numeric-spacing-values>"><strong>6.7</strong></a>
6003 <li><var><percentage></var>, <a href="#percentage-size-value"
6004 title="<percentage>"><strong>3.5</strong></a>
6006 <li><var><relative-size></var>, <a href="#relative-size-value"
6007 title="<relative-size>"><strong>3.5</strong></a>
6009 <li><var><urange></var>, <a href="#urange-value"
6010 title="<urange>"><strong>4.5</strong></a>
6012 <li>@font-face, <a href="#font-face" title="@font-face">4.1</a>, <a
6013 href="#font-face0" title="@font-face">4.3</a>
6015 <li>all-petite-caps, <a href="#all-petite-caps"
6016 title=all-petite-caps><strong>6.6</strong></a>
6018 <li>all-small-caps, <a href="#all-small-caps"
6019 title=all-small-caps><strong>6.6</strong></a>
6021 <li>annotation, <a href="#annotation"
6022 title=annotation><strong>6.8</strong></a>
6024 <li>aspect value, <a href="#aspect-value0" title="aspect
6025 value"><strong>3.6</strong></a>
6027 <li>authoring tool, <a href="#authoring-tool" title="authoring
6028 tool"><strong>#</strong></a>
6030 <li>character map, <a href="#character-map" title="character
6031 map"><strong>5.2</strong></a>
6033 <li>character-variant, <a href="#character-variant"
6034 title=character-variant><strong>6.8</strong></a>
6036 <li>common-ligatures, <a href="#common-ligatures"
6037 title=common-ligatures><strong>6.4</strong></a>
6039 <li>contextual, <a href="#contextual"
6040 title=contextual><strong>6.4</strong></a>
6042 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
6043 title=CSSFontFaceRule><strong>8.1</strong></a>
6045 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
6046 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
6048 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
6049 of"><strong>#</strong></a>
6051 <li>default face, <a href="#default-face" title="default
6052 face"><strong>5.2</strong></a>
6054 <li>descriptor_declaration, <a href="#descriptordeclaration"
6055 title="descriptor_declaration"><strong>4.1</strong></a>
6057 <li>diagonal-fractions, <a href="#diagonal-fractions"
6058 title=diagonal-fractions><strong>6.7</strong></a>
6060 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
6061 title=discretionary-ligatures><strong>6.4</strong></a>
6063 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
6064 of"><strong>#</strong></a>
6066 <li>feature_type, <a href="#featuretype"
6067 title="feature_type"><strong>6.9</strong></a>
6069 <li>feature_value_block, <a href="#featurevalueblock"
6070 title="feature_value_block"><strong>6.9</strong></a>
6072 <li>feature_value_definition, <a href="#featurevaluedefinition"
6073 title="feature_value_definition"><strong>6.9</strong></a>
6075 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
6077 <li>font-family, <a href="#descdef-font-family"
6078 title=font-family><strong>4.2</strong></a>, <a
6079 href="#propdef-font-family" title=font-family><strong>3.1</strong></a>
6081 <li>font-feature-settings, <a href="#propdef-font-feature-settings"
6082 title=font-feature-settings><strong>6.12</strong></a>
6084 <li>font-feature-settings (descriptor), <a
6085 href="#descdef-font-feature-settings" title="font-feature-settings
6086 (descriptor)"><strong>4.7</strong></a>
6088 <li>font-kerning, <a href="#propdef-font-kerning"
6089 title=font-kerning><strong>6.3</strong></a>
6091 <li>font-language-override, <a href="#propdef-font-language-override"
6092 title=font-language-override><strong>6.13</strong></a>
6094 <li>font-size, <a href="#propdef-font-size"
6095 title=font-size><strong>3.5</strong></a>
6097 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
6098 title=font-size-adjust><strong>3.6</strong></a>
6100 <li>font-stretch, <a href="#propdef-font-stretch"
6101 title=font-stretch><strong>3.3</strong></a>
6103 <li>font-stretch (descriptor), <a href="#descdef-font-stretch"
6104 title="font-stretch (descriptor)"><strong>4.4</strong></a>
6106 <li>font-style, <a href="#propdef-font-style"
6107 title=font-style><strong>3.4</strong></a>
6109 <li>font-style (descriptor), <a href="#descdef-font-style"
6110 title="font-style (descriptor)"><strong>4.4</strong></a>
6112 <li>font-synthesis, <a href="#propdef-font-synthesis"
6113 title=font-synthesis><strong>3.8</strong></a>
6115 <li>font-variant, <a href="#propdef-font-variant"
6116 title=font-variant><strong>6.11</strong></a>
6118 <li>font-variant (descriptor), <a href="#descdef-font-variant"
6119 title="font-variant (descriptor)"><strong>4.7</strong></a>
6121 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
6122 title=font-variant-alternates><strong>6.8</strong></a>
6124 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
6125 title=font-variant-caps><strong>6.6</strong></a>
6127 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
6128 title=font-variant-east-asian><strong>6.10</strong></a>
6130 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
6131 title=font-variant-ligatures><strong>6.4</strong></a>
6133 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
6134 title=font-variant-numeric><strong>6.7</strong></a>
6136 <li>font-variant-position, <a href="#propdef-font-variant-position"
6137 title=font-variant-position><strong>6.5</strong></a>
6139 <li>font-weight, <a href="#propdef-font-weight"
6140 title=font-weight><strong>3.2</strong></a>
6142 <li>font-weight (descriptor), <a href="#descdef-font-weight"
6143 title="font-weight (descriptor)"><strong>4.4</strong></a>
6145 <li>font_face_rule, <a href="#fontfacerule"
6146 title="font_face_rule"><strong>4.1</strong></a>
6148 <li>FONT_FACE_SYM, <a href="#fontfacesym"
6149 title="FONT_FACE_SYM"><strong>4.1</strong></a>
6151 <li>font_family_name, <a href="#fontfamilyname"
6152 title="font_family_name"><strong>6.9</strong></a>
6154 <li>font_family_name_list, <a href="#fontfamilynamelist"
6155 title="font_family_name_list"><strong>6.9</strong></a>
6157 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
6158 title="font_feature_values_rule"><strong>6.9</strong></a>
6160 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
6161 title="FONT_FEATURE_VALUES_SYM"><strong>6.9</strong></a>
6163 <li>full-width, <a href="#full-width"
6164 title=full-width><strong>6.10</strong></a>
6166 <li>historical-forms, <a href="#historical-forms"
6167 title=historical-forms><strong>6.8</strong></a>
6169 <li>historical-ligatures, <a href="#historical-ligatures"
6170 title=historical-ligatures><strong>6.4</strong></a>
6172 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
6174 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
6176 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
6178 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
6180 <li>lining-nums, <a href="#lining-nums"
6181 title=lining-nums><strong>6.7</strong></a>
6183 <li>monospace, definition of, <a href="#monospace0" title="monospace,
6184 definition of"><strong>#</strong></a>
6186 <li>no-common-ligatures, <a href="#no-common-ligatures"
6187 title=no-common-ligatures><strong>6.4</strong></a>
6189 <li>no-contextual, <a href="#no-contextual"
6190 title=no-contextual><strong>6.4</strong></a>
6192 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
6193 title=no-discretionary-ligatures><strong>6.4</strong></a>
6195 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
6196 title=no-historical-ligatures><strong>6.4</strong></a>
6198 <li>normal, <a href="#normal" title=normal><strong>6.6</strong></a>, <a
6199 href="#normal0" title=normal><strong>6.7</strong></a>, <a href="#normal1"
6200 title=normal><strong>6.8</strong></a>, <a href="#normal2"
6201 title=normal><strong>6.10</strong></a>
6203 <li>oldstyle-nums, <a href="#oldstyle-nums"
6204 title=oldstyle-nums><strong>6.7</strong></a>
6206 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
6208 <li>ornaments, <a href="#ornaments"
6209 title=ornaments><strong>6.8</strong></a>
6211 <li>petite-caps, <a href="#petite-caps"
6212 title=petite-caps><strong>6.6</strong></a>
6214 <li>proportional-nums, <a href="#proportional-nums"
6215 title=proportional-nums><strong>6.7</strong></a>
6217 <li>proportional-width, <a href="#proportional-width"
6218 title=proportional-width><strong>6.10</strong></a>
6220 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
6222 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
6224 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
6225 definition of"><strong>#</strong></a>
6227 <li>serif, definition of, <a href="#serif0" title="serif, definition
6228 of"><strong>#</strong></a>
6230 <li>simplified, <a href="#simplified"
6231 title=simplified><strong>6.10</strong></a>
6233 <li>slashed-zero, <a href="#slashed-zero"
6234 title=slashed-zero><strong>6.7</strong></a>
6236 <li>small-caps, <a href="#small-caps"
6237 title=small-caps><strong>6.6</strong></a>
6239 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
6241 <li>stacked-fractions, <a href="#stacked-fractions"
6242 title=stacked-fractions><strong>6.7</strong></a>
6244 <li>style sheet
6245 <ul>
6246 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
6247 conformance class"><strong>#</strong></a>
6248 </ul>
6250 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
6252 <li>stylistic, <a href="#stylistic"
6253 title=stylistic><strong>6.8</strong></a>
6255 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
6257 <li>tabular-nums, <a href="#tabular-nums"
6258 title=tabular-nums><strong>6.7</strong></a>
6260 <li>titling-caps, <a href="#titling-caps"
6261 title=titling-caps><strong>6.6</strong></a>
6263 <li>traditional, <a href="#traditional"
6264 title=traditional><strong>6.10</strong></a>
6266 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
6268 <li>unicode-range, <a href="#descdef-unicode-range"
6269 title=unicode-range><strong>4.5</strong></a>
6271 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
6273 <li>width, <a href="#width" title=width><strong>2</strong></a>
6274 </ul>
6275 <!--end-index-->
6277 <h2 class=no-num id=property-index>Property index</h2>
6278 <!--begin-properties-->
6280 <table class=proptable>
6281 <thead>
6282 <tr>
6283 <th>Property
6285 <th>Values
6287 <th>Initial
6289 <th>Applies to
6291 <th>Inh.
6293 <th>Percentages
6295 <th>Media
6297 <tbody>
6298 <tr>
6299 <th><a class=property href="#propdef-font">font</a>
6301 <td>[ [ <‘font-style’> || <font-variant-css21> ||
6302 <‘font-weight’> || <‘font-stretch’ ]?
6303 <‘font-size’> [ / <‘line-height’> ]?
6304 <‘font-family’> ] | caption | icon | menu | message-box |
6305 small-caption | status-bar
6307 <td>see individual properties
6309 <td>all elements
6311 <td>yes
6313 <td>see individual properties
6315 <td>visual
6317 <tr>
6318 <th><a class=property href="#descdef-font-family">font-family</a>
6320 <td>[ <family-name> | <generic-family> ] #
6322 <td>depends on user agent
6324 <td>all elements
6326 <td>yes
6328 <td>N/A
6330 <td>visual
6332 <tr>
6333 <th><a class=property
6334 href="#propdef-font-feature-settings">font-feature-settings</a>
6336 <td>normal | <feature-tag-value> #
6338 <td>normal
6340 <td>all elements
6342 <td>yes
6344 <td>N/A
6346 <td>visual
6348 <tr>
6349 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
6351 <td>auto | normal | none
6353 <td>auto
6355 <td>all elements
6357 <td>yes
6359 <td>N/A
6361 <td>visual
6363 <tr>
6364 <th><a class=property
6365 href="#propdef-font-language-override">font-language-override</a>
6367 <td>normal | <string>
6369 <td>normal
6371 <td>all elements
6373 <td>yes
6375 <td>N/A
6377 <td>visual
6379 <tr>
6380 <th><a class=property href="#propdef-font-size">font-size</a>
6382 <td><absolute-size> | <relative-size> | <length> |
6383 <percentage>
6385 <td>medium
6387 <td>all elements
6389 <td>yes
6391 <td>refer to parent element's font size
6393 <td>visual
6395 <tr>
6396 <th><a class=property
6397 href="#propdef-font-size-adjust">font-size-adjust</a>
6399 <td>none | auto | <number>
6401 <td>none
6403 <td>all elements
6405 <td>yes
6407 <td>N/A
6409 <td>visual
6411 <tr>
6412 <th><a class=property href="#propdef-font-stretch">font-stretch</a>
6414 <td>normal | ultra-condensed | extra-condensed | condensed |
6415 semi-condensed | semi-expanded | expanded | extra-expanded |
6416 ultra-expanded
6418 <td>normal
6420 <td>all elements
6422 <td>yes
6424 <td>N/A
6426 <td>visual
6428 <tr>
6429 <th><a class=property href="#propdef-font-style">font-style</a>
6431 <td>normal | italic | oblique
6433 <td>normal
6435 <td>all elements
6437 <td>yes
6439 <td>N/A
6441 <td>visual
6443 <tr>
6444 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
6446 <td>none | [ weight || style ]
6448 <td>weight style
6450 <td>all elements
6452 <td>yes
6454 <td>N/A
6456 <td>visual
6458 <tr>
6459 <th><a class=property href="#propdef-font-variant">font-variant</a>
6461 <td>normal | none | [ <common-lig-values> ||
6462 <discretionary-lig-values> || <historical-lig-values> ||
6463 <contextual-alt-values> || stylistic(<feature-value-name>)
6464 || historical-forms || styleset(<feature-value-name> #) ||
6465 character-variant(<feature-value-name> #) ||
6466 swash(<feature-value-name>) ||
6467 ornaments(<feature-value-name>) ||
6468 annotation(<feature-value-name>) || [ small-caps | all-small-caps
6469 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
6470 <numeric-figure-values> || <numeric-spacing-values> ||
6471 <numeric-fraction-values> || ordinal || slashed-zero ||
6472 <east-asian-variant-values> || <east-asian-width-values> ||
6473 ruby ]
6475 <td>normal
6477 <td>all elements
6479 <td>yes
6481 <td>see individual properties
6483 <td>visual
6485 <tr>
6486 <th><a class=property
6487 href="#propdef-font-variant-alternates">font-variant-alternates</a>
6489 <td>normal | [ stylistic(<feature-value-name>) || historical-forms
6490 || styleset(<feature-value-name> #) ||
6491 character-variant(<feature-value-name> #) ||
6492 swash(<feature-value-name>) ||
6493 ornaments(<feature-value-name>) ||
6494 annotation(<feature-value-name>) ]
6496 <td>normal
6498 <td>all elements
6500 <td>yes
6502 <td>N/A
6504 <td>visual
6506 <tr>
6507 <th><a class=property
6508 href="#propdef-font-variant-caps">font-variant-caps</a>
6510 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
6511 | unicase | titling-caps
6513 <td>normal
6515 <td>all elements
6517 <td>yes
6519 <td>N/A
6521 <td>visual
6523 <tr>
6524 <th><a class=property
6525 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
6527 <td>normal | [ <east-asian-variant-values> ||
6528 <east-asian-width-values> || ruby ]
6530 <td>normal
6532 <td>all elements
6534 <td>yes
6536 <td>N/A
6538 <td>visual
6540 <tr>
6541 <th><a class=property
6542 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
6544 <td>normal | none | [ <common-lig-values> ||
6545 <discretionary-lig-values> || <historical-lig-values> ||
6546 <contextual-alt-values> ]
6548 <td>normal
6550 <td>all elements
6552 <td>yes
6554 <td>N/A
6556 <td>visual
6558 <tr>
6559 <th><a class=property
6560 href="#propdef-font-variant-numeric">font-variant-numeric</a>
6562 <td>normal | [ <numeric-figure-values> ||
6563 <numeric-spacing-values> || <numeric-fraction-values> ||
6564 ordinal || slashed-zero ]
6566 <td>normal
6568 <td>all elements
6570 <td>yes
6572 <td>N/A
6574 <td>visual
6576 <tr>
6577 <th><a class=property
6578 href="#propdef-font-variant-position">font-variant-position</a>
6580 <td>normal | sub | super
6582 <td>normal
6584 <td>all elements
6586 <td>yes
6588 <td>N/A
6590 <td>visual
6592 <tr>
6593 <th><a class=property href="#propdef-font-weight">font-weight</a>
6595 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
6596 | 700 | 800 | 900
6598 <td>normal
6600 <td>all elements
6602 <td>yes
6604 <td>N/A
6606 <td>visual
6607 </table>
6608 <!--end-properties-->
6609 <!--begin-descriptors-->
6611 <table class=proptable>
6612 <thead>
6613 <tr>
6614 <th>Descriptor
6616 <th>Value
6618 <th>Initial
6620 <th>Percentages
6622 <th>Media
6624 <tbody>
6625 <tr>
6626 <th><a class=property href="#descdef-font-family">font-family</a>
6628 <td><family-name>
6630 <td>N/A
6632 <tr>
6633 <th><a class=property
6634 href="#propdef-font-feature-settings">font-feature-settings</a>
6636 <td>normal | <feature-tag-value> #
6638 <td>normal
6640 <tr>
6641 <th><a class=property href="#propdef-font-stretch">font-stretch</a>
6643 <td>normal | ultra-condensed | extra-condensed | condensed |
6644 semi-condensed | semi-expanded | expanded | extra-expanded |
6645 ultra-expanded
6647 <td>normal
6649 <tr>
6650 <th><a class=property href="#propdef-font-style">font-style</a>
6652 <td>normal | italic | oblique
6654 <td>normal
6656 <tr>
6657 <th><a class=property href="#propdef-font-variant">font-variant</a>
6659 <td>normal | none | [ <common-lig-values> ||
6660 <discretionary-lig-values> || <historical-lig-values> ||
6661 <contextual-alt-values> || stylistic(<feature-value-name>)
6662 || historical-forms || styleset(<feature-value-name> #) ||
6663 character-variant(<feature-value-name> #) ||
6664 swash(<feature-value-name>) ||
6665 ornaments(<feature-value-name>) ||
6666 annotation(<feature-value-name>) || [ small-caps | all-small-caps
6667 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
6668 <numeric-figure-values> || <numeric-spacing-values> ||
6669 <numeric-fraction-values> || ordinal || slashed-zero ||
6670 <east-asian-variant-values> || <east-asian-width-values> ||
6671 ruby ]
6673 <td>normal
6675 <tr>
6676 <th><a class=property href="#propdef-font-weight">font-weight</a>
6678 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
6680 <td>normal
6682 <tr>
6683 <th><a class=property href="#descdef-src">src</a>
6685 <td>[ <url> [format(<string> #)]? | <font-face-name> ] #
6687 <td>N/A
6689 <tr>
6690 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
6692 <td><urange> #
6694 <td>U+0-10FFFF
6695 </table>
6696 <!--end-descriptors-->
6697 <script type="text/javascript">
6698 window.onload = function () {
6699 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
6700 var i, hiresElements = document.getElementsByClassName("hires");
6701 for (i = 0; i < hiresElements.length; i++) {
6702 var h = hiresElements[i];
6703 if (h.tagName != "IMG") continue;
6704 var src = h.getAttribute("src");
6705 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
6706 h.src = src2x;
6707 }
6708 }
6709 </script>
6710 </html>
6711 <!-- Keep this comment at the end of the file
6712 Local variables:
6713 mode: sgml
6714 sgml-declaration:"~/SGML/HTML4.decl"
6715 sgml-default-doctype-name:"html"
6716 sgml-minimize-attributes:t
6717 sgml-nofill-elements:("pre" "style" "br")
6718 sgml-live-element-indicator:t
6719 sgml-omittag:nil
6720 sgml-shorttag:nil
6721 sgml-namecase-general:t
6722 sgml-general-insert-case:lower
6723 sgml-always-quote-attributes:t
6724 sgml-indent-step:nil
6725 sgml-indent-data:t
6726 sgml-parent-document:nil
6727 sgml-exposed-tags:nil
6728 sgml-local-catalogs:nil
6729 sgml-local-ecat-files:nil
6730 End:
6731 -->
6732 <!--
6734 to do:
6736 - wording of OpenType family name handling
6737 - handling combining sequences in the font matching algorithm
6738 - fix-up fi ligature example
6740 -->