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