Fri, 30 Aug 2013 14:13:34 +0900
[css3-fonts] add link to ordinal example
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-30-august-2013>Editor's Draft
119 30 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-20130830/">http://www.w3.org/TR/2013/ED-css-fonts-3-20130830/</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>Test Suite:
167 <dd><a
168 href="http://test.csswg.org/suites/css3-fonts/nightly-unstable/">http://test.csswg.org/suites/css3-fonts/nightly-unstable/</a>
171 <dt>Editor:
173 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
174 </dl>
175 <!--begin-copyright-->
176 <p class=copyright><a
177 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
178 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
179 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
180 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
181 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
182 title="European Research Consortium for Informatics and
183 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
184 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
185 <a
186 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
187 <a
188 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
189 and <a
190 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
191 use</a> rules apply.</p>
192 <!--end-copyright-->
193 <hr title="Separator for header">
194 </div>
196 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
198 <p>This CSS3 module describes how font properties are specified and how
199 font resources are loaded dynamically. The contents of this specification
200 are a consolidation of content previously divided into <a
201 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
202 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
203 Web Fonts</a> modules. The description of font load events was moved into
204 the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
205 Events</a> module.
207 <h2 class="no-num no-toc" id=status>Status of this document</h2>
208 <!--begin-status-->
210 <p>This is a public copy of the editors' draft. It is provided for
211 discussion only and may change at any moment. Its publication here does
212 not imply endorsement of its contents by W3C. Don't cite this document
213 other than as work in progress.
215 <p>The (<a
216 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
217 mailing list <a
218 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
219 www-style@w3.org</a> (see <a
220 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
221 discussion of this specification. When sending e-mail, please put the text
222 “css3-fonts” in the subject, preferably like this:
223 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
225 <p>This document was produced by the <a
226 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
227 the <a href="http://www.w3.org/Style/">Style Activity</a>).
229 <p>This document was produced by a group operating under the <a
230 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
231 2004 W3C Patent Policy</a>. W3C maintains a <a
232 href="http://www.w3.org/2004/01/pp-impl/32061/status"
233 rel=disclosure>public list of any patent disclosures</a> made in
234 connection with the deliverables of the group; that page also includes
235 instructions for disclosing a patent. An individual who has actual
236 knowledge of a patent which the individual believes contains <a
237 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
238 Claim(s)</a> must disclose the information in accordance with <a
239 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
240 6 of the W3C Patent Policy</a>.</p>
241 <!--end-status-->
243 <h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
245 <p>The following features are at risk and may be removed when exiting CR:
247 <ul>
248 <li>fallback handling for text decoration in superscript/subscript variant
249 glyphs (‘<a href="#propdef-font-variant-position"><code
250 class=property>font-variant-position</code></a>’)
252 <li>‘<a href="#propdef-font-language-override"><code
253 class=property>font-language-override</code></a>’ property
254 </ul>
255 <!--
256 <p>This draft is a <strong>Last Call Working Draft</strong>.
257 Please send comments to the
258 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style mailing list</a>
259 as described above. The <strong>deadline for comments</strong>
260 is six weeks after the date of publication in the header, 22 August 2013.</p>
261 -->
263 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
264 <!--begin-toc-->
266 <ul class=toc>
267 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
269 <li><a href="#typography-background"><span class=secno>2 </span>Typography
270 Background</a>
272 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
273 Properties</a>
274 <ul class=toc>
275 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
276 family: the font-family property</a>
277 <ul class=toc>
278 <li><a href="#generic-font-families"><span class=secno>3.1.1
279 </span>Generic font families</a>
280 </ul>
282 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
283 weight: the font-weight property</a>
285 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
286 width: the font-stretch property</a>
288 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
289 the font-style property</a>
291 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
292 the font-size property</a>
294 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
295 </span>Relative sizing: the font-size-adjust property</a>
297 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
298 property: the font property</a>
300 <li><a href="#font-synthesis-prop"><span class=secno>3.8
301 </span>Controlling synthetic faces: the font-synthesis property</a>
302 </ul>
304 <li><a href="#font-resources"><span class=secno>4 </span>Font
305 Resources</a>
306 <ul class=toc>
307 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
308 <code>@font-face</code> rule</a>
310 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
311 family: the font-family descriptor</a>
313 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
314 src descriptor</a>
316 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
317 descriptors: the font-style, font-weight, font-stretch descriptors</a>
319 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
320 range: the unicode-range descriptor</a>
322 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
323 character ranges to define composite fonts</a>
325 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
326 features: the font-variant and font-feature-settings descriptors</a>
328 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
329 loading guidelines</a>
331 <li><a href="#font-fetching-requirements"><span class=secno>4.9
332 </span>Font fetching requirements</a>
333 </ul>
335 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
336 Matching Algorithm</a>
337 <ul class=toc>
338 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
339 sensitivity of font family names</a>
341 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
342 font styles</a>
344 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
345 matching</a>
347 <li><a href="#char-handling-issues"><span class=secno>5.4
348 </span>Character handling issues</a>
350 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
351 matching changes since CSS 2.1</a>
353 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
354 matching examples</a>
355 </ul>
357 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
358 Properties</a>
359 <ul class=toc>
360 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
361 </span>Glyph selection and positioning</a>
363 <li><a href="#language-specific-support"><span class=secno>6.2
364 </span>Language-specific display</a>
366 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
367 the font-kerning property</a>
369 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
370 </span>Ligatures: the font-variant-ligatures property</a>
372 <li><a href="#font-variant-position-prop"><span class=secno>6.5
373 </span>Subscript and superscript forms: the font-variant-position
374 property</a>
376 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
377 </span>Capitalization: the font-variant-caps property</a>
379 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
380 </span>Numerical formatting: the font-variant-numeric property</a>
382 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
383 </span>Alternates and swashes: the font-variant-alternates property</a>
386 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
387 font specific alternates: the <code>@font-feature-values</code>
388 rule</a>
389 <ul class=toc>
390 <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
391 syntax</a>
393 <li><a href="#multi-valued-feature-value-definitions"><span
394 class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
395 </ul>
397 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
398 </span>East Asian text rendering: the font-variant-east-asian
399 property</a>
401 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
402 shorthand for font rendering: the font-variant property</a>
404 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
405 </span>Low-level font feature settings control: the
406 font-feature-settings property</a>
408 <li><a href="#font-language-override-prop"><span class=secno>6.13
409 </span>Font language override: the font-language-override property</a>
410 </ul>
412 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
413 Feature Resolution </a>
414 <ul class=toc>
415 <li><a href="#default-features"><span class=secno>7.1 </span>Default
416 features</a>
418 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
419 precedence</a>
421 <li><a href="#feature-precedence-examples"><span class=secno>7.3
422 </span>Feature precedence examples</a>
423 </ul>
425 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
426 <ul class=toc>
427 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
428 <code>CSSFontFaceRule</code> interface</a>
430 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
431 <code>CSSFontFeatureValuesRule</code> interface</a>
432 </ul>
434 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
435 platform font properties to CSS properties</a>
437 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
438 <ul class=toc>
439 <li class=no-num><a href="#recent-changes"> Changes from the July 2013
440 CSS3 Fonts Last Call Working Draft</a>
441 </ul>
443 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
445 <li class=no-num><a href="#conformance"> Conformance</a>
446 <ul class=toc>
447 <li class=no-num><a href="#conventions"> Document Conventions</a>
449 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
452 <li class=no-num><a href="#partial"> Partial Implementations</a>
454 <li class=no-num><a href="#experimental"> Experimental
455 Implementations</a>
457 <li class=no-num><a href="#testing"> Non-Experimental
458 Implementations</a>
459 </ul>
461 <li class=no-num><a href="#references">References</a>
462 <ul class=toc>
463 <li class=no-num><a href="#normative-references">Normative
464 References</a>
466 <li class=no-num><a href="#other-references">Other References</a>
467 </ul>
469 <li class=no-num><a href="#index">Index</a>
471 <li class=no-num><a href="#property-index">Property index</a>
472 </ul>
473 <!--end-toc-->
475 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
477 <p>A font provides a resource containing the visual representation of
478 characters. At the simplest level it contains information that maps
479 character codes to shapes (called glyphs) that represent these characters.
480 Fonts sharing a common design style are commonly grouped into font
481 families classified by a set of standard font properties. Within a family,
482 the shape displayed for a given character can vary by stroke weight, slant
483 or relative width, among others. An individual font face is described by a
484 unique combination of these properties. For a given range of text, CSS
485 font properties are used to select a font family and a specific font face
486 within that family to be used when rendering that text. As a simple
487 example, to use the bold form of Helvetica one could use:
489 <pre>body {
490 font-family: Helvetica;
491 font-weight: bold;
492 }</pre>
494 <p>Font resources may be installed locally on the system on which a user
495 agent is running or downloadable. For local font resources descriptive
496 information can be obtained directly from the font resource. For
497 downloadable font resources (sometimes referred to as web fonts), the
498 descriptive information is included with the reference to the font
499 resource.
501 <p>Families of fonts typically don't contain a single face for each
502 possible variation of font properties. The CSS font selection mechanism
503 describes how to match a given set of CSS font properties to a single font
504 face.
506 <h2 id=typography-background><span class=secno>2 </span>Typography
507 Background</h2>
509 <p><em>This section is non-normative.</em>
511 <p> Typographic traditions vary across the globe, so there is no unique way
512 to classify all fonts across languages and cultures. For even common Latin
513 letters, wide variations are possible:
515 <div class=figure><img alt="variations in glyphs for a single character"
516 src=aaaaaa.png>
517 <p class=caption>One character, many glyph variations
518 </div>
520 <p>Differences in the anatomy of letterforms is one way to distinguish
521 fonts. For Latin fonts, flourishes at the ends of a character's main
522 strokes, or serifs, can distinguish a font from those without. Similar
523 comparisons exist in non-Latin fonts between fonts with tapered strokes
524 and those using primarily uniform strokes:
526 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
527 <p class=caption>Letterforms with and without serifs
528 </div>
530 <div class=figure><img alt="serif vs. non-serifs for japanese"
531 src=minchovsgothic.png>
532 <p class=caption>Similar groupings for Japanese typefaces
533 </div>
535 <p>Fonts contain letterforms and the data needed to map characters to these
536 letterforms. Often this may be a simple one-to-one mapping, but more
537 complex mappings are also possible. The use of combining diacritic marks
538 creates many variations for an underlying letterform:
540 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
541 <p class=caption>Variations with diacritic marks
542 </div>
544 <p>A sequence of characters can be represented by a single glyph known as a
545 ligature:
547 <div class=figure><img alt="example of a fi ligature"
548 src=final-ligature.png>
549 <p class=caption>Ligature example
550 </div>
552 <p>Visual transformations based on textual context are often stylistic
553 option in European languages. They are required to correctly render
554 languages like Arabic, the lam and alef characters below <em>must</em> be
555 combined when they exist in sequence:
557 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
558 <p class=caption>Required Arabic ligature
559 </div>
561 <p>The relative complexity of these shaping transformations requires
562 additional data within the font.
564 <p>Sets of font faces with various stylistic variations are often grouped
565 together into font families. In the simplest case a regular face is
566 supplemented with bold and italic faces, but much more extensive groupings
567 are possible. Variations in the thickness of letterform strokes, the <dfn
568 id=weight>weight</dfn>, and the overall proportions of the letterform, the
569 <dfn id=width>width</dfn>, are most common. In the example below, each
570 letter uses a different font face within the Univers font family. The
571 width used increases from top to bottom and the weight increases from left
572 to right:
574 <div class=figure><img alt="various width and weight variations within a
575 single family" src=weightwidthvariations.png>
576 <p class=caption>Weight and width variations within a single font family
577 </div>
579 <p>Creating fonts that support multiple scripts is a difficult task;
580 designers need to understand the cultural traditions surrounding the use
581 of type in different scripts and come up with letterforms that somehow
582 share a common theme. Many languages often share a common script and each
583 of these languages may have noticeable stylistic differences. For example,
584 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
585 many languages, not just Russian.
587 <p>The <a href="#character-map"><em>character map</em></a> of a font
588 defines the mapping of characters to glyphs for that font. If a document
589 contains characters not supported by the <a href="#character-map"><em
590 title="character map">character maps</em></a> of the fonts contained in a
591 font family list, a user agent may use a <a
592 href="#system-font-fallback"><em>system font fallback</em></a> procedure
593 to locate an appropriate font that does. If no appropriate font can be
594 found, some form of "missing glyph" character will be rendered by the user
595 agent. System fallback can occur when the specified list of font families
596 does not include a font that supports a given character.
598 <p>Although the <a href="#character-map"><em>character map</em></a> of a
599 font maps a given character to a glyph for that character, modern font
600 technologies such as OpenType and AAT (Apple Advanced Typography) provide
601 ways of mapping a character to different glyphs based upon feature
602 settings. Fonts in these formats allow these features to be embedded in
603 the font itself and controlled by applications. Common typographic
604 features which can be specified this way include ligatures, swashes,
605 contextual alternates, proportional and tabular figures, and automatic
606 fractions, to list just a few. For a visual overview of OpenType features,
607 see the <a href="#OPENTYPE-FONT-GUIDE"
608 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
610 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
612 <p>The particular font face used to render a character is determined by the
613 font family and other font properties that apply to a given element. This
614 structure allows settings to be varied independent of each other.</p>
615 <!-- prop: font-family -->
617 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
618 href="#propdef-font-family">font-family</a> property</h3>
620 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
621 <tbody>
622 <tr>
623 <td>Name:
625 <td><dfn id=propdef-font-family
626 title="font-family!!property">font-family</dfn>
628 <tr>
629 <td>Value:
631 <td>[ <a href="#family-name-value"><var><family-name></var></a> |
632 <a href="#generic-family-value"><var><generic-family></var></a> ]
633 #
635 <tr>
636 <td>Initial:
638 <td>depends on user agent
640 <tr>
641 <td>Applies to:
643 <td>all elements
645 <tr>
646 <td>Inherited:
648 <td>yes
650 <tr>
651 <td>Percentages:
653 <td>N/A
655 <tr>
656 <td>Media:
658 <td>visual
660 <tr>
661 <td>Computed value:
663 <td>as specified
665 <tr>
666 <td>Animatable:
668 <td>no
669 </table>
671 <p>This property specifies a prioritized list of font family names or
672 generic family names. A font family defines a set of faces that vary in
673 weight, width or slope. CSS uses the combination of a family name with
674 other style attributes to select an individual face. Using this selection
675 mechanism, rather than selecting a face via the style name as is often
676 done in design applications, allows some degree of regularity in textual
677 display when fallback occurs.
679 <p class=note>Designers should note that the CSS definition of font
680 attributes used for selection are explicitly not intended to define a font
681 taxonomy. A type designer's idea of a family may often extend to a set of
682 faces that vary along axes other than just the standard axes of weight,
683 width and slope. A family may extend to include both a set of serif faces
684 and a set of sans-serif faces or vary along axes that are unique to that
685 family. The CSS font selection mechanism merely provides a way to
686 determine the “closest” substitute when substitution is necessary.
688 <p>Unlike other CSS properties, component values are a comma-separated list
689 indicating alternatives. A user agent iterates through the list of family
690 names until it matches an available font that contains a glyph for the
691 character to be rendered. This allows for differences in available fonts
692 across platforms and for differences in the range of characters supported
693 by individual fonts.
695 <p>A font family name only specifies a name given to a set of font faces,
696 it does not specify an individual face. For example, given the
697 availability of the fonts below, Futura would match but Futura Medium
698 would not:
700 <div class=figure><img alt="family and face names"
701 src=familyvsfacename.png>
702 <p class=caption>Family and individual face names
703 </div>
705 <p>Consider the example below:
707 <div class=example>
708 <pre>body {
709 font-family: Helvetica, Verdana, sans-serif;
710 }</pre>
712 <p>If Helvetica is available it will be used when rendering. If neither
713 Helvetica nor Verdana is present, then the user-agent-defined sans serif
714 font will be used.</p>
715 </div>
717 <p>There are two types of font family names:
719 <dl>
720 <dt><dfn id=family-name-value><var><family-name></var></dfn>
722 <dd>The name of a font family of choice such as Helvetica or Verdana in
723 the previous example.
725 <dt><dfn id=generic-family-value><var><generic-family></var></dfn>
727 <dd> The following generic family keywords are defined: ‘<a
728 href="#serif"><code class=property>serif</code></a>’, ‘<a
729 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
730 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
731 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
732 href="#monospace"><code class=property>monospace</code></a>’. These
733 keywords can be used as a general fallback mechanism when an author's
734 desired font choices are not available. As keywords, they must not be
735 quoted. Authors are encouraged to append a generic font family as a last
736 alternative for improved robustness.
737 </dl>
739 <p>Font family names other than generic families must either be given
740 quoted as <a
741 href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or
742 unquoted as a sequence of one or more <a
743 href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
744 This means most punctuation characters and digits at the start of each
745 token must be escaped in unquoted font family names.
747 <p>To illustrate this, the following declarations are invalid:
749 <pre>
750 font-family: Red/Black, sans-serif;
751 font-family: "Lucida" Grande, sans-serif;
752 font-family: Ahem!, sans-serif;
753 font-family: test@foo, sans-serif;
754 font-family: #POUND, sans-serif;
755 font-family: Hawaii 5-0, sans-serif;
756 </pre>
758 <p>If a sequence of identifiers is given as a font family name, the
759 computed value is the name converted to a string by joining all the
760 identifiers in the sequence by single spaces.
762 <p>To avoid mistakes in escaping, it is recommended to quote font family
763 names that contain white space, digits, or punctuation characters other
764 than hyphens:
766 <pre>
767 body { font-family: "New Century Schoolbook", serif }
769 <BODY STYLE="font-family: '21st Century', fantasy">
770 </pre>
772 <p>Font family <em>names</em> that happen to be the same as a keyword value
773 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
774 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
775 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
776 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
777 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
778 class=property>cursive</code></a>’) must be quoted to prevent confusion
779 with the keywords with the same names. The keywords ‘<code
780 class=property>initial</code>’ and ‘<code
781 class=property>default</code>’ are reserved for future use and must also
782 be quoted when used as font names. UAs must not consider these keywords as
783 matching the <a
784 href="#family-name-value"><var><family-name></var></a> type.
786 <p>The precise way a set of fonts are grouped into font families varies
787 depending upon the platform font management API's. The Windows GDI API
788 only allows four faces to be grouped into a family while the DirectWrite
789 API and API's on OSX and other platforms support font families with a
790 variety of weights, widths and slopes (see <a
791 href="#platform-props-to-css">Appendix A</a> for more details).
793 <p>Some font formats allow fonts to carry multiple localizations of the
794 family name. User agents must recognize and correctly match all of these
795 names independent of the underlying platform localization, system API used
796 or document encoding:
798 <div class=figure><img alt="examples of localized family names"
799 src=localizedfamilynames.png>
800 <p class=caption>Localized family names
801 </div>
803 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
804 families</h4>
806 <p>All five generic font families are defined to exist in all CSS
807 implementations (they need not necessarily map to five distinct actual
808 fonts). User agents should provide reasonable default choices for the
809 generic font families, which express the characteristics of each family as
810 well as possible within the limits allowed by the underlying technology.
811 User agents are encouraged to allow users to select alternative choices
812 for the generic fonts.
814 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
815 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
817 <p>Serif fonts represent the formal text style for a script. This often
818 means but is not limited to glyphs that have finishing strokes, flared or
819 tapering ends, or have actual serifed endings (including slab serifs).
820 Serif fonts are typically proportionately-spaced. They often display a
821 greater variation between thick and thin strokes than fonts from the ‘<a
822 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
823 font family. CSS uses the term ‘<a href="#serif"><code
824 class=property>serif</code></a>’ to apply to a font for any script,
825 although other names may be more familiar for particular scripts, such as
826 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
827 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
828 class=property>serif</code></a>’ more due to its typographic role rather
829 than its actual design style. Any font that is so described may be used to
830 represent the generic ‘<a href="#serif"><code
831 class=property>serif</code></a>’ family.
833 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
834 <p class=caption>Sample serif fonts
835 </div>
837 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
838 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
839 id=sans-serif>sans-serif</dfn></a></span></h5>
841 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
842 low contrast (vertical and horizontal stems have the close to the same
843 thickness) and have stroke endings that are plain -- without any flaring,
844 cross stroke, or other ornamentation. Sans-serif fonts are typically
845 proportionately-spaced. They often have little variation between thick and
846 thin strokes, compared to fonts from the ‘<a href="#serif"><code
847 class=property>serif</code></a>’ family. CSS uses the term ‘<a
848 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
849 to a font for any script, although other names may be more familiar for
850 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
851 (Korean). Any font that is so described may be used to represent the
852 generic ‘<a href="#sans-serif"><code
853 class=property>sans-serif</code></a>’ family.
855 <div class=figure><img alt="sample sans-serif fonts"
856 src=sansserifexamples.png>
857 <p class=caption>Sample sans-serif fonts
858 </div>
860 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
861 title="cursive, definition of"> <a name=cursive-def><dfn
862 id=cursive>cursive</dfn></a></span></h5>
864 <p>Glyphs in cursive fonts generally use a more informal script style, and
865 the result looks more like handwritten pen or brush writing than printed
866 letterwork. CSS uses the term ‘<a href="#cursive"><code
867 class=property>cursive</code></a>’ to apply to a font for any script,
868 although other names such as Chancery, Brush, Swing and Script are also
869 used in font names.
871 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
872 <p class=caption>Sample cursive fonts
873 </div>
875 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
876 title="fantasy, definition of"> <a name=fantasy-def><dfn
877 id=fantasy>fantasy</dfn></a></span></h5>
879 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
880 playful representations of characters. These do not include Pi or Picture
881 fonts which do not represent actual characters.
883 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
884 <p class=caption>Sample fantasy fonts
885 </div>
887 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
888 title="monospace, definition of"> <a name=monospace-def><dfn
889 id=monospace>monospace</dfn></a></span></h5>
891 <p>The sole criterion of a monospace font is that all glyphs have the same
892 fixed width. This is often used to render samples of computer code.
894 <div class=figure><img alt="sample monospace fonts"
895 src=monospaceexamples.png>
896 <p class=caption>Sample monospace fonts
897 </div>
898 <!-- prop: font-weight -->
900 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
901 href="#propdef-font-weight">font-weight</a> property</h3>
903 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
904 <tbody>
905 <tr>
906 <td>Name:
908 <td><dfn id=propdef-font-weight
909 title="font-weight!!property">font-weight</dfn>
911 <tr>
912 <td>Value:
914 <td><a href="#font-weight-normal-value"
915 title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
916 href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
917 href="#font-weight-numeric-values" title="100...900 weight
918 values">100</a> | <a href="#font-weight-numeric-values"
919 title="100...900 weight values">200</a> | <a
920 href="#font-weight-numeric-values" title="100...900 weight
921 values">300</a> | <a href="#font-weight-numeric-values"
922 title="100...900 weight values">400</a> | <a
923 href="#font-weight-numeric-values" title="100...900 weight
924 values">500</a> | <a href="#font-weight-numeric-values"
925 title="100...900 weight values">600</a> | <a
926 href="#font-weight-numeric-values" title="100...900 weight
927 values">700</a> | <a href="#font-weight-numeric-values"
928 title="100...900 weight values">800</a> | <a
929 href="#font-weight-numeric-values" title="100...900 weight
930 values">900</a>
932 <tr>
933 <td>Initial:
935 <td>normal
937 <tr>
938 <td>Applies to:
940 <td>all elements
942 <tr>
943 <td>Inherited:
945 <td>yes
947 <tr>
948 <td>Percentages:
950 <td>N/A
952 <tr>
953 <td>Media:
955 <td>visual
957 <tr>
958 <td>Computed value:
960 <td>numeric weight value (see description)
962 <tr>
963 <td>Animatable:
965 <td>as <a
966 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
967 weight</a>
968 </table>
970 <p>The <a href="#propdef-font-weight"
971 title="font-weight!!property">‘<code
972 class=property>font-weight</code>’</a> property specifies the weight of
973 glyphs in the font, their degree of blackness or stroke thickness.
975 <p>Values have the following meanings:
977 <dl>
978 <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
979 to 900</dfn>
981 <dd>These values form an ordered sequence, where each number indicates a
982 weight that is at least as dark as its predecessor. These roughly
983 correspond to the commonly used weight names below:
984 </dl>
986 <ul>
987 <li>100 - Thin
989 <li>200 - Extra Light (Ultra Light)
991 <li>300 - Light
993 <li>400 - Normal
995 <li>500 - Medium
997 <li>600 - Semi Bold (Demi Bold)
999 <li>700 - Bold
1001 <li>800 - Extra Bold (Ultra Bold)
1003 <li>900 - Black (Heavy)
1004 </ul>
1006 <dl>
1007 <dt><dfn id=font-weight-normal-value
1008 title="normal!!font-weight">normal</dfn>
1010 <dd>Same as ‘<code class=css>400</code>’.
1012 <dt><dfn id=bold>bold</dfn>
1014 <dd>Same as ‘<code class=css>700</code>’.
1016 <dt><dfn id=bolder>bolder</dfn>
1018 <dd>Specifies a bolder weight than the inherited value.
1020 <dt><dfn id=lighter>lighter</dfn>
1022 <dd>Specifies a lighter weight than the inherited value.
1023 </dl>
1025 <p>Font formats that use a scale other than a nine-step scale should map
1026 their scale onto the CSS scale so that 400 roughly corresponds with a face
1027 that would be labeled as Regular, Book, Roman and 700 roughly matches a
1028 face that would be labeled as Bold. Or weights may be inferred from the
1029 style names, ones that correspond roughly with the scale above. The scale
1030 is relative, so a face with a larger weight value must never appear
1031 lighter. If style names are used to infer weights, care should be taken to
1032 handle variations in style names across locales.
1034 <p>Quite often there are only a few weights available for a particular font
1035 family. When a weight is specified for which no face exists, a face with a
1036 nearby weight is used. In general, bold weights map to faces with heavier
1037 weights and light weights map to faces with lighter weights (see the <a
1038 href="#font-matching-algorithm">font matching section below</a> for a
1039 precise definition). The examples here illustrate which face is used for
1040 different weights, grey indicates a face for that weight does not exist so
1041 a face with a nearby weight is used:
1043 <div class=figure><img alt="weight mappings for a family with 400, 700 and
1044 900 weights" src=optimaweights.png>
1045 <p class=caption>Weight mappings for a font family with 400, 700 and 900
1046 weight faces
1047 </div>
1049 <div class=figure><img alt="weight mappings for a family with 300, 600
1050 weights" src=hiraginoweights.png>
1051 <p class=caption>Weight mappings for a font family with 300 and 600 weight
1052 faces
1053 </div>
1055 <p>Although the practice is not well-loved by typographers, bold faces are
1056 often synthesized by user agents for faces that lack actual bold faces.
1057 For the purposes of style matching, these faces must be treated as if they
1058 exist within the family. Authors can explicitly avoid this behavior by
1059 using the ‘<a href="#propdef-font-synthesis"><code
1060 class=property>font-synthesis</code></a>’ property.
1062 <p>Specified values of ‘<a href="#bolder"><code
1063 class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
1064 class=property>lighter</code></a>’ indicate weights relative to the
1065 weight of the parent element. The computed weight is calculated based on
1066 the inherited <a href="#propdef-font-weight"
1067 title="font-weight!!property">‘<code
1068 class=property>font-weight</code>’</a> value using the chart below.
1070 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
1071 <thead>
1072 <tr>
1073 <th>Inherited value
1075 <th>bolder
1077 <th>lighter
1079 <tbody>
1080 <tr>
1081 <th>100
1083 <td>400
1085 <td>100
1087 <tr>
1088 <th>200
1090 <td>400
1092 <td>100
1094 <tr>
1095 <th>300
1097 <td>400
1099 <td>100
1101 <tr>
1102 <th>400
1104 <td>700
1106 <td>100
1108 <tr>
1109 <th>500
1111 <td>700
1113 <td>100
1115 <tr>
1116 <th>600
1118 <td>900
1120 <td>400
1122 <tr>
1123 <th>700
1125 <td>900
1127 <td>400
1129 <tr>
1130 <th>800
1132 <td>900
1134 <td>700
1136 <tr>
1137 <th>900
1139 <td>900
1141 <td>700
1142 </table>
1144 <p>The table above is equivalent to selecting the next relative bolder or
1145 lighter face, given a font family containing normal and bold faces along
1146 with a thin and a heavy face. Authors who desire finer control over the
1147 exact weight values used for a given element may use numerical values
1148 instead of relative weights.</p>
1149 <!-- prop: font-stretch -->
1151 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
1152 href="#propdef-font-stretch">font-stretch</a> property</h3>
1154 <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
1155 <tbody>
1156 <tr>
1157 <td>Name:
1159 <td><dfn id=propdef-font-stretch
1160 title="font-stretch!!property">font-stretch</dfn>
1162 <tr>
1163 <td>Value:
1165 <td> <a href="#font-stretch-normal-value"
1166 title="normal!!font-stretch">normal</a> | <a
1167 href="#ultra-condensed">ultra-condensed</a> | <a
1168 href="#extra-condensed">extra-condensed</a> | <a
1169 href="#condensed">condensed</a> | <a
1170 href="#semi-condensed-">semi-condensed</a> | <a
1171 href="#semi-expanded">semi-expanded</a> | <a
1172 href="#expanded">expanded</a> | <a
1173 href="#extra-expanded">extra-expanded</a> | <a
1174 href="#ultra-expanded">ultra-expanded</a>
1176 <tr>
1177 <td>Initial:
1179 <td>normal
1181 <tr>
1182 <td>Applies to:
1184 <td>all elements
1186 <tr>
1187 <td>Inherited:
1189 <td>yes
1191 <tr>
1192 <td>Percentages:
1194 <td>N/A
1196 <tr>
1197 <td>Media:
1199 <td>visual
1201 <tr>
1202 <td>Computed value:
1204 <td>as specified
1206 <tr>
1207 <td>Animatable:
1209 <td>as <a href="#font-stretch-animation">font stretch</a>
1210 </table>
1212 <p>The <a href="#propdef-font-stretch"
1213 title="font-stretch!!property">‘<code
1214 class=property>font-stretch</code>’</a> property selects a normal,
1215 condensed, or expanded face from a font family. Absolute keyword values
1216 have the following ordering, from narrowest to widest:
1218 <ul>
1219 <li><dfn id=ultra-condensed>ultra-condensed</dfn>
1221 <li><dfn id=extra-condensed>extra-condensed</dfn>
1223 <li><dfn id=condensed>condensed</dfn>
1225 <li><dfn id=semi-condensed->semi-condensed </dfn>
1227 <li><dfn id=font-stretch-normal-value
1228 title="normal!!font-stretch">normal</dfn>
1230 <li><dfn id=semi-expanded>semi-expanded</dfn>
1232 <li><dfn id=expanded>expanded</dfn>
1234 <li><dfn id=extra-expanded>extra-expanded</dfn>
1236 <li><dfn id=ultra-expanded>ultra-expanded</dfn>
1237 </ul>
1239 <p>When a face does not exist for a given width, normal or condensed values
1240 map to a narrower face, otherwise a wider face. Conversely, expanded
1241 values map to a wider face, otherwise a narrower face. The figure below
1242 shows how the nine font-stretch property settings affect font selection
1243 for font family containing a variety of widths, grey indicates a width for
1244 which no face exists and a different width is substituted:
1246 <div class=figure><img alt="width mappings for a family with condensed,
1247 normal and expanded faces" src=universwidths.png>
1248 <p class=caption>Width mappings for a font family with condensed, normal
1249 and expanded width faces
1250 </div>
1252 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
1253 interpolated in discrete steps. The interpolation happens as though the
1254 ordered values are equally spaced real numbers. The interpolation result
1255 is rounded to the nearest value, with values exactly halfway between two
1256 values rounded towards the later value in the list above.</p>
1257 <!-- prop: font-style -->
1259 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
1260 href="#propdef-font-style">font-style</a> property</h3>
1262 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
1263 <tbody>
1264 <tr>
1265 <td>Name:
1267 <td><dfn id=propdef-font-style
1268 title="font-style!!property">font-style</dfn>
1270 <tr>
1271 <td>Value:
1273 <td><a href="#font-style-normal-value"
1274 title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
1275 <a href="#oblique">oblique</a>
1277 <tr>
1278 <td>Initial:
1280 <td>normal
1282 <tr>
1283 <td>Applies to:
1285 <td>all elements
1287 <tr>
1288 <td>Inherited:
1290 <td>yes
1292 <tr>
1293 <td>Percentages:
1295 <td>N/A
1297 <tr>
1298 <td>Media:
1300 <td>visual
1302 <tr>
1303 <td>Computed value:
1305 <td>as specified
1307 <tr>
1308 <td>Animatable:
1310 <td>no
1311 </table>
1313 <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
1314 class=property>font-style</code>’</a> property allows italic or oblique
1315 faces to be selected. Italic forms are generally cursive in nature while
1316 oblique faces are typically sloped versions of the regular face. Oblique
1317 faces can be simulated by artificially sloping the glyphs of the regular
1318 face. Compare the artificially sloped renderings of Palatino ‘<code
1319 class=property>a</code>’ and Baskerville ‘<code
1320 class=property>N</code>’ in grey with the actual italic versions:
1322 <div class=figure><img alt="artificial sloping vs. real italics"
1323 src=realvsfakeitalics.png>
1324 <p class=caption>Artificial sloping versus real italics
1325 </div>
1327 <p>Values have the following meanings:
1329 <dl>
1330 <dt><dfn id=font-style-normal-value
1331 title="normal!!font-style">normal</dfn>
1333 <dd>selects a face that is classified as a normal face, one that is
1334 neither italic or obliqued
1336 <dt><dfn id=italic>italic</dfn>
1338 <dd>selects a font that is labeled as an italic face, or an oblique face
1339 if one is not
1341 <dt><dfn id=oblique>oblique</dfn>
1343 <dd>selects a font that is labeled as an oblique face, or an italic face
1344 if one is not
1345 </dl>
1347 <p>If no italic or oblique face is available, oblique faces can be
1348 synthesized by rendering non-obliqued faces with an artificial obliquing
1349 operation. The use of these artificially obliqued faces can be disabled
1350 using the ‘<a href="#propdef-font-synthesis"><code
1351 class=property>font-synthesis</code></a>’ property. The details of the
1352 obliquing operation are not explicitly defined.</p>
1353 <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
1355 <p>Many scripts lack the tradition of mixing a cursive form within text
1356 rendered with a normal face. Chinese, Japanese and Korean fonts almost
1357 always lack italic or oblique faces. Fonts that support a mixture of
1358 scripts will sometimes omit specific scripts such as Arabic from the set
1359 of glyphs supported in the italic face. User agents should be careful
1360 about making <a href="#character-map"><em>character map</em></a>
1361 assumptions across faces when implementing support for <a
1362 href="#system-font-fallback"><em>system font fallback</em></a>.</p>
1363 <!-- prop: font-size -->
1365 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
1366 href="#propdef-font-size">font-size</a> property</h3>
1368 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
1369 <tbody>
1370 <tr>
1371 <td>Name:
1373 <td><dfn id=propdef-font-size>font-size</dfn>
1375 <tr>
1376 <td>Value:
1378 <td><a href="#absolute-size-value"><var><absolute-size></var></a>
1379 | <a href="#relative-size-value"><var><relative-size></var></a> |
1380 <a href="#length-size-value"><var><length></var></a> | <a
1381 href="#percentage-size-value"><var><percentage></var></a>
1383 <tr>
1384 <td>Initial:
1386 <td>medium
1388 <tr>
1389 <td>Applies to:
1391 <td>all elements
1393 <tr>
1394 <td>Inherited:
1396 <td>yes
1398 <tr>
1399 <td>Percentages:
1401 <td>refer to parent element's font size
1403 <tr>
1404 <td>Media:
1406 <td>visual
1408 <tr>
1409 <td>Computed value:
1411 <td>absolute length
1413 <tr>
1414 <td>Animatable:
1416 <td>as <a
1417 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
1418 </table>
1420 <p>This property indicates the desired height of glyphs from the font. For
1421 scalable fonts, the font-size is a scale factor applied to the EM unit of
1422 the font. (Note that certain glyphs may bleed outside their EM box.) For
1423 non-scalable fonts, the font-size is converted into absolute units and
1424 matched against the declared font-size of the font, using the same
1425 absolute coordinate space for both of the matched values. Values have the
1426 following meanings:
1428 <dl>
1429 <dt><dfn id=absolute-size-value><var><absolute-size></var></dfn>
1431 <dd> An <a
1432 href="#absolute-size-value"><var><absolute-size></var></a> keyword
1433 refers to an entry in a table of font sizes computed and kept by the user
1434 agent. Possible values are:
1435 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
1437 <dt><dfn id=relative-size-value><var><relative-size></var></dfn>
1439 <dd> A <a href="#relative-size-value"><var><relative-size></var></a>
1440 keyword is interpreted relative to the table of font sizes and the
1441 computed ‘<a href="#propdef-font-size"><code
1442 class=property>font-size</code></a>’ of the parent element. Possible
1443 values are:
1444 <p> [ larger | smaller ]
1446 <p> For example, if the parent element has a font size of ‘<code
1447 class=property>medium</code>’, a value of ‘<code
1448 class=property>larger</code>’ will make the font size of the current
1449 element be ‘<code class=property>large</code>’. If the parent
1450 element's size is not close to a table entry, the user agent is free to
1451 interpolate between table entries or round off to the closest one. The
1452 user agent may have to extrapolate table values if the numerical value
1453 goes beyond the keywords.
1455 <dt><dfn id=length-size-value><var><length></var></dfn>
1457 <dd>A length value specifies an absolute font size (independent of the
1458 user agent's font table). Negative lengths are illegal.
1460 <dt><dfn id=percentage-size-value><var><percentage></var></dfn>
1462 <dd>A percentage value specifies an absolute font size relative to the
1463 parent element's font size. Use of percentage values, or values in
1464 ‘<code class=property>em</code>’s, leads to more robust and
1465 cascadable style sheets.
1466 </dl>
1468 <p>The following table provides user agent guidelines for the absolute-size
1469 scaling factor and their mapping to HTML heading and absolute font-sizes.
1470 The ‘<code class=property>medium</code>’ value is used as the
1471 reference middle value. The user agent may fine-tune these values for
1472 different fonts or different types of display devices.
1474 <table class=data>
1475 <thead>
1476 <tr>
1477 <th>CSS absolute-size values
1479 <th>xx-small
1481 <th>x-small
1483 <th>small
1485 <th>medium
1487 <th>large
1489 <th>x-large
1491 <th>xx-large
1493 <th>
1495 <tbody>
1496 <tr>
1497 <th>scaling factor
1499 <td>3/5
1501 <td>3/4
1503 <td>8/9
1505 <td>1
1507 <td>6/5
1509 <td>3/2
1511 <td>2/1
1513 <td>3/1
1515 <tr>
1516 <th>HTML headings
1518 <td>h6
1520 <td>
1522 <td>h5
1524 <td>h4
1526 <td>h3
1528 <td>h2
1530 <td>h1
1532 <td>
1534 <tr>
1535 <th>HTML font sizes
1537 <td>1
1539 <td>
1541 <td>2
1543 <td>3
1545 <td>4
1547 <td>5
1549 <td>6
1551 <td>7
1552 </table>
1554 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
1555 applying these guidelines should nevertheless avoid creating font-size
1556 resulting in less than 9 device pixels per EM unit on a computer
1557 display.</em>
1559 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
1560 factor between adjacent indexes was 1.5 which user experience proved to be
1561 too large. In CSS2, the suggested scaling factor for computer screen
1562 between adjacent indexes was 1.2 which still created issues for the small
1563 sizes. The new scaling factor varies between each index to provide a
1564 better readability.</em>
1566 <p>The actual value of this property may differ from the computed value due
1567 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
1568 class=property>font-size-adjust</code></a>’ and the unavailability of
1569 certain font sizes.
1571 <p>Child elements inherit the computed <a class=noxref
1572 href="#font-size-prop"> <span class=property>‘<code
1573 class=property>font-size</code>’</span></a> value (otherwise, the effect
1574 of <a class=noxref href="#font-size-adjust-prop"><span
1575 class=property>‘<code
1576 class=property>font-size-adjust</code>’</span></a> would compound).
1578 <div class=example>
1579 <p style="display:none">Example(s):</p>
1581 <pre>p { font-size: 12pt; }
1582 blockquote { font-size: larger }
1583 em { font-size: 150% }
1584 em { font-size: 1.5em }
1585 </pre>
1586 </div>
1587 <!-- prop: font-size-adjust -->
1589 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
1590 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
1592 <table class=propdef id=namefont-size-adjustvaluenone-ltnumbergt>
1593 <tbody>
1594 <tr>
1595 <td>Name:
1597 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
1599 <tr>
1600 <td>Value:
1602 <td><a href="#font-size-adjust-none-value"
1603 title="none!!font-size-adjust">none</a> | <a
1604 href="#aspect-ratio-value"><var><number></var></a>
1606 <tr>
1607 <td>Initial:
1609 <td>none
1611 <tr>
1612 <td>Applies to:
1614 <td>all elements
1616 <tr>
1617 <td>Inherited:
1619 <td>yes
1621 <tr>
1622 <td>Percentages:
1624 <td>N/A
1626 <tr>
1627 <td>Media:
1629 <td>visual
1631 <tr>
1632 <td>Computed value:
1634 <td>as specified
1636 <tr>
1637 <td>Animatable:
1639 <td>as <a
1640 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
1641 </table>
1643 <p>For any given font size, the apparent size and legibility of text varies
1644 across fonts. For scripts such as Latin or Cyrillic that distinguish
1645 between upper and lowercase letters, the relative height of lowercase
1646 letters compared to their uppercase counterparts is a determining factor
1647 of legibility. This is commonly referred to as the <a class=index-def
1648 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
1649 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
1650 the x-height of a font divided by the font size.
1652 <p>In situations where font fallback occurs, fallback fonts may not share
1653 the same aspect ratio as the desired font family and will thus appear less
1654 readable. The ‘<a href="#propdef-font-size-adjust"><code
1655 class=property>font-size-adjust</code></a>’ property is a way to
1656 preserve the readability of text when font fallback occurs. It does this
1657 by adjusting the font-size so that the x-height is the same regardless of
1658 the font used.
1660 <div class=example>
1661 <p>The style defined below defines Verdana as the desired font family, but
1662 if Verdana is not available Futura or Times will be used.</p>
1664 <pre>p {
1665 font-family: Verdana, Futura, Times;
1666 }
1668 <p>Lorem ipsum dolor sit amet, ...</p>
1669 </pre>
1671 <p>Verdana has a relatively high aspect ratio, lowercase letters are
1672 relatively tall compared to uppercase letters, so at small sizes text
1673 appears legible. Times has a lower aspect ratio and so if fallback
1674 occurs, the text will be less legible at small sizes than Verdana.</p>
1675 </div>
1677 <p>How text rendered in each of these fonts compares is shown below, the
1678 columns show text rendered in Verdana, Futura and Times. The same
1679 font-size value is used across cells within each row and red lines are
1680 included to show the differences in x-height. In the upper half each row
1681 is rendered in the same font-size value. The same is true for the lower
1682 half but in this half the ‘<a href="#propdef-font-size-adjust"><code
1683 class=property>font-size-adjust</code></a>’ property is also set so that
1684 the actual font size is adjusted to preserve the x-height across each row.
1685 Note how small text remains relatively legible across each row in the
1686 lower half.
1688 <div class=figure><img alt="text with and without 'font-size-adjust'"
1689 src=fontsizeadjust.png>
1690 <p class=caption>Text with and without the use of ‘<a
1691 href="#propdef-font-size-adjust"><code
1692 class=property>font-size-adjust</code></a>’
1693 </div>
1695 <p>This property allows authors to specify an <a
1696 href="#aspect-value"><i>aspect value</i></a> for an element that will
1697 effectively preserve the x-height of the first choice font, whether it is
1698 substituted or not. Values have the following meanings:
1700 <dl>
1701 <dt><dfn id=font-size-adjust-none-value
1702 title="none!!font-size-adjust">none</dfn>
1704 <dd>Do not preserve the font's x-height.
1706 <dt><dfn id=aspect-ratio-value><var><number></var></dfn>
1708 <dd>Specifies the <a href="#aspect-value"><i>aspect value</i></a> used in
1709 the calculation below to calculate the adjusted font size:
1710 <pre>c = ( a / a' ) s
1711 </pre>
1713 <p>where:</p>
1715 <pre>s = font-size value
1716 a = <a href="#aspect-value"><i>aspect value</i></a> as specified by the 'font-size-adjust' property
1717 a' = <a href="#aspect-value"><i>aspect value</i></a> of actual font
1718 c = adjusted font-size to use
1719 </pre>
1721 <p>This value applies to any font that is selected but in typical usage
1722 it should be based on the <a href="#aspect-value"><i>aspect
1723 value</i></a> of the first font in the font-family list. If this is
1724 specified accurately, the <tt>(a/a')</tt> term in the formula above is
1725 effectively 1 for the first font and no adjustment occurs. If the value
1726 is specified inaccurately, text rendered using the first font in the
1727 family list will display differently in older user agents that don't
1728 support ‘<a href="#propdef-font-size-adjust"><code
1729 class=property>font-size-adjust</code></a>’.</p>
1730 </dl>
1732 <p>The value of ‘<a href="#propdef-font-size-adjust"><code
1733 class=property>font-size-adjust</code></a>’ affects the used value of
1734 ‘<a href="#propdef-font-size"><code
1735 class=property>font-size</code></a>’ but does not affect the computed
1736 value. It affects the size of relative units that are based on font
1737 metrics of the <a href="#first-available-font"><i>first available
1738 font</i></a> such as <code>ex</code> and <code>ch</code> but does not
1739 affect the size of <code>em</code> units. Since numeric values of <a
1740 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1741 class=property>line-height</code>’</a> refer to the computed size of
1742 ‘<a href="#propdef-font-size"><code
1743 class=property>font-size</code></a>’, ‘<a
1744 href="#propdef-font-size-adjust"><code
1745 class=property>font-size-adjust</code></a>’ does not affect the used
1746 value of <a
1747 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1748 class=property>line-height</code>’</a>.
1750 <p class=note>In CSS, authors often specify <a
1751 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1752 class=property>line-height</code>’</a> as a multiple of the ‘<a
1753 href="#propdef-font-size"><code class=property>font-size</code></a>’.
1754 Since the ‘<a href="#propdef-font-size-adjust"><code
1755 class=property>font-size-adjust</code></a>’ property affects the used
1756 value of ‘<a href="#propdef-font-size"><code
1757 class=property>font-size</code></a>’, authors should take care setting
1758 the line height when ‘<a href="#propdef-font-size-adjust"><code
1759 class=property>font-size-adjust</code></a>’ is used. Setting the line
1760 height too tightly can result in overlapping lines of text in this
1761 situation.
1763 <p>Authors can calculate the <a href="#aspect-value"><i>aspect
1764 value</i></a> for a given font by comparing spans with the same content
1765 but different ‘<a href="#propdef-font-size-adjust"><code
1766 class=property>font-size-adjust</code></a>’ properties. If the same
1767 font-size is used, the spans will match when the ‘<a
1768 href="#propdef-font-size-adjust"><code
1769 class=property>font-size-adjust</code></a>’ value is accurate for the
1770 given font.
1772 <div class=example>
1773 <p>Two spans with borders are used to determine the <a
1774 href="#aspect-value"><i>aspect value</i></a> of a font. The ‘<a
1775 href="#propdef-font-size"><code class=property>font-size</code></a>’ is
1776 the same for both spans but the ‘<a
1777 href="#propdef-font-size-adjust"><code
1778 class=property>font-size-adjust</code></a>’ property is specified only
1779 for the right span. Starting with a value of 0.5, the aspect value can be
1780 adjusted until the borders around the two letters line up.</p>
1782 <pre>p {
1783 font-family: Futura;
1784 font-size: 500px;
1785 }
1787 span {
1788 border: solid 1px red;
1789 }
1791 .adjust {
1792 font-size-adjust: 0.5;
1793 }
1795 <p><span>b</span><span class="adjust">b</span></p>
1796 </pre>
1798 <div class=figure><img alt="Futura with an <i>aspect value</i> of 0.5"
1799 src=beforefontsizeadjust.png>
1800 <p class=caption>Futura with an <a href="#aspect-value"><i>aspect
1801 value</i></a> of 0.5
1802 </div>
1804 <p>The box on the right is a bit bigger than the one on the left, so the
1805 <a href="#aspect-value"><i>aspect value</i></a> of this font is something
1806 less than 0.5. Adjust the value until the boxes align.</p>
1807 </div>
1808 <!-- prop: font -->
1810 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
1811 <a href="#propdef-font">font</a> property</h3>
1813 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
1814 <tbody>
1815 <tr>
1816 <td>Name:
1818 <td><dfn id=propdef-font>font</dfn>
1820 <tr>
1821 <td>Value:
1823 <td>[ [ <var><<a href="#propdef-font-style"
1824 title="font-style!!property">‘<code
1825 class=property>font-style</code>’</a>></var> || <a
1826 href="#font-variant-css21-values"><var><font-variant-css21></var></a>
1827 || <var><<a href="#propdef-font-weight"
1828 title="font-weight!!property">‘<code
1829 class=property>font-weight</code>’</a>></var> || <var><<a
1830 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
1831 class=property>font-stretch</code>’</a></var> ]? <var><‘<a
1832 href="#propdef-font-size"><code
1833 class=property>font-size</code></a>’></var> [ / <var><‘<code
1834 class=property>line-height</code>’></var> ]? <var><<a
1835 href="#propdef-font-family" title="font-family!!property">‘<code
1836 class=property>font-family</code>’</a>></var> ] | caption | icon |
1837 menu | message-box | small-caption | status-bar
1839 <tr>
1840 <td>Initial:
1842 <td>see individual properties
1844 <tr>
1845 <td>Applies to:
1847 <td>all elements
1849 <tr>
1850 <td>Inherited:
1852 <td>yes
1854 <tr>
1855 <td>Percentages:
1857 <td>see individual properties
1859 <tr>
1860 <td>Media:
1862 <td>visual
1864 <tr>
1865 <td>Computed value:
1867 <td>see individual properties
1869 <tr>
1870 <td>Animatable:
1872 <td>see individual properties
1873 </table>
1875 <p>The <span class=property>‘<a href="#propdef-font"><code
1876 class=property>font</code></a>’</span> property is, except as described
1877 below, a shorthand property for setting <a href="#propdef-font-style"
1878 title="font-style!!property">‘<code
1879 class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
1880 title="font-variant!!property">‘<code
1881 class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
1882 title="font-weight!!property">‘<code
1883 class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
1884 title="font-stretch!!property">‘<code
1885 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1886 href="#propdef-font-size"><code
1887 class=property>font-size</code></a>’</span>, <a class=property
1888 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1889 class=property>line-height</code>’</a>, <a href="#propdef-font-family"
1890 title="font-family!!property">‘<code
1891 class=property>font-family</code>’</a> at the same place in the
1892 stylesheet. Values for the <a href="#propdef-font-variant"
1893 title="font-variant!!property">‘<code
1894 class=property>font-variant</code>’</a> property may also be included
1895 but only those supported in CSS 2.1, none of the <a
1896 href="#propdef-font-variant" title="font-variant!!property">‘<code
1897 class=property>font-variant</code>’</a> values added in this
1898 specification can be used in the <span class=property>‘<a
1899 href="#propdef-font"><code class=property>font</code></a>’</span>
1900 shorthand:
1902 <pre
1903 class=prod><dfn id=font-variant-css21-values><var><font-variant-css21></var></dfn> = [normal | small-caps]</pre>
1905 <p>The syntax of this property is based on a traditional typographical
1906 shorthand notation to set multiple properties related to fonts.
1908 <p>All subproperties of the ‘<a href="#propdef-font"><code
1909 class=property>font</code></a>’ property are first reset to their
1910 initial values, including those listed above plus <span
1911 class=property>‘<a href="#propdef-font-size-adjust"><code
1912 class=property>font-size-adjust</code></a>’</span>, <span
1913 class=property>‘<a href="#propdef-font-kerning"><code
1914 class=property>font-kerning</code></a>’</span>, subproperties of <a
1915 href="#propdef-font-variant" title="font-variant!!property">‘<code
1916 class=property>font-variant</code>’</a> and and <span>‘<a
1917 href="#propdef-font-language-override"><code
1918 class=property>font-language-override</code></a>’</span>. Then, those
1919 properties that are given explicit values in the <span
1920 class=property>‘<a href="#propdef-font"><code
1921 class=property>font</code></a>’</span> shorthand are set to those
1922 values. For a definition of allowed and initial values, see the previously
1923 defined properties. For reasons of backwards compatibility, it is not
1924 possible to set <span class=property>‘<a
1925 href="#propdef-font-size-adjust"><code
1926 class=property>font-size-adjust</code></a>’</span> to anything other
1927 than its initial value using the <span class=property>‘<a
1928 href="#propdef-font"><code class=property>font</code></a>’</span>
1929 shorthand property; instead, use the individual property.
1931 <div class=example>
1932 <p style="display:none">Example(s):</p>
1934 <pre>p { font: 12pt/14pt sans-serif }
1935 p { font: 80% sans-serif }
1936 p { font: x-large/110% "new century schoolbook", serif }
1937 p { font: bold italic large Palatino, serif }
1938 p { font: normal small-caps 120%/120% fantasy }
1939 p { font: condensed oblique 12pt "Helvetica Neue", serif; }
1940 </pre>
1942 <p> In the second rule, the font size percentage value (‘<code
1943 class=css>80%</code>’) refers to the computed ‘<a
1944 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
1945 the parent element. In the third rule, the line height percentage
1946 (‘<code class=css>110%</code>’) refers to the font size of the
1947 element itself.
1949 <p>The first three rules do not specify the <a
1950 href="#propdef-font-variant" title="font-variant!!property">‘<code
1951 class=property>font-variant</code>’</a> and <a
1952 href="#propdef-font-weight" title="font-weight!!property">‘<code
1953 class=property>font-weight</code>’</a> explicitly, so these properties
1954 receive their initial values (<span title="normal value">‘<code
1955 class=property>normal</code>’</span>). Notice that the font family name
1956 "new century schoolbook", which contains spaces, is enclosed in quotes.
1957 The fourth rule sets the <a href="#propdef-font-weight"
1958 title="font-weight!!property">‘<code
1959 class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
1960 class=property>bold</code></a>’, the <a href="#propdef-font-style"
1961 title="font-style!!property">‘<code
1962 class=property>font-style</code>’</a> to ‘<a href="#italic"><code
1963 class=property>italic</code></a>’, and implicitly sets <a
1964 href="#propdef-font-variant" title="font-variant!!property">‘<code
1965 class=property>font-variant</code>’</a> to <a
1966 href="#font-variant-normal-value" title="normal!!font-variant">‘<code
1967 class=property>normal</code>’</a>.
1969 <p> The fifth rule sets the <a href="#propdef-font-variant"
1970 title="font-variant!!property">‘<code
1971 class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
1972 class=property>small-caps</code></a>’), the <span class=property>‘<a
1973 href="#propdef-font-size"><code
1974 class=property>font-size</code></a>’</span> (120% of the parent's font
1975 size), the <a class=property
1976 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1977 class=property>line-height</code>’</a> (120% of the font size) and the
1978 <a href="#propdef-font-family" title="font-family!!property">‘<code
1979 class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
1980 class=property>fantasy</code></a>’). It follows that the keyword <span
1981 title="normal value">‘<code class=property>normal</code>’</span>
1982 applies to the two remaining properties: <a href="#propdef-font-style"
1983 title="font-style!!property">‘<code
1984 class=property>font-style</code>’</a> and <a
1985 href="#propdef-font-weight" title="font-weight!!property">‘<code
1986 class=property>font-weight</code>’</a>.
1988 <p>The sixth rule sets the <a href="#propdef-font-style"
1989 title="font-style!!property">‘<code
1990 class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
1991 title="font-stretch!!property">‘<code
1992 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1993 href="#propdef-font-size"><code
1994 class=property>font-size</code></a>’</span>, and <a
1995 href="#propdef-font-family" title="font-family!!property">‘<code
1996 class=property>font-family</code>’</a>, the other font properties being
1997 set to their initial values.
1998 </div>
2000 <p>Since the <a href="#propdef-font-stretch"
2001 title="font-stretch!!property">‘<code
2002 class=property>font-stretch</code>’</a> property was not defined in CSS
2003 2.1, when using <a href="#propdef-font-stretch"
2004 title="font-stretch!!property">‘<code
2005 class=property>font-stretch</code>’</a> values within ‘<a
2006 href="#propdef-font"><code class=property>font</code></a>’ rules,
2007 authors should include a extra version compatible with older user agents:
2009 <pre>p {
2010 font: 80% sans-serif; /* for older user agents */
2011 font: condensed 80% sans-serif;
2012 }</pre>
2014 <p>The following values refer to system fonts:
2016 <dl>
2017 <dt><strong>caption</strong>
2019 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
2020 etc.).
2022 <dt><strong>icon</strong>
2024 <dd>The font used to label icons.
2026 <dt><strong>menu</strong>
2028 <dd>The font used in menus (e.g., dropdown menus and menu lists).
2030 <dt><strong>message-box</strong>
2032 <dd>The font used in dialog boxes.
2034 <dt><strong>small-caption</strong>
2036 <dd>The font used for labeling small controls.
2038 <dt><strong>status-bar</strong>
2040 <dd>The font used in window status bars.
2041 </dl>
2043 <p>System fonts may only be set as a whole; that is, the font family, size,
2044 weight, style, etc. are all set at the same time. These values may then be
2045 altered individually if desired. If no font with the indicated
2046 characteristics exists on a given platform, the user agent should either
2047 intelligently substitute (e.g., a smaller version of the ‘<code
2048 class=property>caption</code>’ font might be used for the ‘<code
2049 class=property>small-caption</code>’ font), or substitute a user agent
2050 default font. As for regular fonts, if, for a system font, any of the
2051 individual properties are not part of the operating system's available
2052 user preferences, those properties should be set to their initial values.
2054 <p>That is why this property is "almost" a shorthand property: system fonts
2055 can only be specified with this property, not with <a
2056 href="#propdef-font-family" title="font-family!!property">‘<code
2057 class=property>font-family</code>’</a> itself, so <span
2058 class=property>‘<a href="#propdef-font"><code
2059 class=property>font</code></a>’</span> allows authors to do more than
2060 the sum of its subproperties. However, the individual properties such as
2061 <a href="#propdef-font-weight" title="font-weight!!property">‘<code
2062 class=property>font-weight</code>’</a> are still given values taken from
2063 the system font, which can be independently varied.
2065 <p>Note that the keywords used for the system fonts listed above are only
2066 treated as keywords when they occur in the initial position, in other
2067 positions the same string is treated as part of the font family name:
2069 <pre> font: menu; /* use the font settings for system menus */
2070 font: large menu; /* use a font family named "menu" */</pre>
2072 <div class=example>
2073 <p style="display:none">Example(s):</p>
2075 <pre>button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
2076 button p { font: menu }
2077 button p em { font-weight: bolder }
2078 </pre>
2080 <p>If the font used for dropdown menus on a particular system happened to
2081 be, for example, 9-point Charcoal, with a weight of 600, then P elements
2082 that were descendants of BUTTON would be displayed as if this rule were
2083 in effect:
2085 <pre>button p { font: 600 9pt Charcoal }
2086 </pre>
2088 <p>Because the <span class=property>‘<a href="#propdef-font"><code
2089 class=property>font</code></a>’</span> shorthand resets to its initial
2090 value any property not explicitly given a value, this has the same effect
2091 as this declaration:
2093 <pre>button p {
2094 font-style: normal;
2095 font-variant: normal;
2096 font-weight: 600;
2097 font-size: 9pt;
2098 line-height: normal;
2099 font-family: Charcoal
2100 }
2101 </pre>
2102 </div>
2103 <!-- prop: font-synthesis -->
2105 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
2106 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
2107 property</h3>
2109 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
2110 <tbody>
2111 <tr>
2112 <td>Name:
2114 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
2116 <tr>
2117 <td>Value:
2119 <td>none | [ weight || style ]
2121 <tr>
2122 <td>Initial:
2124 <td>weight style
2126 <tr>
2127 <td>Applies to:
2129 <td>all elements
2131 <tr>
2132 <td>Inherited:
2134 <td>yes
2136 <tr>
2137 <td>Percentages:
2139 <td>N/A
2141 <tr>
2142 <td>Media:
2144 <td>visual
2146 <tr>
2147 <td>Computed value:
2149 <td>as specified
2151 <tr>
2152 <td>Animatable:
2154 <td>no
2155 </table>
2157 <p>This property controls whether user agents are allowed to synthesize
2158 bold or oblique font faces when a font family lacks bold or italic faces.
2159 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
2160 specified, user agents must not synthesize bold faces and if ‘<code
2161 class=property>style</code>’ is not specified user agents must not
2162 synthesize italic faces. A value of ‘<code class=property>none</code>’
2163 disallows all synthetic faces.
2165 <div class=example>
2166 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
2168 <pre>*:lang(ar) { font-synthesis: none; }
2169 </pre>
2170 </div>
2172 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
2174 <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
2175 id=at-font-face-rule style="font-weight: inherit; font-style:
2176 inherit"><code>@font-face</code></dfn> rule</h3>
2178 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
2179 for linking to fonts that are automatically fetched and activated when
2180 needed. This allows authors to select a font that closely matches the
2181 design goals for a given page rather than limiting the font choice to a
2182 set of fonts available on all platforms. A set of font descriptors define
2183 the location of a font resource, either locally or externally, along with
2184 the style characteristics of an individual face. Multiple <a
2185 href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
2186 construct font families with a variety of faces. Using CSS font matching
2187 rules, a user agent can selectively download only those faces that are
2188 needed for a given piece of text.
2190 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2191 consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
2192 at-keyword followed by a block of descriptor declarations. In terms of the
2193 grammar, this specification defines the following productions:
2195 <pre><dfn id=fontfacerule>font_face_rule</dfn>
2196 : <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>*
2197 ;
2199 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
2200 : <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>
2201 ;</pre>
2203 <p>The following new definitions are introduced:
2205 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
2206 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
2208 <p>The following new token is introduced:
2210 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
2212 <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2213 specifies a value for every font descriptor, either implicitly or
2214 explicitly. Those not given explicit values in the rule take the initial
2215 value listed with each descriptor in this specification. These descriptors
2216 apply solely within the context of the <a
2217 href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
2218 are defined, and do not apply to document language elements. There is no
2219 notion of which elements the descriptors apply to or whether the values
2220 are inherited by child elements. When a given descriptor occurs multiple
2221 times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
2222 rule, only the last descriptor declaration is used and all prior
2223 declarations for that descriptor are ignored.
2225 <div class=example>
2226 <p>To use a downloadable font called Gentium:</p>
2228 <pre>
2229 @font-face {
2230 font-family: Gentium;
2231 src: url(http://example.com/fonts/Gentium.woff);
2232 }
2234 p { font-family: Gentium, serif; }
2235 </pre>
2237 <p>The user agent will download Gentium and use it when rendering text
2238 within paragraph elements. If for some reason the site serving the font
2239 is unavailable, the default serif font will be used.</p>
2240 </div>
2242 <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
2243 rules define a set of fonts available for use within the documents that
2244 contain these rules. When font matching is done, fonts defined using these
2245 rules are considered before other available fonts on a system.
2247 <p>Downloaded fonts are only available to documents that reference them.
2248 The process of activating these fonts must not make them available to
2249 other applications or to documents that don't directly link to the same
2250 font. User agent implementers might consider it convenient to use
2251 downloaded fonts when rendering characters in other documents for which no
2252 other available font exists as part of the <a
2253 href="#system-font-fallback"><em>system font fallback</em></a> procedure.
2254 However, this would cause a security leak since the contents of one page
2255 would be able to affect other pages, something an attacker could use as an
2256 attack vector. These restrictions do not affect caching behavior, fonts
2257 are cached the same way other web resources are cached.
2259 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
2260 properties in a declaration block, declarations of any descriptors that
2261 are not supported by the user agent must be ignored. <a
2262 href="#at-font-face-rule"><code>@font-face</code></a> rules require a
2263 font-family and src descriptor; if either of these are missing, the <a
2264 href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
2265 must be ignored entirely.
2267 <p>In cases where user agents have limited platform resources or implement
2268 the ability to disable downloadable font resources, <a
2269 href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
2270 ignored; the behavior of individual descriptors as defined in this
2271 specification should not be altered.
2273 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
2274 href="#descdef-font-family">font-family</a> descriptor</h3>
2276 <table class=descdef>
2277 <tbody>
2278 <tr>
2279 <td>Name:
2281 <td><dfn id=descdef-font-family
2282 title="font-family!!descriptor">font-family</dfn>
2284 <tr>
2285 <td>Value:
2287 <td><a href="#family-name-value"><var><family-name></var></a>
2289 <tr>
2290 <td><em>Initial:</em>
2292 <td>N/A
2293 </table>
2295 <p>This descriptor defines the font family name that will be used in all
2296 CSS font family name matching. It is required for the <a
2297 href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
2298 overrides the font family names contained in the underlying font data. If
2299 the font family name is the same as a font family available in a given
2300 user's environment, it effectively hides the underlying font for documents
2301 that use the stylesheet. This permits a web author to freely choose
2302 font-family names without worrying about conflicts with font family names
2303 present in a given user's environment. Likewise, platform substitutions
2304 for a given font family name must not be used.
2306 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
2307 href="#descdef-src">src</a> descriptor</h3>
2309 <table class=descdef>
2310 <tbody>
2311 <tr>
2312 <td>Name:
2314 <td><dfn id=descdef-src>src</dfn>
2316 <tr>
2317 <td>Value:
2319 <td>[ <url> [format(<string> #)]? | <a
2320 href="#font-face-name-value"><var><font-face-name></var></a> ] #
2322 <tr>
2323 <td><em>Initial:</em>
2325 <td>N/A
2326 </table>
2328 <p>This descriptor specifies the resource containing font data. It is
2329 required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
2330 rule to be valid. Its value is a prioritized, comma-separated list of
2331 external references or locally-installed font face names. When a font is
2332 needed the user agent iterates over the set of references listed, using
2333 the first one it can successfully activate. Fonts containing invalid data
2334 or local font faces that are not found are ignored and the user agent
2335 loads the next font in the list.
2337 <p>As with other URLs in CSS, the URL may be relative, in which case it is
2338 resolved relative to the location of the style sheet containing the <a
2339 href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
2340 SVG fonts, the URL points to an element within a document containing SVG
2341 font definitions. If the element reference is omitted, a reference to the
2342 first defined font is implied. Similarly, font container formats that can
2343 contain more than one font must load one and only one of the fonts for a
2344 given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
2345 Fragment identifiers are used to indicate which font to load. If a
2346 container format lacks a defined fragment identifier scheme,
2347 implementations should use a simple 1-based indexing scheme (e.g.
2348 "font-collection#1" for the first font, "font-collection#2" for the second
2349 font).
2351 <pre>
2352 src: url(fonts/simple.woff); /* load simple.woff relative to stylesheet location */
2353 src: url(/fonts/simple.woff); /* load simple.woff from absolute location */
2354 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
2355 </pre>
2357 <p>External references consist of a URL, followed by an optional hint
2358 describing the format of the font resource referenced by that URL. The
2359 format hint contains a comma-separated list of format strings that denote
2360 well-known font formats. Conformant user agents must skip downloading a
2361 font resource if the format hints indicate only unsupported or unknown
2362 font formats. If no format hints are supplied, the user agent should
2363 download the font resource.
2365 <pre>
2366 /* load WOFF font if possible, otherwise use OpenType font */
2367 @font-face {
2368 font-family: bodytext;
2369 src: url(ideal-sans-serif.woff) format("woff"),
2370 url(basic-sans-serif.ttf) format("opentype");
2371 }
2372 </pre>
2374 <p>Format strings defined by this specification:
2376 <table class=data id=fontformats>
2377 <thead>
2378 <tr>
2379 <th>String
2381 <th>Font Format
2383 <th>Common extensions
2385 <tbody>
2386 <tr>
2387 <th>"woff"
2389 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
2391 <td>.woff
2393 <tr>
2394 <th>"truetype"
2396 <td><a
2397 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
2399 <td>.ttf
2401 <tr>
2402 <th>"opentype"
2404 <td><a
2405 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
2407 <td>.ttf, .otf
2409 <tr>
2410 <th>"embedded-opentype"
2412 <td><a
2413 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
2414 OpenType</a>
2416 <td>.eot
2418 <tr>
2419 <th>"svg"
2421 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
2423 <td>.svg, .svgz
2424 </table>
2426 <p>Given the overlap in common usage between TrueType and OpenType, the
2427 format hints "truetype" and "opentype" must be considered as synonymous; a
2428 format hint of "opentype" does not imply that the font contains Postscript
2429 CFF style glyph data or that it contains OpenType layout information (see
2430 <a href="#platform-props-to-css">Appendix A</a> for more background on
2431 this).
2433 <p>When authors would prefer to use a locally available copy of a given
2434 font and download it if it's not, <code>local()</code> can be used. The
2435 locally-installed <dfn
2436 id=font-face-name-value><var><font-face-name></var></dfn> argument
2437 to <code>local()</code> is a format-specific string that uniquely
2438 identifies a single font face within a larger family. The syntax for a <a
2439 href="#font-face-name-value"><var><font-face-name></var></a> is a
2440 unique font face name enclosed by "local(" and ")". The name can
2441 optionally be enclosed in quotes. If unquoted, the unquoted font family
2442 name processing conventions apply; the name must be a sequence of
2443 identifiers separated by whitespace which is converted to a string by
2444 joining the identifiers together separated by a single space.
2446 <pre>
2447 /* regular face of Gentium */
2448 @font-face {
2449 font-family: MyGentium;
2450 src: local(Gentium), /* use locally available Gentium */
2451 url(Gentium.woff); /* otherwise, download it */
2452 }
2453 </pre>
2455 <p>For OpenType and TrueType fonts, this string is used to match only the
2456 Postscript name or the full font name in the name table of locally
2457 available fonts. Which type of name is used varies by platform and font,
2458 so authors should include both of these names to assure proper matching
2459 across platforms. Platform substitutions for a given font name must not be
2460 used.
2462 <pre>
2463 /* bold face of Gentium */
2464 @font-face {
2465 font-family: MyGentium;
2466 src: local(Gentium Bold), /* full font name */
2467 local(Gentium-Bold), /* Postscript name */
2468 url(GentiumBold.woff); /* otherwise, download it */
2469 font-weight: bold;
2470 }
2471 </pre>
2473 <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2474 specifies the characteristics of a single font within a family, the unique
2475 name used with <code>local()</code> specifies a single font, not an entire
2476 font family. Defined in terms of OpenType font data, the Postscript name
2477 is found in the font's <a
2478 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
2479 in the name record with nameID = 6 (see <a href="#OPENTYPE"
2480 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
2481 Postscript name is the commonly used key for all fonts on OSX and for
2482 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
2483 used as a unique key for fonts with TrueType glyphs on Windows.
2485 <p>For OpenType fonts with multiple localizations of the full font name,
2486 the US English version is used (language ID = 0x409 for Windows and
2487 language ID = 0 for Macintosh) or the first localization when a US English
2488 full font name is not available (the OpenType specification recommends
2489 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
2490 fonts minimally include US English names</a>). User agents that also match
2491 other full font names, e.g. matching the Dutch name when the current
2492 system locale is set to Dutch, are considered non-conformant. This is done
2493 not to prefer English but to avoid matching inconsistencies across font
2494 versions and OS localizations, since font style names (e.g. "Bold") are
2495 frequently localized into many languages and the set of localizations
2496 available varies widely across platform and font version. User agents that
2497 match a concatenation of family name (nameID = 1) with style name (nameID
2498 = 2) are considered non-conformant.
2500 <p>This also allows for referencing faces that belong to larger families
2501 that cannot otherwise be referenced.
2503 <div class=example>
2504 <p>Use a local font or reference an SVG font in another document:</p>
2506 <pre>
2507 @font-face {
2508 font-family: Headline;
2509 src: local(Futura-Medium),
2510 url(fonts.svg#MyGeometricModern) format("svg");
2511 }
2512 </pre>
2514 <p>Create an alias for local Japanese fonts on different platforms:</p>
2516 <pre>
2517 @font-face {
2518 font-family: jpgothic;
2519 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
2520 }
2521 </pre>
2523 <p>Reference a font face that cannot be matched within a larger family:</p>
2525 <pre>
2526 @font-face {
2527 font-family: Hoefler Text Ornaments;
2528 /* has the same font properties as Hoefler Text Regular */
2529 src: local(HoeflerText-Ornaments);
2530 }
2531 </pre>
2533 <p>Since localized fullnames never match, a document with the header style
2534 rules below would always render using the default serif font, regardless
2535 whether a particular system locale parameter is set to Finnish or not:</p>
2537 <pre>
2538 @font-face {
2539 font-family: SectionHeader;
2540 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
2541 font-weight: bold;
2542 }
2544 h2 { font-family: SectionHeader, serif; }
2545 </pre>
2547 <p>A conformant user agent would never load the font ‘<code
2548 class=css>gentium.eot</code>’ in the example below, since it is
2549 included in the first definition of the ‘<a href="#descdef-src"><code
2550 class=property>src</code></a>’ descriptor which is overridden by the
2551 second definition in the same <a
2552 href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
2554 <pre>
2555 @font-face {
2556 font-family: MainText;
2557 src: url(gentium.eot); /* for use with older user agents */
2558 src: local("Gentium"), url(gentium.woff); /* Overrides src definition */
2559 }
2560 </pre>
2561 </div>
2563 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
2564 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
2565 href="#descdef-font-weight">font-weight</a>, <a
2566 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
2568 <table class=descdef>
2569 <tbody>
2570 <tr>
2571 <td>Name:
2573 <td><dfn id=descdef-font-style
2574 title="font-style!!descriptor">font-style</dfn>
2576 <tr>
2577 <td>Value:
2579 <td>normal | italic | oblique
2581 <tr>
2582 <td><em>Initial:</em>
2584 <td>normal
2585 </table>
2587 <table class=descdef>
2588 <tbody>
2589 <tr>
2590 <td>Name:
2592 <td><dfn id=descdef-font-weight
2593 title="font-weight!!descriptor">font-weight</dfn>
2595 <tr>
2596 <td>Value:
2598 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
2600 <tr>
2601 <td><em>Initial:</em>
2603 <td>normal
2604 </table>
2606 <table class=descdef>
2607 <tbody>
2608 <tr>
2609 <td>Name:
2611 <td><dfn id=descdef-font-stretch
2612 title="font-stretch!!descriptor">font-stretch</dfn>
2614 <tr>
2615 <td>Value:
2617 <td>normal | ultra-condensed | extra-condensed | condensed |
2618 semi-condensed | semi-expanded | expanded | extra-expanded |
2619 ultra-expanded
2621 <tr>
2622 <td><em>Initial:</em>
2624 <td>normal
2625 </table>
2627 <p>These descriptors define the characteristics of a font face and are used
2628 in the process of matching styles to specific faces. For a font family
2629 defined with several <a
2630 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
2631 can either download all faces in the family or use these descriptors to
2632 selectively download font faces that match actual styles used in document.
2633 The values for these descriptors are the same as those for the
2634 corresponding font properties except that relative keywords are not
2635 allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
2636 and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
2637 these descriptors are omitted, initial values are assumed.
2639 <p>The value for these font face style attributes is used in place of the
2640 style implied by the underlying font data. This allows authors to combine
2641 faces in flexible combinations, even in situations where the original font
2642 data was arranged differently. User agents that implement synthetic
2643 bolding and obliquing must only apply synthetic styling in cases where the
2644 font descriptors imply this is needed, rather than based on the style
2645 attributes implied by the font data.
2647 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
2648 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
2650 <table class=descdef>
2651 <tbody>
2652 <tr>
2653 <td>Name:
2655 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
2657 <tr>
2658 <td>Value:
2660 <td><a href="#urange-value"><var><urange></var></a> #
2662 <tr>
2663 <td><em>Initial:</em>
2665 <td>U+0-10FFFF
2666 </table>
2668 <p>This descriptor defines the set of Unicode codepoints that may be
2669 supported by the font face for which it is declared. The descriptor value
2670 is a comma-delimited list of Unicode range (<a
2671 href="#urange-value"><var><urange></var></a>) values. The union of
2672 these ranges defines the set of codepoints that serves as a hint for user
2673 agents when deciding whether or not to download a font resource for a
2674 given text run.
2676 <p>Each <dfn id=urange-value><var><urange></var></dfn> value is a <a
2677 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2678 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
2679 "U+" or "u+" prefix followed by a codepoint range in one of the three
2680 forms listed below. Ranges that do not fit one of the these forms are
2681 invalid and cause the declaration to be ignored.
2683 <dl>
2684 <dt>single codepoint (e.g. U+416)
2686 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
2687 digits
2689 <dt>interval range (e.g. U+400-4ff)
2691 <dd>represented as two hyphen-separated valid Unicode codepoints
2692 indicating the inclusive start and end codepoints of a range
2694 <dt>wildcard range (e.g. U+4??)
2696 <dd>defined by the set of codepoints implied when trailing ‘<code
2697 class=css>?</code>’ characters signify any hexadeximal digit
2698 </dl>
2700 <p>Individual codepoints are written using hexadecimal values that
2701 correspond to <a href="http://www.unicode.org/charts/">Unicode character
2702 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
2703 inclusive. Digit values of codepoints are ASCII case-insensitive. For
2704 interval ranges, the start and end codepoints are valid Unicode values and
2705 the end codepoint is greater than or equal to the start codepoint.
2707 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
2708 "U+???") are valid and equivalent to a wildcard range with an initial zero
2709 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
2710 the range of valid Unicode codepoints are invalid. Because of this, the
2711 maximum number of trailing ‘<code class=css>?</code>’ wildcard
2712 characters is five, even though the <a
2713 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2714 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
2716 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
2717 href="#descdef-unicode-range"><code
2718 class=property>unicode-range</code></a>’ descriptor declaration, ranges
2719 may overlap. The union of these ranges defines the set of codepoints for
2720 which the corresponding font may be used. User agents must not download or
2721 use the font for codepoints outside this set. User agents may normalize
2722 the list of ranges into a list that is different but represents the same
2723 set of codepoints.
2725 <p>The associated font might not contain glyphs for the entire set of
2726 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
2727 class=property>unicode-range</code></a>’ descriptor. When the font is
2728 used, the <dfn id=effective-character-map>effective character map</dfn> is
2729 the intersection of the codepoints defined by ‘<a
2730 href="#descdef-unicode-range"><code
2731 class=property>unicode-range</code></a>’ with the font's <a
2732 href="#character-map"><em>character map</em></a>. This allows authors to
2733 define supported ranges in terms of broad ranges without worrying about
2734 the precise codepoint ranges supported by the underlying font.
2736 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
2737 to define composite fonts</h3>
2739 <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
2740 with different unicode ranges for the same family and style descriptor
2741 values can be used to create composite fonts that mix the glyphs from
2742 different fonts for different scripts. This can be used to combine fonts
2743 that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
2744 or it can be used by authors as a way of segmenting a font into fonts for
2745 commonly used characters and less frequently used characters. Since the
2746 user agent will only pull down the fonts it needs this helps reduce page
2747 bandwidth.
2749 <p>If the unicode ranges overlap for a set of <a
2750 href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
2751 family and style descriptor values, the rules are ordered in the reverse
2752 order they were defined; the last rule defined is the first to be checked
2753 for a given character.
2755 <p>Example ranges for specific languages or characters:
2757 <dl>
2758 <dt>unicode-range: U+A5;
2760 <dd>a single code point, the yen/yuan symbol
2762 <dt>unicode-range: U+0-7F;
2764 <dd>code range for basic ASCII characters
2766 <dt>unicode-range: U+590-5ff;
2768 <dd>code range for Hebrew characters
2770 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
2772 <dd>code range for Japanese kanji, hiragana and katakana characters plus
2773 yen/yuan symbol
2774 </dl>
2776 <div class=example>
2777 <p>The BBC provides news services in a wide variety of languages, many
2778 that are not well supported across all platforms. Using an <a
2779 href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
2780 provide a font for any of these languages, as it already does via a
2781 manual font download.</p>
2783 <pre>
2784 @font-face {
2785 font-family: BBCBengali;
2786 src: url(fonts/BBCBengali.woff) format("woff");
2787 unicode-range: U+00-FF, U+980-9FF;
2788 }
2789 </pre>
2790 </div>
2792 <div class=example>
2793 <p>Technical documents often require a wide range of symbols. The STIX
2794 Fonts project is one project aimed at providing fonts to support a wide
2795 range of technical typesetting in a standardized way. The example below
2796 shows the use of a font that provides glyphs for many of the mathematical
2797 and technical symbol ranges within Unicode:</p>
2799 <pre>
2800 @font-face {
2801 font-family: STIXGeneral;
2802 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
2803 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
2804 }
2805 </pre>
2806 </div>
2808 <div class=example>
2809 <p>This example shows how an author can override the glyphs used for Latin
2810 characters in a Japanese font with glyphs from a different font. The
2811 first rule specifies no range so it defaults to the entire range. The
2812 range specified in the second rule overlaps but takes precedence because
2813 it is defined later.</p>
2815 <pre>
2816 @font-face {
2817 font-family: JapaneseWithGentium;
2818 src: local(MSMincho);
2819 /* no range specified, defaults to entire range */
2820 }
2822 @font-face {
2823 font-family: JapaneseWithGentium;
2824 src: url(../fonts/Gentium.woff);
2825 unicode-range: U+0-2FF;
2826 }
2827 </pre>
2828 </div>
2830 <div class=example>
2831 <p>Consider a family constructed to optimize bandwidth by separating out
2832 Latin, Japanese and other characters into different font files:</p>
2834 <pre>
2835 /* fallback font - size: 4.5MB */
2836 @font-face {
2837 font-family: DroidSans;
2838 src: url(DroidSansFallback.woff);
2839 /* no range specified, defaults to entire range */
2840 }
2842 /* Japanese glyphs - size: 1.2MB */
2843 @font-face {
2844 font-family: DroidSans;
2845 src: url(DroidSansJapanese.woff);
2846 unicode-range: U+3000-9FFF, U+ff??;
2847 }
2849 /* Latin, Greek, Cyrillic along with some
2850 punctuation and symbols - size: 190KB */
2851 @font-face {
2852 font-family: DroidSans;
2853 src: url(DroidSans.woff);
2854 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
2855 }
2856 </pre>
2858 <p>For simple Latin text, only the font for Latin characters is
2859 downloaded:</p>
2861 <pre>
2862 body { font-family: DroidSans; }
2864 <p>This is that</p>
2865 </pre>
2867 <p>In this case the user agent first checks the unicode-range for the font
2868 containing Latin characters (DroidSans.woff). Since all the characters
2869 above are in the range U+0-5FF, the user agent downloads the font and
2870 renders the text with that font.</p>
2872 <p>Next, consider text that makes use of an arrow character (⇨):</p>
2874 <pre>
2875 <p>This &#x21e8; that<p>
2876 </pre>
2878 <p>The user agent again first checks the unicode-range of the font
2879 containing Latin characters. Since U+2000-2300 includes the arrow code
2880 point (U+21E8), the user agent downloads the font. For this character
2881 however the Latin font does not have a matching glyph, so the effective
2882 unicode-range used for font matching excludes this code point. Next, the
2883 user agent evaluates the Japanese font. The unicode-range for the
2884 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
2885 user agent does not download the Japanese font. Next the fallback font is
2886 considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
2887 rule for the fallback font does not define unicode-range so its value
2888 defaults to the range of all Unicode code points. The fallback font is
2889 downloaded and used to render the arrow character.</p>
2890 </div>
2892 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
2893 href="#descdef-font-variant">font-variant</a> and <a
2894 href="#descdef-font-feature-settings">font-feature-settings</a>
2895 descriptors</h3>
2897 <table class=descdef>
2898 <tbody>
2899 <tr>
2900 <td>Name:
2902 <td><dfn id=descdef-font-variant
2903 title="font-variant!!descriptor">font-variant</dfn>
2905 <tr>
2906 <td>Value:
2908 <td><a href="#font-variant-normal-value"
2909 title="normal!!font-variant">normal</a> | <a
2910 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
2911 <a href="#common-lig-values"><var><common-lig-values></var></a>
2912 || <a
2913 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
2914 || <a
2915 href="#historical-lig-values"><var><historical-lig-values></var></a>
2916 || <a
2917 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
2918 || <a href="#stylistic"><var
2919 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
2920 href="#historical-forms"><var>historical-forms</var></a> || <a
2921 href="#styleset"><var
2922 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
2923 href="#character-variant"><var
2924 title=character-variant>character-variant(<feature-value-name>
2925 #)</var></a> || <a href="#swash"><var
2926 title=swash>swash(<feature-value-name>)</var></a> || <a
2927 href="#ornaments"><var
2928 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
2929 href="#annotation"><var
2930 title=annotation>annotation(<feature-value-name>)</var></a> || [
2931 <a href="#small-caps"><i>small-caps</i></a> | <a
2932 href="#all-small-caps"><i>all-small-caps</i></a> | <a
2933 href="#petite-caps"><i>petite-caps</i></a> | <a
2934 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
2935 href="#unicase"><i>unicase</i></a> | <a
2936 href="#titling-caps"><i>titling-caps</i></a> ] || <a
2937 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
2938 || <a
2939 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
2940 || <a
2941 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
2942 || <a href="#ordinal"><i>ordinal</i></a> || <a
2943 href="#slashed-zero"><i>slashed-zero</i></a> || <a
2944 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
2945 || <a
2946 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
2947 || <a href="#ruby"><i>ruby</i></a> ]
2949 <tr>
2950 <td><em>Initial:</em>
2952 <td>normal
2953 </table>
2955 <table class=descdef>
2956 <tbody>
2957 <tr>
2958 <td>Name:
2960 <td><dfn id=descdef-font-feature-settings
2961 title="font-feature-settings!!descriptor">font-feature-settings</dfn>
2963 <tr>
2964 <td>Value:
2966 <td><a href="#font-feature-settings-normal-value"
2967 title="normal!!font-feature-settings">normal</a> | <a
2968 href="#feature-tag-value"><var><feature-tag-value></var></a> #
2970 <tr>
2971 <td><em>Initial:</em>
2973 <td>normal
2974 </table>
2976 <p>These descriptors define initial settings that apply when the font
2977 defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
2978 rule is rendered. They do not affect font selection. Values are identical
2979 to those defined for the corresponding <a href="#propdef-font-variant"
2980 title="font-variant!!property">‘<code
2981 class=property>font-variant</code>’</a> and <a
2982 href="#propdef-font-feature-settings"
2983 title="font-feature-settings!!property">‘<code
2984 class=property>font-feature-settings</code>’</a> properties defined
2985 below except that the value ‘<code class=property>inherit</code>’ is
2986 omitted. When multiple font feature descriptors or properties are used,
2987 the cumulative effect on text rendering is detailed in the section <a
2988 href="#font-feature-resolution">Font Feature Resolution</a> below. In
2989 cases where specific values define synthesized fallback for certain <a
2990 href="#propdef-font-variant" title="font-variant!!property">‘<code
2991 class=property>font-variant</code>’</a> subproperties, the same
2992 synthesized fallback applies when used within those values are used with
2993 the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
2994 class=property>font-variant</code>’</a> descriptor.
2996 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
2997 guidelines</h3>
2999 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
3000 designed to allow lazy loading of font resources that are only downloaded
3001 when used within a document. A stylesheet can include <a
3002 href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
3003 of fonts of which only a select set are used; user agents must only
3004 download those fonts that are referred to within the style rules
3005 applicable to a given page. User agents that download all fonts defined in
3006 <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
3007 considering whether those fonts are in fact used within a page are
3008 considered non-conformant. In cases where a font might be downloaded in
3009 character fallback cases, user agents may download a font if it's
3010 contained within the computed value of <a href="#propdef-font-family"
3011 title="font-family!!property">‘<code
3012 class=property>font-family</code>’</a> for a given text run.
3014 <pre>
3015 @font-face {
3016 font-family: GeometricModern;
3017 src: url(font.woff);
3018 }
3020 p {
3021 /* font will be downloaded for pages with p elements */
3022 font-family: GeometricModern, sans-serif;
3023 }
3025 h2 {
3026 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
3027 font-family: Futura, GeometricModern, sans-serif;
3028 }
3029 </pre>
3031 <p>In cases where textual content is loaded before downloadable fonts are
3032 available, user agents may render text as it would be rendered if
3033 downloadable font resources are not available or they may render text
3034 transparently with fallback fonts to avoid a flash of text using a
3035 fallback font. In cases where the font download fails user agents must
3036 display text, simply leaving transparent text is considered non-conformant
3037 behavior. Authors are advised to use fallback fonts in their font lists
3038 that closely match the metrics of the downloadable fonts to avoid large
3039 page reflows where possible.
3041 <p><a id=same-origin-restriction> </a><a
3042 id=allowing-cross-origin-font-loading> </a>
3044 <h3 id=font-fetching-requirements><span class=secno>4.9 </span>Font
3045 fetching requirements</h3>
3046 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
3047 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
3048 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
3049 -->
3051 <p>For font loads, user agents must use the <a
3052 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
3053 CORS-enabled fetch</a> method defined by the <a href="#HTML5"
3054 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification for URL's
3055 defined within @font-face rules. When fetching, user agents must use
3056 "Anonymous" mode, set the referrer source to the stylesheet's URL and set
3057 the origin to the URL of the containing document.
3059 <p class=note>The implications of this for authors are that fonts will
3060 typically not be loaded cross-origin unless authors specifically takes
3061 steps to permit cross-origin loads. Sites can explicitly allow cross-site
3062 loading of font data using the <code>Access-Control-Allow-Origin</code>
3063 HTTP header. For other schemes, no explicit mechanism to allow
3064 cross-origin loading, beyond what is permitted by the <a
3065 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
3066 CORS-enabled fetch</a> method, is defined or required.
3068 <div class=example> For the examples given below, assume that a document is
3069 located at <code>http://example.com/page.html</code> and all URL's link to
3070 valid font resources supported by the user agent. Fonts defined with the
3071 ‘<a href="#descdef-src"><code class=property>src</code></a>’
3072 descriptor values below will be loaded:
3073 <pre>/* same origin (i.e. domain, scheme, port match document) */
3074 src: url(fonts/simple.woff);
3075 src: url(//fonts/simple.woff);
3077 /* data url's with no redirects are treated as same origin */
3078 src: url("data:application/font-woff;base64,...");
3080 /* cross origin, different domain */
3081 /* Access-Control-Allow-Origin response header set to '*' */
3082 src: url(http://another.example.com/fonts/simple.woff);
3083 </pre>
3084 Fonts defined with the ‘<a href="#descdef-src"><code
3085 class=property>src</code></a>’ descriptor values below will fail to
3086 load:
3087 <pre>/* cross origin, different scheme */
3088 /* no Access-Control-xxx headers in response */
3089 src: url(https://example.com/fonts/simple.woff);
3091 /* cross origin, different domain */
3092 /* no Access-Control-xxx headers in response */
3093 src: url(http://another.example.com/fonts/simple.woff);
3094 </pre>
3095 </div>
3097 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
3098 Algorithm</h2>
3100 <p>The algorithm below describes how fonts are associated with individual
3101 runs of text. For each character in the run a font family is chosen and a
3102 particular font face is selected containing a glyph for that character.
3104 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
3105 font family names</h3>
3107 <p>As part of the font matching algorithm outlined below, user agents must
3108 match font family names used in style rules with actual font family names
3109 contained in fonts available in a given environment or with font family
3110 names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
3111 rules. User agents must match these names case insensitively, using the
3112 "Default Caseless Matching" algorithm outlined in the Unicode
3113 specification <a href="#UNICODE6"
3114 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
3115 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
3116 the algorithm must be applied without normalizing the strings involved and
3117 without applying any language-specific tailorings. The case folding method
3118 specified by this algorithm uses the case mappings with status field
3119 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
3120 in the CaseFolding.txt file of the Unicode Character Database.
3122 <p class=note> For authors this means that font family names are matched
3123 case insensitively, whether those names exist in a platform font or in the
3124 <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
3125 in a stylesheet. Authors should take care to ensure that names use a
3126 character sequence consistent with the actual font family name,
3127 particularly when using combining characters such as diacritical marks.
3128 For example, a family name that contains an uppercase A (U+0041) followed
3129 by a combining ring (U+030A) will <strong>not</strong> match a name that
3130 looks identical but which uses the precomposed lowercase a-ring character
3131 (U+00E5) instead of the combining sequence.
3133 <p class=note> Implementors should take care to verify that a given
3134 caseless string comparison implementation uses this precise algorithm and
3135 not assume that a given platform string matching routine follows it, as
3136 many of these have locale-specific behavior or use some level of string
3137 normalization.
3139 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
3140 styles</h3>
3142 <p>The procedure for choosing a font for a given character in a run of text
3143 consists of iterating over the font families named by the <a
3144 href="#propdef-font-family" title="font-family!!property">‘<code
3145 class=property>font-family</code>’</a> property, selecting a font face
3146 with the appropriate style based on other font properties and then
3147 determining whether a glyph exists for the given character. This is done
3148 using the <dfn id=character-map>character map</dfn> of the font, data
3149 which maps characters to the default glyph for that character. A font is
3150 considered to <dfn id=support>support</dfn> a given character if (1) the
3151 character is contained in the font's <a
3152 href="#character-map"><em>character map</em></a> and (2) if required by
3153 the containing script, shaping information is available for that
3154 character.
3156 <p>Some legacy fonts may include a given character in the <a
3157 href="#character-map"><em>character map</em></a> but lack the shaping
3158 information (e.g. <a
3159 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
3160 layout tables</a> or <a
3161 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_techAbout">Graphite
3162 tables</a>) necessary for correctly rendering text runs containing that
3163 character.
3165 <p>Codepoint sequences consisting of a base character followed by a
3166 sequence of combining characters are treated slightly differently, see the
3167 section on <a href="#cluster-matching">cluster matching</a> below.
3169 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
3170 given font family is defined to be the face that would be selected if all
3171 font style properties were set to their initial value.
3173 <ol id=fontmatchingalg>
3174 <li>Using the computed font property values for a given element, the user
3175 agent starts with the first family name specified by the <a
3176 href="#propdef-font-family" title="font-family!!property">‘<code
3177 class=property>font-family</code>’</a> property.
3179 <li>If the family name is a generic family keyword, the user agent looks
3180 up the appropriate font family name to be used. User agents may choose
3181 the generic font family to use based on the language of the containing
3182 element or the Unicode range of the character.
3184 <li>For other family names, the user agent attempts to find the family
3185 name among fonts defined via <a
3186 href="#at-font-face-rule"><code>@font-face</code></a> rules and then
3187 among available system fonts, matching names with a <a
3188 href="#font-family-casing">case-insensitive comparison</a> as outlined in
3189 the section above. On systems containing fonts with multiple localized
3190 font family names, user agents must match any of these names independent
3191 of the underlying system locale or platform API used. If the font
3192 resources defined for a given face in an <a
3193 href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
3194 available or contain invalid font data, then the face should be treated
3195 as not present in the family. If no faces are present for a family
3196 defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
3197 rules, the family should be treated as missing; matching a platform font
3198 with the same name must not occur in this case.
3200 <li>If a font family match occurs, the user agent assembles the set of
3201 font faces in that family and then narrows the set to a single face using
3202 other font properties in the order given below. A group of faces defined
3203 via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
3204 identical font descriptor values but differing ‘<a
3205 href="#descdef-unicode-range"><code
3206 class=property>unicode-range</code></a>’ values are considered to be a
3207 single <dfn id=composite-face>composite face</dfn> for this step:
3208 <ol id=fontstylematchingalg>
3209 <li><a href="#propdef-font-stretch"
3210 title="font-stretch!!property">‘<code
3211 class=property>font-stretch</code>’</a> is tried first. If the
3212 matching set contains faces with width values matching the <a
3213 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
3214 class=property>font-stretch</code>’</a> value, faces with other width
3215 values are removed from the matching set. If there is no face that
3216 exactly matches the width value the nearest width is used instead. If
3217 the value of <a href="#propdef-font-stretch"
3218 title="font-stretch!!property">‘<code
3219 class=property>font-stretch</code>’</a> is <a
3220 href="#font-stretch-normal-value" title="normal!!font-stretch">‘<code
3221 class=property>normal</code>’</a> or one of the condensed values,
3222 narrower width values are checked first, then wider values. If the
3223 value of <a href="#propdef-font-stretch"
3224 title="font-stretch!!property">‘<code
3225 class=property>font-stretch</code>’</a> is one of the expanded
3226 values, wider values are checked first, followed by narrower values.
3227 Once the closest matching width has been determined by this process,
3228 faces with other widths are removed from the matching set.
3230 <li><a href="#propdef-font-style" title="font-style!!property">‘<code
3231 class=property>font-style</code>’</a> is tried next. If the value of
3232 <a href="#propdef-font-style" title="font-style!!property">‘<code
3233 class=property>font-style</code>’</a> is ‘<a href="#italic"><code
3234 class=property>italic</code></a>’, italic faces are checked first,
3235 then oblique, then normal faces. If the value is ‘<a
3236 href="#oblique"><code class=property>oblique</code></a>’, oblique
3237 faces are checked first, then italic faces and then normal faces. If
3238 the value is <a href="#font-style-normal-value"
3239 title="normal!!font-style">‘<code
3240 class=property>normal</code>’</a>, normal faces are checked first,
3241 then oblique faces, then italic faces. Faces with other style values
3242 are excluded from the matching set. User agents are permitted to
3243 distinguish between italic and oblique faces within platform font
3244 families but this is not required, so all italic or oblique faces may
3245 be treated as italic faces. However, within font families defined via
3246 <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
3247 and oblique faces must be distinguished using the value of the <a
3248 href="#descdef-font-style" title="font-style!!descriptor">‘<code
3249 class=property>font-style</code>’</a> descriptor. For families that
3250 lack any italic or oblique faces, users agents may create artificial
3251 oblique faces, if this is permitted by the value of the ‘<a
3252 href="#propdef-font-synthesis"><code
3253 class=property>font-synthesis</code></a>’ property.
3255 <li><a href="#propdef-font-weight"
3256 title="font-weight!!property">‘<code
3257 class=property>font-weight</code>’</a> is matched next, so it will
3258 always reduce the matching set to a single font face. If bolder/lighter
3259 relative weights are used, the effective weight is calculated based on
3260 the inherited weight value, as described in the definition of the <a
3261 href="#propdef-font-weight" title="font-weight!!property">‘<code
3262 class=property>font-weight</code>’</a> property. Given the desired
3263 weight and the weights of faces in the matching set after the steps
3264 above, if the desired weight is available that face matches. Otherwise,
3265 a weight is chosen using the rules below:
3266 <ul>
3267 <li>If the desired weight is less than 400, weights below the desired
3268 weight are checked in descending order followed by weights above the
3269 desired weight in ascending order until a match is found.
3271 <li>If the desired weight is greater than 500, weights above the
3272 desired weight are checked in ascending order followed by weights
3273 below the desired weight in descending order until a match is found.
3275 <li>If the desired weight is 400, 500 is checked first and then the
3276 rule for desired weights less than 400 is used.
3278 <li>If the desired weight is 500, 400 is checked first and then the
3279 rule for desired weights less than 400 is used.
3280 </ul>
3282 <li><span class=property>‘<a href="#propdef-font-size"><code
3283 class=property>font-size</code></a>’</span> must be matched within a
3284 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
3285 are rounded to the nearest whole pixel, while the tolerance for
3286 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
3287 by ‘<code class=property>em</code>’ values in other properties, are
3288 based on the <span class=property>‘<a href="#propdef-font-size"><code
3289 class=property>font-size</code></a>’</span> value that is used, not
3290 the one that is specified.
3291 </ol>
3293 <li>
3294 <p>If the matched face is defined via <a
3295 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
3296 must use the procedure below to select a single font:
3298 <ol>
3299 <li>If the font resource has not been loaded and the range of characters
3300 defined by the ‘<a href="#descdef-unicode-range"><code
3301 class=property>unicode-range</code></a>’ descriptor value includes
3302 the character in question, load the font.
3304 <li>After downloading, if the <a
3305 href="#effective-character-map"><em>effective character map</em></a>
3306 supports the character in question, select that font.
3307 </ol>
3309 <p>When the matched face is a <a href="#composite-face"><em>composite
3310 face</em></a>, user agents must use the procedure above on each of the
3311 faces in the <a href="#composite-face"><em>composite face</em></a> in
3312 reverse order of <a
3313 href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
3315 <p>While the download occurs, user agents may either wait until the font
3316 is downloaded or render once with substituted font metrics and render
3317 again once the font is downloaded.</p>
3319 <li>
3320 <p>If no matching face exists or the matched face does not contain a
3321 glyph for the character to be rendered, the next family name is selected
3322 and the previous three steps repeated. Glyphs from other faces in the
3323 family are not considered. The only exception is that user agents may
3324 optionally substitute a synthetically obliqued version of the <a
3325 href="#default-face"><em>default face</em></a> if that face supports a
3326 given glyph and synthesis of these faces is permitted by the value of
3327 the ‘<a href="#propdef-font-synthesis"><code
3328 class=property>font-synthesis</code></a>’ property. For example, a
3329 synthetic italic version of the regular face may be used if the italic
3330 face doesn't support glyphs for Arabic.</p>
3331 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
3334 <li>If there are no more font families to be evaluated and no matching
3335 face has been found, then the user agent performs a <dfn
3336 id=system-font-fallback>system font fallback</dfn> procedure to find the
3337 best match for the character to be rendered. The result of this procedure
3338 may vary across user agents.
3340 <li>If a particular character cannot be displayed using any font, the user
3341 agent should indicate by some means that a character is not being
3342 displayed, displaying either a symbolic representation of the missing
3343 glyph (e.g. using a <a
3344 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
3345 Font</a>) or using the missing character glyph from a default font.
3346 </ol>
3348 <p>Optimizations of this process are allowed provided that an
3349 implementation behaves as if the algorithm had been followed exactly.
3350 Matching occurs in a well-defined order to insure that the results are as
3351 consistent as possible across user agents, given an identical set of
3352 available fonts and rendering technology.
3354 <p>The <dfn id=first-available-font>first available font</dfn>, used in the
3355 definition of <a
3356 href="http://www.w3.org/TR/css3-values/#font-relative-lengths"><em>font-relative
3357 lengths</em></a> such as ‘<code class=property>ex</code>’ and ‘<code
3358 class=property>ch</code>’, is defined to be the first available font
3359 that would match any character given font families in the ‘<code
3360 class=property>font-family</code>’ list (or a user agent's default font
3361 if none are available).
3363 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
3365 <p>When text contains characters such as combining marks, ideally the base
3366 character should be rendered using the same font as the mark, this assures
3367 proper placement of the mark. For this reason, the font matching algorithm
3368 for clusters is more specialized than the general case of matching a
3369 single character by itself. For sequences containing variation selectors,
3370 which indicate the precise glyph to be used for a given character, user
3371 agents always attempt <a href="#system-font-fallback"><em>system font
3372 fallback</em></a> to find the appropriate glyph before using the default
3373 glyph of the base character.
3375 <p>A sequence of codepoints containing combining mark or other modifiers is
3376 termed a grapheme cluster (see <a href="#CSS3TEXT"
3377 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
3378 description). For a given cluster containing a base character, <em>b</em>
3379 and a sequence of combining characters <em>c1, c2…</em>, the entire
3380 cluster is matched using these steps:
3382 <ol>
3383 <li>For each family in the font list, a face is chosen using the style
3384 selection rules defined in the previous section.
3385 <ol>
3386 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
3387 completely supported by the font, select this font for the sequence.
3389 <li>If a sequence of multiple codepoints is canonically equivalent to a
3390 single character and the font <a href="#support"><em
3391 title=support>supports</em></a> that character, select this font for
3392 the sequence.
3393 </ol>
3395 <li>If no font was found in the font list in step 1:
3396 <ol>
3397 <li>If <em>c1</em> is a variation selector, system fallback must be used
3398 to find a font that <a href="#support"><em
3399 title=support>supports</em></a> the full sequence of <em>b + c1</em>.
3400 If no font on the system <a href="#support"><em
3401 title=support>supports</em></a> the full sequence, match the single
3402 character <em>b</em> using the normal procedure for matching single
3403 characters and ignore the variation selector. Note: a sequence with
3404 more than one variation selector must be treated as an encoding error
3405 and the trailing selectors must be ignored. <a href="#UNICODE6"
3406 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>
3408 <li>Otherwise, the user agent may optionally use system font fallback to
3409 match a font that <a href="#support"><em
3410 title=support>supports</em></a> the entire cluster.
3411 </ol>
3413 <li>If no font is found in step 2, use the matching sequence from step 1
3414 to determine the longest sequence that is completely <a
3415 href="#support"><em title=support>supported</em></a> by a font in the
3416 font list and attempt to match the remaining combining characters
3417 separately using the rules for single characters.
3418 </ol>
3420 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
3421 issues</h3>
3423 <p>CSS font matching is always performed on text runs containing Unicode
3424 characters, so documents using legacy encodings are assumed to have been
3425 transcoded before matching fonts. For fonts containing <a
3426 href="#character-map"><em title="character map">character maps</em></a>
3427 for both legacy encodings and Unicode, the contents of the legacy encoding
3428 <a href="#character-map"><em>character map</em></a> must have no effect on
3429 the results of the font matching process.
3431 <p>The font matching process does not assume that text runs are in either
3432 normalized or denormalized form (see <a href="#CHARMOD-NORM"
3433 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
3434 details). Fonts may only support precomposed forms and not the decomposed
3435 sequence of base character plus combining marks. Authors should always
3436 tailor their choice of fonts to their content, including whether that
3437 content contains normalized or denormalized character streams.
3439 <p>If a given character is a Private-Use Area Unicode codepoint, user
3440 agents must only match font families named in the ‘<code
3441 class=property>font-family</code>’ list that are not generic families.
3442 If none of the families named in the ‘<code
3443 class=property>font-family</code>’ list contain a glyph for that
3444 codepoint, user agents must display some form of missing glyph symbol for
3445 that character rather than attempting <a
3446 href="#system-font-fallback"><em>system font fallback</em></a> for that
3447 codepoint. When matching the replacement character U+FFFD, user agents may
3448 skip the font matching process and immediately display some form of
3449 missing glyph symbol, they are not required to display the glyph from the
3450 font that would be selected by the font matching process.
3452 <p>In general, the fonts for a given family will all have the same or
3453 similar <a href="#character-map"><em title="character map">character
3454 maps</em></a>. The process outlined here is designed to handle even font
3455 families containing faces with widely variant <a href="#character-map"><em
3456 title="character map">character maps</em></a>. However, authors are
3457 cautioned that the use of such families can lead to unexpected results.
3459 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
3460 changes since CSS 2.1</h3>
3462 <p>The algorithm above is different from CSS 2.1 in a number of key places.
3463 These changes were made to better reflect actual font matching behavior
3464 across user agent implementations.
3466 <p>Differences compared to the font matching algorithm in CSS 2.1:
3468 <ul>
3469 <li>The algorithm includes font-stretch matching.
3471 <li>All possible font-style matching scenarios are delineated.
3473 <li>Small-caps fonts are not matched as part of the font matching process,
3474 they are now handled via font features.
3476 <li>Unicode variation selector matching is required.
3478 <li>Cluster sequences are matched as a unit.
3479 </ul>
3481 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
3482 examples</h3>
3484 <div class=example>
3485 <p>It's useful to note that the CSS selector syntax may be used to create
3486 language-sensitive typography. For example, some Chinese and Japanese
3487 characters are unified to have the same Unicode code point, although the
3488 abstract glyphs are not the same in the two languages.
3490 <pre>*:lang(ja-jp) { font: 900 14pt/16pt "Heisei Mincho W9", serif; }
3491 *:lang(zh-tw) { font: 800 14pt/16.5pt "Li Sung", serif; }
3492 </pre>
3494 <p>This selects any element that has the given language — Japanese or
3495 Traditional Chinese — and uses the appropriate font.
3496 </div>
3498 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
3500 <p>Modern font technologies support a variety of advanced typographic and
3501 language-specific font features. Using these features, a single font can
3502 provide glyphs for a wide range of ligatures, contextual and stylistic
3503 alternates, tabular and old-style figures, small capitals, automatic
3504 fractions, swashes, and alternates specific to a given language. To allow
3505 authors control over these font capabilities, the ‘<code
3506 class=property>font-variant</code>’ property has been expanded for CSS3.
3507 It now functions as a shorthand for a set of properties that provide
3508 control over stylistic font features.
3510 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
3511 selection and positioning</h3>
3513 <p>Simple fonts used for displaying Latin text use a very basic processing
3514 model. Fonts contain a <a href="#character-map"><em>character map</em></a>
3515 which maps each character to a glyph for that character. Glyphs for
3516 subsequent characters are simply placed one after the other along a run of
3517 text. Modern font formats such as OpenType and AAT (Apple Advanced
3518 Typography) use a richer processing model. The glyph for a given character
3519 can be chosen and positioned not just based on the codepoint of the
3520 character itself, but also on adjacent characters as well as the language,
3521 script, and features enabled for the text. Font features may be required
3522 for specific scripts, or recommended as enabled by default or they might
3523 be stylistic features meant to be used under author control.
3525 <p>For a good visual overview of these features, see the <a
3526 href="#OPENTYPE-FONT-GUIDE"
3527 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
3528 For a detailed description of glyph processing for OpenType fonts, see <a
3529 href="#WINDOWS-GLYPH-PROC"
3530 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
3532 <p>Stylistic font features can be classified into two broad categories:
3533 ones that affect the harmonization of glyph shapes with the surrounding
3534 context, such as kerning and ligature features, and ones such as the
3535 small-caps, subscript/superscript and alternate features that affect shape
3536 selection.
3538 <p>The subproperties of <a href="#propdef-font-variant"
3539 title="font-variant!!property">‘<code
3540 class=property>font-variant</code>’</a> listed below are used to control
3541 these stylistic font features. They do not control features that are
3542 required for displaying certain scripts, such as the OpenType features
3543 used when displaying Arabic or Indic language text. They affect glyph
3544 selection and positioning, but do not affect font selection as described
3545 in the font matching section (except in cases required for compatibility
3546 with CSS 2.1).
3548 <p>To assure consistent behavior across user agents, the equivalent
3549 OpenType property settings are listed for individual properties and are
3550 normative. When using other font formats these should be used as a
3551 guideline to map CSS font feature property values to specific font
3552 features.
3554 <h3 id=language-specific-support><span class=secno>6.2
3555 </span>Language-specific display</h3>
3557 <p>OpenType also supports language-specific glyph selection and
3558 positioning, so that text can be displayed correctly in cases where the
3559 language dictates a specific display behavior. Many languages share a
3560 common script, but the shape of certain letters can vary across those
3561 languages. For example, certain Cyrillic letters have different shapes in
3562 Russian text than in Bulgarian. In Latin text, it's common to render "fi"
3563 with an explicit fi-ligature that lacks a dot on the "i". However, in
3564 languages such as Turkish which uses both a dotted-i and a dotless-i, it's
3565 important to not use this ligature or use a specialized version that
3566 contains a dot over the "i". The example below shows language-specific
3567 variations based on stylistic traditions found in Spanish, Italian and
3568 French orthography:
3570 <div class=featex><img alt="language specific forms, spanish"
3571 src=locl-1.png></div>
3573 <div class=featex><img alt="language specific forms, italian"
3574 src=locl-2.png></div>
3576 <div class=featex><img alt="language specific forms, french"
3577 src=locl-3.png></div>
3579 <p>If the content language of the element is known according to the rules
3580 of the <a
3581 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
3582 language</a>, user agents are required to infer the OpenType language
3583 system from the content language and use that when selecting and
3584 positioning glyphs using an OpenType font.
3586 <p>For OpenType fonts, in some cases it may be necessary to explicitly
3587 declare the OpenType language to be used, for example when displaying text
3588 in a given language that uses the typographic conventions of another
3589 language or when the font does not explicitly support a given language but
3590 supports a language that shares common typographic conventions. The ‘<a
3591 href="#propdef-font-language-override"><code
3592 class=property>font-language-override</code></a>’ property is used for
3593 this purpose.</p>
3594 <!-- prop: font-kerning -->
3596 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
3597 href="#propdef-font-kerning">font-kerning</a> property</h3>
3599 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
3600 <tbody>
3601 <tr>
3602 <td>Name:
3604 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
3606 <tr>
3607 <td>Value:
3609 <td><a href="#font-kerning-auto-value"
3610 title="auto!!font-kerning">auto</a> | <a
3611 href="#font-kerning-normal-value"
3612 title="normal!!font-kerning">normal</a> | <a
3613 href="#font-kerning-none-value" title="none!!font-kerning">none</a>
3615 <tr>
3616 <td>Initial:
3618 <td>auto
3620 <tr>
3621 <td>Applies to:
3623 <td>all elements
3625 <tr>
3626 <td>Inherited:
3628 <td>yes
3630 <tr>
3631 <td>Percentages:
3633 <td>N/A
3635 <tr>
3636 <td>Media:
3638 <td>visual
3640 <tr>
3641 <td>Computed value:
3643 <td>as specified
3645 <tr>
3646 <td>Animatable:
3648 <td>no
3649 </table>
3651 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
3652 property controls metric kerning, kerning that utilizes adjustment data
3653 contained in the font.
3655 <dl>
3656 <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
3658 <dd>Specifies that kerning is applied at the discretion of the user agent
3660 <dt><dfn id=font-kerning-normal-value
3661 title="normal!!font-kerning">normal</dfn>
3663 <dd>Specifies that kerning is applied
3665 <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
3667 <dd>Specifies that kerning is not applied
3668 </dl>
3670 <p>For fonts that do not include kerning data this property will have no
3671 visible effect. When rendering with OpenType fonts, the <a
3672 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
3673 specification suggests that kerning be enabled by default. When kerning is
3674 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
3675 vertical text runs the <span class=tag>vkrn</span> feature is enabled
3676 instead). User agents must also support fonts that only support kerning
3677 via data contained in a <span class=tag>kern</span> font table, as
3678 detailed in the OpenType specification. If the ‘<code
3679 class=property>letter-spacing</code>’ property is defined, kerning
3680 adjustments are considered part of the default spacing and letter spacing
3681 adjustments are made after kerning has been applied.
3683 <p>When set to ‘<code class=property>auto</code>’, user agents can
3684 determine whether to apply kerning or not based on a number of factors:
3685 text size, script, or other factors that influence text processing speed.
3686 Authors who want proper kerning should use <a
3687 href="#font-kerning-normal-value" title="normal!!font-kerning">‘<code
3688 class=property>normal</code>’</a> to explicitly enable kerning.
3689 Likewise, some authors may prefer to disable kerning in situations where
3690 performance is more important than precise appearance. However, in
3691 well-designed modern implementations the use of kerning generally does not
3692 have a large impact on text rendering speed.</p>
3693 <!-- prop: font-variant-ligatures -->
3695 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
3696 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
3697 property</h3>
3699 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
3700 <tbody>
3701 <tr>
3702 <td>Name:
3704 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
3706 <tr>
3707 <td>Value:
3709 <td><a href="#font-variant-ligatures-normal-value"
3710 title="normal!!font-variant-ligatures">normal</a> | <a
3711 href="#font-variant-ligatures-none-value"
3712 title="none!!font-variant-ligatures">none</a> | [ <a
3713 href="#common-lig-values"><var><common-lig-values></var></a> ||
3714 <a
3715 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
3716 || <a
3717 href="#historical-lig-values"><var><historical-lig-values></var></a>
3718 || <a
3719 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
3720 ]
3722 <tr>
3723 <td>Initial:
3725 <td>normal
3727 <tr>
3728 <td>Applies to:
3730 <td>all elements
3732 <tr>
3733 <td>Inherited:
3735 <td>yes
3737 <tr>
3738 <td>Percentages:
3740 <td>N/A
3742 <tr>
3743 <td>Media:
3745 <td>visual
3747 <tr>
3748 <td>Computed value:
3750 <td>as specified
3752 <tr>
3753 <td>Animatable:
3755 <td>no
3756 </table>
3758 <p>Ligatures and contextual forms are ways of combining glyphs to produce
3759 more harmonized forms.
3761 <pre
3762 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>
3764 <pre
3765 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>
3767 <pre
3768 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>
3770 <pre
3771 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>
3773 <p>Individual values have the following meanings:
3775 <dl>
3776 <dt><dfn id=font-variant-ligatures-normal-value
3777 title="normal!!font-variant-ligatures">normal</dfn>
3779 <dd>A value of <a href="#font-variant-ligatures-normal-value"
3780 title="normal!!font-variant-ligatures">‘<code
3781 class=property>normal</code>’</a> specifies that common default
3782 features are enabled, <a href="#font-feature-resolution">as described in
3783 detail in the next section</a>. For OpenType fonts, common ligatures and
3784 contextual forms are on by default, discretionary and historical
3785 ligatures are not.
3787 <dt><dfn id=font-variant-ligatures-none-value
3788 title="none!!font-variant-ligatures">none</dfn>
3790 <dd>Specifies that all types of ligatures and contextual forms covered by
3791 this property are explicitly disabled. In situations where ligatures are
3792 not considered necessary, this may improve the speed of text rendering.
3794 <dt><dfn id=common-ligatures>common-ligatures</dfn>
3796 <dd>Enables display of common ligatures (OpenType features: <span
3797 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
3798 enabled by default.
3799 </dl>
3801 <div class=featex><img alt="common ligature example" src=liga.png></div>
3803 <dl>
3804 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
3806 <dd>Disables display of common ligatures (OpenType features: <span
3807 class=tag>liga, clig</span>).
3809 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
3811 <dd>Enables display of discretionary ligatures (OpenType feature: <span
3812 class=tag>dlig</span>). Which ligatures are discretionary or optional is
3813 decided by the type designer, so authors will need to refer to the
3814 documentation of a given font to understand which ligatures are
3815 considered discretionary.
3816 </dl>
3818 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
3820 <dl>
3821 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
3823 <dd>Disables display of discretionary ligatures (OpenType feature: <span
3824 class=tag>dlig</span>).
3826 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
3828 <dd>Enables display of historical ligatures (OpenType feature: <span
3829 class=tag>hlig</span>).
3830 </dl>
3832 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
3834 <dl>
3835 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
3837 <dd>Disables display of historical ligatures (OpenType feature: <span
3838 class=tag>hlig</span>).
3840 <dt><dfn id=contextual>contextual</dfn>
3842 <dd>Enables display of contextual alternates (OpenType feature: <span
3843 class=tag>calt</span>). Although not strictly a ligature feature, like
3844 ligatures this feature is commonly used to harmonize the shapes of glyphs
3845 with the surrounding context. For OpenType fonts, this feature is on by
3846 default.
3847 </dl>
3849 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
3851 <dl>
3852 <dt><dfn id=no-contextual>no-contextual</dfn>
3854 <dd>Disables display of contextual alternates (OpenType feature: <span
3855 class=tag>calt</span>).
3856 </dl>
3858 <p>Required ligatures, needed for correctly rendering complex scripts, are
3859 not affected by the settings above, including ‘<code
3860 class=property>none</code>’ (OpenType feature: <span
3861 class=tag>rlig</span>).</p>
3862 <!-- prop: font-variant-position -->
3864 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
3865 and superscript forms: the <a
3866 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
3868 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
3869 <tbody>
3870 <tr>
3871 <td>Name:
3873 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
3875 <tr>
3876 <td>Value:
3878 <td><a href="#font-variant-position-normal-value"
3879 title="normal!!font-variant-position">normal</a> | <a
3880 href="#sub">sub</a> | <a href="#super">super</a>
3882 <tr>
3883 <td>Initial:
3885 <td>normal
3887 <tr>
3888 <td>Applies to:
3890 <td>all elements
3892 <tr>
3893 <td>Inherited:
3895 <td>yes
3897 <tr>
3898 <td>Percentages:
3900 <td>N/A
3902 <tr>
3903 <td>Media:
3905 <td>visual
3907 <tr>
3908 <td>Computed value:
3910 <td>as specified
3912 <tr>
3913 <td>Animatable:
3915 <td>no
3916 </table>
3918 <p>This property is used to enable typographic subscript and superscript
3919 glyphs. These are alternate glyphs designed within the same em-box as
3920 default glyphs and are intended to be laid out on the same baseline as the
3921 default glyphs, with no resizing or repositioning of the baseline. They
3922 are explicitly designed to match the surrounding text and to be more
3923 readable without affecting the line height.
3925 <div class=figure><img alt="comparison between real subscript glyphs and
3926 synthesized ones" src=realsubscripts.png>
3927 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
3928 (bottom)
3929 </div>
3931 <p>Individual values have the following meanings:
3933 <dl>
3934 <dt><dfn id=font-variant-position-normal-value
3935 title="normal!!font-variant-position">normal</dfn>
3937 <dd>None of the features listed below are enabled.
3939 <dt><dfn id=sub>sub</dfn>
3941 <dd>Enables display of subscript variants (OpenType feature: <span
3942 class=tag>subs</span>).
3944 <dt><dfn id=super>super</dfn>
3946 <dd>Enables display of superscript variants (OpenType feature: <span
3947 class=tag>sups</span>).
3948 </dl>
3950 <p>Because of the semantic nature of subscripts and superscripts, when the
3951 value is either ‘<a href="#sub"><code class=property>sub</code></a>’
3952 or ‘<a href="#super"><code class=property>super</code></a>’ for a
3953 given contiguous run of text, if a variant glyph is not available for all
3954 the characters in the run, simulated glyphs must be synthesized for all
3955 characters using reduced forms of the glyphs that would be used without
3956 this feature applied. This is done per run to avoid a mixture of variant
3957 glyphs and synthesized ones that would not align correctly. In the case of
3958 OpenType fonts that lack subscript or superscript glyphs for a given
3959 character, user agents must use the appropriate subscript and superscript
3960 metrics specified in the selected font's <a
3961 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
3962 table</a> <a href="#OPENTYPE"
3963 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
3964 and offset of the synthesized substitutes.
3966 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
3967 using superscript metrics" src=superscript-alt-synth.png>
3968 <p class=caption>Superscript alternate glyph (left), synthesized
3969 superscript glyphs (middle), and incorrect mixture of the two (right)
3970 </div>
3972 <p>In situations where text decorations are only applied to runs of text
3973 containing superscript or subscript glyphs, the synthesized glyphs must be
3974 used to avoid problems with the placement of decorations.
3976 <p>In the past, user agents have used font-size and vertical-align to
3977 simulate subscripts and superscripts for the <code title="HTML sub
3978 element">sub</code> and <code title="HTML sup element">sup</code>
3979 elements. To allow a backwards compatible way of defining subscripts and
3980 superscripts, it is recommended that authors use conditional rules <a
3981 href="#CSS3-CONDITIONAL"
3982 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
3983 older user agents will still render subscripts and superscripts via the
3984 older mechanism.
3986 <p>Authors should note that fonts typically only provide subscript and
3987 superscript glyphs for a subset of all characters supported by the font.
3988 For example, while subscript and superscript glyphs are often available
3989 for Latin numbers, glyphs for punctuation and letter characters are less
3990 frequently provided. The synthetic fallback rules defined for this
3991 property assure that subscripts and superscripts will always appear but
3992 the appearance may not match author expectations if the font used does not
3993 provide the appropriate alternate glyph for all characters contained in a
3994 subscript or superscript.
3996 <p>This property is not cumulative. Applying it to elements within a
3997 subscript or superscript won't nest the placement of a subscript or
3998 superscript glyph. Images contained within text runs where the value of
3999 this property is ‘<a href="#sub"><code class=property>sub</code></a>’
4000 or ‘<a href="#super"><code class=property>super</code></a>’ will be
4001 drawn just as they would if the value was <a
4002 href="#font-variant-position-normal-value"
4003 title="normal!!font-variant-position">‘<code
4004 class=property>normal</code>’</a>.</p>
4005 <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
4006 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
4008 <p>Because of these limitations, ‘<a
4009 href="#propdef-font-variant-position"><code
4010 class=property>font-variant-position</code></a>’ is not recommended for
4011 use in user agent stylesheets. Authors should use it in cases where
4012 subscripts or superscripts will only contain the narrow range of
4013 characters supported by the fonts specified.
4015 <p class=note>The variant glyphs use the same baseline as the default
4016 glyphs would use. There is no shift in the placement along the baseline,
4017 so the use of variant glyphs doesn't affect the height of the inline box
4018 or alter the height of the linebox. This makes superscript and subscript
4019 variants ideal for situations where it's important that leading remain
4020 constant, such as in multi-column layout.
4022 <div class=example>
4023 <p>A typical user agent default style for the <a class=tag
4024 href="#sub">sub</a> element:</p>
4026 <pre>sub {
4027 vertical-align: sub;
4028 font-size: smaller;
4029 line-height: normal;
4030 }
4031 </pre>
4033 <p>Using font-variant-position to specify typographic subscripts in a way
4034 that will still show subscripts in older user agents:</p>
4036 <pre>@supports ( font-variant-position: sub ) {
4038 sub {
4039 vertical-align: baseline;
4040 font-size: 100%;
4041 line-height: inherit;
4042 font-variant-position: sub;
4043 }
4045 }
4046 </pre>
4048 <p>User agents that support the ‘<a
4049 href="#propdef-font-variant-position"><code
4050 class=property>font-variant-position</code></a>’ property will select a
4051 subscript variant glyph and render this without adjusting the baseline or
4052 font-size. Older user agents will ignore the ‘<a
4053 href="#propdef-font-variant-position"><code
4054 class=property>font-variant-position</code></a>’ property definition
4055 and use the standard defaults for subscripts.</p>
4056 </div>
4057 <!-- prop: font-variant-caps -->
4059 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
4060 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
4062 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
4063 <tbody>
4064 <tr>
4065 <td>Name:
4067 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
4069 <tr>
4070 <td>Value:
4072 <td><a href="#font-variant-caps-normal-value"
4073 title="normal!!font-variant-caps">normal</a> | <a
4074 href="#small-caps">small-caps</a> | <a
4075 href="#all-small-caps">all-small-caps</a> | <a
4076 href="#petite-caps">petite-caps</a> | <a
4077 href="#all-petite-caps">all-petite-caps</a> | <a
4078 href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
4080 <tr>
4081 <td>Initial:
4083 <td>normal
4085 <tr>
4086 <td>Applies to:
4088 <td>all elements
4090 <tr>
4091 <td>Inherited:
4093 <td>yes
4095 <tr>
4096 <td>Percentages:
4098 <td>N/A
4100 <tr>
4101 <td>Media:
4103 <td>visual
4105 <tr>
4106 <td>Computed value:
4108 <td>as specified
4110 <tr>
4111 <td>Animatable:
4113 <td>no
4114 </table>
4116 <p>This property allows the selection of alternate glyphs used for small or
4117 petite capitals or for titling. These glyphs are specifically designed to
4118 blend well with the surrounding normal glyphs, to maintain the weight and
4119 readability which suffers when text is simply resized to fit this purpose.
4121 <p>Individual values have the following meanings:
4123 <dl>
4124 <dt><dfn id=font-variant-caps-normal-value
4125 title="normal!!font-variant-caps">normal</dfn>
4127 <dd>None of the features listed below are enabled.
4129 <dt><dfn id=small-caps>small-caps</dfn>
4131 <dd>Enables display of small capitals (OpenType feature: <span
4132 class=tag>smcp</span>). Small-caps glyphs typically use the form of
4133 uppercase letters but are reduced to the size of lowercase letters.
4134 </dl>
4136 <div class=featex><img alt="small-caps example" src=smcp.png></div>
4138 <dl>
4139 <dt><dfn id=all-small-caps>all-small-caps</dfn>
4141 <dd>Enables display of small capitals for both upper and lowercase letters
4142 (OpenType features: <span class=tag>c2sc, smcp</span>).
4144 <dt><dfn id=petite-caps>petite-caps</dfn>
4146 <dd>Enables display of petite capitals (OpenType feature: <span
4147 class=tag>pcap</span>).
4149 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
4151 <dd>Enables display of petite capitals for both upper and lowercase
4152 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
4154 <dt><dfn id=unicase>unicase</dfn>
4156 <dd>Enables display of mixture of small capitals for uppercase letters
4157 with normal lowercase letters (OpenType feature: <span
4158 class=tag>unic</span>).
4160 <dt><dfn id=titling-caps>titling-caps</dfn>
4162 <dd>Enables display of titling capitals (OpenType feature: <span
4163 class=tag>titl</span>). Uppercase letter glyphs are often designed for
4164 use with lowercase letters. When used in all uppercase titling sequences
4165 they can appear too strong. Titling capitals are designed specifically
4166 for this situation.
4167 </dl>
4169 <p>The availability of these glyphs is based on whether a given feature is
4170 defined or not in the feature list of the font. User agents can optionally
4171 decide this on a per-script basis but should explicitly not decide this on
4172 a per-character basis.
4174 <p>Some fonts may only support a subset or none of the features described
4175 for this property. For backwards compatibility with CSS 2.1, if ‘<a
4176 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
4177 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
4178 is specified but small-caps glyphs are not available for a given font,
4179 user agents should simulate a small-caps font, for example by taking a
4180 normal font and replacing the glyphs for lowercase letters with scaled
4181 versions of the glyphs for uppercase characters (replacing the glyphs for
4182 both upper and lowercase letters in the case of ‘<a
4183 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
4185 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
4186 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
4187 width=512>
4188 <p class=caption>Synthetic vs. real small-caps
4189 </div>
4191 <p>To match the surrounding text, a font may provide alternate glyphs for
4192 caseless characters when these features are enabled but when a user agent
4193 simulates small capitals, it must not attempt to simulate alternates for
4194 codepoints which are considered caseless.
4196 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
4197 characters with small-caps, all-small-caps enabled" class=hires
4198 src=small-capitals-variations.png width=418>
4199 <p class=caption>Caseless characters with small-caps, all-small-caps
4200 enabled
4201 </div>
4203 <p>If either ‘<a href="#petite-caps"><code
4204 class=property>petite-caps</code></a>’ or ‘<a
4205 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
4206 is specified for a font that doesn't support these features, the property
4207 behaves as if ‘<a href="#small-caps"><code
4208 class=property>small-caps</code></a>’ or ‘<a
4209 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4210 respectively, had been specified. If ‘<a href="#unicase"><code
4211 class=property>unicase</code></a>’ is specified for a font that doesn't
4212 support that feature, the property behaves as if ‘<a
4213 href="#small-caps"><code class=property>small-caps</code></a>’ was
4214 applied only to lowercased uppercase letters. If ‘<a
4215 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
4216 specified with a font that does not support this feature, this property
4217 has no visible effect. When simulated small capital glyphs are used, for
4218 scripts that lack uppercase and lowercase letters, ‘<a
4219 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
4220 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4221 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
4222 ‘<a href="#all-petite-caps"><code
4223 class=property>all-petite-caps</code></a>’ and ‘<a
4224 href="#unicase"><code class=property>unicase</code></a>’ have no visible
4225 effect.
4227 <p>When casing transforms are used to simulate small capitals, the casing
4228 transformations must match those used for the <span
4229 class=property>‘<code class=property>text-transform</code>’</span>
4230 property.
4232 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
4233 replace glyphs in a small-caps font so that the text appears in all
4234 uppercase letters.
4236 <div class=figure style="padding: 0; margin: auto;"><img alt="using
4237 all-small-caps in acronym-laden text" class=hires
4238 src=acronym-laden-text.png width=596>
4239 <p class=caption>Using small capitals to improve readability in
4240 acronym-laden text
4241 </div>
4243 <div class=example>
4244 <p>Quotes rendered italicised, with small-caps on the first line:</p>
4246 <pre>blockquote { font-style: italic; }
4247 blockquote:first-line { font-variant: small-caps; }
4249 <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>
4250 </pre>
4251 </div>
4252 <!-- prop: font-variant-numeric -->
4254 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
4255 formatting: the <a
4256 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
4258 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
4259 <tbody>
4260 <tr>
4261 <td>Name:
4263 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
4265 <tr>
4266 <td>Value:
4268 <td><a href="#font-variant-numeric-normal-value"
4269 title="normal!!font-variant-numeric">normal</a> | [ <a
4270 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
4271 || <a
4272 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
4273 || <a
4274 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
4275 || <a href="#ordinal">ordinal</a> || <a
4276 href="#slashed-zero">slashed-zero</a> ]
4278 <tr>
4279 <td>Initial:
4281 <td>normal
4283 <tr>
4284 <td>Applies to:
4286 <td>all elements
4288 <tr>
4289 <td>Inherited:
4291 <td>yes
4293 <tr>
4294 <td>Percentages:
4296 <td>N/A
4298 <tr>
4299 <td>Media:
4301 <td>visual
4303 <tr>
4304 <td>Computed value:
4306 <td>as specified
4308 <tr>
4309 <td>Animatable:
4311 <td>no
4312 </table>
4314 <p>Specifies control over numerical forms. The example below shows how some
4315 of these values can be combined to influence the rendering of tabular data
4316 with fonts that support these features. Within normal paragraph text,
4317 proportional numbers are used while tabular numbers are used so that
4318 columns of numbers line up properly:
4320 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
4321 number styles" src=numberstyles.png>
4322 <p class=caption>Using number styles
4323 </div>
4325 <p>Possible combinations:
4327 <pre
4328 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>
4330 <pre
4331 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>
4333 <pre
4334 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>
4336 <p>Individual values have the following meanings:
4338 <dl>
4339 <dt><dfn id=font-variant-numeric-normal-value
4340 title="normal!!font-variant-numeric">normal</dfn>
4342 <dd>None of the features listed below are enabled.
4344 <dt><dfn id=lining-nums>lining-nums</dfn>
4346 <dd>Enables display of lining numerals (OpenType feature: <span
4347 class=tag>lnum</span>).
4349 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
4351 <dd>Enables display of old-style numerals (OpenType feature: <span
4352 class=tag>onum</span>).
4354 <dt><dfn id=proportional-nums>proportional-nums</dfn>
4356 <dd>Enables display of proportional numerals (OpenType feature: <span
4357 class=tag>pnum</span>).
4359 <dt><dfn id=tabular-nums>tabular-nums</dfn>
4361 <dd>Enables display of tabular numerals (OpenType feature: <span
4362 class=tag>tnum</span>).
4364 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
4366 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
4367 class=tag>frac</span>).
4368 </dl>
4370 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
4372 <dl>
4373 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
4375 <dd>Enables display of lining stacked fractions (OpenType feature: <span
4376 class=tag>afrc</span>).
4377 </dl>
4379 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
4381 <dl>
4382 <dt><dfn id=ordinal>ordinal</dfn>
4384 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
4385 <span class=tag>ordn</span>).
4386 </dl>
4388 <div class=featex><img alt="ordinals example" src=ordinals.png></div>
4390 <dl>
4391 <dt><dfn id=slashed-zero>slashed-zero</dfn>
4393 <dd>Enables display of slashed zeros (OpenType feature: <span
4394 class=tag>zero</span>).
4395 </dl>
4397 <div class=featex><img alt="slashed zero example" src=zero.png></div>
4399 <div class=example id=ordinal-example>
4400 <p>In the case of ‘<a href="#ordinal"><code
4401 class=property>ordinal</code></a>’, although ordinal forms are often
4402 the same as superscript forms, they are marked up differently.</p>
4404 <p>For superscripts, the variant property is only applied to the
4405 sub-element containing the superscript:</p>
4407 <pre>
4408 sup { font-variant-position: super; }
4409 x<sup>2</sup>
4410 </pre>
4412 <p>For ordinals, the variant property is applied to the entire ordinal
4413 number:</p>
4415 <pre>
4416 .ordinal { font-variant-numeric: ordinal; }
4417 <span class="ordinal">17th</span>
4418 </pre>
4420 <p>In this case only the "th" will appear in ordinal form, the digits will
4421 remain unchanged. Depending upon the typographic traditions used in a
4422 given language, ordinal forms may differ from superscript forms. In
4423 Italian, for example, ordinal forms sometimes include an underline in the
4424 ordinal design.</p>
4425 </div>
4427 <div class=example id=steak-marinade>
4428 <p>A simple flank steak marinade recipe, rendered with automatic fractions
4429 and old-style numerals:</p>
4431 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
4433 <h4>Steak marinade:</h4>
4434 <ul>
4435 <li><span class="amount">2</span> tbsp olive oil</li>
4436 <li><span class="amount">1</span> tbsp lemon juice</li>
4437 <li><span class="amount">1</span> tbsp soy sauce</li>
4438 <li><span class="amount">1 1/2</span> tbsp dry minced onion</li>
4439 <li><span class="amount">2 1/2</span> tsp italian seasoning</li>
4440 <li>Salt &amp; pepper</li>
4441 </ul>
4443 <p>Mix the meat with the marinade and let it sit covered in the refrigerator
4444 for a few hours or overnight.</p>
4445 </pre>
4447 <p>Note that the fraction feature is only applied to values not the entire
4448 paragraph. Fonts often implement this feature using contextual rules
4449 based on the use of the slash (‘<code class=css>/</code>’) character.
4450 As such, it's not suitable for use as a paragraph-level style.</p>
4451 </div>
4452 <!-- prop: font-variant-alternates -->
4454 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
4455 and swashes: the <a
4456 href="#propdef-font-variant-alternates">font-variant-alternates</a>
4457 property</h3>
4459 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
4460 <tbody>
4461 <tr>
4462 <td>Name:
4464 <td><dfn
4465 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
4467 <tr>
4468 <td>Value:
4470 <td>normal | [ <a href="#stylistic"
4471 title=stylistic>stylistic(<feature-value-name>)</a> || <a
4472 href="#historical-forms">historical-forms</a> || <a href="#styleset"
4473 title=styleset>styleset(<feature-value-name> #)</a> || <a
4474 href="#character-variant"
4475 title=character-variant>character-variant(<feature-value-name>
4476 #)</a> || <a href="#swash"
4477 title=swash>swash(<feature-value-name>)</a> || <a
4478 href="#ornaments"
4479 title=ornaments>ornaments(<feature-value-name>)</a> || <a
4480 href="#annotation"
4481 title=annotation>annotation(<feature-value-name>)</a> ]
4483 <tr>
4484 <td>Initial:
4486 <td>normal
4488 <tr>
4489 <td>Applies to:
4491 <td>all elements
4493 <tr>
4494 <td>Inherited:
4496 <td>yes
4498 <tr>
4499 <td>Percentages:
4501 <td>N/A
4503 <tr>
4504 <td>Media:
4506 <td>visual
4508 <tr>
4509 <td>Computed value:
4511 <td>as specified
4513 <tr>
4514 <td>Animatable:
4516 <td>no
4517 </table>
4519 <p>For any given character, fonts can provide a variety of alternate glyphs
4520 in addition to the default glyph for that character. This property
4521 provides control over the selection of these alternate glyphs.
4523 <p>For many of the property values listed below, several different
4524 alternate glyphs are available. How many alternates are available and what
4525 they represent is font-specific, so these are each marked <dfn
4526 id=font-specific>font specific</dfn> in the value definitions below.
4527 Because the nature of these alternates is font-specific, the <a
4528 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4529 rule is used to define values for a specific font family or set of
4530 families that associate a font-specific numeric
4531 <code><feature-index></code> with a custom
4532 <code><feature-value-name></code>, which is then used in this
4533 property to select specific alternates:
4535 <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
4537 p {
4538 font-family: Noble Script;
4539 font-variant-alternates: swash(flowing); /* use swash alternate #2 */
4540 }</pre>
4542 <p>When a particular <code><feature-value-name></code> has not been
4543 defined for a given family or for a particular feature type, the computed
4544 value must be the same as if it had been defined. However, property values
4545 that contain these undefined <code><feature-value-name></code>
4546 identifiers must be ignored when choosing glyphs.
4548 <pre>/* these two style rules are effectively the same */
4549 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
4550 p { font-variant-alternates: normal; }
4551 </pre>
4553 <p>This allows values to be defined and used for a given set of font
4554 families but ignored if fallback occurs, since the font family name would
4555 be different. If a given value is outside the range supported by a given
4556 font, the value is ignored. These values never apply to generic font
4557 families.
4559 <p>Individual values have the following meanings:
4561 <dl>
4562 <dt><dfn id=font-variant-alternates-normal-value
4563 title="normal!!font-variant-alternates">normal</dfn>
4565 <dd>None of the features listed below are enabled.
4567 <dt><dfn id=historical-forms>historical-forms</dfn>
4569 <dd>Enables display of historical forms (OpenType feature: <span
4570 class=tag>hist</span>).
4571 </dl>
4573 <div class=featex><img alt="historical form example" src=hist.png></div>
4575 <dl>
4576 <dt><dfn id=stylistic
4577 title=stylistic>stylistic(<feature-value-name>)</dfn>
4579 <dd>Enables display of stylistic alternates (<a
4580 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4581 class=tag>salt <feature-index></span>).
4582 </dl>
4584 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
4586 <dl>
4587 <dt><dfn id=styleset title=styleset>styleset(<feature-value-name>
4588 #)</dfn>
4590 <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
4591 specific</em></a>, OpenType feature: <span
4592 class=tag>ss<feature-index></span> OpenType currently defines <span
4593 class=tag>ss01</span> through <span class=tag>ss20</span>).
4594 </dl>
4596 <div class=featex><img alt="styleset example" src=ssnn.png></div>
4598 <dl>
4599 <dt><dfn id=character-variant
4600 title=character-variant>character-variant(<feature-value-name>
4601 #)</dfn>
4603 <dd>Enables display of specific character variants (<a
4604 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4605 class=tag>cv<feature-index></span> OpenType currently defines <span
4606 class=tag>cv01</span> through <span class=tag>cv99</span>).
4608 <dt><dfn id=swash title=swash>swash(<feature-value-name>)</dfn>
4610 <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
4611 specific</em></a>, OpenType feature: <span class=tag>swsh
4612 <feature-index>, cswh <feature-index></span>).
4613 </dl>
4615 <div class=featex><img alt="swash example" src=swsh.png></div>
4617 <dl>
4618 <dt><dfn id=ornaments
4619 title=ornaments>ornaments(<feature-value-name>)</dfn>
4621 <dd>Enables replacement of default glyphs with ornaments, if provided in
4622 the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
4623 feature: <span class=tag>ornm <feature-index></span>). Some fonts
4624 may offer ornament glyphs as alternates for a wide collection of
4625 characters; however, displaying arbitrary characters (e.g.,
4626 alphanumerics) as ornaments is poor practice as it distorts the semantics
4627 of the data. Font designers are encouraged to encode all ornaments
4628 (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
4629 alternates for the bullet character (U+2022) to allow authors to select
4630 the desired glyph using ‘<a href="#ornaments"><code
4631 class=property>ornaments</code></a>’.
4632 </dl>
4634 <div class=featex><img alt="ornaments example" src=ornm.png></div>
4636 <dl>
4637 <dt><dfn id=annotation
4638 title=annotation>annotation(<feature-value-name>)</dfn>
4640 <dd>Enables display of alternate annotation forms (<a
4641 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4642 class=tag>nalt <feature-index></span>).
4643 </dl>
4645 <div class=featex><img alt="alternate annotation form example"
4646 src=nalt.png></div>
4648 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
4649 specific alternates: the <dfn id=at-font-feature-values-rule
4650 style="font-weight: inherit; font-style:
4651 inherit"><code>@font-feature-values</code></dfn> rule</h3>
4653 <p>Several of the possible values of ‘<a
4654 href="#propdef-font-variant-alternates"><code
4655 class=property>font-variant-alternates</code></a>’ listed above are
4656 labeled as <a href="#font-specific"><em>font specific</em></a>. For these
4657 features fonts may define not just a single glyph but a set of alternate
4658 glyphs with an index to select a given alternate. Since these are font
4659 family specific, the <a
4660 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4661 rule is used to define named values for these indices for a given family.
4663 <p class=note>See the <a href="#om-fontfeaturevalues">object model
4664 reference section</a> for a description of the interfaces used to modify
4665 these rules via the CSS Object Model.
4667 <div class=example>
4668 <p>In the case of the swash Q in the example shown above, the swash could
4669 be specified using these style rules:</p>
4671 <pre>
4673 @font-feature-values Jupiter Sans {
4674 @swash {
4675 delicate: 1;
4676 flowing: 2;
4677 }
4678 }
4680 h2 { font-family: Jupiter Sans, sans-serif; }
4682 /* show the second swash variant in h2 headings */
4683 h2:first-letter { font-variant-alternates: swash(flowing); }
4685 <h2>Quick</h2></pre>
4687 <p>When Jupiter Sans is present, the second alternate swash alternate will
4688 be displayed. When not present, no swash character will be shown, since
4689 the specific named value "flowing" is only defined for the Jupiter Sans
4690 family. The @-mark indicates the name of the property value for which a
4691 named value can be used. The name "flowing" is chosen by the author. The
4692 index that represents each alternate is defined within a given font's
4693 data.</p>
4694 </div>
4696 <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
4698 <p>An <a
4699 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4700 rule is composed of a list of font families followed by a block containing
4701 individual <a href="#featurevalueblock"><i
4702 title="feature_value_block">feature value blocks</i></a> that take the
4703 form of @-rules. Each block defines a set of named values for a specific
4704 font feature when a given set of font families is used. Effectively, they
4705 define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
4706 ⟨values⟩ are the numeric indices used for specific features defined
4707 for a given font.
4709 <p>In terms of the grammar, this specification defines the following
4710 productions:
4712 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
4713 : <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>*
4714 '{' <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>*
4715 ;
4717 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
4718 : <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> ]*
4719 ;
4721 <dfn id=fontfamilyname>font_family_name</dfn>
4722 : <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> ]* ]
4723 ;
4725 <dfn id=featurevalueblock>feature_value_block</dfn>
4726 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
4727 '{' <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>*
4728 ;
4730 <dfn id=featuretype>feature_type</dfn>:
4731 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
4732 ;
4734 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
4735 : <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> ]*
4736 ;
4737 </pre>
4739 <p>The following new token is introduced:
4741 <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>;}
4742 </pre>
4744 <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
4745 value blocks</i></a> are handled as <a
4746 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
4747 consist of everything up to the next block or semi-colon, whichever comes
4748 first.
4750 <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
4751 family list</i></a> is a comma-delimited list of <a
4752 href="#fontfamilyname"><i title="font_family_name">font family
4753 names</i></a> that match the definition of <a
4754 href="#family-name-value"><var><family-name></var></a> for the <a
4755 href="#propdef-font-family" title="font-family!!property">‘<code
4756 class=property>font-family</code>’</a> property. This means that only
4757 named font families are allowed, rules that include generic or system
4758 fonts in the list of font families are syntax errors. However, if a user
4759 agent defines a generic font to be a specific named font (e.g. Helvetica),
4760 the settings associated with that family name will be used. If syntax
4761 errors occur within the font family list, the entire rule must be ignored.
4763 <p>Within <a href="#featurevalueblock"><i
4764 title="feature_value_block">feature value blocks</i></a>, the <a
4765 href="#featuretype"><i title="feature_type">feature type</i></a> is
4766 ‘<code class=css>@</code>’ followed by the name of one of the <a
4767 href="#font-specific"><em>font specific</em></a> property values of ‘<a
4768 href="#propdef-font-variant-alternates"><code
4769 class=property>font-variant-alternates</code></a>’ (e.g. <a
4770 href="#swash"><code>@swash</code></a>). The identifiers used within
4771 feature value definitions follow the rules of CSS user identifiers and are
4772 case-sensitive. They are unique only for a given set of font families and
4773 <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
4774 same identifier used with a different <a href="#featuretype"><i
4775 title="feature_type">feature type</i></a> is treated as a separate and
4776 distinct value. If the same identifier is defined mulitple times for a
4777 given <a href="#featuretype"><i title="feature_type">feature type</i></a>
4778 and font family, the last defined value is used. Values associated with a
4779 given identifier are limited to integer values 0 or greater.
4781 <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
4782 title="feature_value_definition">feature value definition</i></a>, such as
4783 invalid identifiers or values, the entire <a
4784 href="#featurevaluedefinition"><i title="feature_value_definition">feature
4785 value definition</i></a> must be omitted, just as syntax errors in style
4786 declarations are handled. When the <a href="#featuretype"><i
4787 title="feature_type">feature type</i></a> is invalid, the entire
4788 associated <a href="#featurevalueblock"><i
4789 title="feature_value_block">feature value block</i></a> must be ignored.
4791 <div class=example>
4792 <p>Rules that are equivalent given syntax error handling:</p>
4794 <pre>@font-feature-values Bongo {
4795 @swash { ornate: 1; }
4796 annotation { boxed: 4; } /* should be @annotation! */
4797 @swash { double-loops: 1; flowing: -1; } /* negative value */
4798 @ornaments ; /* incomplete definition */
4799 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
4800 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a> /* random editing mistake */
4801 }</pre>
4803 <p>The example above is equivalent to:</p>
4805 <pre>@font-feature-values Bongo {
4806 @swash { ornate: 1; }
4807 @swash { double-loops: 1; }
4808 @styleset { double-W: 14; sharp-terminals: 16 1; }
4809 }</pre>
4810 </div>
4812 <p>If multiple <a
4813 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4814 rules are defined for a given family, the resulting values definitions are
4815 the union of the definitions contained within these rules. This allows a
4816 set of named values to be defined for a given font family globally for a
4817 site and specific additions made per-page.
4819 <div class=example>
4820 <p>Using both site-wide and per-page feature values:</p>
4822 <pre>
4823 site.css:
4825 @font-feature-values Mercury Serif {
4826 @styleset {
4827 stacked-g: 3; /* "two-storey" versions of g, a */
4828 stacked-a: 4;
4829 }
4830 }
4832 page.css:
4834 @font-feature-values Mercury Serif {
4835 @styleset {
4836 geometric-m: 7; /* alternate version of m */
4837 }
4838 }
4840 body {
4841 font-family: Mercury Serif, serif;
4843 /* enable both the use of stacked g and alternate m */
4844 font-variant-alternates: styleset(stacked-g, geometric-m);
4845 }</pre>
4846 </div>
4848 <div class=example>
4849 <p>Using a commonly named value allows authors to use a single style rule
4850 to cover a set of fonts for which the underlying selector is different
4851 for each font. If either font in the example below is found, a circled
4852 number glyph will be used:</p>
4854 <pre>@font-feature-values Taisho Gothic {
4855 @annotation { boxed: 1; circled: 4; }
4856 }
4858 @font-feature-values Otaru Kisa {
4859 @annotation { circled: 1; black-boxed: 3; }
4860 }
4862 h3.title {
4863 /* circled form defined for both fonts */
4864 font-family: Taisho Gothic, Otaru Kisa;
4865 font-variant: annotation(circled);
4866 }</pre>
4867 </div>
4869 <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
4870 </span>Multi-valued feature value definitions</h4>
4872 <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
4873 href="#propdef-font-variant-alternates"><code
4874 class=property>font-variant-alternates</code></a>’ property values take
4875 a single value (e.g. ‘<a href="#swash"><code
4876 class=property>swash</code></a>’). The ‘<a
4877 href="#character-variant"><code
4878 class=property>character-variant</code></a>’ property value allows two
4879 values and ‘<a href="#styleset"><code
4880 class=property>styleset</code></a>’ allows an unlimited number.
4882 <p>For the styleset property value, multiple values indicate the style sets
4883 to be enabled. Values between 1 and 99 enable OpenType features <span
4884 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
4885 OpenType standard only officially defines <span class=tag>ss01</span>
4886 through <span class=tag>ss20</span>. For OpenType fonts, values greater
4887 than 99 or equal to 0 do not generate a syntax error when parsed but
4888 enable no OpenType features.
4890 <pre>@font-feature-values Mars Serif {
4891 @styleset {
4892 alt-g: 1; /* implies ss01 = 1 */
4893 curly-quotes: 3; /* implies ss03 = 1 */
4894 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
4895 }
4897 @styleset {
4898 dumb: 125; /* >99, ignored */
4899 }
4901 @swash {
4902 swishy: 3 5; /* more than 1 value for swash, syntax error */
4903 }
4904 }
4906 p.codeblock {
4907 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
4908 font-variant-alternates: styleset(curly-quotes, code);
4909 }</pre>
4911 <p>For character-variant, a single value between 1 and 99 indicates the
4912 enabling of OpenType feature <span class=tag>cv01</span> through <span
4913 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
4914 to 0 are ignored but do not generate a syntax error when parsed but enable
4915 no OpenType features. When two values are listed, the first value
4916 indicates the feature used and the second the value passed for that
4917 feature. If more than two values are assigned to a given name, a syntax
4918 error occurs and the entire <a href="#featurevaluedefinition"><i
4919 title="feature_value_definition">feature value definition</i></a> is
4920 ignored.
4922 <pre>@font-feature-values MM Greek {
4923 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
4924 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
4925 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
4926 @character-variant { gamma: 12; } /* implies cv12 = 1 */
4927 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
4928 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
4929 @character-variant { silly: 105; } /* >99, ignored */
4930 @character-variant { dumb: 323 3; } /* >99, ignored */
4931 }
4933 #title {
4934 /* use the third alternate beta, first alternate gamma */
4935 font-variant-alternates: character-variant(beta-3, gamma);
4936 }
4938 p {
4939 /* zeta-2 follows zeta, implies cv20 = 2 */
4940 font-variant-alternates: character-variant(zeta, zeta-2);
4941 }
4943 .special {
4944 /* zeta follows zeta-2, implies cv20 = 3 */
4945 font-variant-alternates: character-variant(zeta-2, zeta);
4946 }</pre>
4948 <div class=figure><img alt="Matching text on Byzantine seals using
4949 character variants" src=byzantineseal.png>
4950 <p class=caption>Byzantine seal text displayed with character variants
4951 </div>
4953 <div class=example>
4954 <p>In the figure above, the text in red is rendered using a font
4955 containing character variants that mimic the character forms found on a
4956 Byzantine seal from the 8th century A.D. Two lines below is the same text
4957 displayed in a font without variants. Note the two variants for U and N
4958 used on the seal.</p>
4960 <pre>@font-feature-values Athena Ruby {
4961 @character-variant {
4962 leo-B: 2 1;
4963 leo-M: 13 3;
4964 leo-alt-N: 14 1;
4965 leo-N: 14 2;
4966 leo-T: 20 1;
4967 leo-U: 21 2;
4968 leo-alt-U: 21 4;
4969 }
4970 }
4972 p {
4973 font-variant: discretionary-ligatures,
4974 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
4975 }
4977 span.alt-N {
4978 font-variant-alternates: character-variant(leo-alt-N);
4979 }
4981 span.alt-U {
4982 font-variant-alternates: character-variant(leo-alt-U);
4983 }
4985 <p>ENO....UP͞RSTU<span class="alt-U">U</span>͞<span class="alt-U">U</span>ΚΑΙTỤẠG̣IUPNS</p>
4987 <p>LEON|ΚΑΙCONSTA|NTI<span class="alt-N">N</span>OS..|STOIBAṢ.|LIṢROM|AIO<span class="alt-N">N</span></p>
4988 </pre>
4989 </div>
4991 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
4992 Asian text rendering: the <a
4993 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
4994 property</h3>
4996 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
4997 <tbody>
4998 <tr>
4999 <td>Name:
5001 <td><dfn
5002 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
5004 <tr>
5005 <td>Value:
5007 <td><a href="#font-variant-east-asian-normal-value"
5008 title="normal!!font-variant-east-asian">normal</a> | [ <a
5009 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
5010 || <a
5011 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
5012 || <a href="#ruby">ruby</a> ]
5014 <tr>
5015 <td>Initial:
5017 <td>normal
5019 <tr>
5020 <td>Applies to:
5022 <td>all elements
5024 <tr>
5025 <td>Inherited:
5027 <td>yes
5029 <tr>
5030 <td>Percentages:
5032 <td>N/A
5034 <tr>
5035 <td>Media:
5037 <td>visual
5039 <tr>
5040 <td>Computed value:
5042 <td>as specified
5044 <tr>
5045 <td>Animatable:
5047 <td>no
5048 </table>
5050 <p>Allows control of glyph substitution and sizing in East Asian text.
5052 <pre
5053 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>
5055 <pre
5056 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>
5058 <p>Individual values have the following meanings:
5060 <dl>
5061 <dt><dfn id=font-variant-east-asian-normal-value
5062 title="normal!!font-variant-east-asian">normal</dfn>
5064 <dd>None of the features listed below are enabled.
5066 <dt><dfn id=jis78>jis78</dfn>
5068 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
5069 class=tag>jp78</span>).
5070 </dl>
5072 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
5074 <dl>
5075 <dt><dfn id=jis83>jis83</dfn>
5077 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
5078 class=tag>jp83</span>).
5080 <dt><dfn id=jis90>jis90</dfn>
5082 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
5083 class=tag>jp90</span>).
5085 <dt><dfn id=jis04>jis04</dfn>
5087 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
5088 class=tag>jp04</span>).
5089 <p>The various JIS variants reflect the glyph forms defined in different
5090 Japanese national standards. Fonts generally include glyphs defined by
5091 the most recent national standard but it's sometimes necessary to use
5092 older variants, to match signage for example.</p>
5094 <dt><dfn id=simplified>simplified</dfn>
5096 <dd>Enables rendering of simplified forms (OpenType feature: <span
5097 class=tag>smpl</span>).
5099 <dt><dfn id=traditional>traditional</dfn>
5101 <dd>Enables rendering of traditional forms (OpenType feature: <span
5102 class=tag>trad</span>).
5103 </dl>
5105 <p>The ‘<a href="#simplified"><code
5106 class=property>simplified</code></a>’ and ‘<a
5107 href="#traditional"><code class=property>traditional</code></a>’ values
5108 allow control over the glyph forms for characters which have been
5109 simplified over time but for which the older, traditional form is still
5110 used in some contexts. The exact set of characters and glyph forms will
5111 vary to some degree by context for which a given font was designed.
5113 <div class=featex><img alt="tradtional form example" src=trad.png></div>
5115 <dl>
5116 <dt><dfn id=full-width>full-width</dfn>
5118 <dd>Enables rendering of full-width variants (OpenType feature: <span
5119 class=tag>fwid</span>).
5121 <dt><dfn id=proportional-width>proportional-width</dfn>
5123 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
5124 <span class=tag>pwid</span>).
5125 </dl>
5127 <div class=featex><img alt="proportionally spaced Japanese example"
5128 src=pwid.png></div>
5130 <dl>
5131 <dt><dfn id=ruby>ruby</dfn>
5133 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
5134 class=tag>ruby</span>). Since ruby text is generally smaller than the
5135 associated body text, font designers can design special glyphs for use
5136 with ruby that are more readable than scaled down versions of the default
5137 glyphs. Only glyph selection is affected, there is no associated font
5138 scaling or other change that affects line layout. The red ruby text below
5139 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
5140 Note the slight difference in stroke thickness.
5141 </dl>
5143 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
5145 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
5146 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
5147 property</h3>
5149 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
5150 <tbody>
5151 <tr>
5152 <td>Name:
5154 <td><dfn id=propdef-font-variant
5155 title="font-variant!!property">font-variant</dfn>
5157 <tr>
5158 <td>Value:
5160 <td><a href="#font-variant-normal-value"
5161 title="normal!!font-variant">normal</a> | <a
5162 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
5163 <a href="#common-lig-values"><var><common-lig-values></var></a>
5164 || <a
5165 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
5166 || <a
5167 href="#historical-lig-values"><var><historical-lig-values></var></a>
5168 || <a
5169 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
5170 || <a href="#stylistic"><var
5171 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
5172 href="#historical-forms"><var>historical-forms</var></a> || <a
5173 href="#styleset"><var
5174 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
5175 href="#character-variant"><var
5176 title=character-variant>character-variant(<feature-value-name>
5177 #)</var></a> || <a href="#swash"><var
5178 title=swash>swash(<feature-value-name>)</var></a> || <a
5179 href="#ornaments"><var
5180 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
5181 href="#annotation"><var
5182 title=annotation>annotation(<feature-value-name>)</var></a> || [
5183 <a href="#small-caps"><i>small-caps</i></a> | <a
5184 href="#all-small-caps"><i>all-small-caps</i></a> | <a
5185 href="#petite-caps"><i>petite-caps</i></a> | <a
5186 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
5187 href="#unicase"><i>unicase</i></a> | <a
5188 href="#titling-caps"><i>titling-caps</i></a> ] || <a
5189 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
5190 || <a
5191 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
5192 || <a
5193 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
5194 || <a href="#ordinal"><i>ordinal</i></a> || <a
5195 href="#slashed-zero"><i>slashed-zero</i></a> || <a
5196 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
5197 || <a
5198 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
5199 || <a href="#ruby"><i>ruby</i></a> ]
5201 <tr>
5202 <td>Initial:
5204 <td>normal
5206 <tr>
5207 <td>Applies to:
5209 <td>all elements
5211 <tr>
5212 <td>Inherited:
5214 <td>yes
5216 <tr>
5217 <td>Percentages:
5219 <td>see individual properties
5221 <tr>
5222 <td>Media:
5224 <td>visual
5226 <tr>
5227 <td>Computed value:
5229 <td>see individual properties
5231 <tr>
5232 <td>Animatable:
5234 <td>see individual properties
5235 </table>
5237 <p>The <a href="#propdef-font-variant"
5238 title="font-variant!!property">‘<code
5239 class=property>font-variant</code>’</a> property is a shorthand for all
5240 font-variant subproperties. The value <dfn id=font-variant-normal-value
5241 title="normal!!font-variant">‘<code
5242 class=property>normal</code>’</dfn> resets all subproperties of <a
5243 href="#propdef-font-variant" title="font-variant!!property">‘<code
5244 class=property>font-variant</code>’</a> to their inital value. The <dfn
5245 id=font-variant-none-value title="none!!font-variant">‘<code
5246 class=property>none</code>’</dfn> value sets ‘<a
5247 href="#propdef-font-variant-ligatures"><code
5248 class=property>font-variant-ligatures</code></a>’ to ‘<code
5249 class=property>none</code>’ and resets all other font feature properties
5250 to their initial value. Like other shorthands, using <a
5251 href="#propdef-font-variant" title="font-variant!!property">‘<code
5252 class=property>font-variant</code>’</a> resets unspecified <a
5253 href="#propdef-font-variant" title="font-variant!!property">‘<code
5254 class=property>font-variant</code>’</a> subproperties to their initial
5255 values. It does not reset the values of either ‘<a
5256 href="#propdef-font-language-override"><code
5257 class=property>font-language-override</code></a>’ or <a
5258 href="#propdef-font-feature-settings"
5259 title="font-feature-settings!!property">‘<code
5260 class=property>font-feature-settings</code>’</a>.
5262 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
5263 font feature settings control: the <a
5264 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
5266 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
5267 <tbody>
5268 <tr>
5269 <td>Name:
5271 <td><dfn id=propdef-font-feature-settings
5272 title="font-feature-settings!!property">font-feature-settings</dfn>
5274 <tr>
5275 <td>Value:
5277 <td><a href="#font-feature-settings-normal-value"
5278 title="normal!!font-feature-settings">normal</a> | <a
5279 href="#feature-tag-value"><var><feature-tag-value></var></a> #
5281 <tr>
5282 <td>Initial:
5284 <td>normal
5286 <tr>
5287 <td>Applies to:
5289 <td>all elements
5291 <tr>
5292 <td>Inherited:
5294 <td>yes
5296 <tr>
5297 <td>Percentages:
5299 <td>N/A
5301 <tr>
5302 <td>Media:
5304 <td>visual
5306 <tr>
5307 <td>Computed value:
5309 <td>as specified
5311 <tr>
5312 <td>Animatable:
5314 <td>no
5315 </table>
5317 <p>This property provides low-level control over OpenType font features. It
5318 is intended as a way of providing access to font features that are not
5319 widely used but are needed for a particular use case.
5321 <p>Authors should generally use <a href="#propdef-font-variant"
5322 title="font-variant!!property">‘<code
5323 class=property>font-variant</code>’</a> and its related subproperties
5324 whenever possible and only use this property for special cases where its
5325 use is the only way of accessing a particular infrequently used font
5326 feature.
5328 <pre>/* enable small caps and use second swash alternate */
5329 font-feature-settings: "smcp", "swsh" 2;</pre>
5331 <p>A value of <dfn id=font-feature-settings-normal-value
5332 title="normal!!font-feature-settings">‘<code
5333 class=property>normal</code>’</dfn> means that no change in glyph
5334 selection or positioning occurs due to this property.
5336 <p>Feature tag values have the following syntax:
5338 <pre
5339 class=prod><dfn id=feature-tag-value><var><feature-tag-value></var></dfn> = <string> [ <integer> | on | off ]?</pre>
5341 <p>The <string> is a case-sensitive OpenType feature tag. As
5342 specified in the OpenType specification, feature tags contain four ASCII
5343 characters. Tag strings longer or shorter than four characters, or
5344 containing characters outside the U+20–7E codepoint range are invalid.
5345 Feature tags need only match a feature tag defined in the font, so they
5346 are not limited to explicitly registered OpenType features. Fonts defining
5347 custom feature tags should follow the <a
5348 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
5349 rules</a> defined in the OpenType specification <a
5350 href="#OPENTYPE-FEATURES"
5351 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
5353 <p>Feature tags not present in the font are ignored; a user agent must not
5354 attempt to synthesize fallback behavior based on these feature tags. The
5355 one exception is that user agents may synthetically support the <span
5356 class=tag>kern</span> feature with fonts that contain kerning data in the
5357 form of a ‘<code class=property>kern</code>’ table but lack <span
5358 class=tag>kern</span> feature support in the ‘<code
5359 class=property>GPOS</code>’ table.
5361 <p class=note>In general, authors should use the ‘<a
5362 href="#propdef-font-kerning"><code
5363 class=property>font-kerning</code></a>’ property to explicitly enable or
5364 disable kerning since this property always affects fonts with either type
5365 of kerning data.
5367 <p>If present, a value indicates an index used for glyph selection. An
5368 <integer> value must be 0 or greater. A value of 0 indicates that
5369 the feature is disabled. For boolean features, a value of 1 enables the
5370 feature. For non-boolean features, a value of 1 or greater enables the
5371 feature and indicates the feature selection index. A value of ‘<code
5372 class=property>on</code>’ is synonymous with 1 and ‘<code
5373 class=property>off</code>’ is synonymous with 0. If the value is
5374 omitted, a value of 1 is assumed.
5376 <pre>
5377 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
5378 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
5379 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
5380 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
5381 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
5382 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
5383 font-feature-settings: "silly" off; /* invalid, tag too long */
5384 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
5385 font-feature-settings: dlig; /* invalid, tag must be a string */
5386 </pre>
5388 <p>When values greater than the range supported by the font are specified,
5389 the behavior is explicitly undefined. For boolean features, in general
5390 these will enable the feature. For non-boolean features, out of range
5391 values will in general be equivalent to a 0 value. However, in both cases
5392 the exact behavior will depend upon the way the font is designed
5393 (specifically, which type of lookup is used to define the feature).
5395 <p>Although specifically defined for OpenType feature tags, feature tags
5396 for other modern font formats that support font features may be added in
5397 the future. Where possible, features defined for other font formats should
5398 attempt to follow the pattern of registered OpenType tags.
5400 <div class=example>
5401 <p>The Japanese text below will be rendered with half-width kana
5402 characters:</p>
5404 <pre lang=ja>
5405 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
5407 <p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p>
5408 </pre>
5409 </div>
5411 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
5412 language override: the <a
5413 href="#propdef-font-language-override">font-language-override</a> property</h3>
5415 <table class=propdef id=namefont-language-overridevaluenormal-lt>
5416 <tbody>
5417 <tr>
5418 <td>Name:
5420 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
5422 <tr>
5423 <td>Value:
5425 <td><a href="#font-language-override-normal-value"
5426 title="normal!!font-language-override">normal</a> | <a
5427 href="#font-language-override-string-value"><var><string></var></a>
5429 <tr>
5430 <td>Initial:
5432 <td><a href="#font-language-override-normal-value"
5433 title="normal!!font-language-override">normal</a>
5435 <tr>
5436 <td>Applies to:
5438 <td>all elements
5440 <tr>
5441 <td>Inherited:
5443 <td>yes
5445 <tr>
5446 <td>Percentages:
5448 <td>N/A
5450 <tr>
5451 <td>Media:
5453 <td>visual
5455 <tr>
5456 <td>Computed value:
5458 <td>as specified
5460 <tr>
5461 <td>Animatable:
5463 <td>no
5464 </table>
5466 <p>Normally, authors can control the use of language-specific glyph
5467 substitutions and positioning by setting the content language of an
5468 element, as <a href="#language-specific-support">described above</a>:
5470 <pre><!-- Display text using S'gaw Karen specific features -->
5471 <p lang="ksw">...</p></pre>
5473 <p>In some cases, authors may need to specify a language system that
5474 differs from the content language, for example due to the need to mimic
5475 another language's typographic traditions. The ‘<a
5476 href="#propdef-font-language-override"><code
5477 class=property>font-language-override</code></a>’ property allows
5478 authors to explicitly specify the language system of the font, overriding
5479 the language system implied by the content language.
5481 <p>Values have the following meanings:
5483 <dl>
5484 <dt><dfn id=font-language-override-normal-value
5485 title="normal!!font-language-override">normal</dfn>
5487 <dd>specifies that when rendering with OpenType fonts, the content
5488 language of the element is used to infer the OpenType language system
5490 <dt><dfn
5491 id=font-language-override-string-value><var><string></var></dfn>
5493 <dd>single three-letter case-sensitive OpenType <a
5494 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
5495 system tag</a>, specifies the OpenType language system to be used instead
5496 of the language system implied by the language of the element
5497 </dl>
5498 <!-- For this level, string represents a single language code, there's no concept of "fallback"
5499 http://www.w3.org/2013/06/07-css-minutes.html#item04 -->
5501 <p>Use of invalid OpenType language system tags must not generate a parse
5502 error but must be ignored when doing glyph selection and placement.
5504 <div class=example>
5505 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
5506 Declaration of Human Rights</a> has been translated into a wide variety
5507 of languages. In Turkish, Article 9 of this document might be marked up
5508 as below:</p>
5510 <pre lang=tr><body lang="tr">
5512 <h4>Madde 9</h4>
5513 <p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.</p>
5514 </pre>
5516 <p>Here the user agent uses the value of the ‘<code
5517 class=property>lang</code>’ attribute when rendering text and
5518 appropriately renders this text without ‘<code
5519 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
5520 href="#propdef-font-language-override"><code
5521 class=property>font-language-override</code></a>’ property.</p>
5523 <p>However, a given font may lack support for a specific language. In this
5524 situation authors may need to use the typographic conventions of a
5525 related language that are supported by that font:</p>
5527 <pre lang=mk><body lang="mk"> <!-- Macedonian lang code -->
5529 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
5531 <h4>Члeн 9</h4>
5532 <p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
5534 </pre>
5536 <p>The Macedonian text here will be rendered using Serbian typographic
5537 conventions, with the assumption that the font specified supports
5538 Serbian.</p>
5539 </div>
5541 <p><a id=rendering-considerations></a>
5543 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
5544 Resolution</h2>
5546 <p>As described in the previous section, font features can be enabled in a
5547 variety of ways, either via the use of <a href="#propdef-font-variant"
5548 title="font-variant!!property">‘<code
5549 class=property>font-variant</code>’</a> or <a
5550 href="#propdef-font-feature-settings"
5551 title="font-feature-settings!!property">‘<code
5552 class=property>font-feature-settings</code>’</a> in a style rule or
5553 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5554 The resolution order for the union of these settings is defined below.
5555 Features defined via CSS properties are applied on top of layout engine
5556 default features.
5558 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
5560 <p>For OpenType fonts, user agents must enable the default features defined
5561 in the OpenType documentation for a given script and writing mode.
5562 Required ligatures, common ligatures and contextual forms must be enabled
5563 by default (OpenType features: <span class=tag>rlig, liga, clig,
5564 calt</span>), along with localized forms (OpenType feature: <span
5565 class=tag>locl</span>), and features required for proper display of
5566 composed characters and marks (OpenType features: <span class=tag>ccmp,
5567 mark, mkmk</span>). These features must always be enabled, even when the
5568 value of the <a href="#propdef-font-variant"
5569 title="font-variant!!property">‘<code
5570 class=property>font-variant</code>’</a> and <a
5571 href="#propdef-font-feature-settings"
5572 title="font-feature-settings!!property">‘<code
5573 class=property>font-feature-settings</code>’</a> properties is <span
5574 title="normal value">‘<code class=property>normal</code>’</span>.
5575 Individual features are only disabled when explicitly overridden by the
5576 author, as when ‘<a href="#propdef-font-variant-ligatures"><code
5577 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
5578 href="#no-common-ligatures"><code
5579 class=property>no-common-ligatures</code></a>’. For handling complex
5580 scripts such as <a
5581 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
5582 <a
5583 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
5584 or <a
5585 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
5586 additional features are required. For upright text within vertical text
5587 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
5588 must be enabled.
5590 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
5592 <p>General and <a href="#font-specific"><em>font specific</em></a> font
5593 feature property settings are resolved in the order below, in ascending
5594 order of precedence. This ordering is used to construct a combined list of
5595 font features that affect a given text run.
5597 <ol>
5598 <li>Font features enabled by default, including features required for a
5599 given script.
5601 <li>If the font is defined via an <a
5602 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5603 features implied by the font-variant descriptor in the <a
5604 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5606 <li>If the font is defined via an <a
5607 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5608 features implied by the font-feature-settings descriptor in the <a
5609 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5611 <li>Font features implied by the value of the <a
5612 href="#propdef-font-variant" title="font-variant!!property">‘<code
5613 class=property>font-variant</code>’</a> property, the related <a
5614 href="#propdef-font-variant" title="font-variant!!property">‘<code
5615 class=property>font-variant</code>’</a> subproperties and any other CSS
5616 property that uses OpenType features (e.g. the ‘<a
5617 href="#propdef-font-kerning"><code
5618 class=property>font-kerning</code></a>’ property).</li>
5619 <!-- other CSS props override 'font-variant' but not 'font-feature-settings' -->
5620 <!-- http://lists.w3.org/Archives/Public/www-style/2013Aug/0110.html -->
5622 <li>Feature settings determined by properties other than <a
5623 href="#propdef-font-variant" title="font-variant!!property">‘<code
5624 class=property>font-variant</code>’</a> or <a
5625 href="#propdef-font-feature-settings"
5626 title="font-feature-settings!!property">‘<code
5627 class=property>font-feature-settings</code>’</a>. For example, setting
5628 a non-default value for the ‘<code
5629 class=property>letter-spacing</code>’ property disables common
5630 ligatures.
5632 <li>Font features implied by the value of <a
5633 href="#propdef-font-feature-settings"
5634 title="font-feature-settings!!property">‘<code
5635 class=property>font-feature-settings</code>’</a> property.
5636 </ol>
5638 <p>This ordering allows authors to set up a general set of defaults for
5639 fonts within their <a
5640 href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
5641 them with property settings for specific elements. General property
5642 settings override the settings in <a
5643 href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
5644 font feature settings override <a href="#propdef-font-variant"
5645 title="font-variant!!property">‘<code
5646 class=property>font-variant</code>’</a> property settings.
5648 <p>For situations where the combined list of font feature settings contains
5649 more than one value for the same feature, the last value is used. When a
5650 font lacks support for a given underlying font feature, text is simply
5651 rendered as if that font feature was not enabled; font fallback does not
5652 occur and no attempt is made to synthesize the feature except where
5653 explicitly defined for specific properties.
5655 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
5656 precedence examples</h3>
5658 <div class=example>
5659 <p>With the styles below, numbers are rendered proportionally when used
5660 within a paragraph but are shown in tabular form within tables of prices:</p>
5662 <pre>body {
5663 font-variant-numeric: proportional-nums;
5664 }
5666 table.prices td {
5667 font-variant-numeric: tabular-nums;
5668 }
5669 </pre>
5670 </div>
5672 <div class=example>
5673 <p>When the <a href="#descdef-font-variant"
5674 title="font-variant!!descriptor">font-variant</a> descriptor is used
5675 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
5676 it only applies to the font defined by that rule.</p>
5678 <pre>@font-face {
5679 font-family: MainText;
5680 src: url(http://example.com/font.woff);
5681 font-variant: oldstyle-nums proportional-nums styleset(1,3);
5682 }
5684 body {
5685 font-family: MainText, Helvetica;
5686 }
5688 table.prices td {
5689 font-variant-numeric: tabular-nums;
5690 }
5691 </pre>
5693 <p>In this case, old-style numerals will be used throughout but only where
5694 the font "MainText" is used. Just as in the previous example, tabular
5695 values will be used in price tables since ‘<a
5696 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
5697 appears in a general style rule and its use is mutually exclusive with
5698 ‘<a href="#proportional-nums"><code
5699 class=property>proportional-nums</code></a>’. Stylistic alternate sets
5700 will only be used where MainText is used.</p>
5701 </div>
5703 <div class=example>
5704 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
5705 also be used to access font features in locally available fonts via the
5706 use of <code>local()</code> in the ‘<a href="#descdef-src"><code
5707 class=property>src</code></a>’ descriptor of the <a
5708 href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
5710 <pre>@font-face {
5711 font-family: BodyText;
5712 src: local("HiraMaruPro-W4");
5713 font-variant: proportional-width;
5714 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
5715 }
5717 body { font-family: BodyText, serif; }
5718 </pre>
5720 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
5721 text rendering occurs, Japanese kana will be proportionally spaced and
5722 Latin text will be italicised. Text rendered with the fallback serif font
5723 will use default rendering properties.</p>
5724 </div>
5726 <div class=example>
5727 <p>In the example below, discretionary ligatures are enabled only for a
5728 downloadable font but are disabled within spans of class "special":</p>
5730 <pre>@font-face {
5731 font-family: main;
5732 src: url(fonts/ffmeta.woff) format("woff");
5733 font-variant: discretionary-ligatures;
5734 }
5736 body { font-family: main, Helvetica; }
5737 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5738 </pre>
5740 <p>Suppose one adds a rule using ‘<code
5741 class=property>font-feature-settings</code>’ to enable discretionary
5742 ligatures:</p>
5744 <pre>body { font-family: main, Helvetica; }
5745 span { font-feature-settings: "dlig"; }
5746 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5747 </pre>
5749 <p>In this case, discretionary ligatures <em>will</em> be rendered within
5750 spans of class "special". This is because both the <a
5751 href="#propdef-font-feature-settings"
5752 title="font-feature-settings!!property">‘<code
5753 class=property>font-feature-settings</code>’</a> and ‘<a
5754 href="#propdef-font-variant-ligatures"><code
5755 class=property>font-variant-ligatures</code></a>’ properties apply to
5756 these spans. Although the ‘<code class=css>no-discretionary
5757 ligatures</code>’ setting of ‘<a
5758 href="#propdef-font-variant-ligatures"><code
5759 class=property>font-variant-ligatures</code></a>’ effectively disables
5760 the OpenType <span class=tag>dlig</span> feature, because the <a
5761 href="#propdef-font-feature-settings"
5762 title="font-feature-settings!!property">‘<code
5763 class=property>font-feature-settings</code>’</a> is resolved after
5764 that, the ‘<code class=property>dlig</code>’ value reenables
5765 discretionary ligatures.</p>
5766 </div>
5768 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
5770 <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
5771 and <a
5772 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5773 rules can be accessed via the following extensions to the CSS Object
5774 Model.
5776 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
5777 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
5779 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
5780 <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5782 <pre class=idl>
5783 interface CSSFontFaceRule : CSSRule {
5784 attribute DOMString family;
5785 attribute DOMString src;
5786 attribute DOMString style;
5787 attribute DOMString weight;
5788 attribute DOMString stretch;
5789 attribute DOMString unicodeRange;
5790 attribute DOMString variant;
5791 attribute DOMString featureSettings;
5792 }</pre>
5794 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
5795 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
5796 defined a different variant of this rule. This definition supercedes that
5797 one.
5799 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
5800 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5801 interface</h3>
5803 <p>The <code>CSSRule</code> interface is extended as follows:
5805 <pre class=idl>partial interface CSSRule {
5806 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
5807 }</pre>
5809 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
5810 interface represents a <a
5811 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5812 rule.
5814 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
5815 attribute DOMString fontFamily;
5816 readonly attribute CSSFontFeatureValuesMap annotation;
5817 readonly attribute CSSFontFeatureValuesMap ornaments;
5818 readonly attribute CSSFontFeatureValuesMap stylistic;
5819 readonly attribute CSSFontFeatureValuesMap swash;
5820 readonly attribute CSSFontFeatureValuesMap characterVariant;
5821 readonly attribute CSSFontFeatureValuesMap styleset;
5822 }
5824 [MapClass(DOMString, sequence<unsigned long>)]
5825 interface CSSFontFeatureValuesMap {
5826 void set(DOMString featureValueName,
5827 (unsigned long or sequence<unsigned long>) values);
5828 }</pre>
5830 <dl class=idl-attributes>
5831 <dt><var>fontFamily</var> of type <code>DOMString</code>
5833 <dd>The list of one or more font families for which a given set of feature
5834 values is defined.
5836 <dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
5838 <dd>Maps of feature values associated with feature value names for a given
5839 ‘<a href="#propdef-font-variant-alternates"><code
5840 class=property>font-variant-alternates</code></a>’ value type
5841 </dl>
5843 <p>Each value map attribute of <a
5844 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5845 reflects the values defined via a corresponding <a
5846 href="#featurevalueblock"><i title="feature_value_block">feature value
5847 block</i></a>. Thus, the <var title="annotation
5848 attribute">annotation</var> attribute contains the values contained within
5849 a <code title="@annotation">@annotation</code> <a
5850 href="#featurevalueblock"><i title="feature_value_block">feature value
5851 block</i></a>, the <var title="ornaments attribute">ornaments</var>
5852 attribute contains the values contained with a <code
5853 title="@ornaments">@ornaments</code> <a href="#featurevalueblock"><i
5854 title="feature_value_block">feature value block</i></a> and so forth.
5856 <p>The <code>CSSFontFeatureValuesMap</code> interface uses the <a
5857 href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map
5858 class methods</a> but the <code>set</code> method has different behavior.
5859 It takes a sequence of unsigned integers and associates it with a given
5860 <code>featureValueName</code>. The method behaves the same as the default
5861 map class method except that a single unsigned long value is treated as a
5862 sequence of a single value. The method throws an exception if an invalid
5863 number of values is passed in. If the associated <a
5864 href="#featurevalueblock"><i title="feature_value_block">feature value
5865 block</i></a> only allows a limited number of values, the <code>set</code>
5866 method throws an <code>InvalidAccessError</code> exception when the input
5867 sequence to <code>set</code> contains more than the limited number of
5868 values. See the description of <a
5869 href="#multi-valued-feature-value-definitions">multi-valued feature value
5870 definitions</a> for details on the maximum number of values allowed for a
5871 given type of <a href="#featurevalueblock"><i
5872 title="feature_value_block">feature value block</i></a>. The
5873 <code>get</code> method always returns a sequence of values, even if the
5874 sequence only contains a single value.
5876 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
5877 properties to CSS properties</h2>
5879 <p><em>This appendix is included as background for some of the problems and
5880 situations that are described in other sections. It should be viewed as
5881 informative only.</em>
5883 <p>Font properties in CSS are designed to be independent of the underlying
5884 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
5885 SVG fonts in addition to the common TrueType and OpenType fonts. But there
5886 are facets of the TrueType and OpenType formats that often cause confusion
5887 for authors and present challenges to implementers on different platforms.
5889 <p>Originally developed at Apple, TrueType was designed as an outline font
5890 format for both screen and print. Microsoft joined Apple in developing the
5891 TrueType format and both platforms have supported TrueType fonts since
5892 then. Font data in the TrueType format consists of a set of tables
5893 distinguished with common four-letter tag names, each containing a
5894 specific type of data. For example, naming information, including
5895 copyright and license information, is stored in the ‘<code
5896 class=property>name</code>’ table. The <a
5897 href="#character-map"><em>character map</em></a> (‘<code
5898 class=property>cmap</code>’) table contains a mapping of character
5899 encodings to glyphs. Apple later added additional tables for supporting
5900 enhanced typographic functionality; these are now called Apple Advanced
5901 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
5902 tables for advanced typography and called their format OpenType <a
5903 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
5905 <p>In many cases the font data used under Microsoft Windows or Linux is
5906 slightly different from the data used under Apple's Mac OS X because the
5907 TrueType format allowed for explicit variation across platforms. This
5908 includes font metrics, names and <a href="#character-map"><em>character
5909 map</em></a> data.
5911 <p>Specifically, font family name data is handled differently across
5912 platforms. For TrueType and OpenType fonts these names are contained in
5913 the ‘<code class=property>name</code>’ table, in name records with
5914 name ID 1. Mulitple names can be stored for different locales, but
5915 Microsoft recommends fonts always include at least a US English version of
5916 the name. On Windows, Microsoft made the decision for backwards
5917 compatibility to limit this family name to a maximum of four faces; for
5918 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
5919 ID 21) can be used. Other platforms such as OSX don't have this
5920 limitation, so the family name is used to define all possible groupings.
5922 <p>Other name table data provides names used to uniquely identify a
5923 specific face within a family. The full font name (name ID 4) and the
5924 Postscript name (name ID 6) describe a single face uniquely. For example,
5925 the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
5926 and a Postscript name of "GillSans-Bold". There can be multiple localized
5927 versions of the fullname for a given face, but the Postscript name is
5928 always a unique name made from a limited set of ASCII characters.
5930 <p>On various platforms, different names are used to search for a font. For
5931 example, with the Windows GDI CreateIndirectFont API, either a family or
5932 fullname can be used to lookup a face, while on Mac OS X the
5933 CTFontCreateWithName API call is used to lookup a given face using the
5934 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
5935 to be searched using any of these names. In situations where platform
5936 API's automatically substitute other font choices, it may be necessary to
5937 verify a returned font matches a given name.
5939 <p>The weight of a given face can be determined via the usWeightClass field
5940 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
5941 the width can be determined via the usWidthClass of the OS/2 table or
5942 inferred from the style name. For historical reasons related to synthetic
5943 bolding at weights 200 or lower with the Windows GDI API, font designers
5944 have sometimes skewed values in the OS/2 table to avoid these weights.
5946 <p>Rendering complex scripts that use contextual shaping such as Thai,
5947 Arabic and Devanagari requires features present only in OpenType or AAT
5948 fonts. Currently, complex script rendering is supported on Windows and
5949 Linux using OpenType font features while both OpenType and AAT font
5950 features are used under Mac OS X.
5952 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
5954 <h3 class=no-num id=recent-changes> Changes from the <a
5955 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">July 2013 CSS3
5956 Fonts Last Call Working Draft</a></h3>
5958 <p>Major changes include:
5960 <ul>
5961 <li>reorder feature precedence such that features implied by other CSS
5962 properties override ‘<code class=property>font-variant</code>’
5963 settings
5965 <li>switched examples to use .woff files
5967 <li>revised wording of font fetching algorithm
5969 <li>drop ‘<code class=property>auto</code>’ value for ‘<a
5970 href="#propdef-font-size-adjust"><code
5971 class=property>font-size-adjust</code></a>’
5973 <li>clarify effect of ‘<a href="#propdef-font-size-adjust"><code
5974 class=property>font-size-adjust</code></a>’ on <a class=property
5975 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
5976 class=property>line-height</code>’</a>
5978 <li>allow user agents to synthesize OpenType <span class=tag>kern</span>
5979 feature
5981 <li>add example of ordinals and associated markup
5983 <li>minor editorial cleanups
5984 </ul>
5986 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
5988 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
5989 their help and feedback. John Hudson was kind enough to take the time to
5990 explain the subtleties of OpenType language tags and provided the example
5991 of character variant usage for displaying text on Byzantine seals. Ken
5992 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
5993 and Unicode variation selectors. The idea for supporting font features by
5994 using <a href="#propdef-font-variant"
5995 title="font-variant!!property">‘<code
5996 class=property>font-variant</code>’</a> subproperties originated with
5997 Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
5998 of the initial design ideas for the <a
5999 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
6000 rule. Thanks also to House Industries for allowing the use of Ed Interlock
6001 in the discretionary ligatures example.
6003 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
6004 that is <em>The Elements of Typographic Style</em>.
6006 <h2 class=no-num id=conformance> Conformance</h2>
6008 <h3 class=no-num id=conventions> Document Conventions</h3>
6010 <p>Conformance requirements are expressed with a combination of descriptive
6011 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
6012 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
6013 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
6014 normative parts of this document are to be interpreted as described in RFC
6015 2119. However, for readability, these words do not appear in all uppercase
6016 letters in this specification.
6018 <p>All of the text of this specification is normative except sections
6019 explicitly marked as non-normative, examples, and notes. <a
6020 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
6022 <p>Examples in this specification are introduced with the words “for
6023 example” or are set apart from the normative text with
6024 <code>class="example"</code>, like this:
6026 <div class=example>
6027 <p>This is an example of an informative example.
6028 </div>
6030 <p>Informative notes begin with the word “Note” and are set apart from
6031 the normative text with <code>class="note"</code>, like this:
6033 <p class=note>Note, this is an informative note.
6035 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
6037 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
6038 classes:
6040 <dl>
6041 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
6042 sheet</dfn>
6044 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
6045 style sheet</a>.
6047 <dt><dfn id=renderer>renderer</dfn>
6049 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
6050 that interprets the semantics of a style sheet and renders documents that
6051 use them.
6053 <dt><dfn id=authoring-tool>authoring tool</dfn>
6055 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
6056 that writes a style sheet.
6057 </dl>
6059 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
6060 declarations that use properties defined in this module have values that
6061 are valid according to the generic CSS grammar and the individual grammars
6062 of each property as given in this module.
6064 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
6065 interpreting the style sheet as defined by the appropriate specifications,
6066 it supports all the features defined by CSS Fonts Level 3 Module by
6067 parsing them correctly and rendering the document accordingly. However,
6068 the inability of a UA to correctly render a document due to limitations of
6069 the device does not make the UA non-conformant. (For example, a UA is not
6070 required to render color on a monochrome monitor.)
6072 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
6073 style sheets that are syntactically correct according to the generic CSS
6074 grammar and the individual grammars of each feature in this module, and
6075 meet all other conformance requirements of style sheets as described in
6076 this module.
6078 <h3 class=no-num id=partial> Partial Implementations</h3>
6080 <p>So that authors can exploit the forward-compatible parsing rules to
6081 assign fallback values, CSS renderers <strong>must</strong> treat as
6082 invalid (and <a
6083 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
6084 appropriate</a>) any at-rules, properties, property values, keywords, and
6085 other syntactic constructs for which they have no usable level of support.
6086 In particular, user agents <strong>must not</strong> selectively ignore
6087 unsupported component values and honor supported values in a single
6088 multi-value property declaration: if any value is considered invalid (as
6089 unsupported values must be), CSS requires that the entire declaration be
6090 ignored.
6092 <h3 class=no-num id=experimental> Experimental Implementations</h3>
6094 <p>To avoid clashes with future CSS features, the CSS2.1 specification
6095 reserves a <a
6096 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
6097 syntax</a> for proprietary and experimental extensions to CSS.
6099 <p>Prior to a specification reaching the Candidate Recommendation stage in
6100 the W3C process, all implementations of a CSS feature are considered
6101 experimental. The CSS Working Group recommends that implementations use a
6102 vendor-prefixed syntax for such features, including those in W3C Working
6103 Drafts. This avoids incompatibilities with future changes in the draft.
6105 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
6107 <p>Once a specification reaches the Candidate Recommendation stage,
6108 non-experimental implementations are possible, and implementors should
6109 release an unprefixed implementation of any CR-level feature they can
6110 demonstrate to be correctly implemented according to spec.
6112 <p>To establish and maintain the interoperability of CSS across
6113 implementations, the CSS Working Group requests that non-experimental CSS
6114 renderers submit an implementation report (and, if necessary, the
6115 testcases used for that implementation report) to the W3C before releasing
6116 an unprefixed implementation of any CSS features. Testcases submitted to
6117 W3C are subject to review and correction by the CSS Working Group.
6119 <p>Further information on submitting testcases and implementation reports
6120 can be found from on the CSS Working Group's website at <a
6121 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
6122 Questions should be directed to the <a
6123 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
6124 mailing list.
6126 <h2 class=no-num id=references>References</h2>
6128 <h3 class=no-num id=normative-references>Normative References</h3>
6129 <!--begin-normative-->
6130 <!-- Sorted by label -->
6132 <dl class=bibliography>
6133 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6134 <!---->
6136 <dt id=CHARMOD>[CHARMOD]
6138 <dd>Martin J. Dürst; et al. <a
6139 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
6140 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
6141 2005. W3C Recommendation. URL: <a
6142 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
6143 </dd>
6144 <!---->
6146 <dt id=CORS>[CORS]
6148 <dd>Anne van Kesteren. <a
6149 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
6150 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
6151 Recommendation. (Work in progress.) URL: <a
6152 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
6153 </dd>
6154 <!---->
6156 <dt id=CSS21>[CSS21]
6158 <dd>Bert Bos; et al. <a
6159 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
6160 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
6161 2011. W3C Recommendation. URL: <a
6162 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
6163 </dd>
6164 <!---->
6166 <dt id=CSS3VAL>[CSS3VAL]
6168 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
6169 href="http://www.w3.org/TR/2013/CR-css3-values-20130730/"><cite>CSS
6170 Values and Units Module Level 3.</cite></a> 30 July 2013. W3C Candidate
6171 Recommendation. (Work in progress.) URL: <a
6172 href="http://www.w3.org/TR/2013/CR-css3-values-20130730/">http://www.w3.org/TR/2013/CR-css3-values-20130730/</a>
6173 </dd>
6174 <!---->
6176 <dt id=HTML5>[HTML5]
6178 <dd>Robin Berjon; et al. <a
6179 href="http://www.w3.org/TR/2013/CR-html5-20130806/"><cite>HTML5.</cite></a>
6180 6 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a
6181 href="http://www.w3.org/TR/2013/CR-html5-20130806/">http://www.w3.org/TR/2013/CR-html5-20130806/</a>
6182 </dd>
6183 <!---->
6185 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
6187 <dd><a
6188 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136"><cite>Information
6189 technology — Coding of audio-visual objects — Part 22: Open Font
6190 Format.</cite></a> International Organization for Standardization.
6191 ISO/IEC 14496-22:2009. URL: <a
6192 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>
6193 </dd>
6194 <!---->
6196 <dt id=OPENTYPE>[OPENTYPE]
6198 <dd><a
6199 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
6200 specification.</cite></a> Microsoft. URL: <a
6201 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
6202 </dd>
6203 <!---->
6205 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
6207 <dd><a
6208 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
6209 feature registry.</cite></a> Microsoft. URL: <a
6210 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
6211 </dd>
6212 <!---->
6214 <dt id=RFC2119>[RFC2119]
6216 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
6217 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
6218 RFC 2119. URL: <a
6219 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
6220 </dd>
6221 <!---->
6223 <dt id=UAX15>[UAX15]
6225 <dd>Mark Davis; Ken Whistler. <a
6226 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
6227 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
6228 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
6229 </dd>
6230 <!---->
6232 <dt id=UAX29>[UAX29]
6234 <dd>Mark Davis. <a
6235 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
6236 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
6237 URL: <a
6238 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
6239 </dd>
6240 <!---->
6242 <dt id=UNICODE6>[UNICODE6]
6244 <dd>The Unicode Consortium. <a
6245 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
6246 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
6247 Version 6.2.0 URL: <a
6248 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
6249 </dd>
6250 <!---->
6251 </dl>
6252 <!--end-normative-->
6253 <!--{{!CSS21}}-->
6254 <!--{{!CSS3VAL}}-->
6255 <!--{{!OPENTYPE}}-->
6256 <!--{{!OPENTYPE-FEATURES}}-->
6257 <!--{{!OPEN-FONT-FORMAT}}-->
6258 <!--{{!UNICODE6}}-->
6259 <!--{{!UAX15}}-->
6260 <!--{{!UAX29}}-->
6261 <!--{{!CORS}}-->
6262 <!--{{!HTML5}}-->
6263 <!--{{!CHARMOD}}-->
6265 <h3 class=no-num id=other-references>Other References</h3>
6266 <!--begin-informative-->
6267 <!-- Sorted by label -->
6269 <dl class=bibliography>
6270 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6271 <!---->
6273 <dt id=AAT-FEATURES>[AAT-FEATURES]
6275 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
6276 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
6277 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
6278 </dd>
6279 <!---->
6281 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
6283 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
6284 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
6285 <!---->
6287 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
6289 <dd>François Yergeau; et al. <a
6290 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
6291 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
6292 W3C Working Draft. (Work in progress.) URL: <a
6293 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
6294 </dd>
6295 <!---->
6297 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
6299 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
6300 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
6301 <!---->
6303 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
6305 <dd>L. David Baron. <a
6306 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/"><cite>CSS
6307 Conditional Rules Module Level 3.</cite></a> 4 April 2013. W3C Candidate
6308 Recommendation. (Work in progress.) URL: <a
6309 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/">http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a>
6310 </dd>
6311 <!---->
6313 <dt id=CSS3TEXT>[CSS3TEXT]
6315 <dd>Elika J. Etemad; Koji Ishii. <a
6316 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
6317 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
6318 progress.) URL: <a
6319 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
6320 </dd>
6321 <!---->
6323 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
6325 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
6326 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
6327 ISBN 0-201-17633-5.</dd>
6328 <!---->
6330 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
6332 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
6333 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
6334 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
6335 2000. W3C Recommendation. URL: <a
6336 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>
6337 </dd>
6338 <!---->
6340 <dt id=ELEMTYPO>[ELEMTYPO]
6342 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
6343 4.</cite> Hartley & Marks. 2013. ISBN 0-88179-212-8.</dd>
6344 <!---->
6346 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
6348 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
6349 ISBN 1-932026-01-0.</dd>
6350 <!---->
6352 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
6354 <dd><a
6355 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
6356 User Guide.</cite></a> FontShop International. URL: <a
6357 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
6358 </dd>
6359 <!---->
6361 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
6363 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
6364 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
6365 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
6366 <!---->
6368 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
6370 <dd>John Hudson. <a
6371 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
6372 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
6373 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
6374 </dd>
6375 <!---->
6376 </dl>
6377 <!--end-informative-->
6378 <!--{{ARABIC-TYPO}}-->
6379 <!--{{CJKV-INFO-PROCESSING}}-->
6380 <!--{{DIGITAL-TYPOGRAPHY}}-->
6381 <!--{{DOM-LEVEL-2-STYLE}}-->
6382 <!--{{ELEMTYPO}}-->
6383 <!--{{LANGCULTTYPE}}-->
6384 <!--{{OPENTYPE-FONT-GUIDE}}-->
6385 <!--{{RASTER-TRAGEDY}}-->
6386 <!--{{WINDOWS-GLYPH-PROC}}-->
6387 <!--{{CHARMOD-NORM}}-->
6388 <!--{{AAT-FEATURES}}-->
6389 <!--{{CSS3-CONDITIONAL}}-->
6390 <!--{{CSS3TEXT}}-->
6392 <h2 class=no-num id=index>Index</h2>
6393 <!--begin-index-->
6395 <ul class=indexlist>
6396 <li>100...900 weight values, <a href="#font-weight-numeric-values"
6397 title="100...900 weight values"><strong>3.2</strong></a>
6399 <li><var><absolute-size></var>, <a href="#absolute-size-value"
6400 title="<absolute-size>"><strong>3.5</strong></a>
6402 <li><var><common-lig-values></var>, <a href="#common-lig-values"
6403 title="<common-lig-values>"><strong>6.4</strong></a>
6405 <li><var><contextual-alt-values></var>, <a
6406 href="#contextual-alt-values"
6407 title="<contextual-alt-values>"><strong>6.4</strong></a>
6409 <li><var><discretionary-lig-values></var>, <a
6410 href="#discretionary-lig-values"
6411 title="<discretionary-lig-values>"><strong>6.4</strong></a>
6413 <li><var><east-asian-variant-values></var>, <a
6414 href="#east-asian-variant-values"
6415 title="<east-asian-variant-values>"><strong>6.10</strong></a>
6417 <li><var><east-asian-width-values></var>, <a
6418 href="#east-asian-width-values"
6419 title="<east-asian-width-values>"><strong>6.10</strong></a>
6421 <li><var><family-name></var>, <a href="#family-name-value"
6422 title="<family-name>"><strong>3.1</strong></a>
6424 <li><var><feature-tag-value></var>, <a href="#feature-tag-value"
6425 title="<feature-tag-value>"><strong>6.12</strong></a>
6427 <li><var><font-face-name></var>, <a href="#font-face-name-value"
6428 title="<font-face-name>"><strong>4.3</strong></a>
6430 <li><var><font-variant-css21></var>, <a
6431 href="#font-variant-css21-values"
6432 title="<font-variant-css21>"><strong>3.7</strong></a>
6434 <li><var><generic-family></var>, <a href="#generic-family-value"
6435 title="<generic-family>"><strong>3.1</strong></a>
6437 <li><var><historical-lig-values></var>, <a
6438 href="#historical-lig-values"
6439 title="<historical-lig-values>"><strong>6.4</strong></a>
6441 <li><var><length></var>, <a href="#length-size-value"
6442 title="<length>"><strong>3.5</strong></a>
6444 <li><var><number></var>, <a href="#aspect-ratio-value"
6445 title="<number>"><strong>3.6</strong></a>
6447 <li><var><numeric-figure-values></var>, <a
6448 href="#numeric-figure-values"
6449 title="<numeric-figure-values>"><strong>6.7</strong></a>
6451 <li><var><numeric-fraction-values></var>, <a
6452 href="#numeric-fraction-values"
6453 title="<numeric-fraction-values>"><strong>6.7</strong></a>
6455 <li><var><numeric-spacing-values></var>, <a
6456 href="#numeric-spacing-values"
6457 title="<numeric-spacing-values>"><strong>6.7</strong></a>
6459 <li><var><percentage></var>, <a href="#percentage-size-value"
6460 title="<percentage>"><strong>3.5</strong></a>
6462 <li><var><relative-size></var>, <a href="#relative-size-value"
6463 title="<relative-size>"><strong>3.5</strong></a>
6465 <li><var><string></var>, <a
6466 href="#font-language-override-string-value"
6467 title="<string>"><strong>6.13</strong></a>
6469 <li><var><urange></var>, <a href="#urange-value"
6470 title="<urange>"><strong>4.5</strong></a>
6472 <li><code>@font-face</code>, <a href="#at-font-face-rule"
6473 title="@font-face"><strong>4.1</strong></a>
6475 <li><code>@font-feature-values</code>, <a
6476 href="#at-font-feature-values-rule"
6477 title="@font-feature-values"><strong>6.9</strong></a>
6479 <li>all-petite-caps, <a href="#all-petite-caps"
6480 title=all-petite-caps><strong>6.6</strong></a>
6482 <li>all-small-caps, <a href="#all-small-caps"
6483 title=all-small-caps><strong>6.6</strong></a>
6485 <li>annotation, <a href="#annotation"
6486 title=annotation><strong>6.8</strong></a>
6488 <li>aspect value, <a href="#aspect-value0" title="aspect
6489 value"><strong>3.6</strong></a>
6491 <li>authoring tool, <a href="#authoring-tool" title="authoring
6492 tool"><strong>#</strong></a>
6494 <li>auto
6495 <ul>
6496 <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
6497 font-kerning"><strong>6.3</strong></a>
6498 </ul>
6500 <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
6502 <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
6504 <li>character map, <a href="#character-map" title="character
6505 map"><strong>5.2</strong></a>
6507 <li>character-variant, <a href="#character-variant"
6508 title=character-variant><strong>6.8</strong></a>
6510 <li>common-ligatures, <a href="#common-ligatures"
6511 title=common-ligatures><strong>6.4</strong></a>
6513 <li>composite face, <a href="#composite-face" title="composite
6514 face"><strong>5.2</strong></a>
6516 <li>condensed, <a href="#condensed"
6517 title=condensed><strong>3.3</strong></a>
6519 <li>contextual, <a href="#contextual"
6520 title=contextual><strong>6.4</strong></a>
6522 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
6523 title=CSSFontFaceRule><strong>8.1</strong></a>
6525 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
6526 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
6528 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
6529 of"><strong>#</strong></a>
6531 <li>default face, <a href="#default-face" title="default
6532 face"><strong>5.2</strong></a>
6534 <li>descriptor_declaration, <a href="#descriptordeclaration"
6535 title="descriptor_declaration"><strong>4.1</strong></a>
6537 <li>diagonal-fractions, <a href="#diagonal-fractions"
6538 title=diagonal-fractions><strong>6.7</strong></a>
6540 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
6541 title=discretionary-ligatures><strong>6.4</strong></a>
6543 <li>effective character map, <a href="#effective-character-map"
6544 title="effective character map"><strong>4.5</strong></a>
6546 <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
6548 <li>extra-condensed, <a href="#extra-condensed"
6549 title=extra-condensed><strong>3.3</strong></a>
6551 <li>extra-expanded, <a href="#extra-expanded"
6552 title=extra-expanded><strong>3.3</strong></a>
6554 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
6555 of"><strong>#</strong></a>
6557 <li>feature_type, <a href="#featuretype"
6558 title="feature_type"><strong>6.9.1</strong></a>
6560 <li>feature_value_block, <a href="#featurevalueblock"
6561 title="feature_value_block"><strong>6.9.1</strong></a>
6563 <li>feature_value_definition, <a href="#featurevaluedefinition"
6564 title="feature_value_definition"><strong>6.9.1</strong></a>
6566 <li>first available font, <a href="#first-available-font" title="first
6567 available font"><strong>5.2</strong></a>
6569 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
6571 <li>font specific, <a href="#font-specific" title="font
6572 specific"><strong>6.8</strong></a>
6574 <li>font-family
6575 <ul>
6576 <li>descriptor, <a href="#descdef-font-family" title="font-family,
6577 descriptor"><strong>4.2</strong></a>
6579 <li>property, <a href="#propdef-font-family" title="font-family,
6580 property"><strong>3.1</strong></a>
6581 </ul>
6583 <li>font-feature-settings
6584 <ul>
6585 <li>descriptor, <a href="#descdef-font-feature-settings"
6586 title="font-feature-settings, descriptor"><strong>4.7</strong></a>
6588 <li>property, <a href="#propdef-font-feature-settings"
6589 title="font-feature-settings, property"><strong>6.12</strong></a>
6590 </ul>
6592 <li>font-kerning, <a href="#propdef-font-kerning"
6593 title=font-kerning><strong>6.3</strong></a>
6595 <li>font-language-override, <a href="#propdef-font-language-override"
6596 title=font-language-override><strong>6.13</strong></a>
6598 <li>font-size, <a href="#propdef-font-size"
6599 title=font-size><strong>3.5</strong></a>
6601 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
6602 title=font-size-adjust><strong>3.6</strong></a>
6604 <li>font-stretch
6605 <ul>
6606 <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
6607 descriptor"><strong>4.4</strong></a>
6609 <li>property, <a href="#propdef-font-stretch" title="font-stretch,
6610 property"><strong>3.3</strong></a>
6611 </ul>
6613 <li>font-style
6614 <ul>
6615 <li>descriptor, <a href="#descdef-font-style" title="font-style,
6616 descriptor"><strong>4.4</strong></a>
6618 <li>property, <a href="#propdef-font-style" title="font-style,
6619 property"><strong>3.4</strong></a>
6620 </ul>
6622 <li>font-synthesis, <a href="#propdef-font-synthesis"
6623 title=font-synthesis><strong>3.8</strong></a>
6625 <li>font-variant
6626 <ul>
6627 <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
6628 descriptor"><strong>4.7</strong></a>
6630 <li>property, <a href="#propdef-font-variant" title="font-variant,
6631 property"><strong>6.11</strong></a>
6632 </ul>
6634 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
6635 title=font-variant-alternates><strong>6.8</strong></a>
6637 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
6638 title=font-variant-caps><strong>6.6</strong></a>
6640 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
6641 title=font-variant-east-asian><strong>6.10</strong></a>
6643 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
6644 title=font-variant-ligatures><strong>6.4</strong></a>
6646 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
6647 title=font-variant-numeric><strong>6.7</strong></a>
6649 <li>font-variant-position, <a href="#propdef-font-variant-position"
6650 title=font-variant-position><strong>6.5</strong></a>
6652 <li>font-weight
6653 <ul>
6654 <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
6655 descriptor"><strong>4.4</strong></a>
6657 <li>property, <a href="#propdef-font-weight" title="font-weight,
6658 property"><strong>3.2</strong></a>
6659 </ul>
6661 <li>font_face_rule, <a href="#fontfacerule"
6662 title="font_face_rule"><strong>4.1</strong></a>
6664 <li>FONT_FACE_SYM, <a href="#fontfacesym"
6665 title="FONT_FACE_SYM"><strong>4.1</strong></a>
6667 <li>font_family_name, <a href="#fontfamilyname"
6668 title="font_family_name"><strong>6.9.1</strong></a>
6670 <li>font_family_name_list, <a href="#fontfamilynamelist"
6671 title="font_family_name_list"><strong>6.9.1</strong></a>
6673 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
6674 title="font_feature_values_rule"><strong>6.9.1</strong></a>
6676 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
6677 title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
6679 <li>full-width, <a href="#full-width"
6680 title=full-width><strong>6.10</strong></a>
6682 <li>historical-forms, <a href="#historical-forms"
6683 title=historical-forms><strong>6.8</strong></a>
6685 <li>historical-ligatures, <a href="#historical-ligatures"
6686 title=historical-ligatures><strong>6.4</strong></a>
6688 <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
6690 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
6692 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
6694 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
6696 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
6698 <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
6700 <li>lining-nums, <a href="#lining-nums"
6701 title=lining-nums><strong>6.7</strong></a>
6703 <li>monospace, definition of, <a href="#monospace0" title="monospace,
6704 definition of"><strong>#</strong></a>
6706 <li>no-common-ligatures, <a href="#no-common-ligatures"
6707 title=no-common-ligatures><strong>6.4</strong></a>
6709 <li>no-contextual, <a href="#no-contextual"
6710 title=no-contextual><strong>6.4</strong></a>
6712 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
6713 title=no-discretionary-ligatures><strong>6.4</strong></a>
6715 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
6716 title=no-historical-ligatures><strong>6.4</strong></a>
6718 <li>none
6719 <ul>
6720 <li>font-kerning, <a href="#font-kerning-none-value" title="none,
6721 font-kerning"><strong>6.3</strong></a>
6723 <li>font-size-adjust, <a href="#font-size-adjust-none-value"
6724 title="none, font-size-adjust"><strong>3.6</strong></a>
6726 <li>font-variant, <a href="#font-variant-none-value" title="none,
6727 font-variant"><strong>6.11</strong></a>
6729 <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
6730 title="none, font-variant-ligatures"><strong>6.4</strong></a>
6731 </ul>
6733 <li>normal
6734 <ul>
6735 <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
6736 title="normal, font-feature-settings"><strong>6.12</strong></a>
6738 <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
6739 font-kerning"><strong>6.3</strong></a>
6741 <li>font-language-override, <a
6742 href="#font-language-override-normal-value" title="normal,
6743 font-language-override"><strong>6.13</strong></a>
6745 <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
6746 font-stretch"><strong>3.3</strong></a>
6748 <li>font-style, <a href="#font-style-normal-value" title="normal,
6749 font-style"><strong>3.4</strong></a>
6751 <li>font-variant, <a href="#font-variant-normal-value" title="normal,
6752 font-variant"><strong>6.11</strong></a>
6754 <li>font-variant-alternates, <a
6755 href="#font-variant-alternates-normal-value" title="normal,
6756 font-variant-alternates"><strong>6.8</strong></a>
6758 <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
6759 title="normal, font-variant-caps"><strong>6.6</strong></a>
6761 <li>font-variant-east-asian, <a
6762 href="#font-variant-east-asian-normal-value" title="normal,
6763 font-variant-east-asian"><strong>6.10</strong></a>
6765 <li>font-variant-ligatures, <a
6766 href="#font-variant-ligatures-normal-value" title="normal,
6767 font-variant-ligatures"><strong>6.4</strong></a>
6769 <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
6770 title="normal, font-variant-numeric"><strong>6.7</strong></a>
6772 <li>font-variant-position, <a href="#font-variant-position-normal-value"
6773 title="normal, font-variant-position"><strong>6.5</strong></a>
6775 <li>font-weight, <a href="#font-weight-normal-value" title="normal,
6776 font-weight"><strong>3.2</strong></a>
6777 </ul>
6779 <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
6781 <li>oldstyle-nums, <a href="#oldstyle-nums"
6782 title=oldstyle-nums><strong>6.7</strong></a>
6784 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
6786 <li>ornaments, <a href="#ornaments"
6787 title=ornaments><strong>6.8</strong></a>
6789 <li>petite-caps, <a href="#petite-caps"
6790 title=petite-caps><strong>6.6</strong></a>
6792 <li>proportional-nums, <a href="#proportional-nums"
6793 title=proportional-nums><strong>6.7</strong></a>
6795 <li>proportional-width, <a href="#proportional-width"
6796 title=proportional-width><strong>6.10</strong></a>
6798 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
6800 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
6802 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
6803 definition of"><strong>#</strong></a>
6805 <li>semi-condensed, <a href="#semi-condensed-"
6806 title=semi-condensed><strong>3.3</strong></a>
6808 <li>semi-expanded, <a href="#semi-expanded"
6809 title=semi-expanded><strong>3.3</strong></a>
6811 <li>serif, definition of, <a href="#serif0" title="serif, definition
6812 of"><strong>#</strong></a>
6814 <li>simplified, <a href="#simplified"
6815 title=simplified><strong>6.10</strong></a>
6817 <li>slashed-zero, <a href="#slashed-zero"
6818 title=slashed-zero><strong>6.7</strong></a>
6820 <li>small-caps, <a href="#small-caps"
6821 title=small-caps><strong>6.6</strong></a>
6823 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
6825 <li>stacked-fractions, <a href="#stacked-fractions"
6826 title=stacked-fractions><strong>6.7</strong></a>
6828 <li>style sheet
6829 <ul>
6830 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
6831 conformance class"><strong>#</strong></a>
6832 </ul>
6834 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
6836 <li>stylistic, <a href="#stylistic"
6837 title=stylistic><strong>6.8</strong></a>
6839 <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
6841 <li>super, <a href="#super" title=super><strong>6.5</strong></a>
6843 <li>support, <a href="#support" title=support><strong>5.2</strong></a>
6845 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
6847 <li>system font fallback, <a href="#system-font-fallback" title="system
6848 font fallback"><strong>5.2</strong></a>
6850 <li>tabular-nums, <a href="#tabular-nums"
6851 title=tabular-nums><strong>6.7</strong></a>
6853 <li>titling-caps, <a href="#titling-caps"
6854 title=titling-caps><strong>6.6</strong></a>
6856 <li>traditional, <a href="#traditional"
6857 title=traditional><strong>6.10</strong></a>
6859 <li>ultra-condensed, <a href="#ultra-condensed"
6860 title=ultra-condensed><strong>3.3</strong></a>
6862 <li>ultra-expanded, <a href="#ultra-expanded"
6863 title=ultra-expanded><strong>3.3</strong></a>
6865 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
6867 <li>unicode-range, <a href="#descdef-unicode-range"
6868 title=unicode-range><strong>4.5</strong></a>
6870 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
6872 <li>width, <a href="#width" title=width><strong>2</strong></a>
6873 </ul>
6874 <!--end-index-->
6876 <h2 class=no-num id=property-index>Property index</h2>
6877 <!--begin-properties-->
6879 <table class=proptable>
6880 <thead>
6881 <tr>
6882 <th>Property
6884 <th>Values
6886 <th>Initial
6888 <th>Applies to
6890 <th>Inh.
6892 <th>Percentages
6894 <th>Media
6896 <tbody>
6897 <tr>
6898 <th><a class=property href="#propdef-font">font</a>
6900 <td>[ [ <‘font-style’> || <font-variant-css21> ||
6901 <‘font-weight’> || <‘font-stretch’ ]?
6902 <‘font-size’> [ / <‘line-height’> ]?
6903 <‘font-family’> ] | caption | icon | menu | message-box |
6904 small-caption | status-bar
6906 <td>see individual properties
6908 <td>all elements
6910 <td>yes
6912 <td>see individual properties
6914 <td>visual
6916 <tr>
6917 <th><span class=property>font-family</span>
6919 <td>[ <family-name> | <generic-family> ] #
6921 <td>depends on user agent
6923 <td>all elements
6925 <td>yes
6927 <td>N/A
6929 <td>visual
6931 <tr>
6932 <th><span class=property>font-feature-settings</span>
6934 <td>normal | <feature-tag-value> #
6936 <td>normal
6938 <td>all elements
6940 <td>yes
6942 <td>N/A
6944 <td>visual
6946 <tr>
6947 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
6949 <td>auto | normal | none
6951 <td>auto
6953 <td>all elements
6955 <td>yes
6957 <td>N/A
6959 <td>visual
6961 <tr>
6962 <th><a class=property
6963 href="#propdef-font-language-override">font-language-override</a>
6965 <td>normal | <string>
6967 <td>normal
6969 <td>all elements
6971 <td>yes
6973 <td>N/A
6975 <td>visual
6977 <tr>
6978 <th><a class=property href="#propdef-font-size">font-size</a>
6980 <td><absolute-size> | <relative-size> | <length> |
6981 <percentage>
6983 <td>medium
6985 <td>all elements
6987 <td>yes
6989 <td>refer to parent element's font size
6991 <td>visual
6993 <tr>
6994 <th><a class=property
6995 href="#propdef-font-size-adjust">font-size-adjust</a>
6997 <td>none | <number>
6999 <td>none
7001 <td>all elements
7003 <td>yes
7005 <td>N/A
7007 <td>visual
7009 <tr>
7010 <th><span class=property>font-stretch</span>
7012 <td>normal | ultra-condensed | extra-condensed | condensed |
7013 semi-condensed | semi-expanded | expanded | extra-expanded |
7014 ultra-expanded
7016 <td>normal
7018 <td>all elements
7020 <td>yes
7022 <td>N/A
7024 <td>visual
7026 <tr>
7027 <th><span class=property>font-style</span>
7029 <td>normal | italic | oblique
7031 <td>normal
7033 <td>all elements
7035 <td>yes
7037 <td>N/A
7039 <td>visual
7041 <tr>
7042 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
7044 <td>none | [ weight || style ]
7046 <td>weight style
7048 <td>all elements
7050 <td>yes
7052 <td>N/A
7054 <td>visual
7056 <tr>
7057 <th><span class=property>font-variant</span>
7059 <td>normal | none | [ <common-lig-values> ||
7060 <discretionary-lig-values> || <historical-lig-values> ||
7061 <contextual-alt-values> || stylistic(<feature-value-name>)
7062 || historical-forms || styleset(<feature-value-name> #) ||
7063 character-variant(<feature-value-name> #) ||
7064 swash(<feature-value-name>) ||
7065 ornaments(<feature-value-name>) ||
7066 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7067 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7068 <numeric-figure-values> || <numeric-spacing-values> ||
7069 <numeric-fraction-values> || ordinal || slashed-zero ||
7070 <east-asian-variant-values> || <east-asian-width-values> ||
7071 ruby ]
7073 <td>normal
7075 <td>all elements
7077 <td>yes
7079 <td>see individual properties
7081 <td>visual
7083 <tr>
7084 <th><a class=property
7085 href="#propdef-font-variant-alternates">font-variant-alternates</a>
7087 <td>normal | [ stylistic(<feature-value-name>) || historical-forms
7088 || styleset(<feature-value-name> #) ||
7089 character-variant(<feature-value-name> #) ||
7090 swash(<feature-value-name>) ||
7091 ornaments(<feature-value-name>) ||
7092 annotation(<feature-value-name>) ]
7094 <td>normal
7096 <td>all elements
7098 <td>yes
7100 <td>N/A
7102 <td>visual
7104 <tr>
7105 <th><a class=property
7106 href="#propdef-font-variant-caps">font-variant-caps</a>
7108 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
7109 | unicase | titling-caps
7111 <td>normal
7113 <td>all elements
7115 <td>yes
7117 <td>N/A
7119 <td>visual
7121 <tr>
7122 <th><a class=property
7123 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
7125 <td>normal | [ <east-asian-variant-values> ||
7126 <east-asian-width-values> || ruby ]
7128 <td>normal
7130 <td>all elements
7132 <td>yes
7134 <td>N/A
7136 <td>visual
7138 <tr>
7139 <th><a class=property
7140 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
7142 <td>normal | none | [ <common-lig-values> ||
7143 <discretionary-lig-values> || <historical-lig-values> ||
7144 <contextual-alt-values> ]
7146 <td>normal
7148 <td>all elements
7150 <td>yes
7152 <td>N/A
7154 <td>visual
7156 <tr>
7157 <th><a class=property
7158 href="#propdef-font-variant-numeric">font-variant-numeric</a>
7160 <td>normal | [ <numeric-figure-values> ||
7161 <numeric-spacing-values> || <numeric-fraction-values> ||
7162 ordinal || slashed-zero ]
7164 <td>normal
7166 <td>all elements
7168 <td>yes
7170 <td>N/A
7172 <td>visual
7174 <tr>
7175 <th><a class=property
7176 href="#propdef-font-variant-position">font-variant-position</a>
7178 <td>normal | sub | super
7180 <td>normal
7182 <td>all elements
7184 <td>yes
7186 <td>N/A
7188 <td>visual
7190 <tr>
7191 <th><span class=property>font-weight</span>
7193 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
7194 | 700 | 800 | 900
7196 <td>normal
7198 <td>all elements
7200 <td>yes
7202 <td>N/A
7204 <td>visual
7205 </table>
7206 <!--end-properties-->
7207 <!--begin-descriptors-->
7209 <table class=proptable>
7210 <thead>
7211 <tr>
7212 <th>Descriptor
7214 <th>Value
7216 <th>Initial
7218 <th>Percentages
7220 <th>Media
7222 <tbody>
7223 <tr>
7224 <th><span class=property>font-family</span>
7226 <td><family-name>
7228 <td>N/A
7230 <tr>
7231 <th><span class=property>font-feature-settings</span>
7233 <td>normal | <feature-tag-value> #
7235 <td>normal
7237 <tr>
7238 <th><span class=property>font-stretch</span>
7240 <td>normal | ultra-condensed | extra-condensed | condensed |
7241 semi-condensed | semi-expanded | expanded | extra-expanded |
7242 ultra-expanded
7244 <td>normal
7246 <tr>
7247 <th><span class=property>font-style</span>
7249 <td>normal | italic | oblique
7251 <td>normal
7253 <tr>
7254 <th><span class=property>font-variant</span>
7256 <td>normal | none | [ <common-lig-values> ||
7257 <discretionary-lig-values> || <historical-lig-values> ||
7258 <contextual-alt-values> || stylistic(<feature-value-name>)
7259 || historical-forms || styleset(<feature-value-name> #) ||
7260 character-variant(<feature-value-name> #) ||
7261 swash(<feature-value-name>) ||
7262 ornaments(<feature-value-name>) ||
7263 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7264 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7265 <numeric-figure-values> || <numeric-spacing-values> ||
7266 <numeric-fraction-values> || ordinal || slashed-zero ||
7267 <east-asian-variant-values> || <east-asian-width-values> ||
7268 ruby ]
7270 <td>normal
7272 <tr>
7273 <th><span class=property>font-weight</span>
7275 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
7277 <td>normal
7279 <tr>
7280 <th><a class=property href="#descdef-src">src</a>
7282 <td>[ <url> [format(<string> #)]? | <font-face-name> ] #
7284 <td>N/A
7286 <tr>
7287 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
7289 <td><urange> #
7291 <td>U+0-10FFFF
7292 </table>
7293 <!--end-descriptors-->
7294 <script type="text/javascript">
7295 window.onload = function () {
7296 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
7297 var i, hiresElements = document.getElementsByClassName("hires");
7298 for (i = 0; i < hiresElements.length; i++) {
7299 var h = hiresElements[i];
7300 if (h.tagName != "IMG") continue;
7301 var src = h.getAttribute("src");
7302 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
7303 h.src = src2x;
7304 }
7305 }
7306 </script>
7307 </html>
7308 <!-- Keep this comment at the end of the file
7309 Local variables:
7310 mode: sgml
7311 sgml-declaration:"~/SGML/HTML4.decl"
7312 sgml-default-doctype-name:"html"
7313 sgml-minimize-attributes:t
7314 sgml-nofill-elements:("pre" "style" "br")
7315 sgml-live-element-indicator:t
7316 sgml-omittag:nil
7317 sgml-shorttag:nil
7318 sgml-namecase-general:t
7319 sgml-general-insert-case:lower
7320 sgml-always-quote-attributes:t
7321 sgml-indent-step:nil
7322 sgml-indent-data:t
7323 sgml-parent-document:nil
7324 sgml-exposed-tags:nil
7325 sgml-local-catalogs:nil
7326 sgml-local-ecat-files:nil
7327 End:
7328 -->
7329 <!--
7331 to do:
7333 - wording of OpenType family name handling
7334 - handling combining sequences in the font matching algorithm
7335 - fix-up fi ligature example
7337 -->