Mon, 12 Aug 2013 16:46:57 +0900
[css3-fonts] change feature precedence for features implied by other CSS properties
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-12-august-2013>Editor's Draft
119 12 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-20130812/">http://www.w3.org/TR/2013/ED-css-fonts-3-20130812/</a> -->
129 <dt>Latest version:
131 <dd><a
132 href="http://www.w3.org/TR/css-fonts-3/">http://www.w3.org/TR/css-fonts-3/</a>
134 <dt>Latest editor's draft:
136 <dd><a
137 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
138 (<a
139 href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
140 log</a>)
142 <dt>Previous version:
144 <dd><a
145 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/</a>
147 <dt>Issues List:
149 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
150 issues in Tracker</a>
152 <dd><a
153 href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Fonts&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED">CSS3
154 Fonts issues in Bugzilla</a>
156 <dt>Discussion:
158 <dd><a
159 href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
160 with subject line “<kbd>[css-fonts] <var>… message topic
161 …</var></kbd>” (<a
162 href="http://lists.w3.org/Archives/Public/www-style/"
163 rel=discussion>archives</a>)
165 <dt>Editor:
167 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
168 </dl>
169 <!--begin-copyright-->
170 <p class=copyright><a
171 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
172 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
173 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
174 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
175 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
176 title="European Research Consortium for Informatics and
177 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
178 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
179 <a
180 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
181 <a
182 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
183 and <a
184 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
185 use</a> rules apply.</p>
186 <!--end-copyright-->
187 <hr title="Separator for header">
188 </div>
190 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
192 <p>This CSS3 module describes how font properties are specified and how
193 font resources are loaded dynamically. The contents of this specification
194 are a consolidation of content previously divided into <a
195 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
196 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
197 Web Fonts</a> modules. The description of font load events was moved into
198 the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
199 Events</a> module.
201 <h2 class="no-num no-toc" id=status>Status of this document</h2>
202 <!--begin-status-->
204 <p>This is a public copy of the editors' draft. It is provided for
205 discussion only and may change at any moment. Its publication here does
206 not imply endorsement of its contents by W3C. Don't cite this document
207 other than as work in progress.
209 <p>The (<a
210 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
211 mailing list <a
212 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
213 www-style@w3.org</a> (see <a
214 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
215 discussion of this specification. When sending e-mail, please put the text
216 “css3-fonts” in the subject, preferably like this:
217 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
219 <p>This document was produced by the <a
220 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
221 the <a href="http://www.w3.org/Style/">Style Activity</a>).
223 <p>This document was produced by a group operating under the <a
224 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
225 2004 W3C Patent Policy</a>. W3C maintains a <a
226 href="http://www.w3.org/2004/01/pp-impl/32061/status"
227 rel=disclosure>public list of any patent disclosures</a> made in
228 connection with the deliverables of the group; that page also includes
229 instructions for disclosing a patent. An individual who has actual
230 knowledge of a patent which the individual believes contains <a
231 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
232 Claim(s)</a> must disclose the information in accordance with <a
233 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
234 6 of the W3C Patent Policy</a>.</p>
235 <!--end-status-->
237 <h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
239 <p>The following features are at risk and may be removed when exiting CR:
241 <ul>
242 <li>fallback handling for text decoration in superscript/subscript variant
243 glyphs (‘<a href="#propdef-font-variant-position"><code
244 class=property>font-variant-position</code></a>’)
246 <li>‘<a href="#propdef-font-language-override"><code
247 class=property>font-language-override</code></a>’ property
248 </ul>
249 <!--
250 <p>This draft is a <strong>Last Call Working Draft</strong>.
251 Please send comments to the
252 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style mailing list</a>
253 as described above. The <strong>deadline for comments</strong>
254 is six weeks after the date of publication in the header, 22 August 2013.</p>
255 -->
257 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
258 <!--begin-toc-->
260 <ul class=toc>
261 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
263 <li><a href="#typography-background"><span class=secno>2 </span>Typography
264 Background</a>
266 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
267 Properties</a>
268 <ul class=toc>
269 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
270 family: the font-family property</a>
271 <ul class=toc>
272 <li><a href="#generic-font-families"><span class=secno>3.1.1
273 </span>Generic font families</a>
274 </ul>
276 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
277 weight: the font-weight property</a>
279 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
280 width: the font-stretch property</a>
282 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
283 the font-style property</a>
285 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
286 the font-size property</a>
288 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
289 </span>Relative sizing: the font-size-adjust property</a>
291 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
292 property: the font property</a>
294 <li><a href="#font-synthesis-prop"><span class=secno>3.8
295 </span>Controlling synthetic faces: the font-synthesis property</a>
296 </ul>
298 <li><a href="#font-resources"><span class=secno>4 </span>Font
299 Resources</a>
300 <ul class=toc>
301 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
302 <code>@font-face</code> rule</a>
304 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
305 family: the font-family descriptor</a>
307 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
308 src descriptor</a>
310 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
311 descriptors: the font-style, font-weight, font-stretch descriptors</a>
313 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
314 range: the unicode-range descriptor</a>
316 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
317 character ranges to define composite fonts</a>
319 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
320 features: the font-variant and font-feature-settings descriptors</a>
322 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
323 loading guidelines</a>
325 <li><a href="#same-origin-restriction"><span class=secno>4.9
326 </span>Same-origin restriction for fonts</a>
327 <ul class=toc>
328 <li><a href="#default-same-origin-restriction"><span class=secno>4.9.1
329 </span>Default same-origin restriction</a>
331 <li><a href="#allowing-cross-origin-font-loading"><span
332 class=secno>4.9.2 </span>Allowing cross-origin font loading</a>
333 </ul>
334 </ul>
336 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
337 Matching Algorithm</a>
338 <ul class=toc>
339 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
340 sensitivity of font family names</a>
342 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
343 font styles</a>
345 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
346 matching</a>
348 <li><a href="#char-handling-issues"><span class=secno>5.4
349 </span>Character handling issues</a>
351 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
352 matching changes since CSS 2.1</a>
354 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
355 matching examples</a>
356 </ul>
358 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
359 Properties</a>
360 <ul class=toc>
361 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
362 </span>Glyph selection and positioning</a>
364 <li><a href="#language-specific-support"><span class=secno>6.2
365 </span>Language-specific display</a>
367 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
368 the font-kerning property</a>
370 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
371 </span>Ligatures: the font-variant-ligatures property</a>
373 <li><a href="#font-variant-position-prop"><span class=secno>6.5
374 </span>Subscript and superscript forms: the font-variant-position
375 property</a>
377 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
378 </span>Capitalization: the font-variant-caps property</a>
380 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
381 </span>Numerical formatting: the font-variant-numeric property</a>
383 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
384 </span>Alternates and swashes: the font-variant-alternates property</a>
387 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
388 font specific alternates: the <code>@font-feature-values</code>
389 rule</a>
390 <ul class=toc>
391 <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
392 syntax</a>
394 <li><a href="#multi-valued-feature-value-definitions"><span
395 class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
396 </ul>
398 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
399 </span>East Asian text rendering: the font-variant-east-asian
400 property</a>
402 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
403 shorthand for font rendering: the font-variant property</a>
405 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
406 </span>Low-level font feature settings control: the
407 font-feature-settings property</a>
409 <li><a href="#font-language-override-prop"><span class=secno>6.13
410 </span>Font language override: the font-language-override property</a>
411 </ul>
413 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
414 Feature Resolution </a>
415 <ul class=toc>
416 <li><a href="#default-features"><span class=secno>7.1 </span>Default
417 features</a>
419 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
420 precedence</a>
422 <li><a href="#feature-precedence-examples"><span class=secno>7.3
423 </span>Feature precedence examples</a>
424 </ul>
426 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
427 <ul class=toc>
428 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
429 <code>CSSFontFaceRule</code> interface</a>
431 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
432 <code>CSSFontFeatureValuesRule</code> interface</a>
433 </ul>
435 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
436 platform font properties to CSS properties</a>
438 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
439 <ul class=toc>
440 <li class=no-num><a href="#recent-changes"> Changes from the July 2013
441 CSS3 Fonts Last Call Working Draft</a>
442 </ul>
444 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
446 <li class=no-num><a href="#conformance"> Conformance</a>
447 <ul class=toc>
448 <li class=no-num><a href="#conventions"> Document Conventions</a>
450 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
453 <li class=no-num><a href="#partial"> Partial Implementations</a>
455 <li class=no-num><a href="#experimental"> Experimental
456 Implementations</a>
458 <li class=no-num><a href="#testing"> Non-Experimental
459 Implementations</a>
460 </ul>
462 <li class=no-num><a href="#references">References</a>
463 <ul class=toc>
464 <li class=no-num><a href="#normative-references">Normative
465 References</a>
467 <li class=no-num><a href="#other-references">Other References</a>
468 </ul>
470 <li class=no-num><a href="#index">Index</a>
472 <li class=no-num><a href="#property-index">Property index</a>
473 </ul>
474 <!--end-toc-->
476 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
478 <p>A font provides a resource containing the visual representation of
479 characters. At the simplest level it contains information that maps
480 character codes to shapes (called glyphs) that represent these characters.
481 Fonts sharing a common design style are commonly grouped into font
482 families classified by a set of standard font properties. Within a family,
483 the shape displayed for a given character can vary by stroke weight, slant
484 or relative width, among others. An individual font face is described by a
485 unique combination of these properties. For a given range of text, CSS
486 font properties are used to select a font family and a specific font face
487 within that family to be used when rendering that text. As a simple
488 example, to use the bold form of Helvetica one could use:
490 <pre>body {
491 font-family: Helvetica;
492 font-weight: bold;
493 }</pre>
495 <p>Font resources may be installed locally on the system on which a user
496 agent is running or downloadable. For local font resources descriptive
497 information can be obtained directly from the font resource. For
498 downloadable font resources (sometimes referred to as web fonts), the
499 descriptive information is included with the reference to the font
500 resource.
502 <p>Families of fonts typically don't contain a single face for each
503 possible variation of font properties. The CSS font selection mechanism
504 describes how to match a given set of CSS font properties to a single font
505 face.
507 <h2 id=typography-background><span class=secno>2 </span>Typography
508 Background</h2>
510 <p><em>This section is non-normative.</em>
512 <p> Typographic traditions vary across the globe, so there is no unique way
513 to classify all fonts across languages and cultures. For even common Latin
514 letters, wide variations are possible:
516 <div class=figure><img alt="variations in glyphs for a single character"
517 src=aaaaaa.png>
518 <p class=caption>One character, many glyph variations
519 </div>
521 <p>Differences in the anatomy of letterforms is one way to distinguish
522 fonts. For Latin fonts, flourishes at the ends of a character's main
523 strokes, or serifs, can distinguish a font from those without. Similar
524 comparisons exist in non-Latin fonts between fonts with tapered strokes
525 and those using primarily uniform strokes:
527 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
528 <p class=caption>Letterforms with and without serifs
529 </div>
531 <div class=figure><img alt="serif vs. non-serifs for japanese"
532 src=minchovsgothic.png>
533 <p class=caption>Similar groupings for Japanese typefaces
534 </div>
536 <p>Fonts contain letterforms and the data needed to map characters to these
537 letterforms. Often this may be a simple one-to-one mapping, but more
538 complex mappings are also possible. The use of combining diacritic marks
539 creates many variations for an underlying letterform:
541 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
542 <p class=caption>Variations with diacritic marks
543 </div>
545 <p>A sequence of characters can be represented by a single glyph known as a
546 ligature:
548 <div class=figure><img alt="example of a fi ligature"
549 src=final-ligature.png>
550 <p class=caption>Ligature example
551 </div>
553 <p>Visual transformations based on textual context are often stylistic
554 option in European languages. They are required to correctly render
555 languages like Arabic, the lam and alef characters below <em>must</em> be
556 combined when they exist in sequence:
558 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
559 <p class=caption>Required Arabic ligature
560 </div>
562 <p>The relative complexity of these shaping transformations requires
563 additional data within the font.
565 <p>Sets of font faces with various stylistic variations are often grouped
566 together into font families. In the simplest case a regular face is
567 supplemented with bold and italic faces, but much more extensive groupings
568 are possible. Variations in the thickness of letterform strokes, the <dfn
569 id=weight>weight</dfn>, and the overall proportions of the letterform, the
570 <dfn id=width>width</dfn>, are most common. In the example below, each
571 letter uses a different font face within the Univers font family. The
572 width used increases from top to bottom and the weight increases from left
573 to right:
575 <div class=figure><img alt="various width and weight variations within a
576 single family" src=weightwidthvariations.png>
577 <p class=caption>Weight and width variations within a single font family
578 </div>
580 <p>Creating fonts that support multiple scripts is a difficult task;
581 designers need to understand the cultural traditions surrounding the use
582 of type in different scripts and come up with letterforms that somehow
583 share a common theme. Many languages often share a common script and each
584 of these languages may have noticeable stylistic differences. For example,
585 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
586 many languages, not just Russian.
588 <p>The <a href="#character-map"><em>character map</em></a> of a font
589 defines the mapping of characters to glyphs for that font. If a document
590 contains characters not supported by the <a href="#character-map"><em
591 title="character map">character maps</em></a> of the fonts contained in a
592 font family list, a user agent may use a <a
593 href="#system-font-fallback"><em>system font fallback</em></a> procedure
594 to locate an appropriate font that does. If no appropriate font can be
595 found, some form of "missing glyph" character will be rendered by the user
596 agent. System fallback can occur when the specified list of font families
597 does not include a font that supports a given character.
599 <p>Although the <a href="#character-map"><em>character map</em></a> of a
600 font maps a given character to a glyph for that character, modern font
601 technologies such as OpenType and AAT (Apple Advanced Typography) provide
602 ways of mapping a character to different glyphs based upon feature
603 settings. Fonts in these formats allow these features to be embedded in
604 the font itself and controlled by applications. Common typographic
605 features which can be specified this way include ligatures, swashes,
606 contextual alternates, proportional and tabular figures, and automatic
607 fractions, to list just a few. For a visual overview of OpenType features,
608 see the <a href="#OPENTYPE-FONT-GUIDE"
609 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
611 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
613 <p>The particular font face used to render a character is determined by the
614 font family and other font properties that apply to a given element. This
615 structure allows settings to be varied independent of each other.</p>
616 <!-- prop: font-family -->
618 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
619 href="#propdef-font-family">font-family</a> property</h3>
621 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
622 <tbody>
623 <tr>
624 <td>Name:
626 <td><dfn id=propdef-font-family
627 title="font-family!!property">font-family</dfn>
629 <tr>
630 <td>Value:
632 <td>[ <a href="#family-name-value"><var><family-name></var></a> |
633 <a href="#generic-family-value"><var><generic-family></var></a> ]
634 #
636 <tr>
637 <td>Initial:
639 <td>depends on user agent
641 <tr>
642 <td>Applies to:
644 <td>all elements
646 <tr>
647 <td>Inherited:
649 <td>yes
651 <tr>
652 <td>Percentages:
654 <td>N/A
656 <tr>
657 <td>Media:
659 <td>visual
661 <tr>
662 <td>Computed value:
664 <td>as specified
666 <tr>
667 <td>Animatable:
669 <td>no
670 </table>
672 <p>This property specifies a prioritized list of font family names or
673 generic family names. A font family defines a set of faces that vary in
674 weight, width or slope. CSS uses the combination of a family name with
675 other style attributes to select an individual face. Using this selection
676 mechanism, rather than selecting a face via the style name as is often
677 done in design applications, allows some degree of regularity in textual
678 display when fallback occurs.
680 <p class=note>Designers should note that the CSS definition of font
681 attributes used for selection are explicitly not intended to define a font
682 taxonomy. A type designer's idea of a family may often extend to a set of
683 faces that vary along axes other than just the standard axes of weight,
684 width and slope. A family may extend to include both a set of serif faces
685 and a set of sans-serif faces or vary along axes that are unique to that
686 family. The CSS font selection mechanism merely provides a way to
687 determine the “closest” substitute when substitution is necessary.
689 <p>Unlike other CSS properties, component values are a comma-separated list
690 indicating alternatives. A user agent iterates through the list of family
691 names until it matches an available font that contains a glyph for the
692 character to be rendered. This allows for differences in available fonts
693 across platforms and for differences in the range of characters supported
694 by individual fonts.
696 <p>A font family name only specifies a name given to a set of font faces,
697 it does not specify an individual face. For example, given the
698 availability of the fonts below, Futura would match but Futura Medium
699 would not:
701 <div class=figure><img alt="family and face names"
702 src=familyvsfacename.png>
703 <p class=caption>Family and individual face names
704 </div>
706 <p>Consider the example below:
708 <div class=example>
709 <pre>body {
710 font-family: Helvetica, Verdana, sans-serif;
711 }</pre>
713 <p>If Helvetica is available it will be used when rendering. If neither
714 Helvetica nor Verdana is present, then the user-agent-defined sans serif
715 font will be used.</p>
716 </div>
718 <p>There are two types of font family names:
720 <dl>
721 <dt><dfn id=family-name-value><var><family-name></var></dfn>
723 <dd>The name of a font family of choice such as Helvetica or Verdana in
724 the previous example.
726 <dt><dfn id=generic-family-value><var><generic-family></var></dfn>
728 <dd> The following generic family keywords are defined: ‘<a
729 href="#serif"><code class=property>serif</code></a>’, ‘<a
730 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
731 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
732 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
733 href="#monospace"><code class=property>monospace</code></a>’. These
734 keywords can be used as a general fallback mechanism when an author's
735 desired font choices are not available. As keywords, they must not be
736 quoted. Authors are encouraged to append a generic font family as a last
737 alternative for improved robustness.
738 </dl>
740 <p>Font family names other than generic families must either be given
741 quoted as <a
742 href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or
743 unquoted as a sequence of one or more <a
744 href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
745 This means most punctuation characters and digits at the start of each
746 token must be escaped in unquoted font family names.
748 <p>To illustrate this, the following declarations are invalid:
750 <pre>
751 font-family: Red/Black, sans-serif;
752 font-family: "Lucida" Grande, sans-serif;
753 font-family: Ahem!, sans-serif;
754 font-family: test@foo, sans-serif;
755 font-family: #POUND, sans-serif;
756 font-family: Hawaii 5-0, sans-serif;
757 </pre>
759 <p>If a sequence of identifiers is given as a font family name, the
760 computed value is the name converted to a string by joining all the
761 identifiers in the sequence by single spaces.
763 <p>To avoid mistakes in escaping, it is recommended to quote font family
764 names that contain white space, digits, or punctuation characters other
765 than hyphens:
767 <pre>
768 body { font-family: "New Century Schoolbook", serif }
770 <BODY STYLE="font-family: '21st Century', fantasy">
771 </pre>
773 <p>Font family <em>names</em> that happen to be the same as a keyword value
774 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
775 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
776 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
777 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
778 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
779 class=property>cursive</code></a>’) must be quoted to prevent confusion
780 with the keywords with the same names. The keywords ‘<code
781 class=property>initial</code>’ and ‘<code
782 class=property>default</code>’ are reserved for future use and must also
783 be quoted when used as font names. UAs must not consider these keywords as
784 matching the <a
785 href="#family-name-value"><var><family-name></var></a> type.
787 <p>The precise way a set of fonts are grouped into font families varies
788 depending upon the platform font management API's. The Windows GDI API
789 only allows four faces to be grouped into a family while the DirectWrite
790 API and API's on OSX and other platforms support font families with a
791 variety of weights, widths and slopes (see <a
792 href="#platform-props-to-css">Appendix A</a> for more details).
794 <p>Some font formats allow fonts to carry multiple localizations of the
795 family name. User agents must recognize and correctly match all of these
796 names independent of the underlying platform localization, system API used
797 or document encoding:
799 <div class=figure><img alt="examples of localized family names"
800 src=localizedfamilynames.png>
801 <p class=caption>Localized family names
802 </div>
804 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
805 families</h4>
807 <p>All five generic font families are defined to exist in all CSS
808 implementations (they need not necessarily map to five distinct actual
809 fonts). User agents should provide reasonable default choices for the
810 generic font families, which express the characteristics of each family as
811 well as possible within the limits allowed by the underlying technology.
812 User agents are encouraged to allow users to select alternative choices
813 for the generic fonts.
815 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
816 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
818 <p>Serif fonts represent the formal text style for a script. This often
819 means but is not limited to glyphs that have finishing strokes, flared or
820 tapering ends, or have actual serifed endings (including slab serifs).
821 Serif fonts are typically proportionately-spaced. They often display a
822 greater variation between thick and thin strokes than fonts from the ‘<a
823 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
824 font family. CSS uses the term ‘<a href="#serif"><code
825 class=property>serif</code></a>’ to apply to a font for any script,
826 although other names may be more familiar for particular scripts, such as
827 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
828 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
829 class=property>serif</code></a>’ more due to its typographic role rather
830 than its actual design style. Any font that is so described may be used to
831 represent the generic ‘<a href="#serif"><code
832 class=property>serif</code></a>’ family.
834 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
835 <p class=caption>Sample serif fonts
836 </div>
838 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
839 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
840 id=sans-serif>sans-serif</dfn></a></span></h5>
842 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
843 low contrast (vertical and horizontal stems have the close to the same
844 thickness) and have stroke endings that are plain -- without any flaring,
845 cross stroke, or other ornamentation. Sans-serif fonts are typically
846 proportionately-spaced. They often have little variation between thick and
847 thin strokes, compared to fonts from the ‘<a href="#serif"><code
848 class=property>serif</code></a>’ family. CSS uses the term ‘<a
849 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
850 to a font for any script, although other names may be more familiar for
851 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
852 (Korean). Any font that is so described may be used to represent the
853 generic ‘<a href="#sans-serif"><code
854 class=property>sans-serif</code></a>’ family.
856 <div class=figure><img alt="sample sans-serif fonts"
857 src=sansserifexamples.png>
858 <p class=caption>Sample sans-serif fonts
859 </div>
861 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
862 title="cursive, definition of"> <a name=cursive-def><dfn
863 id=cursive>cursive</dfn></a></span></h5>
865 <p>Glyphs in cursive fonts generally use a more informal script style, and
866 the result looks more like handwritten pen or brush writing than printed
867 letterwork. CSS uses the term ‘<a href="#cursive"><code
868 class=property>cursive</code></a>’ to apply to a font for any script,
869 although other names such as Chancery, Brush, Swing and Script are also
870 used in font names.
872 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
873 <p class=caption>Sample cursive fonts
874 </div>
876 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
877 title="fantasy, definition of"> <a name=fantasy-def><dfn
878 id=fantasy>fantasy</dfn></a></span></h5>
880 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
881 playful representations of characters. These do not include Pi or Picture
882 fonts which do not represent actual characters.
884 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
885 <p class=caption>Sample fantasy fonts
886 </div>
888 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
889 title="monospace, definition of"> <a name=monospace-def><dfn
890 id=monospace>monospace</dfn></a></span></h5>
892 <p>The sole criterion of a monospace font is that all glyphs have the same
893 fixed width. This is often used to render samples of computer code.
895 <div class=figure><img alt="sample monospace fonts"
896 src=monospaceexamples.png>
897 <p class=caption>Sample monospace fonts
898 </div>
899 <!-- prop: font-weight -->
901 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
902 href="#propdef-font-weight">font-weight</a> property</h3>
904 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
905 <tbody>
906 <tr>
907 <td>Name:
909 <td><dfn id=propdef-font-weight
910 title="font-weight!!property">font-weight</dfn>
912 <tr>
913 <td>Value:
915 <td><a href="#font-weight-normal-value"
916 title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
917 href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
918 href="#font-weight-numeric-values" title="100...900 weight
919 values">100</a> | <a href="#font-weight-numeric-values"
920 title="100...900 weight values">200</a> | <a
921 href="#font-weight-numeric-values" title="100...900 weight
922 values">300</a> | <a href="#font-weight-numeric-values"
923 title="100...900 weight values">400</a> | <a
924 href="#font-weight-numeric-values" title="100...900 weight
925 values">500</a> | <a href="#font-weight-numeric-values"
926 title="100...900 weight values">600</a> | <a
927 href="#font-weight-numeric-values" title="100...900 weight
928 values">700</a> | <a href="#font-weight-numeric-values"
929 title="100...900 weight values">800</a> | <a
930 href="#font-weight-numeric-values" title="100...900 weight
931 values">900</a>
933 <tr>
934 <td>Initial:
936 <td>normal
938 <tr>
939 <td>Applies to:
941 <td>all elements
943 <tr>
944 <td>Inherited:
946 <td>yes
948 <tr>
949 <td>Percentages:
951 <td>N/A
953 <tr>
954 <td>Media:
956 <td>visual
958 <tr>
959 <td>Computed value:
961 <td>numeric weight value (see description)
963 <tr>
964 <td>Animatable:
966 <td>as <a
967 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
968 weight</a>
969 </table>
971 <p>The <a href="#propdef-font-weight"
972 title="font-weight!!property">‘<code
973 class=property>font-weight</code>’</a> property specifies the weight of
974 glyphs in the font, their degree of blackness or stroke thickness.
976 <p>Values have the following meanings:
978 <dl>
979 <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
980 to 900</dfn>
982 <dd>These values form an ordered sequence, where each number indicates a
983 weight that is at least as dark as its predecessor. These roughly
984 correspond to the commonly used weight names below:
985 </dl>
987 <ul>
988 <li>100 - Thin
990 <li>200 - Extra Light (Ultra Light)
992 <li>300 - Light
994 <li>400 - Normal
996 <li>500 - Medium
998 <li>600 - Semi Bold (Demi Bold)
1000 <li>700 - Bold
1002 <li>800 - Extra Bold (Ultra Bold)
1004 <li>900 - Black (Heavy)
1005 </ul>
1007 <dl>
1008 <dt><dfn id=font-weight-normal-value
1009 title="normal!!font-weight">normal</dfn>
1011 <dd>Same as ‘<code class=css>400</code>’.
1013 <dt><dfn id=bold>bold</dfn>
1015 <dd>Same as ‘<code class=css>700</code>’.
1017 <dt><dfn id=bolder>bolder</dfn>
1019 <dd>Specifies a bolder weight than the inherited value.
1021 <dt><dfn id=lighter>lighter</dfn>
1023 <dd>Specifies a lighter weight than the inherited value.
1024 </dl>
1026 <p>Font formats that use a scale other than a nine-step scale should map
1027 their scale onto the CSS scale so that 400 roughly corresponds with a face
1028 that would be labeled as Regular, Book, Roman and 700 roughly matches a
1029 face that would be labeled as Bold. Or weights may be inferred from the
1030 style names, ones that correspond roughly with the scale above. The scale
1031 is relative, so a face with a larger weight value must never appear
1032 lighter. If style names are used to infer weights, care should be taken to
1033 handle variations in style names across locales.
1035 <p>Quite often there are only a few weights available for a particular font
1036 family. When a weight is specified for which no face exists, a face with a
1037 nearby weight is used. In general, bold weights map to faces with heavier
1038 weights and light weights map to faces with lighter weights (see the <a
1039 href="#font-matching-algorithm">font matching section below</a> for a
1040 precise definition). The examples here illustrate which face is used for
1041 different weights, grey indicates a face for that weight does not exist so
1042 a face with a nearby weight is used:
1044 <div class=figure><img alt="weight mappings for a family with 400, 700 and
1045 900 weights" src=optimaweights.png>
1046 <p class=caption>Weight mappings for a font family with 400, 700 and 900
1047 weight faces
1048 </div>
1050 <div class=figure><img alt="weight mappings for a family with 300, 600
1051 weights" src=hiraginoweights.png>
1052 <p class=caption>Weight mappings for a font family with 300 and 600 weight
1053 faces
1054 </div>
1056 <p>Although the practice is not well-loved by typographers, bold faces are
1057 often synthesized by user agents for faces that lack actual bold faces.
1058 For the purposes of style matching, these faces must be treated as if they
1059 exist within the family. Authors can explicitly avoid this behavior by
1060 using the ‘<a href="#propdef-font-synthesis"><code
1061 class=property>font-synthesis</code></a>’ property.
1063 <p>Specified values of ‘<a href="#bolder"><code
1064 class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
1065 class=property>lighter</code></a>’ indicate weights relative to the
1066 weight of the parent element. The computed weight is calculated based on
1067 the inherited <a href="#propdef-font-weight"
1068 title="font-weight!!property">‘<code
1069 class=property>font-weight</code>’</a> value using the chart below.
1071 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
1072 <thead>
1073 <tr>
1074 <th>Inherited value
1076 <th>bolder
1078 <th>lighter
1080 <tbody>
1081 <tr>
1082 <th>100
1084 <td>400
1086 <td>100
1088 <tr>
1089 <th>200
1091 <td>400
1093 <td>100
1095 <tr>
1096 <th>300
1098 <td>400
1100 <td>100
1102 <tr>
1103 <th>400
1105 <td>700
1107 <td>100
1109 <tr>
1110 <th>500
1112 <td>700
1114 <td>100
1116 <tr>
1117 <th>600
1119 <td>900
1121 <td>400
1123 <tr>
1124 <th>700
1126 <td>900
1128 <td>400
1130 <tr>
1131 <th>800
1133 <td>900
1135 <td>700
1137 <tr>
1138 <th>900
1140 <td>900
1142 <td>700
1143 </table>
1145 <p>The table above is equivalent to selecting the next relative bolder or
1146 lighter face, given a font family containing normal and bold faces along
1147 with a thin and a heavy face. Authors who desire finer control over the
1148 exact weight values used for a given element may use numerical values
1149 instead of relative weights.</p>
1150 <!-- prop: font-stretch -->
1152 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
1153 href="#propdef-font-stretch">font-stretch</a> property</h3>
1155 <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
1156 <tbody>
1157 <tr>
1158 <td>Name:
1160 <td><dfn id=propdef-font-stretch
1161 title="font-stretch!!property">font-stretch</dfn>
1163 <tr>
1164 <td>Value:
1166 <td> <a href="#font-stretch-normal-value"
1167 title="normal!!font-stretch">normal</a> | <a
1168 href="#ultra-condensed">ultra-condensed</a> | <a
1169 href="#extra-condensed">extra-condensed</a> | <a
1170 href="#condensed">condensed</a> | <a
1171 href="#semi-condensed-">semi-condensed</a> | <a
1172 href="#semi-expanded">semi-expanded</a> | <a
1173 href="#expanded">expanded</a> | <a
1174 href="#extra-expanded">extra-expanded</a> | <a
1175 href="#ultra-expanded">ultra-expanded</a>
1177 <tr>
1178 <td>Initial:
1180 <td>normal
1182 <tr>
1183 <td>Applies to:
1185 <td>all elements
1187 <tr>
1188 <td>Inherited:
1190 <td>yes
1192 <tr>
1193 <td>Percentages:
1195 <td>N/A
1197 <tr>
1198 <td>Media:
1200 <td>visual
1202 <tr>
1203 <td>Computed value:
1205 <td>as specified
1207 <tr>
1208 <td>Animatable:
1210 <td>as <a href="#font-stretch-animation">font stretch</a>
1211 </table>
1213 <p>The <a href="#propdef-font-stretch"
1214 title="font-stretch!!property">‘<code
1215 class=property>font-stretch</code>’</a> property selects a normal,
1216 condensed, or expanded face from a font family. Absolute keyword values
1217 have the following ordering, from narrowest to widest:
1219 <ul>
1220 <li><dfn id=ultra-condensed>ultra-condensed</dfn>
1222 <li><dfn id=extra-condensed>extra-condensed</dfn>
1224 <li><dfn id=condensed>condensed</dfn>
1226 <li><dfn id=semi-condensed->semi-condensed </dfn>
1228 <li><dfn id=font-stretch-normal-value
1229 title="normal!!font-stretch">normal</dfn>
1231 <li><dfn id=semi-expanded>semi-expanded</dfn>
1233 <li><dfn id=expanded>expanded</dfn>
1235 <li><dfn id=extra-expanded>extra-expanded</dfn>
1237 <li><dfn id=ultra-expanded>ultra-expanded</dfn>
1238 </ul>
1240 <p>When a face does not exist for a given width, normal or condensed values
1241 map to a narrower face, otherwise a wider face. Conversely, expanded
1242 values map to a wider face, otherwise a narrower face. The figure below
1243 shows how the nine font-stretch property settings affect font selection
1244 for font family containing a variety of widths, grey indicates a width for
1245 which no face exists and a different width is substituted:
1247 <div class=figure><img alt="width mappings for a family with condensed,
1248 normal and expanded faces" src=universwidths.png>
1249 <p class=caption>Width mappings for a font family with condensed, normal
1250 and expanded width faces
1251 </div>
1253 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
1254 interpolated in discrete steps. The interpolation happens as though the
1255 ordered values are equally spaced real numbers. The interpolation result
1256 is rounded to the nearest value, with values exactly halfway between two
1257 values rounded towards the later value in the list above.</p>
1258 <!-- prop: font-style -->
1260 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
1261 href="#propdef-font-style">font-style</a> property</h3>
1263 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
1264 <tbody>
1265 <tr>
1266 <td>Name:
1268 <td><dfn id=propdef-font-style
1269 title="font-style!!property">font-style</dfn>
1271 <tr>
1272 <td>Value:
1274 <td><a href="#font-style-normal-value"
1275 title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
1276 <a href="#oblique">oblique</a>
1278 <tr>
1279 <td>Initial:
1281 <td>normal
1283 <tr>
1284 <td>Applies to:
1286 <td>all elements
1288 <tr>
1289 <td>Inherited:
1291 <td>yes
1293 <tr>
1294 <td>Percentages:
1296 <td>N/A
1298 <tr>
1299 <td>Media:
1301 <td>visual
1303 <tr>
1304 <td>Computed value:
1306 <td>as specified
1308 <tr>
1309 <td>Animatable:
1311 <td>no
1312 </table>
1314 <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
1315 class=property>font-style</code>’</a> property allows italic or oblique
1316 faces to be selected. Italic forms are generally cursive in nature while
1317 oblique faces are typically sloped versions of the regular face. Oblique
1318 faces can be simulated by artificially sloping the glyphs of the regular
1319 face. Compare the artificially sloped renderings of Palatino ‘<code
1320 class=property>a</code>’ and Baskerville ‘<code
1321 class=property>N</code>’ in grey with the actual italic versions:
1323 <div class=figure><img alt="artificial sloping vs. real italics"
1324 src=realvsfakeitalics.png>
1325 <p class=caption>Artificial sloping versus real italics
1326 </div>
1328 <p>Values have the following meanings:
1330 <dl>
1331 <dt><dfn id=font-style-normal-value
1332 title="normal!!font-style">normal</dfn>
1334 <dd>selects a face that is classified as a normal face, one that is
1335 neither italic or obliqued
1337 <dt><dfn id=italic>italic</dfn>
1339 <dd>selects a font that is labeled as an italic face, or an oblique face
1340 if one is not
1342 <dt><dfn id=oblique>oblique</dfn>
1344 <dd>selects a font that is labeled as an oblique face, or an italic face
1345 if one is not
1346 </dl>
1348 <p>If no italic or oblique face is available, oblique faces can be
1349 synthesized by rendering non-obliqued faces with an artificial obliquing
1350 operation. The use of these artificially obliqued faces can be disabled
1351 using the ‘<a href="#propdef-font-synthesis"><code
1352 class=property>font-synthesis</code></a>’ property. The details of the
1353 obliquing operation are not explicitly defined.</p>
1354 <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
1356 <p>Many scripts lack the tradition of mixing a cursive form within text
1357 rendered with a normal face. Chinese, Japanese and Korean fonts almost
1358 always lack italic or oblique faces. Fonts that support a mixture of
1359 scripts will sometimes omit specific scripts such as Arabic from the set
1360 of glyphs supported in the italic face. User agents should be careful
1361 about making <a href="#character-map"><em>character map</em></a>
1362 assumptions across faces when implementing support for <a
1363 href="#system-font-fallback"><em>system font fallback</em></a>.</p>
1364 <!-- prop: font-size -->
1366 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
1367 href="#propdef-font-size">font-size</a> property</h3>
1369 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
1370 <tbody>
1371 <tr>
1372 <td>Name:
1374 <td><dfn id=propdef-font-size>font-size</dfn>
1376 <tr>
1377 <td>Value:
1379 <td><a href="#absolute-size-value"><var><absolute-size></var></a>
1380 | <a href="#relative-size-value"><var><relative-size></var></a> |
1381 <a href="#length-size-value"><var><length></var></a> | <a
1382 href="#percentage-size-value"><var><percentage></var></a>
1384 <tr>
1385 <td>Initial:
1387 <td>medium
1389 <tr>
1390 <td>Applies to:
1392 <td>all elements
1394 <tr>
1395 <td>Inherited:
1397 <td>yes
1399 <tr>
1400 <td>Percentages:
1402 <td>refer to parent element's font size
1404 <tr>
1405 <td>Media:
1407 <td>visual
1409 <tr>
1410 <td>Computed value:
1412 <td>absolute length
1414 <tr>
1415 <td>Animatable:
1417 <td>as <a
1418 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
1419 </table>
1421 <p>This property indicates the desired height of glyphs from the font. For
1422 scalable fonts, the font-size is a scale factor applied to the EM unit of
1423 the font. (Note that certain glyphs may bleed outside their EM box.) For
1424 non-scalable fonts, the font-size is converted into absolute units and
1425 matched against the declared font-size of the font, using the same
1426 absolute coordinate space for both of the matched values. Values have the
1427 following meanings:
1429 <dl>
1430 <dt><dfn id=absolute-size-value><var><absolute-size></var></dfn>
1432 <dd> An <a
1433 href="#absolute-size-value"><var><absolute-size></var></a> keyword
1434 refers to an entry in a table of font sizes computed and kept by the user
1435 agent. Possible values are:
1436 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
1438 <dt><dfn id=relative-size-value><var><relative-size></var></dfn>
1440 <dd> A <a href="#relative-size-value"><var><relative-size></var></a>
1441 keyword is interpreted relative to the table of font sizes and the
1442 computed ‘<a href="#propdef-font-size"><code
1443 class=property>font-size</code></a>’ of the parent element. Possible
1444 values are:
1445 <p> [ larger | smaller ]
1447 <p> For example, if the parent element has a font size of ‘<code
1448 class=property>medium</code>’, a value of ‘<code
1449 class=property>larger</code>’ will make the font size of the current
1450 element be ‘<code class=property>large</code>’. If the parent
1451 element's size is not close to a table entry, the user agent is free to
1452 interpolate between table entries or round off to the closest one. The
1453 user agent may have to extrapolate table values if the numerical value
1454 goes beyond the keywords.
1456 <dt><dfn id=length-size-value><var><length></var></dfn>
1458 <dd>A length value specifies an absolute font size (independent of the
1459 user agent's font table). Negative lengths are illegal.
1461 <dt><dfn id=percentage-size-value><var><percentage></var></dfn>
1463 <dd>A percentage value specifies an absolute font size relative to the
1464 parent element's font size. Use of percentage values, or values in
1465 ‘<code class=property>em</code>’s, leads to more robust and
1466 cascadable style sheets.
1467 </dl>
1469 <p>The following table provides user agent guidelines for the absolute-size
1470 scaling factor and their mapping to HTML heading and absolute font-sizes.
1471 The ‘<code class=property>medium</code>’ value is used as the
1472 reference middle value. The user agent may fine-tune these values for
1473 different fonts or different types of display devices.
1475 <table class=data>
1476 <thead>
1477 <tr>
1478 <th>CSS absolute-size values
1480 <th>xx-small
1482 <th>x-small
1484 <th>small
1486 <th>medium
1488 <th>large
1490 <th>x-large
1492 <th>xx-large
1494 <th>
1496 <tbody>
1497 <tr>
1498 <th>scaling factor
1500 <td>3/5
1502 <td>3/4
1504 <td>8/9
1506 <td>1
1508 <td>6/5
1510 <td>3/2
1512 <td>2/1
1514 <td>3/1
1516 <tr>
1517 <th>HTML headings
1519 <td>h6
1521 <td>
1523 <td>h5
1525 <td>h4
1527 <td>h3
1529 <td>h2
1531 <td>h1
1533 <td>
1535 <tr>
1536 <th>HTML font sizes
1538 <td>1
1540 <td>
1542 <td>2
1544 <td>3
1546 <td>4
1548 <td>5
1550 <td>6
1552 <td>7
1553 </table>
1555 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
1556 applying these guidelines should nevertheless avoid creating font-size
1557 resulting in less than 9 device pixels per EM unit on a computer
1558 display.</em>
1560 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
1561 factor between adjacent indexes was 1.5 which user experience proved to be
1562 too large. In CSS2, the suggested scaling factor for computer screen
1563 between adjacent indexes was 1.2 which still created issues for the small
1564 sizes. The new scaling factor varies between each index to provide a
1565 better readability.</em>
1567 <p>The actual value of this property may differ from the computed value due
1568 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
1569 class=property>font-size-adjust</code></a>’ and the unavailability of
1570 certain font sizes.
1572 <p>Child elements inherit the computed <a class=noxref
1573 href="#font-size-prop"> <span class=property>‘<code
1574 class=property>font-size</code>’</span></a> value (otherwise, the effect
1575 of <a class=noxref href="#font-size-adjust-prop"><span
1576 class=property>‘<code
1577 class=property>font-size-adjust</code>’</span></a> would compound).
1579 <div class=example>
1580 <p style="display:none">Example(s):</p>
1582 <pre>p { font-size: 12pt; }
1583 blockquote { font-size: larger }
1584 em { font-size: 150% }
1585 em { font-size: 1.5em }
1586 </pre>
1587 </div>
1588 <!-- prop: font-size-adjust -->
1590 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
1591 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
1593 <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
1594 <tbody>
1595 <tr>
1596 <td>Name:
1598 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
1600 <tr>
1601 <td>Value:
1603 <td><a href="#font-size-adjust-none-value"
1604 title="none!!font-size-adjust">none</a> | <a
1605 href="#font-size-adjust-auto-value"
1606 title="auto!!font-size-adjust">auto</a> | <a
1607 href="#aspect-ratio-value"><var><number></var></a>
1609 <tr>
1610 <td>Initial:
1612 <td>none
1614 <tr>
1615 <td>Applies to:
1617 <td>all elements
1619 <tr>
1620 <td>Inherited:
1622 <td>yes
1624 <tr>
1625 <td>Percentages:
1627 <td>N/A
1629 <tr>
1630 <td>Media:
1632 <td>visual
1634 <tr>
1635 <td>Computed value:
1637 <td>as specified
1639 <tr>
1640 <td>Animatable:
1642 <td>as <a
1643 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
1644 </table>
1646 <p>For any given font size, the apparent size and legibility of text varies
1647 across fonts. For scripts such as Latin or Cyrillic that distinguish
1648 between upper and lowercase letters, the relative height of lowercase
1649 letters compared to their uppercase counterparts is a determining factor
1650 of legibility. This is commonly referred to as the <a class=index-def
1651 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
1652 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
1653 the x-height of a font divided by the font size.
1655 <p>In situations where font fallback occurs, fallback fonts may not share
1656 the same aspect ratio as the desired font family and will thus appear less
1657 readable. The font-size-adjust property is a way to preserve the
1658 readability of text when font fallback occurs. It does this by adjusting
1659 the font-size so that the x-height is the same regardless of the font
1660 used.
1662 <div class=example>
1663 <p>The style defined below defines Verdana as the desired font family, but
1664 if Verdana is not available Futura or Times will be used.</p>
1666 <pre>p {
1667 font-family: Verdana, Futura, Times;
1668 }
1670 <p>Lorem ipsum dolor sit amet, ...</p>
1671 </pre>
1673 <p>Verdana has a relatively high aspect ratio, lowercase letters are
1674 relatively tall compared to uppercase letters, so at small sizes text
1675 appears legible. Times has a lower aspect ratio and so if fallback
1676 occurs, the text will be less legible at small sizes than Verdana.</p>
1677 </div>
1679 <p>How text rendered in each of these fonts compares is shown below, the
1680 columns show text rendered in Verdana, Futura and Times. The same
1681 font-size value is used across cells within each row and red lines are
1682 included to show the differences in x-height. In the upper half each row
1683 is rendered in the same font-size value. The same is true for the lower
1684 half but in this half the font-size-adjust property is also set so that
1685 the actual font size is adjusted to preserve the x-height across each row.
1686 Note how small text remains relatively legible across each row in the
1687 lower half.
1689 <div class=figure><img alt="text with and without font-size-adjust"
1690 src=fontsizeadjust.png>
1691 <p class=caption>Text with and without the use of font-size-adjust
1692 </div>
1694 <p>This property allows authors to specify an <a
1695 href="#aspect-value"><i>aspect value</i></a> for an element that will
1696 effectively preserve the x-height of the first choice font, whether it is
1697 substituted or not. Values have the following meanings:
1699 <dl>
1700 <dt><dfn id=font-size-adjust-none-value
1701 title="none!!font-size-adjust">none</dfn>
1703 <dd>Do not preserve the font's x-height.
1705 <dt><dfn id=font-size-adjust-auto-value
1706 title="auto!!font-size-adjust">auto</dfn>
1708 <dd>Behaves just like <number>, except the number used is the <a
1709 href="#aspect-value"><i>aspect value</i></a> calculated by user agents
1710 for the first font in the list of fonts defined for the initial value of
1711 the <a href="#propdef-font-family" title="font-family!!property">‘<code
1712 class=property>font-family</code>’</a> property. Effectively this is
1713 the default font used when <a href="#propdef-font-family"
1714 title="font-family!!property">‘<code
1715 class=property>font-family</code>’</a> is not otherwise specified.
1716 <p>Authors can use this value to specify that font size should be
1717 normalized across fonts based on the x-height without the need to
1718 specify the aspect ratio explicitly.</p>
1720 <dt><dfn id=aspect-ratio-value><var><number></var></dfn>
1722 <dd>Specifies the <a href="#aspect-value"><i>aspect value</i></a> used in
1723 the calculation below to calculate the adjusted font size:
1724 <pre>c = ( a / a' ) s
1725 </pre>
1727 <p>where:</p>
1729 <pre>s = font-size value
1730 a = <a href="#aspect-value"><i>aspect value</i></a> as specified by the font-size-adjust property
1731 a' = <a href="#aspect-value"><i>aspect value</i></a> of actual font
1732 c = adjusted font-size to use
1733 </pre>
1735 <p>This value applies to any font that is selected but in typical usage
1736 it should be based on the <a href="#aspect-value"><i>aspect
1737 value</i></a> of the first font in the font-family list. If this is
1738 specified accurately, the <tt>(a/a')</tt> term in the formula above is
1739 effectively 1 for the first font and no adjustment occurs. If the value
1740 is specified inaccurately, text rendered using the first font in the
1741 family list will display differently in older user agents that don't
1742 support font-size-adjust.</p>
1743 </dl>
1745 <p>The value of ‘<a href="#propdef-font-size-adjust"><code
1746 class=property>font-size-adjust</code></a>’ affects the size of relative
1747 units that are based on font metrics of the <a
1748 href="#first-available-font"><i>first available font</i></a> such as
1749 <code>ex</code> and <code>ch</code> but does not affect the size of
1750 <code>em</code> units.
1752 <p>Authors can calculate the <a href="#aspect-value"><i>aspect
1753 value</i></a> for a given font by comparing spans with the same content
1754 but different font-size-adjust properties. If the same font-size is used,
1755 the spans will match when the font-size-adjust value is accurate for the
1756 given font.
1758 <div class=example>
1759 <p>Two spans with borders are used to determine the <a
1760 href="#aspect-value"><i>aspect value</i></a> of a font. The font-size is
1761 the same for both spans but the font-size-adjust property is specified
1762 only for the right span. Starting with a value of 0.5, the aspect value
1763 can be adjusted until the borders around the two letters line up.</p>
1765 <pre>p {
1766 font-family: Futura;
1767 font-size: 500px;
1768 }
1770 span {
1771 border: solid 1px red;
1772 }
1774 .adjust {
1775 font-size-adjust: 0.5;
1776 }
1778 <p><span>b</span><span class="adjust">b</span></p>
1779 </pre>
1781 <div class=figure><img alt="Futura with an <i>aspect value</i> of 0.5"
1782 src=beforefontsizeadjust.png>
1783 <p class=caption>Futura with an <a href="#aspect-value"><i>aspect
1784 value</i></a> of 0.5
1785 </div>
1787 <p>The box on the right is a bit bigger than the one on the left, so the
1788 <a href="#aspect-value"><i>aspect value</i></a> of this font is something
1789 less than 0.5. Adjust the value until the boxes align.</p>
1790 </div>
1791 <!-- prop: font -->
1793 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
1794 <a href="#propdef-font">font</a> property</h3>
1796 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
1797 <tbody>
1798 <tr>
1799 <td>Name:
1801 <td><dfn id=propdef-font>font</dfn>
1803 <tr>
1804 <td>Value:
1806 <td>[ [ <var><<a href="#propdef-font-style"
1807 title="font-style!!property">‘<code
1808 class=property>font-style</code>’</a>></var> || <a
1809 href="#font-variant-css21-values"><var><font-variant-css21></var></a>
1810 || <var><<a href="#propdef-font-weight"
1811 title="font-weight!!property">‘<code
1812 class=property>font-weight</code>’</a>></var> || <var><<a
1813 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
1814 class=property>font-stretch</code>’</a></var> ]? <var><‘<a
1815 href="#propdef-font-size"><code
1816 class=property>font-size</code></a>’></var> [ / <var><‘<code
1817 class=property>line-height</code>’></var> ]? <var><<a
1818 href="#propdef-font-family" title="font-family!!property">‘<code
1819 class=property>font-family</code>’</a>></var> ] | caption | icon |
1820 menu | message-box | small-caption | status-bar
1822 <tr>
1823 <td>Initial:
1825 <td>see individual properties
1827 <tr>
1828 <td>Applies to:
1830 <td>all elements
1832 <tr>
1833 <td>Inherited:
1835 <td>yes
1837 <tr>
1838 <td>Percentages:
1840 <td>see individual properties
1842 <tr>
1843 <td>Media:
1845 <td>visual
1847 <tr>
1848 <td>Computed value:
1850 <td>see individual properties
1852 <tr>
1853 <td>Animatable:
1855 <td>see individual properties
1856 </table>
1858 <p>The <span class=property>‘<a href="#propdef-font"><code
1859 class=property>font</code></a>’</span> property is, except as described
1860 below, a shorthand property for setting <a href="#propdef-font-style"
1861 title="font-style!!property">‘<code
1862 class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
1863 title="font-variant!!property">‘<code
1864 class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
1865 title="font-weight!!property">‘<code
1866 class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
1867 title="font-stretch!!property">‘<code
1868 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1869 href="#propdef-font-size"><code
1870 class=property>font-size</code></a>’</span>, <a class=property
1871 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1872 class=property>line-height</code>’</a>, <a href="#propdef-font-family"
1873 title="font-family!!property">‘<code
1874 class=property>font-family</code>’</a> at the same place in the
1875 stylesheet. Values for the <a href="#propdef-font-variant"
1876 title="font-variant!!property">‘<code
1877 class=property>font-variant</code>’</a> property may also be included
1878 but only those supported in CSS 2.1, none of the <a
1879 href="#propdef-font-variant" title="font-variant!!property">‘<code
1880 class=property>font-variant</code>’</a> values added in this
1881 specification can be used in the <span class=property>‘<a
1882 href="#propdef-font"><code class=property>font</code></a>’</span>
1883 shorthand:
1885 <pre
1886 class=prod><dfn id=font-variant-css21-values><var><font-variant-css21></var></dfn> = [normal | small-caps]</pre>
1888 <p>The syntax of this property is based on a traditional typographical
1889 shorthand notation to set multiple properties related to fonts.
1891 <p>All subproperties of the ‘<a href="#propdef-font"><code
1892 class=property>font</code></a>’ property are first reset to their
1893 initial values, including those listed above plus <span
1894 class=property>‘<a href="#propdef-font-size-adjust"><code
1895 class=property>font-size-adjust</code></a>’</span>, <span
1896 class=property>‘<a href="#propdef-font-kerning"><code
1897 class=property>font-kerning</code></a>’</span>, subproperties of <a
1898 href="#propdef-font-variant" title="font-variant!!property">‘<code
1899 class=property>font-variant</code>’</a> and and <span>‘<a
1900 href="#propdef-font-language-override"><code
1901 class=property>font-language-override</code></a>’</span>. Then, those
1902 properties that are given explicit values in the <span
1903 class=property>‘<a href="#propdef-font"><code
1904 class=property>font</code></a>’</span> shorthand are set to those
1905 values. For a definition of allowed and initial values, see the previously
1906 defined properties. For reasons of backwards compatibility, it is not
1907 possible to set <span class=property>‘<a
1908 href="#propdef-font-size-adjust"><code
1909 class=property>font-size-adjust</code></a>’</span> to anything other
1910 than its initial value using the <span class=property>‘<a
1911 href="#propdef-font"><code class=property>font</code></a>’</span>
1912 shorthand property; instead, use the individual property.
1914 <div class=example>
1915 <p style="display:none">Example(s):</p>
1917 <pre>p { font: 12pt/14pt sans-serif }
1918 p { font: 80% sans-serif }
1919 p { font: x-large/110% "new century schoolbook", serif }
1920 p { font: bold italic large Palatino, serif }
1921 p { font: normal small-caps 120%/120% fantasy }
1922 p { font: condensed oblique 12pt "Helvetica Neue", serif; }
1923 </pre>
1925 <p> In the second rule, the font size percentage value (‘<code
1926 class=css>80%</code>’) refers to the computed ‘<a
1927 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
1928 the parent element. In the third rule, the line height percentage
1929 (‘<code class=css>110%</code>’) refers to the font size of the
1930 element itself.
1932 <p>The first three rules do not specify the <a
1933 href="#propdef-font-variant" title="font-variant!!property">‘<code
1934 class=property>font-variant</code>’</a> and <a
1935 href="#propdef-font-weight" title="font-weight!!property">‘<code
1936 class=property>font-weight</code>’</a> explicitly, so these properties
1937 receive their initial values (<span title="normal value">‘<code
1938 class=property>normal</code>’</span>). Notice that the font family name
1939 "new century schoolbook", which contains spaces, is enclosed in quotes.
1940 The fourth rule sets the <a href="#propdef-font-weight"
1941 title="font-weight!!property">‘<code
1942 class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
1943 class=property>bold</code></a>’, the <a href="#propdef-font-style"
1944 title="font-style!!property">‘<code
1945 class=property>font-style</code>’</a> to ‘<a href="#italic"><code
1946 class=property>italic</code></a>’, and implicitly sets <a
1947 href="#propdef-font-variant" title="font-variant!!property">‘<code
1948 class=property>font-variant</code>’</a> to <a
1949 href="#font-variant-normal-value" title="normal!!font-variant">‘<code
1950 class=property>normal</code>’</a>.
1952 <p> The fifth rule sets the <a href="#propdef-font-variant"
1953 title="font-variant!!property">‘<code
1954 class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
1955 class=property>small-caps</code></a>’), the <span class=property>‘<a
1956 href="#propdef-font-size"><code
1957 class=property>font-size</code></a>’</span> (120% of the parent's font
1958 size), the <a class=property
1959 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1960 class=property>line-height</code>’</a> (120% of the font size) and the
1961 <a href="#propdef-font-family" title="font-family!!property">‘<code
1962 class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
1963 class=property>fantasy</code></a>’). It follows that the keyword <span
1964 title="normal value">‘<code class=property>normal</code>’</span>
1965 applies to the two remaining properties: <a href="#propdef-font-style"
1966 title="font-style!!property">‘<code
1967 class=property>font-style</code>’</a> and <a
1968 href="#propdef-font-weight" title="font-weight!!property">‘<code
1969 class=property>font-weight</code>’</a>.
1971 <p>The sixth rule sets the <a href="#propdef-font-style"
1972 title="font-style!!property">‘<code
1973 class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
1974 title="font-stretch!!property">‘<code
1975 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1976 href="#propdef-font-size"><code
1977 class=property>font-size</code></a>’</span>, and <a
1978 href="#propdef-font-family" title="font-family!!property">‘<code
1979 class=property>font-family</code>’</a>, the other font properties being
1980 set to their initial values.
1981 </div>
1983 <p>Since the <a href="#propdef-font-stretch"
1984 title="font-stretch!!property">‘<code
1985 class=property>font-stretch</code>’</a> property was not defined in CSS
1986 2.1, when using <a href="#propdef-font-stretch"
1987 title="font-stretch!!property">‘<code
1988 class=property>font-stretch</code>’</a> values within ‘<a
1989 href="#propdef-font"><code class=property>font</code></a>’ rules,
1990 authors should include a extra version compatible with older user agents:
1992 <pre>p {
1993 font: 80% sans-serif; /* for older user agents */
1994 font: condensed 80% sans-serif;
1995 }</pre>
1997 <p>The following values refer to system fonts:
1999 <dl>
2000 <dt><strong>caption</strong>
2002 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
2003 etc.).
2005 <dt><strong>icon</strong>
2007 <dd>The font used to label icons.
2009 <dt><strong>menu</strong>
2011 <dd>The font used in menus (e.g., dropdown menus and menu lists).
2013 <dt><strong>message-box</strong>
2015 <dd>The font used in dialog boxes.
2017 <dt><strong>small-caption</strong>
2019 <dd>The font used for labeling small controls.
2021 <dt><strong>status-bar</strong>
2023 <dd>The font used in window status bars.
2024 </dl>
2026 <p>System fonts may only be set as a whole; that is, the font family, size,
2027 weight, style, etc. are all set at the same time. These values may then be
2028 altered individually if desired. If no font with the indicated
2029 characteristics exists on a given platform, the user agent should either
2030 intelligently substitute (e.g., a smaller version of the ‘<code
2031 class=property>caption</code>’ font might be used for the ‘<code
2032 class=property>small-caption</code>’ font), or substitute a user agent
2033 default font. As for regular fonts, if, for a system font, any of the
2034 individual properties are not part of the operating system's available
2035 user preferences, those properties should be set to their initial values.
2037 <p>That is why this property is "almost" a shorthand property: system fonts
2038 can only be specified with this property, not with <a
2039 href="#propdef-font-family" title="font-family!!property">‘<code
2040 class=property>font-family</code>’</a> itself, so <span
2041 class=property>‘<a href="#propdef-font"><code
2042 class=property>font</code></a>’</span> allows authors to do more than
2043 the sum of its subproperties. However, the individual properties such as
2044 <a href="#propdef-font-weight" title="font-weight!!property">‘<code
2045 class=property>font-weight</code>’</a> are still given values taken from
2046 the system font, which can be independently varied.
2048 <p>Note that the keywords used for the system fonts listed above are only
2049 treated as keywords when they occur in the initial position, in other
2050 positions the same string is treated as part of the font family name:
2052 <pre> font: menu; /* use the font settings for system menus */
2053 font: large menu; /* use a font family named "menu" */</pre>
2055 <div class=example>
2056 <p style="display:none">Example(s):</p>
2058 <pre>button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
2059 button p { font: menu }
2060 button p em { font-weight: bolder }
2061 </pre>
2063 <p>If the font used for dropdown menus on a particular system happened to
2064 be, for example, 9-point Charcoal, with a weight of 600, then P elements
2065 that were descendants of BUTTON would be displayed as if this rule were
2066 in effect:
2068 <pre>button p { font: 600 9pt Charcoal }
2069 </pre>
2071 <p>Because the <span class=property>‘<a href="#propdef-font"><code
2072 class=property>font</code></a>’</span> shorthand resets to its initial
2073 value any property not explicitly given a value, this has the same effect
2074 as this declaration:
2076 <pre>button p {
2077 font-style: normal;
2078 font-variant: normal;
2079 font-weight: 600;
2080 font-size: 9pt;
2081 line-height: normal;
2082 font-family: Charcoal
2083 }
2084 </pre>
2085 </div>
2086 <!-- prop: font-synthesis -->
2088 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
2089 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
2090 property</h3>
2092 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
2093 <tbody>
2094 <tr>
2095 <td>Name:
2097 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
2099 <tr>
2100 <td>Value:
2102 <td>none | [ weight || style ]
2104 <tr>
2105 <td>Initial:
2107 <td>weight style
2109 <tr>
2110 <td>Applies to:
2112 <td>all elements
2114 <tr>
2115 <td>Inherited:
2117 <td>yes
2119 <tr>
2120 <td>Percentages:
2122 <td>N/A
2124 <tr>
2125 <td>Media:
2127 <td>visual
2129 <tr>
2130 <td>Computed value:
2132 <td>as specified
2134 <tr>
2135 <td>Animatable:
2137 <td>no
2138 </table>
2140 <p>This property controls whether user agents are allowed to synthesize
2141 bold or oblique font faces when a font family lacks bold or italic faces.
2142 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
2143 specified, user agents must not synthesize bold faces and if ‘<code
2144 class=property>style</code>’ is not specified user agents must not
2145 synthesize italic faces. A value of ‘<code class=property>none</code>’
2146 disallows all synthetic faces.
2148 <div class=example>
2149 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
2151 <pre>*:lang(ar) { font-synthesis: none; }
2152 </pre>
2153 </div>
2155 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
2157 <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
2158 id=at-font-face-rule style="font-weight: inherit; font-style:
2159 inherit"><code>@font-face</code></dfn> rule</h3>
2161 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
2162 for linking to fonts that are automatically fetched and activated when
2163 needed. This allows authors to select a font that closely matches the
2164 design goals for a given page rather than limiting the font choice to a
2165 set of fonts available on all platforms. A set of font descriptors define
2166 the location of a font resource, either locally or externally, along with
2167 the style characteristics of an individual face. Multiple <a
2168 href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
2169 construct font families with a variety of faces. Using CSS font matching
2170 rules, a user agent can selectively download only those faces that are
2171 needed for a given piece of text.
2173 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2174 consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
2175 at-keyword followed by a block of descriptor declarations. In terms of the
2176 grammar, this specification defines the following productions:
2178 <pre><dfn id=fontfacerule>font_face_rule</dfn>
2179 : <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>*
2180 ;
2182 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
2183 : <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>
2184 ;</pre>
2186 <p>The following new definitions are introduced:
2188 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
2189 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
2191 <p>The following new token is introduced:
2193 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
2195 <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2196 specifies a value for every font descriptor, either implicitly or
2197 explicitly. Those not given explicit values in the rule take the initial
2198 value listed with each descriptor in this specification. These descriptors
2199 apply solely within the context of the <a
2200 href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
2201 are defined, and do not apply to document language elements. There is no
2202 notion of which elements the descriptors apply to or whether the values
2203 are inherited by child elements. When a given descriptor occurs multiple
2204 times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
2205 rule, only the last descriptor declaration is used and all prior
2206 declarations for that descriptor are ignored.
2208 <div class=example>
2209 <p>To use a downloadable font called Gentium:</p>
2211 <pre>
2212 @font-face {
2213 font-family: Gentium;
2214 src: url(http://example.com/fonts/Gentium.ttf);
2215 }
2217 p { font-family: Gentium, serif; }
2218 </pre>
2220 <p>The user agent will download Gentium and use it when rendering text
2221 within paragraph elements. If for some reason the site serving the font
2222 is unavailable, the default serif font will be used.</p>
2223 </div>
2225 <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
2226 rules define a set of fonts available for use within the documents that
2227 contain these rules. When font matching is done, fonts defined using these
2228 rules are considered before other available fonts on a system.
2230 <p>Downloaded fonts are only available to documents that reference them.
2231 The process of activating these fonts must not make them available to
2232 other applications or to documents that don't directly link to the same
2233 font. User agent implementers might consider it convenient to use
2234 downloaded fonts when rendering characters in other documents for which no
2235 other available font exists as part of the <a
2236 href="#system-font-fallback"><em>system font fallback</em></a> procedure.
2237 However, this would cause a security leak since the contents of one page
2238 would be able to affect other pages, something an attacker could use as an
2239 attack vector. These restrictions do not affect caching behavior, fonts
2240 are cached the same way other web resources are cached.
2242 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
2243 properties in a declaration block, declarations of any descriptors that
2244 are not supported by the user agent must be ignored. <a
2245 href="#at-font-face-rule"><code>@font-face</code></a> rules require a
2246 font-family and src descriptor; if either of these are missing, the <a
2247 href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
2248 must be ignored entirely.
2250 <p>In cases where user agents have limited platform resources or implement
2251 the ability to disable downloadable font resources, <a
2252 href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
2253 ignored; the behavior of individual descriptors as defined in this
2254 specification should not be altered.
2256 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
2257 href="#descdef-font-family">font-family</a> descriptor</h3>
2259 <table class=descdef>
2260 <tbody>
2261 <tr>
2262 <td>Name:
2264 <td><dfn id=descdef-font-family
2265 title="font-family!!descriptor">font-family</dfn>
2267 <tr>
2268 <td>Value:
2270 <td><a href="#family-name-value"><var><family-name></var></a>
2272 <tr>
2273 <td><em>Initial:</em>
2275 <td>N/A
2276 </table>
2278 <p>This descriptor defines the font family name that will be used in all
2279 CSS font family name matching. It is required for the <a
2280 href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
2281 overrides the font family names contained in the underlying font data. If
2282 the font family name is the same as a font family available in a given
2283 user's environment, it effectively hides the underlying font for documents
2284 that use the stylesheet. This permits a web author to freely choose
2285 font-family names without worrying about conflicts with font family names
2286 present in a given user's environment. Likewise, platform substitutions
2287 for a given font family name must not be used.
2289 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
2290 href="#descdef-src">src</a> descriptor</h3>
2292 <table class=descdef>
2293 <tbody>
2294 <tr>
2295 <td>Name:
2297 <td><dfn id=descdef-src>src</dfn>
2299 <tr>
2300 <td>Value:
2302 <td>[ <url> [format(<string> #)]? | <a
2303 href="#font-face-name-value"><var><font-face-name></var></a> ] #
2305 <tr>
2306 <td><em>Initial:</em>
2308 <td>N/A
2309 </table>
2311 <p>This descriptor specifies the resource containing font data. It is
2312 required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
2313 rule to be valid. Its value is a prioritized, comma-separated list of
2314 external references or locally-installed font face names. When a font is
2315 needed the user agent iterates over the set of references listed, using
2316 the first one it can successfully activate. Fonts containing invalid data
2317 or local font faces that are not found are ignored and the user agent
2318 loads the next font in the list.
2320 <p>As with other URLs in CSS, the URL may be relative, in which case it is
2321 resolved relative to the location of the style sheet containing the <a
2322 href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
2323 SVG fonts, the URL points to an element within a document containing SVG
2324 font definitions. If the element reference is omitted, a reference to the
2325 first defined font is implied. Similarly, font container formats that can
2326 contain more than one font must load one and only one of the fonts for a
2327 given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
2328 Fragment identifiers are used to indicate which font to load. If a
2329 container format lacks a defined fragment identifier scheme,
2330 implementations should use a simple 1-based indexing scheme (e.g.
2331 "font-collection#1" for the first font, "font-collection#2" for the second
2332 font).
2334 <pre>
2335 src: url(fonts/simple.ttf); /* load simple.ttf relative to stylesheet location */
2336 src: url(/fonts/simple.ttf); /* load simple.ttf from absolute location */
2337 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
2338 </pre>
2340 <p>External references consist of a URL, followed by an optional hint
2341 describing the format of the font resource referenced by that URL. The
2342 format hint contains a comma-separated list of format strings that denote
2343 well-known font formats. Conformant user agents must skip downloading a
2344 font resource if the format hints indicate only unsupported or unknown
2345 font formats. If no format hints are supplied, the user agent should
2346 download the font resource.
2348 <pre>
2349 /* load WOFF font if possible, otherwise use OpenType font */
2350 @font-face {
2351 font-family: bodytext;
2352 src: url(ideal-sans-serif.woff) format("woff"),
2353 url(basic-sans-serif.ttf) format("opentype");
2354 }
2355 </pre>
2357 <p>Format strings defined by this specification:
2359 <table class=data id=fontformats>
2360 <thead>
2361 <tr>
2362 <th>String
2364 <th>Font Format
2366 <th>Common extensions
2368 <tbody>
2369 <tr>
2370 <th>"woff"
2372 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
2374 <td>.woff
2376 <tr>
2377 <th>"truetype"
2379 <td><a
2380 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
2382 <td>.ttf
2384 <tr>
2385 <th>"opentype"
2387 <td><a
2388 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
2390 <td>.ttf, .otf
2392 <tr>
2393 <th>"embedded-opentype"
2395 <td><a
2396 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
2397 OpenType</a>
2399 <td>.eot
2401 <tr>
2402 <th>"svg"
2404 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
2406 <td>.svg, .svgz
2407 </table>
2409 <p>Given the overlap in common usage between TrueType and OpenType, the
2410 format hints "truetype" and "opentype" must be considered as synonymous; a
2411 format hint of "opentype" does not imply that the font contains Postscript
2412 CFF style glyph data or that it contains OpenType layout information (see
2413 <a href="#platform-props-to-css">Appendix A</a> for more background on
2414 this).
2416 <p>When authors would prefer to use a locally available copy of a given
2417 font and download it if it's not, <code>local()</code> can be used. The
2418 locally-installed <dfn
2419 id=font-face-name-value><var><font-face-name></var></dfn> argument
2420 to <code>local()</code> is a format-specific string that uniquely
2421 identifies a single font face within a larger family. The syntax for a <a
2422 href="#font-face-name-value"><var><font-face-name></var></a> is a
2423 unique font face name enclosed by "local(" and ")". The name can
2424 optionally be enclosed in quotes. If unquoted, the unquoted font family
2425 name processing conventions apply; the name must be a sequence of
2426 identifiers separated by whitespace which is converted to a string by
2427 joining the identifiers together separated by a single space.
2429 <pre>
2430 /* regular face of Gentium */
2431 @font-face {
2432 font-family: MyGentium;
2433 src: local(Gentium), /* use locally available Gentium */
2434 url(Gentium.ttf); /* otherwise, download it */
2435 }
2436 </pre>
2438 <p>For OpenType and TrueType fonts, this string is used to match only the
2439 Postscript name or the full font name in the name table of locally
2440 available fonts. Which type of name is used varies by platform and font,
2441 so authors should include both of these names to assure proper matching
2442 across platforms. Platform substitutions for a given font name must not be
2443 used.
2445 <pre>
2446 /* bold face of Gentium */
2447 @font-face {
2448 font-family: MyGentium;
2449 src: local(Gentium Bold), /* full font name */
2450 local(Gentium-Bold), /* Postscript name */
2451 url(GentiumBold.ttf); /* otherwise, download it */
2452 font-weight: bold;
2453 }
2454 </pre>
2456 <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2457 specifies the characteristics of a single font within a family, the unique
2458 name used with <code>local()</code> specifies a single font, not an entire
2459 font family. Defined in terms of OpenType font data, the Postscript name
2460 is found in the font's <a
2461 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
2462 in the name record with nameID = 6 (see <a href="#OPENTYPE"
2463 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
2464 Postscript name is the commonly used key for all fonts on OSX and for
2465 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
2466 used as a unique key for fonts with TrueType glyphs on Windows.
2468 <p>For OpenType fonts with multiple localizations of the full font name,
2469 the US English version is used (language ID = 0x409 for Windows and
2470 language ID = 0 for Macintosh) or the first localization when a US English
2471 full font name is not available (the OpenType specification recommends
2472 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
2473 fonts minimally include US English names</a>). User agents that also match
2474 other full font names, e.g. matching the Dutch name when the current
2475 system locale is set to Dutch, are considered non-conformant. This is done
2476 not to prefer English but to avoid matching inconsistencies across font
2477 versions and OS localizations, since font style names (e.g. "Bold") are
2478 frequently localized into many languages and the set of localizations
2479 available varies widely across platform and font version. User agents that
2480 match a concatenation of family name (nameID = 1) with style name (nameID
2481 = 2) are considered non-conformant.
2483 <p>This also allows for referencing faces that belong to larger families
2484 that cannot otherwise be referenced.
2486 <div class=example>
2487 <p>Use a local font or reference an SVG font in another document:</p>
2489 <pre>
2490 @font-face {
2491 font-family: Headline;
2492 src: local(Futura-Medium),
2493 url(fonts.svg#MyGeometricModern) format("svg");
2494 }
2495 </pre>
2497 <p>Create an alias for local Japanese fonts on different platforms:</p>
2499 <pre>
2500 @font-face {
2501 font-family: jpgothic;
2502 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
2503 }
2504 </pre>
2506 <p>Reference a font face that cannot be matched within a larger family:</p>
2508 <pre>
2509 @font-face {
2510 font-family: Hoefler Text Ornaments;
2511 /* has the same font properties as Hoefler Text Regular */
2512 src: local(HoeflerText-Ornaments);
2513 }
2514 </pre>
2516 <p>Since localized fullnames never match, a document with the header style
2517 rules below would always render using the default serif font, regardless
2518 whether a particular system locale parameter is set to Finnish or not:</p>
2520 <pre>
2521 @font-face {
2522 font-family: SectionHeader;
2523 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
2524 font-weight: bold;
2525 }
2527 h2 { font-family: SectionHeader, serif; }
2528 </pre>
2530 <p>A conformant user agent would never load the font ‘<code
2531 class=css>gentium.eot</code>’ in the example below, since it is
2532 included in the first definition of the ‘<a href="#descdef-src"><code
2533 class=property>src</code></a>’ descriptor which is overridden by the
2534 second definition in the same <a
2535 href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
2537 <pre>
2538 @font-face {
2539 font-family: MainText;
2540 src: url(gentium.eot); /* for use with older non-conformant user agents */
2541 src: local("Gentium"), url(gentium.ttf); /* Overrides src definition */
2542 }
2543 </pre>
2544 </div>
2546 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
2547 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
2548 href="#descdef-font-weight">font-weight</a>, <a
2549 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
2551 <table class=descdef>
2552 <tbody>
2553 <tr>
2554 <td>Name:
2556 <td><dfn id=descdef-font-style
2557 title="font-style!!descriptor">font-style</dfn>
2559 <tr>
2560 <td>Value:
2562 <td>normal | italic | oblique
2564 <tr>
2565 <td><em>Initial:</em>
2567 <td>normal
2568 </table>
2570 <table class=descdef>
2571 <tbody>
2572 <tr>
2573 <td>Name:
2575 <td><dfn id=descdef-font-weight
2576 title="font-weight!!descriptor">font-weight</dfn>
2578 <tr>
2579 <td>Value:
2581 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
2583 <tr>
2584 <td><em>Initial:</em>
2586 <td>normal
2587 </table>
2589 <table class=descdef>
2590 <tbody>
2591 <tr>
2592 <td>Name:
2594 <td><dfn id=descdef-font-stretch
2595 title="font-stretch!!descriptor">font-stretch</dfn>
2597 <tr>
2598 <td>Value:
2600 <td>normal | ultra-condensed | extra-condensed | condensed |
2601 semi-condensed | semi-expanded | expanded | extra-expanded |
2602 ultra-expanded
2604 <tr>
2605 <td><em>Initial:</em>
2607 <td>normal
2608 </table>
2610 <p>These descriptors define the characteristics of a font face and are used
2611 in the process of matching styles to specific faces. For a font family
2612 defined with several <a
2613 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
2614 can either download all faces in the family or use these descriptors to
2615 selectively download font faces that match actual styles used in document.
2616 The values for these descriptors are the same as those for the
2617 corresponding font properties except that relative keywords are not
2618 allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
2619 and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
2620 these descriptors are omitted, initial values are assumed.
2622 <p>The value for these font face style attributes is used in place of the
2623 style implied by the underlying font data. This allows authors to combine
2624 faces in flexible combinations, even in situations where the original font
2625 data was arranged differently. User agents that implement synthetic
2626 bolding and obliquing must only apply synthetic styling in cases where the
2627 font descriptors imply this is needed, rather than based on the style
2628 attributes implied by the font data.
2630 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
2631 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
2633 <table class=descdef>
2634 <tbody>
2635 <tr>
2636 <td>Name:
2638 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
2640 <tr>
2641 <td>Value:
2643 <td><a href="#urange-value"><var><urange></var></a> #
2645 <tr>
2646 <td><em>Initial:</em>
2648 <td>U+0-10FFFF
2649 </table>
2651 <p>This descriptor defines the set of Unicode codepoints that may be
2652 supported by the font face for which it is declared. The descriptor value
2653 is a comma-delimited list of Unicode range (<a
2654 href="#urange-value"><var><urange></var></a>) values. The union of
2655 these ranges defines the set of codepoints that serves as a hint for user
2656 agents when deciding whether or not to download a font resource for a
2657 given text run.
2659 <p>Each <dfn id=urange-value><var><urange></var></dfn> value is a <a
2660 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2661 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
2662 "U+" or "u+" prefix followed by a codepoint range in one of the three
2663 forms listed below. Ranges that do not fit one of the these forms are
2664 invalid and cause the declaration to be ignored.
2666 <dl>
2667 <dt>single codepoint (e.g. U+416)
2669 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
2670 digits
2672 <dt>interval range (e.g. U+400-4ff)
2674 <dd>represented as two hyphen-separated valid Unicode codepoints
2675 indicating the inclusive start and end codepoints of a range
2677 <dt>wildcard range (e.g. U+4??)
2679 <dd>defined by the set of codepoints implied when trailing ‘<code
2680 class=css>?</code>’ characters signify any hexadeximal digit
2681 </dl>
2683 <p>Individual codepoints are written using hexadecimal values that
2684 correspond to <a href="http://www.unicode.org/charts/">Unicode character
2685 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
2686 inclusive. Digit values of codepoints are ASCII case-insensitive. For
2687 interval ranges, the start and end codepoints are valid Unicode values and
2688 the end codepoint is greater than or equal to the start codepoint.
2690 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
2691 "U+???") are valid and equivalent to a wildcard range with an initial zero
2692 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
2693 the range of valid Unicode codepoints are invalid. Because of this, the
2694 maximum number of trailing ‘<code class=css>?</code>’ wildcard
2695 characters is five, even though the <a
2696 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2697 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
2699 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
2700 href="#descdef-unicode-range"><code
2701 class=property>unicode-range</code></a>’ descriptor declaration, ranges
2702 may overlap. The union of these ranges defines the set of codepoints for
2703 which the corresponding font may be used. User agents must not download or
2704 use the font for codepoints outside this set. User agents may normalize
2705 the list of ranges into a list that is different but represents the same
2706 set of codepoints.
2708 <p>The associated font might not contain glyphs for the entire set of
2709 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
2710 class=property>unicode-range</code></a>’ descriptor. When the font is
2711 used, the <dfn id=effective-character-map>effective character map</dfn> is
2712 the intersection of the codepoints defined by ‘<a
2713 href="#descdef-unicode-range"><code
2714 class=property>unicode-range</code></a>’ with the font's <a
2715 href="#character-map"><em>character map</em></a>. This allows authors to
2716 define supported ranges in terms of broad ranges without worrying about
2717 the precise codepoint ranges supported by the underlying font.
2719 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
2720 to define composite fonts</h3>
2722 <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
2723 with different unicode ranges for the same family and style descriptor
2724 values can be used to create composite fonts that mix the glyphs from
2725 different fonts for different scripts. This can be used to combine fonts
2726 that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
2727 or it can be used by authors as a way of segmenting a font into fonts for
2728 commonly used characters and less frequently used characters. Since the
2729 user agent will only pull down the fonts it needs this helps reduce page
2730 bandwidth.
2732 <p>If the unicode ranges overlap for a set of <a
2733 href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
2734 family and style descriptor values, the rules are ordered in the reverse
2735 order they were defined; the last rule defined is the first to be checked
2736 for a given character.
2738 <p>Example ranges for specific languages or characters:
2740 <dl>
2741 <dt>unicode-range: U+A5;
2743 <dd>a single code point, the yen/yuan symbol
2745 <dt>unicode-range: U+0-7F;
2747 <dd>code range for basic ASCII characters
2749 <dt>unicode-range: U+590-5ff;
2751 <dd>code range for Hebrew characters
2753 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
2755 <dd>code range for Japanese kanji, hiragana and katakana characters plus
2756 yen/yuan symbol
2757 </dl>
2759 <div class=example>
2760 <p>The BBC provides news services in a wide variety of languages, many
2761 that are not well supported across all platforms. Using an <a
2762 href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
2763 provide a font for any of these languages, as it already does via a
2764 manual font download.</p>
2766 <pre>
2767 @font-face {
2768 font-family: BBCBengali;
2769 src: url(fonts/BBCBengali.ttf) format("opentype");
2770 unicode-range: U+00-FF, U+980-9FF;
2771 }
2772 </pre>
2773 </div>
2775 <div class=example>
2776 <p>Technical documents often require a wide range of symbols. The STIX
2777 Fonts project is one project aimed at providing fonts to support a wide
2778 range of technical typesetting in a standardized way. The example below
2779 shows the use of a font that provides glyphs for many of the mathematical
2780 and technical symbol ranges within Unicode:</p>
2782 <pre>
2783 @font-face {
2784 font-family: STIXGeneral;
2785 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
2786 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
2787 }
2788 </pre>
2789 </div>
2791 <div class=example>
2792 <p>This example shows how an author can override the glyphs used for Latin
2793 characters in a Japanese font with glyphs from a different font. The
2794 first rule specifies no range so it defaults to the entire range. The
2795 range specified in the second rule overlaps but takes precedence because
2796 it is defined later.</p>
2798 <pre>
2799 @font-face {
2800 font-family: JapaneseWithGentium;
2801 src: local(MSMincho);
2802 /* no range specified, defaults to entire range */
2803 }
2805 @font-face {
2806 font-family: JapaneseWithGentium;
2807 src: url(../fonts/Gentium.ttf);
2808 unicode-range: U+0-2FF;
2809 }
2810 </pre>
2811 </div>
2813 <div class=example>
2814 <p>Consider a family constructed to optimize bandwidth by separating out
2815 Latin, Japanese and other characters into different font files:</p>
2817 <pre>
2818 /* fallback font - size: 4.5MB */
2819 @font-face {
2820 font-family: DroidSans;
2821 src: url(DroidSansFallback.ttf);
2822 /* no range specified, defaults to entire range */
2823 }
2825 /* Japanese glyphs - size: 1.2MB */
2826 @font-face {
2827 font-family: DroidSans;
2828 src: url(DroidSansJapanese.ttf);
2829 unicode-range: U+3000-9FFF, U+ff??;
2830 }
2832 /* Latin, Greek, Cyrillic along with some
2833 punctuation and symbols - size: 190KB */
2834 @font-face {
2835 font-family: DroidSans;
2836 src: url(DroidSans.ttf);
2837 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
2838 }
2839 </pre>
2841 <p>For simple Latin text, only the font for Latin characters is
2842 downloaded:</p>
2844 <pre>
2845 body { font-family: DroidSans; }
2847 <p>This is that</p>
2848 </pre>
2850 <p>In this case the user agent first checks the unicode-range for the font
2851 containing Latin characters (DroidSans.ttf). Since all the characters
2852 above are in the range U+0-5FF, the user agent downloads the font and
2853 renders the text with that font.</p>
2855 <p>Next, consider text that makes use of an arrow character (⇨):</p>
2857 <pre>
2858 <p>This &#x21e8; that<p>
2859 </pre>
2861 <p>The user agent again first checks the unicode-range of the font
2862 containing Latin characters. Since U+2000-2300 includes the arrow code
2863 point (U+21E8), the user agent downloads the font. For this character
2864 however the Latin font does not have a matching glyph, so the effective
2865 unicode-range used for font matching excludes this code point. Next, the
2866 user agent evaluates the Japanese font. The unicode-range for the
2867 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
2868 user agent does not download the Japanese font. Next the fallback font is
2869 considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
2870 rule for the fallback font does not define unicode-range so its value
2871 defaults to the range of all Unicode code points. The fallback font is
2872 downloaded and used to render the arrow character.</p>
2873 </div>
2875 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
2876 href="#descdef-font-variant">font-variant</a> and <a
2877 href="#descdef-font-feature-settings">font-feature-settings</a>
2878 descriptors</h3>
2880 <table class=descdef>
2881 <tbody>
2882 <tr>
2883 <td>Name:
2885 <td><dfn id=descdef-font-variant
2886 title="font-variant!!descriptor">font-variant</dfn>
2888 <tr>
2889 <td>Value:
2891 <td><a href="#font-variant-normal-value"
2892 title="normal!!font-variant">normal</a> | <a
2893 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
2894 <a href="#common-lig-values"><var><common-lig-values></var></a>
2895 || <a
2896 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
2897 || <a
2898 href="#historical-lig-values"><var><historical-lig-values></var></a>
2899 || <a
2900 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
2901 || <a href="#stylistic"><var
2902 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
2903 href="#historical-forms"><var>historical-forms</var></a> || <a
2904 href="#styleset"><var
2905 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
2906 href="#character-variant"><var
2907 title=character-variant>character-variant(<feature-value-name>
2908 #)</var></a> || <a href="#swash"><var
2909 title=swash>swash(<feature-value-name>)</var></a> || <a
2910 href="#ornaments"><var
2911 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
2912 href="#annotation"><var
2913 title=annotation>annotation(<feature-value-name>)</var></a> || [
2914 <a href="#small-caps"><i>small-caps</i></a> | <a
2915 href="#all-small-caps"><i>all-small-caps</i></a> | <a
2916 href="#petite-caps"><i>petite-caps</i></a> | <a
2917 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
2918 href="#unicase"><i>unicase</i></a> | <a
2919 href="#titling-caps"><i>titling-caps</i></a> ] || <a
2920 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
2921 || <a
2922 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
2923 || <a
2924 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
2925 || <a href="#ordinal"><i>ordinal</i></a> || <a
2926 href="#slashed-zero"><i>slashed-zero</i></a> || <a
2927 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
2928 || <a
2929 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
2930 || <a href="#ruby"><i>ruby</i></a> ]
2932 <tr>
2933 <td><em>Initial:</em>
2935 <td>normal
2936 </table>
2938 <table class=descdef>
2939 <tbody>
2940 <tr>
2941 <td>Name:
2943 <td><dfn id=descdef-font-feature-settings
2944 title="font-feature-settings!!descriptor">font-feature-settings</dfn>
2946 <tr>
2947 <td>Value:
2949 <td><a href="#font-feature-settings-normal-value"
2950 title="normal!!font-feature-settings">normal</a> | <a
2951 href="#feature-tag-value"><var><feature-tag-value></var></a> #
2953 <tr>
2954 <td><em>Initial:</em>
2956 <td>normal
2957 </table>
2959 <p>These descriptors define initial settings that apply when the font
2960 defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
2961 rule is rendered. They do not affect font selection. Values are identical
2962 to those defined for the corresponding <a href="#propdef-font-variant"
2963 title="font-variant!!property">‘<code
2964 class=property>font-variant</code>’</a> and <a
2965 href="#propdef-font-feature-settings"
2966 title="font-feature-settings!!property">‘<code
2967 class=property>font-feature-settings</code>’</a> properties defined
2968 below except that the value ‘<code class=property>inherit</code>’ is
2969 omitted. When multiple font feature descriptors or properties are used,
2970 the cumulative effect on text rendering is detailed in the section <a
2971 href="#font-feature-resolution">Font Feature Resolution</a> below. In
2972 cases where specific values define synthesized fallback for certain <a
2973 href="#propdef-font-variant" title="font-variant!!property">‘<code
2974 class=property>font-variant</code>’</a> subproperties, the same
2975 synthesized fallback applies when used within those values are used with
2976 the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
2977 class=property>font-variant</code>’</a> descriptor.
2979 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
2980 guidelines</h3>
2982 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
2983 designed to allow lazy loading of font resources that are only downloaded
2984 when used within a document. A stylesheet can include <a
2985 href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
2986 of fonts of which only a select set are used; user agents must only
2987 download those fonts that are referred to within the style rules
2988 applicable to a given page. User agents that download all fonts defined in
2989 <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
2990 considering whether those fonts are in fact used within a page are
2991 considered non-conformant. In cases where a font might be downloaded in
2992 character fallback cases, user agents may download a font if it's
2993 contained within the computed value of <a href="#propdef-font-family"
2994 title="font-family!!property">‘<code
2995 class=property>font-family</code>’</a> for a given text run.
2997 <pre>
2998 @font-face {
2999 font-family: GeometricModern;
3000 src: url(font.ttf);
3001 }
3003 p {
3004 /* font will be downloaded for pages with p elements */
3005 font-family: GeometricModern, sans-serif;
3006 }
3008 h2 {
3009 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
3010 font-family: Futura, GeometricModern, sans-serif;
3011 }
3012 </pre>
3014 <p>In cases where textual content is loaded before downloadable fonts are
3015 available, user agents may render text as it would be rendered if
3016 downloadable font resources are not available or they may render text
3017 transparently with fallback fonts to avoid a flash of text using a
3018 fallback font. In cases where the font download fails user agents must
3019 display text, simply leaving transparent text is considered non-conformant
3020 behavior. Authors are advised to use fallback fonts in their font lists
3021 that closely match the metrics of the downloadable fonts to avoid large
3022 page reflows where possible.
3024 <h3 id=same-origin-restriction><span class=secno>4.9 </span>Same-origin
3025 restriction for fonts</h3>
3027 <h4 id=default-same-origin-restriction><span class=secno>4.9.1
3028 </span>Default same-origin restriction</h4>
3029 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
3030 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
3031 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
3032 -->
3034 <p>User agents must implement a same-origin restriction when loading fonts
3035 via the <a href="#at-font-face-rule"><code>@font-face</code></a>
3036 mechanism. This restriction limits the loading of fonts for a given
3037 document to fonts loaded from the same origin. Fonts can only be loaded
3038 via the same host, port, and method combination as the containing
3039 document, using the <a
3040 href="http://www.w3.org/TR/html5/browsers.html#origin">origin matching
3041 algorithm</a> described in the <a href="#HTML5"
3042 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification. The origin of
3043 the stylesheet containing <a
3044 href="#at-font-face-rule"><code>@font-face</code></a> rules is not used
3045 when deciding whether a font is same origin or not, only the origin of the
3046 containing document is used. The restriction applies to all font types.
3048 <p>Given a document located at http://example.com/page.html, fonts defined
3049 with ‘<a href="#descdef-src"><code class=property>src</code></a>’
3050 definitions considered cross origin must not be loaded:
3052 <pre>
3053 /* same origin (i.e. domain, scheme, port match document) */
3054 src: url(fonts/simple.ttf);
3055 src: url(//fonts/simple.ttf);
3057 /* cross origin, different scheme */
3058 src: url(https://example.com/fonts/simple.ttf);
3060 /* cross origin, different domain */
3061 src: url(http://another.example.com/fonts/simple.ttf);
3062 </pre>
3064 <h4 id=allowing-cross-origin-font-loading><span class=secno>4.9.2
3065 </span>Allowing cross-origin font loading</h4>
3067 <p>User agents must also implement the ability to relax this restriction
3068 using cross-site origin controls <a href="#CORS"
3069 rel=biblioentry>[CORS]<!--{{!CORS}}--></a> for fonts loaded via HTTP.
3070 Sites can explicitly allow cross-site downloading of font data using the
3071 <code>Access-Control-Allow-Origin</code> HTTP header. For other schemes,
3072 no explicit relaxation mechanism is defined or required.
3074 <p>For font loads, user agents must use the <a
3075 href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
3076 CORS-enabled fetch</a> method defined by the <a href="#HTML5"
3077 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification for URL's
3078 defined within @font-face rules. When fetching, user agents must use
3079 "Anonymous" mode, set the referrer source to the stylesheet's URL and set
3080 the origin to the URL of the containing document.
3082 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
3083 Algorithm</h2>
3085 <p>The algorithm below describes how fonts are associated with individual
3086 runs of text. For each character in the run a font family is chosen and a
3087 particular font face is selected containing a glyph for that character.
3089 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
3090 font family names</h3>
3092 <p>As part of the font matching algorithm outlined below, user agents must
3093 match font family names used in style rules with actual font family names
3094 contained in fonts available in a given environment or with font family
3095 names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
3096 rules. User agents must match these names case insensitively, using the
3097 "Default Caseless Matching" algorithm outlined in the Unicode
3098 specification <a href="#UNICODE6"
3099 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
3100 detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
3101 the algorithm must be applied without normalizing the strings involved and
3102 without applying any language-specific tailorings. The case folding method
3103 specified by this algorithm uses the case mappings with status field
3104 ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
3105 in the CaseFolding.txt file of the Unicode Character Database.
3107 <p class=note> For authors this means that font family names are matched
3108 case insensitively, whether those names exist in a platform font or in the
3109 <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
3110 in a stylesheet. Authors should take care to ensure that names use a
3111 character sequence consistent with the actual font family name,
3112 particularly when using combining characters such as diacritical marks.
3113 For example, a family name that contains an uppercase A (U+0041) followed
3114 by a combining ring (U+030A) will <strong>not</strong> match a name that
3115 looks identical but which uses the precomposed lowercase a-ring character
3116 (U+00E5) instead of the combining sequence.
3118 <p class=note> Implementors should take care to verify that a given
3119 caseless string comparison implementation uses this precise algorithm and
3120 not assume that a given platform string matching routine follows it, as
3121 many of these have locale-specific behavior or use some level of string
3122 normalization.
3124 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
3125 styles</h3>
3127 <p>The procedure for choosing a font for a given character in a run of text
3128 consists of iterating over the font families named by the <a
3129 href="#propdef-font-family" title="font-family!!property">‘<code
3130 class=property>font-family</code>’</a> property, selecting a font face
3131 with the appropriate style based on other font properties and then
3132 determining whether a glyph exists for the given character. This is done
3133 using the <dfn id=character-map>character map</dfn> of the font, data
3134 which maps characters to the default glyph for that character. A font is
3135 considered to <dfn id=support>support</dfn> a given character if (1) the
3136 character is contained in the font's <a
3137 href="#character-map"><em>character map</em></a> and (2) if required by
3138 the containing script, shaping information is available for that
3139 character.
3141 <p>Some legacy fonts may include a given character in the <a
3142 href="#character-map"><em>character map</em></a> but lack the shaping
3143 information (e.g. <a
3144 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
3145 layout tables</a> or <a
3146 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_techAbout">Graphite
3147 tables</a>) necessary for correctly rendering text runs containing that
3148 character.
3150 <p>Codepoint sequences consisting of a base character followed by a
3151 sequence of combining characters are treated slightly differently, see the
3152 section on <a href="#cluster-matching">cluster matching</a> below.
3154 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
3155 given font family is defined to be the face that would be selected if all
3156 font style properties were set to their initial value.
3158 <ol id=fontmatchingalg>
3159 <li>Using the computed font property values for a given element, the user
3160 agent starts with the first family name specified by the <a
3161 href="#propdef-font-family" title="font-family!!property">‘<code
3162 class=property>font-family</code>’</a> property.
3164 <li>If the family name is a generic family keyword, the user agent looks
3165 up the appropriate font family name to be used. User agents may choose
3166 the generic font family to use based on the language of the containing
3167 element or the Unicode range of the character.
3169 <li>For other family names, the user agent attempts to find the family
3170 name among fonts defined via <a
3171 href="#at-font-face-rule"><code>@font-face</code></a> rules and then
3172 among available system fonts, matching names with a <a
3173 href="#font-family-casing">case-insensitive comparison</a> as outlined in
3174 the section above. On systems containing fonts with multiple localized
3175 font family names, user agents must match any of these names independent
3176 of the underlying system locale or platform API used. If the font
3177 resources defined for a given face in an <a
3178 href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
3179 available or contain invalid font data, then the face should be treated
3180 as not present in the family. If no faces are present for a family
3181 defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
3182 rules, the family should be treated as missing; matching a platform font
3183 with the same name must not occur in this case.
3185 <li>If a font family match occurs, the user agent assembles the set of
3186 font faces in that family and then narrows the set to a single face using
3187 other font properties in the order given below. A group of faces defined
3188 via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
3189 identical font descriptor values but differing ‘<a
3190 href="#descdef-unicode-range"><code
3191 class=property>unicode-range</code></a>’ values are considered to be a
3192 single <dfn id=composite-face>composite face</dfn> for this step:
3193 <ol id=fontstylematchingalg>
3194 <li><a href="#propdef-font-stretch"
3195 title="font-stretch!!property">‘<code
3196 class=property>font-stretch</code>’</a> is tried first. If the
3197 matching set contains faces with width values matching the <a
3198 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
3199 class=property>font-stretch</code>’</a> value, faces with other width
3200 values are removed from the matching set. If there is no face that
3201 exactly matches the width value the nearest width is used instead. If
3202 the value of <a href="#propdef-font-stretch"
3203 title="font-stretch!!property">‘<code
3204 class=property>font-stretch</code>’</a> is <a
3205 href="#font-stretch-normal-value" title="normal!!font-stretch">‘<code
3206 class=property>normal</code>’</a> or one of the condensed values,
3207 narrower width values are checked first, then wider values. If the
3208 value of <a href="#propdef-font-stretch"
3209 title="font-stretch!!property">‘<code
3210 class=property>font-stretch</code>’</a> is one of the expanded
3211 values, wider values are checked first, followed by narrower values.
3212 Once the closest matching width has been determined by this process,
3213 faces with other widths are removed from the matching set.
3215 <li><a href="#propdef-font-style" title="font-style!!property">‘<code
3216 class=property>font-style</code>’</a> is tried next. If the value of
3217 <a href="#propdef-font-style" title="font-style!!property">‘<code
3218 class=property>font-style</code>’</a> is ‘<a href="#italic"><code
3219 class=property>italic</code></a>’, italic faces are checked first,
3220 then oblique, then normal faces. If the value is ‘<a
3221 href="#oblique"><code class=property>oblique</code></a>’, oblique
3222 faces are checked first, then italic faces and then normal faces. If
3223 the value is <a href="#font-style-normal-value"
3224 title="normal!!font-style">‘<code
3225 class=property>normal</code>’</a>, normal faces are checked first,
3226 then oblique faces, then italic faces. Faces with other style values
3227 are excluded from the matching set. User agents are permitted to
3228 distinguish between italic and oblique faces within platform font
3229 families but this is not required, so all italic or oblique faces may
3230 be treated as italic faces. However, within font families defined via
3231 <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
3232 and oblique faces must be distinguished using the value of the <a
3233 href="#descdef-font-style" title="font-style!!descriptor">‘<code
3234 class=property>font-style</code>’</a> descriptor. For families that
3235 lack any italic or oblique faces, users agents may create artificial
3236 oblique faces, if this is permitted by the value of the ‘<a
3237 href="#propdef-font-synthesis"><code
3238 class=property>font-synthesis</code></a>’ property.
3240 <li><a href="#propdef-font-weight"
3241 title="font-weight!!property">‘<code
3242 class=property>font-weight</code>’</a> is matched next, so it will
3243 always reduce the matching set to a single font face. If bolder/lighter
3244 relative weights are used, the effective weight is calculated based on
3245 the inherited weight value, as described in the definition of the <a
3246 href="#propdef-font-weight" title="font-weight!!property">‘<code
3247 class=property>font-weight</code>’</a> property. Given the desired
3248 weight and the weights of faces in the matching set after the steps
3249 above, if the desired weight is available that face matches. Otherwise,
3250 a weight is chosen using the rules below:
3251 <ul>
3252 <li>If the desired weight is less than 400, weights below the desired
3253 weight are checked in descending order followed by weights above the
3254 desired weight in ascending order until a match is found.
3256 <li>If the desired weight is greater than 500, weights above the
3257 desired weight are checked in ascending order followed by weights
3258 below the desired weight in descending order until a match is found.
3260 <li>If the desired weight is 400, 500 is checked first and then the
3261 rule for desired weights less than 400 is used.
3263 <li>If the desired weight is 500, 400 is checked first and then the
3264 rule for desired weights less than 400 is used.
3265 </ul>
3267 <li><span class=property>‘<a href="#propdef-font-size"><code
3268 class=property>font-size</code></a>’</span> must be matched within a
3269 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
3270 are rounded to the nearest whole pixel, while the tolerance for
3271 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
3272 by ‘<code class=property>em</code>’ values in other properties, are
3273 based on the <span class=property>‘<a href="#propdef-font-size"><code
3274 class=property>font-size</code></a>’</span> value that is used, not
3275 the one that is specified.
3276 </ol>
3278 <li>
3279 <p>If the matched face is defined via <a
3280 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
3281 must use the procedure below to select a single font:
3283 <ol>
3284 <li>If the font resource has not been loaded and the range of characters
3285 defined by the ‘<a href="#descdef-unicode-range"><code
3286 class=property>unicode-range</code></a>’ descriptor value includes
3287 the character in question, load the font.
3289 <li>After downloading, if the <a
3290 href="#effective-character-map"><em>effective character map</em></a>
3291 supports the character in question, select that font.
3292 </ol>
3294 <p>When the matched face is a <a href="#composite-face"><em>composite
3295 face</em></a>, user agents must use the procedure above on each of the
3296 faces in the <a href="#composite-face"><em>composite face</em></a> in
3297 reverse order of <a
3298 href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
3300 <p>While the download occurs, user agents may either wait until the font
3301 is downloaded or render once with substituted font metrics and render
3302 again once the font is downloaded.</p>
3304 <li>
3305 <p>If no matching face exists or the matched face does not contain a
3306 glyph for the character to be rendered, the next family name is selected
3307 and the previous three steps repeated. Glyphs from other faces in the
3308 family are not considered. The only exception is that user agents may
3309 optionally substitute a synthetically obliqued version of the <a
3310 href="#default-face"><em>default face</em></a> if that face supports a
3311 given glyph and synthesis of these faces is permitted by the value of
3312 the ‘<a href="#propdef-font-synthesis"><code
3313 class=property>font-synthesis</code></a>’ property. For example, a
3314 synthetic italic version of the regular face may be used if the italic
3315 face doesn't support glyphs for Arabic.</p>
3316 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
3319 <li>If there are no more font families to be evaluated and no matching
3320 face has been found, then the user agent performs a <dfn
3321 id=system-font-fallback>system font fallback</dfn> procedure to find the
3322 best match for the character to be rendered. The result of this procedure
3323 may vary across user agents.
3325 <li>If a particular character cannot be displayed using any font, the user
3326 agent should indicate by some means that a character is not being
3327 displayed, displaying either a symbolic representation of the missing
3328 glyph (e.g. using a <a
3329 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
3330 Font</a>) or using the missing character glyph from a default font.
3331 </ol>
3333 <p>Optimizations of this process are allowed provided that an
3334 implementation behaves as if the algorithm had been followed exactly.
3335 Matching occurs in a well-defined order to insure that the results are as
3336 consistent as possible across user agents, given an identical set of
3337 available fonts and rendering technology.
3339 <p>The <dfn id=first-available-font>first available font</dfn>, used in the
3340 definition of <a
3341 href="http://www.w3.org/TR/css3-values/#font-relative-lengths"><em>font-relative
3342 lengths</em></a> such as ‘<code class=property>ex</code>’ and ‘<code
3343 class=property>ch</code>’, is defined to be the first available font
3344 that would match any character given font families in the ‘<code
3345 class=property>font-family</code>’ list (or a user agent's default font
3346 if none are available).
3348 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
3350 <p>When text contains characters such as combining marks, ideally the base
3351 character should be rendered using the same font as the mark, this assures
3352 proper placement of the mark. For this reason, the font matching algorithm
3353 for clusters is more specialized than the general case of matching a
3354 single character by itself. For sequences containing variation selectors,
3355 which indicate the precise glyph to be used for a given character, user
3356 agents always attempt <a href="#system-font-fallback"><em>system font
3357 fallback</em></a> to find the appropriate glyph before using the default
3358 glyph of the base character.
3360 <p>A sequence of codepoints containing combining mark or other modifiers is
3361 termed a grapheme cluster (see <a href="#CSS3TEXT"
3362 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
3363 description). For a given cluster containing a base character, <em>b</em>
3364 and a sequence of combining characters <em>c1, c2…</em>, the entire
3365 cluster is matched using these steps:
3367 <ol>
3368 <li>For each family in the font list, a face is chosen using the style
3369 selection rules defined in the previous section.
3370 <ol>
3371 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
3372 completely supported by the font, select this font for the sequence.
3374 <li>If a sequence of multiple codepoints is canonically equivalent to a
3375 single character and the font <a href="#support"><em
3376 title=support>supports</em></a> that character, select this font for
3377 the sequence.
3378 </ol>
3380 <li>If no font was found in the font list in step 1:
3381 <ol>
3382 <li>If <em>c1</em> is a variation selector, system fallback must be used
3383 to find a font that <a href="#support"><em
3384 title=support>supports</em></a> the full sequence of <em>b + c1</em>.
3385 If no font on the system <a href="#support"><em
3386 title=support>supports</em></a> the full sequence, match the single
3387 character <em>b</em> using the normal procedure for matching single
3388 characters and ignore the variation selector. Note: a sequence with
3389 more than one variation selector must be treated as an encoding error
3390 and the trailing selectors must be ignored. <a href="#UNICODE6"
3391 rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>
3393 <li>Otherwise, the user agent may optionally use system font fallback to
3394 match a font that <a href="#support"><em
3395 title=support>supports</em></a> the entire cluster.
3396 </ol>
3398 <li>If no font is found in step 2, use the matching sequence from step 1
3399 to determine the longest sequence that is completely <a
3400 href="#support"><em title=support>supported</em></a> by a font in the
3401 font list and attempt to match the remaining combining characters
3402 separately using the rules for single characters.
3403 </ol>
3405 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
3406 issues</h3>
3408 <p>CSS font matching is always performed on text runs containing Unicode
3409 characters, so documents using legacy encodings are assumed to have been
3410 transcoded before matching fonts. For fonts containing <a
3411 href="#character-map"><em title="character map">character maps</em></a>
3412 for both legacy encodings and Unicode, the contents of the legacy encoding
3413 <a href="#character-map"><em>character map</em></a> must have no effect on
3414 the results of the font matching process.
3416 <p>The font matching process does not assume that text runs are in either
3417 normalized or denormalized form (see <a href="#CHARMOD-NORM"
3418 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
3419 details). Fonts may only support precomposed forms and not the decomposed
3420 sequence of base character plus combining marks. Authors should always
3421 tailor their choice of fonts to their content, including whether that
3422 content contains normalized or denormalized character streams.
3424 <p>If a given character is a Private-Use Area Unicode codepoint, user
3425 agents must only match font families named in the ‘<code
3426 class=property>font-family</code>’ list that are not generic families.
3427 If none of the families named in the ‘<code
3428 class=property>font-family</code>’ list contain a glyph for that
3429 codepoint, user agents must display some form of missing glyph symbol for
3430 that character rather than attempting <a
3431 href="#system-font-fallback"><em>system font fallback</em></a> for that
3432 codepoint. When matching the replacement character U+FFFD, user agents may
3433 skip the font matching process and immediately display some form of
3434 missing glyph symbol, they are not required to display the glyph from the
3435 font that would be selected by the font matching process.
3437 <p>In general, the fonts for a given family will all have the same or
3438 similar <a href="#character-map"><em title="character map">character
3439 maps</em></a>. The process outlined here is designed to handle even font
3440 families containing faces with widely variant <a href="#character-map"><em
3441 title="character map">character maps</em></a>. However, authors are
3442 cautioned that the use of such families can lead to unexpected results.
3444 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
3445 changes since CSS 2.1</h3>
3447 <p>The algorithm above is different from CSS 2.1 in a number of key places.
3448 These changes were made to better reflect actual font matching behavior
3449 across user agent implementations.
3451 <p>Differences compared to the font matching algorithm in CSS 2.1:
3453 <ul>
3454 <li>The algorithm includes font-stretch matching.
3456 <li>All possible font-style matching scenarios are delineated.
3458 <li>Small-caps fonts are not matched as part of the font matching process,
3459 they are now handled via font features.
3461 <li>Unicode variation selector matching is required.
3463 <li>Cluster sequences are matched as a unit.
3464 </ul>
3466 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
3467 examples</h3>
3469 <div class=example>
3470 <p>It's useful to note that the CSS selector syntax may be used to create
3471 language-sensitive typography. For example, some Chinese and Japanese
3472 characters are unified to have the same Unicode code point, although the
3473 abstract glyphs are not the same in the two languages.
3475 <pre>*:lang(ja-jp) { font: 900 14pt/16pt "Heisei Mincho W9", serif; }
3476 *:lang(zh-tw) { font: 800 14pt/16.5pt "Li Sung", serif; }
3477 </pre>
3479 <p>This selects any element that has the given language — Japanese or
3480 Traditional Chinese — and uses the appropriate font.
3481 </div>
3483 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
3485 <p>Modern font technologies support a variety of advanced typographic and
3486 language-specific font features. Using these features, a single font can
3487 provide glyphs for a wide range of ligatures, contextual and stylistic
3488 alternates, tabular and old-style figures, small capitals, automatic
3489 fractions, swashes, and alternates specific to a given language. To allow
3490 authors control over these font capabilities, the ‘<code
3491 class=property>font-variant</code>’ property has been expanded for CSS3.
3492 It now functions as a shorthand for a set of properties that provide
3493 control over stylistic font features.
3495 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
3496 selection and positioning</h3>
3498 <p>Simple fonts used for displaying Latin text use a very basic processing
3499 model. Fonts contain a <a href="#character-map"><em>character map</em></a>
3500 which maps each character to a glyph for that character. Glyphs for
3501 subsequent characters are simply placed one after the other along a run of
3502 text. Modern font formats such as OpenType and AAT (Apple Advanced
3503 Typography) use a richer processing model. The glyph for a given character
3504 can be chosen and positioned not just based on the codepoint of the
3505 character itself, but also on adjacent characters as well as the language,
3506 script, and features enabled for the text. Font features may be required
3507 for specific scripts, or recommended as enabled by default or they might
3508 be stylistic features meant to be used under author control.
3510 <p>For a good visual overview of these features, see the <a
3511 href="#OPENTYPE-FONT-GUIDE"
3512 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
3513 For a detailed description of glyph processing for OpenType fonts, see <a
3514 href="#WINDOWS-GLYPH-PROC"
3515 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
3517 <p>Stylistic font features can be classified into two broad categories:
3518 ones that affect the harmonization of glyph shapes with the surrounding
3519 context, such as kerning and ligature features, and ones such as the
3520 small-caps, subscript/superscript and alternate features that affect shape
3521 selection.
3523 <p>The subproperties of <a href="#propdef-font-variant"
3524 title="font-variant!!property">‘<code
3525 class=property>font-variant</code>’</a> listed below are used to control
3526 these stylistic font features. They do not control features that are
3527 required for displaying certain scripts, such as the OpenType features
3528 used when displaying Arabic or Indic language text. They affect glyph
3529 selection and positioning, but do not affect font selection as described
3530 in the font matching section (except in cases required for compatibility
3531 with CSS 2.1).
3533 <p>To assure consistent behavior across user agents, the equivalent
3534 OpenType property settings are listed for individual properties and are
3535 normative. When using other font formats these should be used as a
3536 guideline to map CSS font feature property values to specific font
3537 features.
3539 <h3 id=language-specific-support><span class=secno>6.2
3540 </span>Language-specific display</h3>
3542 <p>OpenType also supports language-specific glyph selection and
3543 positioning, so that text can be displayed correctly in cases where the
3544 language dictates a specific display behavior. Many languages share a
3545 common script, but the shape of certain letters can vary across those
3546 languages. For example, certain Cyrillic letters have different shapes in
3547 Russian text than in Bulgarian. In Latin text, it's common to render "fi"
3548 with an explicit fi-ligature that lacks a dot on the "i". However, in
3549 languages such as Turkish which uses both a dotted-i and a dotless-i, it's
3550 important to not use this ligature or use a specialized version that
3551 contains a dot over the "i". The example below shows language-specific
3552 variations based on stylistic traditions found in Spanish, Italian and
3553 French orthography:
3555 <div class=featex><img alt="language specific forms, spanish"
3556 src=locl-1.png></div>
3558 <div class=featex><img alt="language specific forms, italian"
3559 src=locl-2.png></div>
3561 <div class=featex><img alt="language specific forms, french"
3562 src=locl-3.png></div>
3564 <p>If the content language of the element is known according to the rules
3565 of the <a
3566 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
3567 language</a>, user agents are required to infer the OpenType language
3568 system from the content language and use that when selecting and
3569 positioning glyphs using an OpenType font.
3571 <p>For OpenType fonts, in some cases it may be necessary to explicitly
3572 declare the OpenType language to be used, for example when displaying text
3573 in a given language that uses the typographic conventions of another
3574 language or when the font does not explicitly support a given language but
3575 supports a language that shares common typographic conventions. The ‘<a
3576 href="#propdef-font-language-override"><code
3577 class=property>font-language-override</code></a>’ property is used for
3578 this purpose.</p>
3579 <!-- prop: font-kerning -->
3581 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
3582 href="#propdef-font-kerning">font-kerning</a> property</h3>
3584 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
3585 <tbody>
3586 <tr>
3587 <td>Name:
3589 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
3591 <tr>
3592 <td>Value:
3594 <td><a href="#font-kerning-auto-value"
3595 title="auto!!font-kerning">auto</a> | <a
3596 href="#font-kerning-normal-value"
3597 title="normal!!font-kerning">normal</a> | <a
3598 href="#font-kerning-none-value" title="none!!font-kerning">none</a>
3600 <tr>
3601 <td>Initial:
3603 <td>auto
3605 <tr>
3606 <td>Applies to:
3608 <td>all elements
3610 <tr>
3611 <td>Inherited:
3613 <td>yes
3615 <tr>
3616 <td>Percentages:
3618 <td>N/A
3620 <tr>
3621 <td>Media:
3623 <td>visual
3625 <tr>
3626 <td>Computed value:
3628 <td>as specified
3630 <tr>
3631 <td>Animatable:
3633 <td>no
3634 </table>
3636 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
3637 property controls metric kerning, kerning that utilizes adjustment data
3638 contained in the font.
3640 <dl>
3641 <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
3643 <dd>Specifies that kerning is applied at the discretion of the user agent
3645 <dt><dfn id=font-kerning-normal-value
3646 title="normal!!font-kerning">normal</dfn>
3648 <dd>Specifies that kerning is applied
3650 <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
3652 <dd>Specifies that kerning is not applied
3653 </dl>
3655 <p>For fonts that do not include kerning data this property will have no
3656 visible effect. When rendering with OpenType fonts, the <a
3657 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
3658 specification suggests that kerning be enabled by default. When kerning is
3659 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
3660 vertical text runs the <span class=tag>vkrn</span> feature is enabled
3661 instead). User agents must also support fonts that only support kerning
3662 via data contained in a <span class=tag>kern</span> font table, as
3663 detailed in the OpenType specification. If the ‘<code
3664 class=property>letter-spacing</code>’ property is defined, kerning
3665 adjustments are considered part of the default spacing and letter spacing
3666 adjustments are made after kerning has been applied.
3668 <p>When set to ‘<code class=property>auto</code>’, user agents can
3669 determine whether to apply kerning or not based on a number of factors:
3670 text size, script, or other factors that influence text processing speed.
3671 Authors who want proper kerning should use <a
3672 href="#font-kerning-normal-value" title="normal!!font-kerning">‘<code
3673 class=property>normal</code>’</a> to explicitly enable kerning.
3674 Likewise, some authors may prefer to disable kerning in situations where
3675 performance is more important than precise appearance. However, in
3676 well-designed modern implementations the use of kerning generally does not
3677 have a large impact on text rendering speed.</p>
3678 <!-- prop: font-variant-ligatures -->
3680 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
3681 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
3682 property</h3>
3684 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
3685 <tbody>
3686 <tr>
3687 <td>Name:
3689 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
3691 <tr>
3692 <td>Value:
3694 <td><a href="#font-variant-ligatures-normal-value"
3695 title="normal!!font-variant-ligatures">normal</a> | <a
3696 href="#font-variant-ligatures-none-value"
3697 title="none!!font-variant-ligatures">none</a> | [ <a
3698 href="#common-lig-values"><var><common-lig-values></var></a> ||
3699 <a
3700 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
3701 || <a
3702 href="#historical-lig-values"><var><historical-lig-values></var></a>
3703 || <a
3704 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
3705 ]
3707 <tr>
3708 <td>Initial:
3710 <td>normal
3712 <tr>
3713 <td>Applies to:
3715 <td>all elements
3717 <tr>
3718 <td>Inherited:
3720 <td>yes
3722 <tr>
3723 <td>Percentages:
3725 <td>N/A
3727 <tr>
3728 <td>Media:
3730 <td>visual
3732 <tr>
3733 <td>Computed value:
3735 <td>as specified
3737 <tr>
3738 <td>Animatable:
3740 <td>no
3741 </table>
3743 <p>Ligatures and contextual forms are ways of combining glyphs to produce
3744 more harmonized forms.
3746 <pre
3747 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>
3749 <pre
3750 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>
3752 <pre
3753 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>
3755 <pre
3756 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>
3758 <p>Individual values have the following meanings:
3760 <dl>
3761 <dt><dfn id=font-variant-ligatures-normal-value
3762 title="normal!!font-variant-ligatures">normal</dfn>
3764 <dd>A value of <a href="#font-variant-ligatures-normal-value"
3765 title="normal!!font-variant-ligatures">‘<code
3766 class=property>normal</code>’</a> specifies that common default
3767 features are enabled, <a href="#font-feature-resolution">as described in
3768 detail in the next section</a>. For OpenType fonts, common ligatures and
3769 contextual forms are on by default, discretionary and historical
3770 ligatures are not.
3772 <dt><dfn id=font-variant-ligatures-none-value
3773 title="none!!font-variant-ligatures">none</dfn>
3775 <dd>Specifies that all types of ligatures and contextual forms covered by
3776 this property are explicitly disabled. In situations where ligatures are
3777 not considered necessary, this may improve the speed of text rendering.
3779 <dt><dfn id=common-ligatures>common-ligatures</dfn>
3781 <dd>Enables display of common ligatures (OpenType features: <span
3782 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
3783 enabled by default.
3784 </dl>
3786 <div class=featex><img alt="common ligature example" src=liga.png></div>
3788 <dl>
3789 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
3791 <dd>Disables display of common ligatures (OpenType features: <span
3792 class=tag>liga, clig</span>).
3794 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
3796 <dd>Enables display of discretionary ligatures (OpenType feature: <span
3797 class=tag>dlig</span>). Which ligatures are discretionary or optional is
3798 decided by the type designer, so authors will need to refer to the
3799 documentation of a given font to understand which ligatures are
3800 considered discretionary.
3801 </dl>
3803 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
3805 <dl>
3806 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
3808 <dd>Disables display of discretionary ligatures (OpenType feature: <span
3809 class=tag>dlig</span>).
3811 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
3813 <dd>Enables display of historical ligatures (OpenType feature: <span
3814 class=tag>hlig</span>).
3815 </dl>
3817 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
3819 <dl>
3820 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
3822 <dd>Disables display of historical ligatures (OpenType feature: <span
3823 class=tag>hlig</span>).
3825 <dt><dfn id=contextual>contextual</dfn>
3827 <dd>Enables display of contextual alternates (OpenType feature: <span
3828 class=tag>calt</span>). Although not strictly a ligature feature, like
3829 ligatures this feature is commonly used to harmonize the shapes of glyphs
3830 with the surrounding context. For OpenType fonts, this feature is on by
3831 default.
3832 </dl>
3834 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
3836 <dl>
3837 <dt><dfn id=no-contextual>no-contextual</dfn>
3839 <dd>Disables display of contextual alternates (OpenType feature: <span
3840 class=tag>calt</span>).
3841 </dl>
3843 <p>Required ligatures, needed for correctly rendering complex scripts, are
3844 not affected by the settings above, including ‘<code
3845 class=property>none</code>’ (OpenType feature: <span
3846 class=tag>rlig</span>).</p>
3847 <!-- prop: font-variant-position -->
3849 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
3850 and superscript forms: the <a
3851 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
3853 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
3854 <tbody>
3855 <tr>
3856 <td>Name:
3858 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
3860 <tr>
3861 <td>Value:
3863 <td><a href="#font-variant-position-normal-value"
3864 title="normal!!font-variant-position">normal</a> | <a
3865 href="#sub">sub</a> | <a href="#super">super</a>
3867 <tr>
3868 <td>Initial:
3870 <td>normal
3872 <tr>
3873 <td>Applies to:
3875 <td>all elements
3877 <tr>
3878 <td>Inherited:
3880 <td>yes
3882 <tr>
3883 <td>Percentages:
3885 <td>N/A
3887 <tr>
3888 <td>Media:
3890 <td>visual
3892 <tr>
3893 <td>Computed value:
3895 <td>as specified
3897 <tr>
3898 <td>Animatable:
3900 <td>no
3901 </table>
3903 <p>This property is used to enable typographic subscript and superscript
3904 glyphs. These are alternate glyphs designed within the same em-box as
3905 default glyphs and are intended to be laid out on the same baseline as the
3906 default glyphs, with no resizing or repositioning of the baseline. They
3907 are explicitly designed to match the surrounding text and to be more
3908 readable without affecting the line height.
3910 <div class=figure><img alt="comparison between real subscript glyphs and
3911 synthesized ones" src=realsubscripts.png>
3912 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
3913 (bottom)
3914 </div>
3916 <p>Individual values have the following meanings:
3918 <dl>
3919 <dt><dfn id=font-variant-position-normal-value
3920 title="normal!!font-variant-position">normal</dfn>
3922 <dd>None of the features listed below are enabled.
3924 <dt><dfn id=sub>sub</dfn>
3926 <dd>Enables display of subscript variants (OpenType feature: <span
3927 class=tag>subs</span>).
3929 <dt><dfn id=super>super</dfn>
3931 <dd>Enables display of superscript variants (OpenType feature: <span
3932 class=tag>sups</span>).
3933 </dl>
3935 <p>Because of the semantic nature of subscripts and superscripts, when the
3936 value is either ‘<a href="#sub"><code class=property>sub</code></a>’
3937 or ‘<a href="#super"><code class=property>super</code></a>’ for a
3938 given contiguous run of text, if a variant glyph is not available for all
3939 the characters in the run, simulated glyphs must be synthesized for all
3940 characters using reduced forms of the glyphs that would be used without
3941 this feature applied. This is done per run to avoid a mixture of variant
3942 glyphs and synthesized ones that would not align correctly. In the case of
3943 OpenType fonts that lack subscript or superscript glyphs for a given
3944 character, user agents must use the appropriate subscript and superscript
3945 metrics specified in the selected font's <a
3946 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
3947 table</a> <a href="#OPENTYPE"
3948 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
3949 and offset of the synthesized substitutes.
3951 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
3952 using superscript metrics" src=superscript-alt-synth.png>
3953 <p class=caption>Superscript alternate glyph (left), synthesized
3954 superscript glyphs (middle), and incorrect mixture of the two (right)
3955 </div>
3957 <p>In situations where text decorations are only applied to runs of text
3958 containing superscript or subscript glyphs, the synthesized glyphs must be
3959 used to avoid problems with the placement of decorations.
3961 <p>In the past, user agents have used font-size and vertical-align to
3962 simulate subscripts and superscripts for the <code title="HTML sub
3963 element">sub</code> and <code title="HTML sup element">sup</code>
3964 elements. To allow a backwards compatible way of defining subscripts and
3965 superscripts, it is recommended that authors use conditional rules <a
3966 href="#CSS3-CONDITIONAL"
3967 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
3968 older user agents will still render subscripts and superscripts via the
3969 older mechanism.
3971 <p>Authors should note that fonts typically only provide subscript and
3972 superscript glyphs for a subset of all characters supported by the font.
3973 For example, while subscript and superscript glyphs are often available
3974 for Latin numbers, glyphs for punctuation and letter characters are less
3975 frequently provided. The synthetic fallback rules defined for this
3976 property assure that subscripts and superscripts will always appear but
3977 the appearance may not match author expectations if the font used does not
3978 provide the appropriate alternate glyph for all characters contained in a
3979 subscript or superscript.
3981 <p>This property is not cumulative. Applying it to elements within a
3982 subscript or superscript won't nest the placement of a subscript or
3983 superscript glyph. Images contained within text runs where the value of
3984 this property is ‘<a href="#sub"><code class=property>sub</code></a>’
3985 or ‘<a href="#super"><code class=property>super</code></a>’ will be
3986 drawn just as they would if the value was <a
3987 href="#font-variant-position-normal-value"
3988 title="normal!!font-variant-position">‘<code
3989 class=property>normal</code>’</a>.</p>
3990 <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
3991 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
3993 <p>Because of these limitations, ‘<a
3994 href="#propdef-font-variant-position"><code
3995 class=property>font-variant-position</code></a>’ is not recommended for
3996 use in user agent stylesheets. Authors should use it in cases where
3997 subscripts or superscripts will only contain the narrow range of
3998 characters supported by the fonts specified.
4000 <p class=note>The variant glyphs use the same baseline as the default
4001 glyphs would use. There is no shift in the placement along the baseline,
4002 so the use of variant glyphs doesn't affect the height of the inline box
4003 or alter the height of the linebox. This makes superscript and subscript
4004 variants ideal for situations where it's important that leading remain
4005 constant, such as in multi-column layout.
4007 <div class=example>
4008 <p>A typical user agent default style for the <a class=tag
4009 href="#sub">sub</a> element:</p>
4011 <pre>sub {
4012 vertical-align: sub;
4013 font-size: smaller;
4014 line-height: normal;
4015 }
4016 </pre>
4018 <p>Using font-variant-position to specify typographic subscripts in a way
4019 that will still show subscripts in older user agents:</p>
4021 <pre>@supports ( font-variant-position: sub ) {
4023 sub {
4024 vertical-align: baseline;
4025 font-size: 100%;
4026 line-height: inherit;
4027 font-variant-position: sub;
4028 }
4030 }
4031 </pre>
4033 <p>User agents that support the ‘<a
4034 href="#propdef-font-variant-position"><code
4035 class=property>font-variant-position</code></a>’ property will select a
4036 subscript variant glyph and render this without adjusting the baseline or
4037 font-size. Older user agents will ignore the ‘<a
4038 href="#propdef-font-variant-position"><code
4039 class=property>font-variant-position</code></a>’ property definition
4040 and use the standard defaults for subscripts.</p>
4041 </div>
4042 <!-- prop: font-variant-caps -->
4044 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
4045 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
4047 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
4048 <tbody>
4049 <tr>
4050 <td>Name:
4052 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
4054 <tr>
4055 <td>Value:
4057 <td><a href="#font-variant-caps-normal-value"
4058 title="normal!!font-variant-caps">normal</a> | <a
4059 href="#small-caps">small-caps</a> | <a
4060 href="#all-small-caps">all-small-caps</a> | <a
4061 href="#petite-caps">petite-caps</a> | <a
4062 href="#all-petite-caps">all-petite-caps</a> | <a
4063 href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
4065 <tr>
4066 <td>Initial:
4068 <td>normal
4070 <tr>
4071 <td>Applies to:
4073 <td>all elements
4075 <tr>
4076 <td>Inherited:
4078 <td>yes
4080 <tr>
4081 <td>Percentages:
4083 <td>N/A
4085 <tr>
4086 <td>Media:
4088 <td>visual
4090 <tr>
4091 <td>Computed value:
4093 <td>as specified
4095 <tr>
4096 <td>Animatable:
4098 <td>no
4099 </table>
4101 <p>This property allows the selection of alternate glyphs used for small or
4102 petite capitals or for titling. These glyphs are specifically designed to
4103 blend well with the surrounding normal glyphs, to maintain the weight and
4104 readability which suffers when text is simply resized to fit this purpose.
4106 <p>Individual values have the following meanings:
4108 <dl>
4109 <dt><dfn id=font-variant-caps-normal-value
4110 title="normal!!font-variant-caps">normal</dfn>
4112 <dd>None of the features listed below are enabled.
4114 <dt><dfn id=small-caps>small-caps</dfn>
4116 <dd>Enables display of small capitals (OpenType feature: <span
4117 class=tag>smcp</span>). Small-caps glyphs typically use the form of
4118 uppercase letters but are reduced to the size of lowercase letters.
4119 </dl>
4121 <div class=featex><img alt="small-caps example" src=smcp.png></div>
4123 <dl>
4124 <dt><dfn id=all-small-caps>all-small-caps</dfn>
4126 <dd>Enables display of small capitals for both upper and lowercase letters
4127 (OpenType features: <span class=tag>c2sc, smcp</span>).
4129 <dt><dfn id=petite-caps>petite-caps</dfn>
4131 <dd>Enables display of petite capitals (OpenType feature: <span
4132 class=tag>pcap</span>).
4134 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
4136 <dd>Enables display of petite capitals for both upper and lowercase
4137 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
4139 <dt><dfn id=unicase>unicase</dfn>
4141 <dd>Enables display of mixture of small capitals for uppercase letters
4142 with normal lowercase letters (OpenType feature: <span
4143 class=tag>unic</span>).
4145 <dt><dfn id=titling-caps>titling-caps</dfn>
4147 <dd>Enables display of titling capitals (OpenType feature: <span
4148 class=tag>titl</span>). Uppercase letter glyphs are often designed for
4149 use with lowercase letters. When used in all uppercase titling sequences
4150 they can appear too strong. Titling capitals are designed specifically
4151 for this situation.
4152 </dl>
4154 <p>The availability of these glyphs is based on whether a given feature is
4155 defined or not in the feature list of the font. User agents can optionally
4156 decide this on a per-script basis but should explicitly not decide this on
4157 a per-character basis.
4159 <p>Some fonts may only support a subset or none of the features described
4160 for this property. For backwards compatibility with CSS 2.1, if ‘<a
4161 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
4162 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
4163 is specified but small-caps glyphs are not available for a given font,
4164 user agents should simulate a small-caps font, for example by taking a
4165 normal font and replacing the glyphs for lowercase letters with scaled
4166 versions of the glyphs for uppercase characters (replacing the glyphs for
4167 both upper and lowercase letters in the case of ‘<a
4168 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
4170 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
4171 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
4172 width=512>
4173 <p class=caption>Synthetic vs. real small-caps
4174 </div>
4176 <p>To match the surrounding text, a font may provide alternate glyphs for
4177 caseless characters when these features are enabled but when a user agent
4178 simulates small capitals, it must not attempt to simulate alternates for
4179 codepoints which are considered caseless.
4181 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
4182 characters with small-caps, all-small-caps enabled" class=hires
4183 src=small-capitals-variations.png width=418>
4184 <p class=caption>Caseless characters with small-caps, all-small-caps
4185 enabled
4186 </div>
4188 <p>If either ‘<a href="#petite-caps"><code
4189 class=property>petite-caps</code></a>’ or ‘<a
4190 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
4191 is specified for a font that doesn't support these features, the property
4192 behaves as if ‘<a href="#small-caps"><code
4193 class=property>small-caps</code></a>’ or ‘<a
4194 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4195 respectively, had been specified. If ‘<a href="#unicase"><code
4196 class=property>unicase</code></a>’ is specified for a font that doesn't
4197 support that feature, the property behaves as if ‘<a
4198 href="#small-caps"><code class=property>small-caps</code></a>’ was
4199 applied only to lowercased uppercase letters. If ‘<a
4200 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
4201 specified with a font that does not support this feature, this property
4202 has no visible effect. When simulated small capital glyphs are used, for
4203 scripts that lack uppercase and lowercase letters, ‘<a
4204 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
4205 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4206 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
4207 ‘<a href="#all-petite-caps"><code
4208 class=property>all-petite-caps</code></a>’ and ‘<a
4209 href="#unicase"><code class=property>unicase</code></a>’ have no visible
4210 effect.
4212 <p>When casing transforms are used to simulate small capitals, the casing
4213 transformations must match those used for the <span
4214 class=property>‘<code class=property>text-transform</code>’</span>
4215 property.
4217 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
4218 replace glyphs in a small-caps font so that the text appears in all
4219 uppercase letters.
4221 <div class=figure style="padding: 0; margin: auto;"><img alt="using
4222 all-small-caps in acronym-laden text" class=hires
4223 src=acronym-laden-text.png width=596>
4224 <p class=caption>Using small capitals to improve readability in
4225 acronym-laden text
4226 </div>
4228 <div class=example>
4229 <p>Quotes rendered italicised, with small-caps on the first line:</p>
4231 <pre>blockquote { font-style: italic; }
4232 blockquote:first-line { font-variant: small-caps; }
4234 <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>
4235 </pre>
4236 </div>
4237 <!-- prop: font-variant-numeric -->
4239 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
4240 formatting: the <a
4241 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
4243 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
4244 <tbody>
4245 <tr>
4246 <td>Name:
4248 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
4250 <tr>
4251 <td>Value:
4253 <td><a href="#font-variant-numeric-normal-value"
4254 title="normal!!font-variant-numeric">normal</a> | [ <a
4255 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
4256 || <a
4257 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
4258 || <a
4259 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
4260 || <a href="#ordinal">ordinal</a> || <a
4261 href="#slashed-zero">slashed-zero</a> ]
4263 <tr>
4264 <td>Initial:
4266 <td>normal
4268 <tr>
4269 <td>Applies to:
4271 <td>all elements
4273 <tr>
4274 <td>Inherited:
4276 <td>yes
4278 <tr>
4279 <td>Percentages:
4281 <td>N/A
4283 <tr>
4284 <td>Media:
4286 <td>visual
4288 <tr>
4289 <td>Computed value:
4291 <td>as specified
4293 <tr>
4294 <td>Animatable:
4296 <td>no
4297 </table>
4299 <p>Specifies control over numerical forms. The example below shows how some
4300 of these values can be combined to influence the rendering of tabular data
4301 with fonts that support these features. Within normal paragraph text,
4302 proportional numbers are used while tabular numbers are used so that
4303 columns of numbers line up properly:
4305 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
4306 number styles" src=numberstyles.png>
4307 <p class=caption>Using number styles
4308 </div>
4310 <p>Possible combinations:
4312 <pre
4313 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>
4315 <pre
4316 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>
4318 <pre
4319 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>
4321 <p>Individual values have the following meanings:
4323 <dl>
4324 <dt><dfn id=font-variant-numeric-normal-value
4325 title="normal!!font-variant-numeric">normal</dfn>
4327 <dd>None of the features listed below are enabled.
4329 <dt><dfn id=lining-nums>lining-nums</dfn>
4331 <dd>Enables display of lining numerals (OpenType feature: <span
4332 class=tag>lnum</span>).
4334 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
4336 <dd>Enables display of old-style numerals (OpenType feature: <span
4337 class=tag>onum</span>).
4339 <dt><dfn id=proportional-nums>proportional-nums</dfn>
4341 <dd>Enables display of proportional numerals (OpenType feature: <span
4342 class=tag>pnum</span>).
4344 <dt><dfn id=tabular-nums>tabular-nums</dfn>
4346 <dd>Enables display of tabular numerals (OpenType feature: <span
4347 class=tag>tnum</span>).
4349 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
4351 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
4352 class=tag>frac</span>).
4353 </dl>
4355 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
4357 <dl>
4358 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
4360 <dd>Enables display of lining stacked fractions (OpenType feature: <span
4361 class=tag>afrc</span>).
4362 </dl>
4364 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
4366 <dl>
4367 <dt><dfn id=ordinal>ordinal</dfn>
4369 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
4370 <span class=tag>ordn</span>).
4372 <dt><dfn id=slashed-zero>slashed-zero</dfn>
4374 <dd>Enables display of slashed zeros (OpenType feature: <span
4375 class=tag>zero</span>).
4376 </dl>
4378 <div class=featex><img alt="slashed zero example" src=zero.png></div>
4380 <div class=example id=steak-marinade>
4381 <p>A simple flank steak marinade recipe, rendered with automatic fractions
4382 and old-style numerals:</p>
4384 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
4386 <h4>Steak marinade:</h4>
4387 <ul>
4388 <li><span class="amount">2</span> tbsp olive oil</li>
4389 <li><span class="amount">1</span> tbsp lemon juice</li>
4390 <li><span class="amount">1</span> tbsp soy sauce</li>
4391 <li><span class="amount">1 1/2</span> tbsp dry minced onion</li>
4392 <li><span class="amount">2 1/2</span> tsp italian seasoning</li>
4393 <li>Salt &amp; pepper</li>
4394 </ul>
4396 <p>Mix the meat with the marinade and let it sit covered in the refrigerator
4397 for a few hours or overnight.</p>
4398 </pre>
4400 <p>Note that the fraction feature is only applied to values not the entire
4401 paragraph. Fonts often implement this feature using contextual rules
4402 based on the use of the slash (‘<code class=css>/</code>’) character.
4403 As such, it's not suitable for use as a paragraph-level style.</p>
4404 </div>
4405 <!-- prop: font-variant-alternates -->
4407 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
4408 and swashes: the <a
4409 href="#propdef-font-variant-alternates">font-variant-alternates</a>
4410 property</h3>
4412 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
4413 <tbody>
4414 <tr>
4415 <td>Name:
4417 <td><dfn
4418 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
4420 <tr>
4421 <td>Value:
4423 <td>normal | [ <a href="#stylistic"
4424 title=stylistic>stylistic(<feature-value-name>)</a> || <a
4425 href="#historical-forms">historical-forms</a> || <a href="#styleset"
4426 title=styleset>styleset(<feature-value-name> #)</a> || <a
4427 href="#character-variant"
4428 title=character-variant>character-variant(<feature-value-name>
4429 #)</a> || <a href="#swash"
4430 title=swash>swash(<feature-value-name>)</a> || <a
4431 href="#ornaments"
4432 title=ornaments>ornaments(<feature-value-name>)</a> || <a
4433 href="#annotation"
4434 title=annotation>annotation(<feature-value-name>)</a> ]
4436 <tr>
4437 <td>Initial:
4439 <td>normal
4441 <tr>
4442 <td>Applies to:
4444 <td>all elements
4446 <tr>
4447 <td>Inherited:
4449 <td>yes
4451 <tr>
4452 <td>Percentages:
4454 <td>N/A
4456 <tr>
4457 <td>Media:
4459 <td>visual
4461 <tr>
4462 <td>Computed value:
4464 <td>as specified
4466 <tr>
4467 <td>Animatable:
4469 <td>no
4470 </table>
4472 <p>For any given character, fonts can provide a variety of alternate glyphs
4473 in addition to the default glyph for that character. This property
4474 provides control over the selection of these alternate glyphs.
4476 <p>For many of the property values listed below, several different
4477 alternate glyphs are available. How many alternates are available and what
4478 they represent is font-specific, so these are each marked <dfn
4479 id=font-specific>font specific</dfn> in the value definitions below.
4480 Because the nature of these alternates is font-specific, the <a
4481 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4482 rule is used to define values for a specific font family or set of
4483 families that associate a font-specific numeric
4484 <code><feature-index></code> with a custom
4485 <code><feature-value-name></code>, which is then used in this
4486 property to select specific alternates:
4488 <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
4490 p {
4491 font-family: Noble Script;
4492 font-variant-alternates: swash(flowing); /* use swash alternate #2 */
4493 }</pre>
4495 <p>When a particular <code><feature-value-name></code> has not been
4496 defined for a given family or for a particular feature type, the computed
4497 value must be the same as if it had been defined. However, property values
4498 that contain these undefined <code><feature-value-name></code>
4499 identifiers must be ignored when choosing glyphs.
4501 <pre>/* these two style rules are effectively the same */
4502 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
4503 p { font-variant-alternates: normal; }
4504 </pre>
4506 <p>This allows values to be defined and used for a given set of font
4507 families but ignored if fallback occurs, since the font family name would
4508 be different. If a given value is outside the range supported by a given
4509 font, the value is ignored. These values never apply to generic font
4510 families.
4512 <p>Individual values have the following meanings:
4514 <dl>
4515 <dt><dfn id=font-variant-alternates-normal-value
4516 title="normal!!font-variant-alternates">normal</dfn>
4518 <dd>None of the features listed below are enabled.
4520 <dt><dfn id=historical-forms>historical-forms</dfn>
4522 <dd>Enables display of historical forms (OpenType feature: <span
4523 class=tag>hist</span>).
4524 </dl>
4526 <div class=featex><img alt="historical form example" src=hist.png></div>
4528 <dl>
4529 <dt><dfn id=stylistic
4530 title=stylistic>stylistic(<feature-value-name>)</dfn>
4532 <dd>Enables display of stylistic alternates (<a
4533 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4534 class=tag>salt <feature-index></span>).
4535 </dl>
4537 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
4539 <dl>
4540 <dt><dfn id=styleset title=styleset>styleset(<feature-value-name>
4541 #)</dfn>
4543 <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
4544 specific</em></a>, OpenType feature: <span
4545 class=tag>ss<feature-index></span> OpenType currently defines <span
4546 class=tag>ss01</span> through <span class=tag>ss20</span>).
4547 </dl>
4549 <div class=featex><img alt="styleset example" src=ssnn.png></div>
4551 <dl>
4552 <dt><dfn id=character-variant
4553 title=character-variant>character-variant(<feature-value-name>
4554 #)</dfn>
4556 <dd>Enables display of specific character variants (<a
4557 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4558 class=tag>cv<feature-index></span> OpenType currently defines <span
4559 class=tag>cv01</span> through <span class=tag>cv99</span>).
4561 <dt><dfn id=swash title=swash>swash(<feature-value-name>)</dfn>
4563 <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
4564 specific</em></a>, OpenType feature: <span class=tag>swsh
4565 <feature-index>, cswh <feature-index></span>).
4566 </dl>
4568 <div class=featex><img alt="swash example" src=swsh.png></div>
4570 <dl>
4571 <dt><dfn id=ornaments
4572 title=ornaments>ornaments(<feature-value-name>)</dfn>
4574 <dd>Enables replacement of default glyphs with ornaments, if provided in
4575 the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
4576 feature: <span class=tag>ornm <feature-index></span>). Some fonts
4577 may offer ornament glyphs as alternates for a wide collection of
4578 characters; however, displaying arbitrary characters (e.g.,
4579 alphanumerics) as ornaments is poor practice as it distorts the semantics
4580 of the data. Font designers are encouraged to encode all ornaments
4581 (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
4582 alternates for the bullet character (U+2022) to allow authors to select
4583 the desired glyph using ‘<a href="#ornaments"><code
4584 class=property>ornaments</code></a>’.
4585 </dl>
4587 <div class=featex><img alt="ornaments example" src=ornm.png></div>
4589 <dl>
4590 <dt><dfn id=annotation
4591 title=annotation>annotation(<feature-value-name>)</dfn>
4593 <dd>Enables display of alternate annotation forms (<a
4594 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4595 class=tag>nalt <feature-index></span>).
4596 </dl>
4598 <div class=featex><img alt="alternate annotation form example"
4599 src=nalt.png></div>
4601 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
4602 specific alternates: the <dfn id=at-font-feature-values-rule
4603 style="font-weight: inherit; font-style:
4604 inherit"><code>@font-feature-values</code></dfn> rule</h3>
4606 <p>Several of the possible values of ‘<a
4607 href="#propdef-font-variant-alternates"><code
4608 class=property>font-variant-alternates</code></a>’ listed above are
4609 labeled as <a href="#font-specific"><em>font specific</em></a>. For these
4610 features fonts may define not just a single glyph but a set of alternate
4611 glyphs with an index to select a given alternate. Since these are font
4612 family specific, the <a
4613 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4614 rule is used to define named values for these indices for a given family.
4616 <p class=note>See the <a href="#om-fontfeaturevalues">object model
4617 reference section</a> for a description of the interfaces used to modify
4618 these rules via the CSS Object Model.
4620 <div class=example>
4621 <p>In the case of the swash Q in the example shown above, the swash could
4622 be specified using these style rules:</p>
4624 <pre>
4626 @font-feature-values Jupiter Sans {
4627 @swash {
4628 delicate: 1;
4629 flowing: 2;
4630 }
4631 }
4633 h2 { font-family: Jupiter Sans, sans-serif; }
4635 /* show the second swash variant in h2 headings */
4636 h2:first-letter { font-variant-alternates: swash(flowing); }
4638 <h2>Quick</h2></pre>
4640 <p>When Jupiter Sans is present, the second alternate swash alternate will
4641 be displayed. When not present, no swash character will be shown, since
4642 the specific named value "flowing" is only defined for the Jupiter Sans
4643 family. The @-mark indicates the name of the property value for which a
4644 named value can be used. The name "flowing" is chosen by the author. The
4645 index that represents each alternate is defined within a given font's
4646 data.</p>
4647 </div>
4649 <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
4651 <p>An <a
4652 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4653 rule is composed of a list of font families followed by a block containing
4654 individual <a href="#featurevalueblock"><i
4655 title="feature_value_block">feature value blocks</i></a> that take the
4656 form of @-rules. Each block defines a set of named values for a specific
4657 font feature when a given set of font families is used. Effectively, they
4658 define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
4659 ⟨values⟩ are the numeric indices used for specific features defined
4660 for a given font.
4662 <p>In terms of the grammar, this specification defines the following
4663 productions:
4665 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
4666 : <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>*
4667 '{' <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>*
4668 ;
4670 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
4671 : <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> ]*
4672 ;
4674 <dfn id=fontfamilyname>font_family_name</dfn>
4675 : <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> ]* ]
4676 ;
4678 <dfn id=featurevalueblock>feature_value_block</dfn>
4679 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
4680 '{' <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>*
4681 ;
4683 <dfn id=featuretype>feature_type</dfn>:
4684 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
4685 ;
4687 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
4688 : <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> ]*
4689 ;
4690 </pre>
4692 <p>The following new token is introduced:
4694 <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>;}
4695 </pre>
4697 <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
4698 value blocks</i></a> are handled as <a
4699 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
4700 consist of everything up to the next block or semi-colon, whichever comes
4701 first.
4703 <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
4704 family list</i></a> is a comma-delimited list of <a
4705 href="#fontfamilyname"><i title="font_family_name">font family
4706 names</i></a> that match the definition of <a
4707 href="#family-name-value"><var><family-name></var></a> for the <a
4708 href="#propdef-font-family" title="font-family!!property">‘<code
4709 class=property>font-family</code>’</a> property. This means that only
4710 named font families are allowed, rules that include generic or system
4711 fonts in the list of font families are syntax errors. However, if a user
4712 agent defines a generic font to be a specific named font (e.g. Helvetica),
4713 the settings associated with that family name will be used. If syntax
4714 errors occur within the font family list, the entire rule must be ignored.
4716 <p>Within <a href="#featurevalueblock"><i
4717 title="feature_value_block">feature value blocks</i></a>, the <a
4718 href="#featuretype"><i title="feature_type">feature type</i></a> is
4719 ‘<code class=css>@</code>’ followed by the name of one of the <a
4720 href="#font-specific"><em>font specific</em></a> property values of ‘<a
4721 href="#propdef-font-variant-alternates"><code
4722 class=property>font-variant-alternates</code></a>’ (e.g. <a
4723 href="#swash"><code>@swash</code></a>). The identifiers used within
4724 feature value definitions follow the rules of CSS user identifiers and are
4725 case-sensitive. They are unique only for a given set of font families and
4726 <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
4727 same identifier used with a different <a href="#featuretype"><i
4728 title="feature_type">feature type</i></a> is treated as a separate and
4729 distinct value. If the same identifier is defined mulitple times for a
4730 given <a href="#featuretype"><i title="feature_type">feature type</i></a>
4731 and font family, the last defined value is used. Values associated with a
4732 given identifier are limited to integer values 0 or greater.
4734 <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
4735 title="feature_value_definition">feature value definition</i></a>, such as
4736 invalid identifiers or values, the entire <a
4737 href="#featurevaluedefinition"><i title="feature_value_definition">feature
4738 value definition</i></a> must be omitted, just as syntax errors in style
4739 declarations are handled. When the <a href="#featuretype"><i
4740 title="feature_type">feature type</i></a> is invalid, the entire
4741 associated <a href="#featurevalueblock"><i
4742 title="feature_value_block">feature value block</i></a> must be ignored.
4744 <div class=example>
4745 <p>Rules that are equivalent given syntax error handling:</p>
4747 <pre>@font-feature-values Bongo {
4748 @swash { ornate: 1; }
4749 annotation { boxed: 4; } /* should be @annotation! */
4750 @swash { double-loops: 1; flowing: -1; } /* negative value */
4751 @ornaments ; /* incomplete definition */
4752 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
4753 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a> /* random editing mistake */
4754 }</pre>
4756 <p>The example above is equivalent to:</p>
4758 <pre>@font-feature-values Bongo {
4759 @swash { ornate: 1; }
4760 @swash { double-loops: 1; }
4761 @styleset { double-W: 14; sharp-terminals: 16 1; }
4762 }</pre>
4763 </div>
4765 <p>If multiple <a
4766 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4767 rules are defined for a given family, the resulting values definitions are
4768 the union of the definitions contained within these rules. This allows a
4769 set of named values to be defined for a given font family globally for a
4770 site and specific additions made per-page.
4772 <div class=example>
4773 <p>Using both site-wide and per-page feature values:</p>
4775 <pre>
4776 site.css:
4778 @font-feature-values Mercury Serif {
4779 @styleset {
4780 stacked-g: 3; /* "two-storey" versions of g, a */
4781 stacked-a: 4;
4782 }
4783 }
4785 page.css:
4787 @font-feature-values Mercury Serif {
4788 @styleset {
4789 geometric-m: 7; /* alternate version of m */
4790 }
4791 }
4793 body {
4794 font-family: Mercury Serif, serif;
4796 /* enable both the use of stacked g and alternate m */
4797 font-variant-alternates: styleset(stacked-g, geometric-m);
4798 }</pre>
4799 </div>
4801 <div class=example>
4802 <p>Using a commonly named value allows authors to use a single style rule
4803 to cover a set of fonts for which the underlying selector is different
4804 for each font. If either font in the example below is found, a circled
4805 number glyph will be used:</p>
4807 <pre>@font-feature-values Taisho Gothic {
4808 @annotation { boxed: 1; circled: 4; }
4809 }
4811 @font-feature-values Otaru Kisa {
4812 @annotation { circled: 1; black-boxed: 3; }
4813 }
4815 h3.title {
4816 /* circled form defined for both fonts */
4817 font-family: Taisho Gothic, Otaru Kisa;
4818 font-variant: annotation(circled);
4819 }</pre>
4820 </div>
4822 <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
4823 </span>Multi-valued feature value definitions</h4>
4825 <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
4826 href="#propdef-font-variant-alternates"><code
4827 class=property>font-variant-alternates</code></a>’ property values take
4828 a single value (e.g. ‘<a href="#swash"><code
4829 class=property>swash</code></a>’). The ‘<a
4830 href="#character-variant"><code
4831 class=property>character-variant</code></a>’ property value allows two
4832 values and ‘<a href="#styleset"><code
4833 class=property>styleset</code></a>’ allows an unlimited number.
4835 <p>For the styleset property value, multiple values indicate the style sets
4836 to be enabled. Values between 1 and 99 enable OpenType features <span
4837 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
4838 OpenType standard only officially defines <span class=tag>ss01</span>
4839 through <span class=tag>ss20</span>. For OpenType fonts, values greater
4840 than 99 or equal to 0 do not generate a syntax error when parsed but
4841 enable no OpenType features.
4843 <pre>@font-feature-values Mars Serif {
4844 @styleset {
4845 alt-g: 1; /* implies ss01 = 1 */
4846 curly-quotes: 3; /* implies ss03 = 1 */
4847 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
4848 }
4850 @styleset {
4851 dumb: 125; /* >99, ignored */
4852 }
4854 @swash {
4855 swishy: 3 5; /* more than 1 value for swash, syntax error */
4856 }
4857 }
4859 p.codeblock {
4860 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
4861 font-variant-alternates: styleset(curly-quotes, code);
4862 }</pre>
4864 <p>For character-variant, a single value between 1 and 99 indicates the
4865 enabling of OpenType feature <span class=tag>cv01</span> through <span
4866 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
4867 to 0 are ignored but do not generate a syntax error when parsed but enable
4868 no OpenType features. When two values are listed, the first value
4869 indicates the feature used and the second the value passed for that
4870 feature. If more than two values are assigned to a given name, a syntax
4871 error occurs and the entire <a href="#featurevaluedefinition"><i
4872 title="feature_value_definition">feature value definition</i></a> is
4873 ignored.
4875 <pre>@font-feature-values MM Greek {
4876 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
4877 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
4878 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
4879 @character-variant { gamma: 12; } /* implies cv12 = 1 */
4880 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
4881 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
4882 @character-variant { silly: 105; } /* >99, ignored */
4883 @character-variant { dumb: 323 3; } /* >99, ignored */
4884 }
4886 #title {
4887 /* use the third alternate beta, first alternate gamma */
4888 font-variant-alternates: character-variant(beta-3, gamma);
4889 }
4891 p {
4892 /* zeta-2 follows zeta, implies cv20 = 2 */
4893 font-variant-alternates: character-variant(zeta, zeta-2);
4894 }
4896 .special {
4897 /* zeta follows zeta-2, implies cv20 = 3 */
4898 font-variant-alternates: character-variant(zeta-2, zeta);
4899 }</pre>
4901 <div class=figure><img alt="Matching text on Byzantine seals using
4902 character variants" src=byzantineseal.png>
4903 <p class=caption>Byzantine seal text displayed with character variants
4904 </div>
4906 <div class=example>
4907 <p>In the figure above, the text in red is rendered using a font
4908 containing character variants that mimic the character forms found on a
4909 Byzantine seal from the 8th century A.D. Two lines below is the same text
4910 displayed in a font without variants. Note the two variants for U and N
4911 used on the seal.</p>
4913 <pre>@font-feature-values Athena Ruby {
4914 @character-variant {
4915 leo-B: 2 1;
4916 leo-M: 13 3;
4917 leo-alt-N: 14 1;
4918 leo-N: 14 2;
4919 leo-T: 20 1;
4920 leo-U: 21 2;
4921 leo-alt-U: 21 4;
4922 }
4923 }
4925 p {
4926 font-variant: discretionary-ligatures,
4927 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
4928 }
4930 span.alt-N {
4931 font-variant-alternates: character-variant(leo-alt-N);
4932 }
4934 span.alt-U {
4935 font-variant-alternates: character-variant(leo-alt-U);
4936 }
4938 <p>ENO....UP͞RSTU<span class="alt-U">U</span>͞<span class="alt-U">U</span>ΚΑΙTỤẠG̣IUPNS</p>
4940 <p>LEON|ΚΑΙCONSTA|NTI<span class="alt-N">N</span>OS..|STOIBAṢ.|LIṢROM|AIO<span class="alt-N">N</span></p>
4941 </pre>
4942 </div>
4944 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
4945 Asian text rendering: the <a
4946 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
4947 property</h3>
4949 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
4950 <tbody>
4951 <tr>
4952 <td>Name:
4954 <td><dfn
4955 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
4957 <tr>
4958 <td>Value:
4960 <td><a href="#font-variant-east-asian-normal-value"
4961 title="normal!!font-variant-east-asian">normal</a> | [ <a
4962 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
4963 || <a
4964 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
4965 || <a href="#ruby">ruby</a> ]
4967 <tr>
4968 <td>Initial:
4970 <td>normal
4972 <tr>
4973 <td>Applies to:
4975 <td>all elements
4977 <tr>
4978 <td>Inherited:
4980 <td>yes
4982 <tr>
4983 <td>Percentages:
4985 <td>N/A
4987 <tr>
4988 <td>Media:
4990 <td>visual
4992 <tr>
4993 <td>Computed value:
4995 <td>as specified
4997 <tr>
4998 <td>Animatable:
5000 <td>no
5001 </table>
5003 <p>Allows control of glyph substitution and sizing in East Asian text.
5005 <pre
5006 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>
5008 <pre
5009 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>
5011 <p>Individual values have the following meanings:
5013 <dl>
5014 <dt><dfn id=font-variant-east-asian-normal-value
5015 title="normal!!font-variant-east-asian">normal</dfn>
5017 <dd>None of the features listed below are enabled.
5019 <dt><dfn id=jis78>jis78</dfn>
5021 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
5022 class=tag>jp78</span>).
5023 </dl>
5025 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
5027 <dl>
5028 <dt><dfn id=jis83>jis83</dfn>
5030 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
5031 class=tag>jp83</span>).
5033 <dt><dfn id=jis90>jis90</dfn>
5035 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
5036 class=tag>jp90</span>).
5038 <dt><dfn id=jis04>jis04</dfn>
5040 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
5041 class=tag>jp04</span>).
5042 <p>The various JIS variants reflect the glyph forms defined in different
5043 Japanese national standards. Fonts generally include glyphs defined by
5044 the most recent national standard but it's sometimes necessary to use
5045 older variants, to match signage for example.</p>
5047 <dt><dfn id=simplified>simplified</dfn>
5049 <dd>Enables rendering of simplified forms (OpenType feature: <span
5050 class=tag>smpl</span>).
5052 <dt><dfn id=traditional>traditional</dfn>
5054 <dd>Enables rendering of traditional forms (OpenType feature: <span
5055 class=tag>trad</span>).
5056 </dl>
5058 <p>The ‘<a href="#simplified"><code
5059 class=property>simplified</code></a>’ and ‘<a
5060 href="#traditional"><code class=property>traditional</code></a>’ values
5061 allow control over the glyph forms for characters which have been
5062 simplified over time but for which the older, traditional form is still
5063 used in some contexts. The exact set of characters and glyph forms will
5064 vary to some degree by context for which a given font was designed.
5066 <div class=featex><img alt="tradtional form example" src=trad.png></div>
5068 <dl>
5069 <dt><dfn id=full-width>full-width</dfn>
5071 <dd>Enables rendering of full-width variants (OpenType feature: <span
5072 class=tag>fwid</span>).
5074 <dt><dfn id=proportional-width>proportional-width</dfn>
5076 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
5077 <span class=tag>pwid</span>).
5078 </dl>
5080 <div class=featex><img alt="proportionally spaced Japanese example"
5081 src=pwid.png></div>
5083 <dl>
5084 <dt><dfn id=ruby>ruby</dfn>
5086 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
5087 class=tag>ruby</span>). Since ruby text is generally smaller than the
5088 associated body text, font designers can design special glyphs for use
5089 with ruby that are more readable than scaled down versions of the default
5090 glyphs. Only glyph selection is affected, there is no associated font
5091 scaling or other change that affects line layout. The red ruby text below
5092 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
5093 Note the slight difference in stroke thickness.
5094 </dl>
5096 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
5098 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
5099 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
5100 property</h3>
5102 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
5103 <tbody>
5104 <tr>
5105 <td>Name:
5107 <td><dfn id=propdef-font-variant
5108 title="font-variant!!property">font-variant</dfn>
5110 <tr>
5111 <td>Value:
5113 <td><a href="#font-variant-normal-value"
5114 title="normal!!font-variant">normal</a> | <a
5115 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
5116 <a href="#common-lig-values"><var><common-lig-values></var></a>
5117 || <a
5118 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
5119 || <a
5120 href="#historical-lig-values"><var><historical-lig-values></var></a>
5121 || <a
5122 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
5123 || <a href="#stylistic"><var
5124 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
5125 href="#historical-forms"><var>historical-forms</var></a> || <a
5126 href="#styleset"><var
5127 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
5128 href="#character-variant"><var
5129 title=character-variant>character-variant(<feature-value-name>
5130 #)</var></a> || <a href="#swash"><var
5131 title=swash>swash(<feature-value-name>)</var></a> || <a
5132 href="#ornaments"><var
5133 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
5134 href="#annotation"><var
5135 title=annotation>annotation(<feature-value-name>)</var></a> || [
5136 <a href="#small-caps"><i>small-caps</i></a> | <a
5137 href="#all-small-caps"><i>all-small-caps</i></a> | <a
5138 href="#petite-caps"><i>petite-caps</i></a> | <a
5139 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
5140 href="#unicase"><i>unicase</i></a> | <a
5141 href="#titling-caps"><i>titling-caps</i></a> ] || <a
5142 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
5143 || <a
5144 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
5145 || <a
5146 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
5147 || <a href="#ordinal"><i>ordinal</i></a> || <a
5148 href="#slashed-zero"><i>slashed-zero</i></a> || <a
5149 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
5150 || <a
5151 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
5152 || <a href="#ruby"><i>ruby</i></a> ]
5154 <tr>
5155 <td>Initial:
5157 <td>normal
5159 <tr>
5160 <td>Applies to:
5162 <td>all elements
5164 <tr>
5165 <td>Inherited:
5167 <td>yes
5169 <tr>
5170 <td>Percentages:
5172 <td>see individual properties
5174 <tr>
5175 <td>Media:
5177 <td>visual
5179 <tr>
5180 <td>Computed value:
5182 <td>see individual properties
5184 <tr>
5185 <td>Animatable:
5187 <td>see individual properties
5188 </table>
5190 <p>The <a href="#propdef-font-variant"
5191 title="font-variant!!property">‘<code
5192 class=property>font-variant</code>’</a> property is a shorthand for all
5193 font-variant subproperties. The value <dfn id=font-variant-normal-value
5194 title="normal!!font-variant">‘<code
5195 class=property>normal</code>’</dfn> resets all subproperties of <a
5196 href="#propdef-font-variant" title="font-variant!!property">‘<code
5197 class=property>font-variant</code>’</a> to their inital value. The <dfn
5198 id=font-variant-none-value title="none!!font-variant">‘<code
5199 class=property>none</code>’</dfn> value sets ‘<a
5200 href="#propdef-font-variant-ligatures"><code
5201 class=property>font-variant-ligatures</code></a>’ to ‘<code
5202 class=property>none</code>’ and resets all other font feature properties
5203 to their initial value. Like other shorthands, using <a
5204 href="#propdef-font-variant" title="font-variant!!property">‘<code
5205 class=property>font-variant</code>’</a> resets unspecified <a
5206 href="#propdef-font-variant" title="font-variant!!property">‘<code
5207 class=property>font-variant</code>’</a> subproperties to their initial
5208 values. It does not reset the values of either ‘<a
5209 href="#propdef-font-language-override"><code
5210 class=property>font-language-override</code></a>’ or <a
5211 href="#propdef-font-feature-settings"
5212 title="font-feature-settings!!property">‘<code
5213 class=property>font-feature-settings</code>’</a>.
5215 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
5216 font feature settings control: the <a
5217 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
5219 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
5220 <tbody>
5221 <tr>
5222 <td>Name:
5224 <td><dfn id=propdef-font-feature-settings
5225 title="font-feature-settings!!property">font-feature-settings</dfn>
5227 <tr>
5228 <td>Value:
5230 <td><a href="#font-feature-settings-normal-value"
5231 title="normal!!font-feature-settings">normal</a> | <a
5232 href="#feature-tag-value"><var><feature-tag-value></var></a> #
5234 <tr>
5235 <td>Initial:
5237 <td>normal
5239 <tr>
5240 <td>Applies to:
5242 <td>all elements
5244 <tr>
5245 <td>Inherited:
5247 <td>yes
5249 <tr>
5250 <td>Percentages:
5252 <td>N/A
5254 <tr>
5255 <td>Media:
5257 <td>visual
5259 <tr>
5260 <td>Computed value:
5262 <td>as specified
5264 <tr>
5265 <td>Animatable:
5267 <td>no
5268 </table>
5270 <p>This property provides low-level control over OpenType font features. It
5271 is intended as a way of providing access to font features that are not
5272 widely used but are needed for a particular use case.
5274 <p>Authors should generally use <a href="#propdef-font-variant"
5275 title="font-variant!!property">‘<code
5276 class=property>font-variant</code>’</a> and its related subproperties
5277 whenever possible and only use this property for special cases where its
5278 use is the only way of accessing a particular infrequently used font
5279 feature.
5281 <pre>/* enable small caps and use second swash alternate */
5282 font-feature-settings: "smcp", "swsh" 2;</pre>
5284 <p>A value of <dfn id=font-feature-settings-normal-value
5285 title="normal!!font-feature-settings">‘<code
5286 class=property>normal</code>’</dfn> means that no change in glyph
5287 selection or positioning occurs due to this property.
5289 <p>Feature tag values have the following syntax:
5291 <pre
5292 class=prod><dfn id=feature-tag-value><var><feature-tag-value></var></dfn> = <string> [ <integer> | on | off ]?</pre>
5294 <p>The <string> is a case-sensitive OpenType feature tag. As
5295 specified in the OpenType specification, feature tags contain four ASCII
5296 characters. Tag strings longer or shorter than four characters, or
5297 containing characters outside the U+20–7E codepoint range are invalid.
5298 Feature tags need only match a feature tag defined in the font, so they
5299 are not limited to explicitly registered OpenType features. Fonts defining
5300 custom feature tags should follow the <a
5301 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
5302 rules</a> defined in the OpenType specification <a
5303 href="#OPENTYPE-FEATURES"
5304 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
5305 Feature tags not present in the font are ignored; a user agent must not
5306 attempt to synthesize fallback behavior based on these feature tags.
5308 <p>This means that explicitly disabling the <span class=tag>kern</span>
5309 feature will not affect the application of kerning data found in the
5310 ‘<code class=property>kern</code>’ table (as opposed to kerning data
5311 associated with the <span class=tag>kern</span> feature in the ‘<code
5312 class=property>GPOS</code>’ table). Authors should use the ‘<a
5313 href="#propdef-font-kerning"><code
5314 class=property>font-kerning</code></a>’ property to explictly enable or
5315 disable kerning since this property affects both types of kerning.
5317 <p>If present, a value indicates an index used for glyph selection. An
5318 <integer> value must be 0 or greater. A value of 0 indicates that
5319 the feature is disabled. For boolean features, a value of 1 enables the
5320 feature. For non-boolean features, a value of 1 or greater enables the
5321 feature and indicates the feature selection index. A value of ‘<code
5322 class=property>on</code>’ is synonymous with 1 and ‘<code
5323 class=property>off</code>’ is synonymous with 0. If the value is
5324 omitted, a value of 1 is assumed.
5326 <pre>
5327 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
5328 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
5329 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
5330 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
5331 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
5332 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
5333 font-feature-settings: "palin" off; /* good idea but invalid tagname */
5334 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
5335 font-feature-settings: dlig; /* invalid, tag must be a string */
5336 </pre>
5338 <p>When values greater than the range supported by the font are specified,
5339 the behavior is explicitly undefined. For boolean features, in general
5340 these will enable the feature. For non-boolean features, out of range
5341 values will in general be equivalent to a 0 value. However, in both cases
5342 the exact behavior will depend upon the way the font is designed
5343 (specifically, which type of lookup is used to define the feature).
5345 <p>Although specifically defined for OpenType feature tags, feature tags
5346 for other modern font formats that support font features may be added in
5347 the future. Where possible, features defined for other font formats should
5348 attempt to follow the pattern of registered OpenType tags.
5350 <div class=example>
5351 <p>The Japanese text below will be rendered with half-width kana
5352 characters:</p>
5354 <pre lang=ja>
5355 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
5357 <p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p>
5358 </pre>
5359 </div>
5361 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
5362 language override: the <a
5363 href="#propdef-font-language-override">font-language-override</a> property</h3>
5365 <table class=propdef id=namefont-language-overridevaluenormal-lt>
5366 <tbody>
5367 <tr>
5368 <td>Name:
5370 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
5372 <tr>
5373 <td>Value:
5375 <td><a href="#font-language-override-normal-value"
5376 title="normal!!font-language-override">normal</a> | <a
5377 href="#font-language-override-string-value"><var><string></var></a>
5379 <tr>
5380 <td>Initial:
5382 <td><a href="#font-language-override-normal-value"
5383 title="normal!!font-language-override">normal</a>
5385 <tr>
5386 <td>Applies to:
5388 <td>all elements
5390 <tr>
5391 <td>Inherited:
5393 <td>yes
5395 <tr>
5396 <td>Percentages:
5398 <td>N/A
5400 <tr>
5401 <td>Media:
5403 <td>visual
5405 <tr>
5406 <td>Computed value:
5408 <td>as specified
5410 <tr>
5411 <td>Animatable:
5413 <td>no
5414 </table>
5416 <p>Normally, authors can control the use of language-specific glyph
5417 substitutions and positioning by setting the content language of an
5418 element, as <a href="#language-specific-support">described above</a>:
5420 <pre><!-- Display text using S'gaw Karen specific features -->
5421 <p lang="ksw">...</p></pre>
5423 <p>In some cases, authors may need to specify a language system that
5424 differs from the content language, for example due to the need to mimic
5425 another language's typographic traditions. The ‘<a
5426 href="#propdef-font-language-override"><code
5427 class=property>font-language-override</code></a>’ property allows
5428 authors to explicitly specify the language system of the font, overriding
5429 the language system implied by the content language.
5431 <p>Values have the following meanings:
5433 <dl>
5434 <dt><dfn id=font-language-override-normal-value
5435 title="normal!!font-language-override">normal</dfn>
5437 <dd>specifies that when rendering with OpenType fonts, the content
5438 language of the element is used to infer the OpenType language system
5440 <dt><dfn
5441 id=font-language-override-string-value><var><string></var></dfn>
5443 <dd>single three-letter case-sensitive OpenType <a
5444 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
5445 system tag</a>, specifies the OpenType language system to be used instead
5446 of the language system implied by the language of the element
5447 </dl>
5448 <!-- For this level, string represents a single language code, there's no concept of "fallback"
5449 http://www.w3.org/2013/06/07-css-minutes.html#item04 -->
5451 <p>Use of invalid OpenType language system tags must not generate a parse
5452 error but must be ignored when doing glyph selection and placement.
5454 <div class=example>
5455 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
5456 Declaration of Human Rights</a> has been translated into a wide variety
5457 of languages. In Turkish, Article 9 of this document might be marked up
5458 as below:</p>
5460 <pre lang=tr><body lang="tr">
5462 <h4>Madde 9</h4>
5463 <p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.</p>
5464 </pre>
5466 <p>Here the user agent uses the value of the ‘<code
5467 class=property>lang</code>’ attribute when rendering text and
5468 appropriately renders this text without ‘<code
5469 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
5470 href="#propdef-font-language-override"><code
5471 class=property>font-language-override</code></a>’ property.</p>
5473 <p>However, a given font may lack support for a specific language. In this
5474 situation authors may need to use the typographic conventions of a
5475 related language that are supported by that font:</p>
5477 <pre lang=mk><body lang="mk"> <!-- Macedonian lang code -->
5479 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
5481 <h4>Члeн 9</h4>
5482 <p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
5484 </pre>
5486 <p>The Macedonian text here will be rendered using Serbian typographic
5487 conventions, with the assumption that the font specified supports
5488 Serbian.</p>
5489 </div>
5491 <p><a id=rendering-considerations></a>
5493 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
5494 Resolution</h2>
5496 <p>As described in the previous section, font features can be enabled in a
5497 variety of ways, either via the use of <a href="#propdef-font-variant"
5498 title="font-variant!!property">‘<code
5499 class=property>font-variant</code>’</a> or <a
5500 href="#propdef-font-feature-settings"
5501 title="font-feature-settings!!property">‘<code
5502 class=property>font-feature-settings</code>’</a> in a style rule or
5503 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5504 The resolution order for the union of these settings is defined below.
5505 Features defined via CSS properties are applied on top of layout engine
5506 default features.
5508 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
5510 <p>For OpenType fonts, user agents must enable the default features defined
5511 in the OpenType documentation for a given script and writing mode.
5512 Required ligatures, common ligatures and contextual forms must be enabled
5513 by default (OpenType features: <span class=tag>rlig, liga, clig,
5514 calt</span>), along with localized forms (OpenType feature: <span
5515 class=tag>locl</span>), and features required for proper display of
5516 composed characters and marks (OpenType features: <span class=tag>ccmp,
5517 mark, mkmk</span>). These features must always be enabled, even when the
5518 value of the <a href="#propdef-font-variant"
5519 title="font-variant!!property">‘<code
5520 class=property>font-variant</code>’</a> and <a
5521 href="#propdef-font-feature-settings"
5522 title="font-feature-settings!!property">‘<code
5523 class=property>font-feature-settings</code>’</a> properties is <span
5524 title="normal value">‘<code class=property>normal</code>’</span>.
5525 Individual features are only disabled when explicitly overridden by the
5526 author, as when ‘<a href="#propdef-font-variant-ligatures"><code
5527 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
5528 href="#no-common-ligatures"><code
5529 class=property>no-common-ligatures</code></a>’. For handling complex
5530 scripts such as <a
5531 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
5532 <a
5533 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
5534 or <a
5535 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
5536 additional features are required. For upright text within vertical text
5537 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
5538 must be enabled.
5540 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
5542 <p>General and <a href="#font-specific"><em>font specific</em></a> font
5543 feature property settings are resolved in the order below, in ascending
5544 order of precedence. This ordering is used to construct a combined list of
5545 font features that affect a given text run.
5547 <ol>
5548 <li>Font features enabled by default, including features required for a
5549 given script.
5551 <li>If the font is defined via an <a
5552 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5553 features implied by the font-variant descriptor in the <a
5554 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5556 <li>If the font is defined via an <a
5557 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5558 features implied by the font-feature-settings descriptor in the <a
5559 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5561 <li>Font features implied by the value of the <a
5562 href="#propdef-font-variant" title="font-variant!!property">‘<code
5563 class=property>font-variant</code>’</a> property, the related <a
5564 href="#propdef-font-variant" title="font-variant!!property">‘<code
5565 class=property>font-variant</code>’</a> subproperties and any other CSS
5566 property that uses OpenType features (e.g. the ‘<a
5567 href="#propdef-font-kerning"><code
5568 class=property>font-kerning</code></a>’ property).</li>
5569 <!-- other CSS props override 'font-variant' but not 'font-feature-settings' -->
5570 <!-- http://lists.w3.org/Archives/Public/www-style/2013Aug/0110.html -->
5572 <li>Feature settings determined by properties other than <a
5573 href="#propdef-font-variant" title="font-variant!!property">‘<code
5574 class=property>font-variant</code>’</a> or <a
5575 href="#propdef-font-feature-settings"
5576 title="font-feature-settings!!property">‘<code
5577 class=property>font-feature-settings</code>’</a>. For example, setting
5578 a non-default value for the ‘<code
5579 class=property>letter-spacing</code>’ property disables common
5580 ligatures.
5582 <li>Font features implied by the value of <a
5583 href="#propdef-font-feature-settings"
5584 title="font-feature-settings!!property">‘<code
5585 class=property>font-feature-settings</code>’</a> property.
5586 </ol>
5588 <p>This ordering allows authors to set up a general set of defaults for
5589 fonts within their <a
5590 href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
5591 them with property settings for specific elements. General property
5592 settings override the settings in <a
5593 href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
5594 font feature settings override <a href="#propdef-font-variant"
5595 title="font-variant!!property">‘<code
5596 class=property>font-variant</code>’</a> property settings.
5598 <p>For situations where the combined list of font feature settings contains
5599 more than one value for the same feature, the last value is used. When a
5600 font lacks support for a given underlying font feature, text is simply
5601 rendered as if that font feature was not enabled; font fallback does not
5602 occur and no attempt is made to synthesize the feature except where
5603 explicitly defined for specific properties.
5605 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
5606 precedence examples</h3>
5608 <div class=example>
5609 <p>With the styles below, numbers are rendered proportionally when used
5610 within a paragraph but are shown in tabular form within tables of prices:</p>
5612 <pre>body {
5613 font-variant-numeric: proportional-nums;
5614 }
5616 table.prices td {
5617 font-variant-numeric: tabular-nums;
5618 }
5619 </pre>
5620 </div>
5622 <div class=example>
5623 <p>When the <a href="#descdef-font-variant"
5624 title="font-variant!!descriptor">font-variant</a> descriptor is used
5625 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
5626 it only applies to the font defined by that rule.</p>
5628 <pre>@font-face {
5629 font-family: MainText;
5630 src: url(http://example.com/font.ttf);
5631 font-variant: oldstyle-nums proportional-nums styleset(1,3);
5632 }
5634 body {
5635 font-family: MainText, Helvetica;
5636 }
5638 table.prices td {
5639 font-variant-numeric: tabular-nums;
5640 }
5641 </pre>
5643 <p>In this case, old-style numerals will be used throughout but only where
5644 the font "MainText" is used. Just as in the previous example, tabular
5645 values will be used in price tables since ‘<a
5646 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
5647 appears in a general style rule and its use is mutually exclusive with
5648 ‘<a href="#proportional-nums"><code
5649 class=property>proportional-nums</code></a>’. Stylistic alternate sets
5650 will only be used where MainText is used.</p>
5651 </div>
5653 <div class=example>
5654 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
5655 also be used to access font features in locally available fonts via the
5656 use of <code>local()</code> in the ‘<a href="#descdef-src"><code
5657 class=property>src</code></a>’ descriptor of the <a
5658 href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
5660 <pre>@font-face {
5661 font-family: BodyText;
5662 src: local("HiraMaruPro-W4");
5663 font-variant: proportional-width;
5664 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
5665 }
5667 body { font-family: BodyText, serif; }
5668 </pre>
5670 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
5671 text rendering occurs, Japanese kana will be proportionally spaced and
5672 Latin text will be italicised. Text rendered with the fallback serif font
5673 will use default rendering properties.</p>
5674 </div>
5676 <div class=example>
5677 <p>In the example below, discretionary ligatures are enabled only for a
5678 downloadable font but are disabled within spans of class "special":</p>
5680 <pre>@font-face {
5681 font-family: main;
5682 src: url(fonts/ffmeta.woff) format("woff");
5683 font-variant: discretionary-ligatures;
5684 }
5686 body { font-family: main, Helvetica; }
5687 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5688 </pre>
5690 <p>Suppose one adds a rule using ‘<code
5691 class=property>font-feature-settings</code>’ to enable discretionary
5692 ligatures:</p>
5694 <pre>body { font-family: main, Helvetica; }
5695 span { font-feature-settings: "dlig"; }
5696 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5697 </pre>
5699 <p>In this case, discretionary ligatures <em>will</em> be rendered within
5700 spans of class "special". This is because both the <a
5701 href="#propdef-font-feature-settings"
5702 title="font-feature-settings!!property">‘<code
5703 class=property>font-feature-settings</code>’</a> and ‘<a
5704 href="#propdef-font-variant-ligatures"><code
5705 class=property>font-variant-ligatures</code></a>’ properties apply to
5706 these spans. Although the ‘<code class=css>no-discretionary
5707 ligatures</code>’ setting of ‘<a
5708 href="#propdef-font-variant-ligatures"><code
5709 class=property>font-variant-ligatures</code></a>’ effectively disables
5710 the OpenType <span class=tag>dlig</span> feature, because the <a
5711 href="#propdef-font-feature-settings"
5712 title="font-feature-settings!!property">‘<code
5713 class=property>font-feature-settings</code>’</a> is resolved after
5714 that, the ‘<code class=property>dlig</code>’ value reenables
5715 discretionary ligatures.</p>
5716 </div>
5718 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
5720 <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
5721 and <a
5722 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5723 rules can be accessed via the following extensions to the CSS Object
5724 Model.
5726 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
5727 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
5729 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
5730 <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5732 <pre class=idl>
5733 interface CSSFontFaceRule : CSSRule {
5734 attribute DOMString family;
5735 attribute DOMString src;
5736 attribute DOMString style;
5737 attribute DOMString weight;
5738 attribute DOMString stretch;
5739 attribute DOMString unicodeRange;
5740 attribute DOMString variant;
5741 attribute DOMString featureSettings;
5742 }</pre>
5744 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
5745 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
5746 defined a different variant of this rule. This definition supercedes that
5747 one.
5749 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
5750 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5751 interface</h3>
5753 <p>The <code>CSSRule</code> interface is extended as follows:
5755 <pre class=idl>partial interface CSSRule {
5756 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
5757 }</pre>
5759 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
5760 interface represents a <a
5761 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5762 rule.
5764 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
5765 attribute DOMString fontFamily;
5766 readonly attribute CSSFontFeatureValuesMap annotation;
5767 readonly attribute CSSFontFeatureValuesMap ornaments;
5768 readonly attribute CSSFontFeatureValuesMap stylistic;
5769 readonly attribute CSSFontFeatureValuesMap swash;
5770 readonly attribute CSSFontFeatureValuesMap characterVariant;
5771 readonly attribute CSSFontFeatureValuesMap styleset;
5772 }
5774 [MapClass(DOMString, sequence<unsigned long>)]
5775 interface CSSFontFeatureValuesMap {
5776 void set(DOMString featureValueName,
5777 (unsigned long or sequence<unsigned long>) values);
5778 }</pre>
5780 <dl class=idl-attributes>
5781 <dt><var>fontFamily</var> of type <code>DOMString</code>
5783 <dd>The list of one or more font families for which a given set of feature
5784 values is defined.
5786 <dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
5788 <dd>Maps of feature values associated with feature value names for a given
5789 ‘<a href="#propdef-font-variant-alternates"><code
5790 class=property>font-variant-alternates</code></a>’ value type
5791 </dl>
5793 <p>Each value map attribute of <a
5794 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5795 reflects the values defined via a corresponding <a
5796 href="#featurevalueblock"><i title="feature_value_block">feature value
5797 block</i></a>. Thus, the <var title="annotation
5798 attribute">annotation</var> attribute contains the values contained within
5799 a <code title="@annotation">@annotation</code> <a
5800 href="#featurevalueblock"><i title="feature_value_block">feature value
5801 block</i></a>, the <var title="ornaments attribute">ornaments</var>
5802 attribute contains the values contained with a <code
5803 title="@ornaments">@ornaments</code> <a href="#featurevalueblock"><i
5804 title="feature_value_block">feature value block</i></a> and so forth.
5806 <p>The <code>CSSFontFeatureValuesMap</code> interface uses the <a
5807 href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map
5808 class methods</a> but the <code>set</code> method has different behavior.
5809 It takes a sequence of unsigned integers and associates it with a given
5810 <code>featureValueName</code>. The method behaves the same as the default
5811 map class method except that a single unsigned long value is treated as a
5812 sequence of a single value. The method throws an exception if an invalid
5813 number of values is passed in. If the associated <a
5814 href="#featurevalueblock"><i title="feature_value_block">feature value
5815 block</i></a> only allows a limited number of values, the <code>set</code>
5816 method throws an <code>InvalidAccessError</code> exception when the input
5817 sequence to <code>set</code> contains more than the limited number of
5818 values. See the description of <a
5819 href="#multi-valued-feature-value-definitions">multi-valued feature value
5820 definitions</a> for details on the maximum number of values allowed for a
5821 given type of <a href="#featurevalueblock"><i
5822 title="feature_value_block">feature value block</i></a>. The
5823 <code>get</code> method always returns a sequence of values, even if the
5824 sequence only contains a single value.
5826 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
5827 properties to CSS properties</h2>
5829 <p><em>This appendix is included as background for some of the problems and
5830 situations that are described in other sections. It should be viewed as
5831 informative only.</em>
5833 <p>Font properties in CSS are designed to be independent of the underlying
5834 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
5835 SVG fonts in addition to the common TrueType and OpenType fonts. But there
5836 are facets of the TrueType and OpenType formats that often cause confusion
5837 for authors and present challenges to implementers on different platforms.
5839 <p>Originally developed at Apple, TrueType was designed as an outline font
5840 format for both screen and print. Microsoft joined Apple in developing the
5841 TrueType format and both platforms have supported TrueType fonts since
5842 then. Font data in the TrueType format consists of a set of tables
5843 distinguished with common four-letter tag names, each containing a
5844 specific type of data. For example, naming information, including
5845 copyright and license information, is stored in the ‘<code
5846 class=property>name</code>’ table. The <a
5847 href="#character-map"><em>character map</em></a> (‘<code
5848 class=property>cmap</code>’) table contains a mapping of character
5849 encodings to glyphs. Apple later added additional tables for supporting
5850 enhanced typographic functionality; these are now called Apple Advanced
5851 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
5852 tables for advanced typography and called their format OpenType <a
5853 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
5855 <p>In many cases the font data used under Microsoft Windows or Linux is
5856 slightly different from the data used under Apple's Mac OS X because the
5857 TrueType format allowed for explicit variation across platforms. This
5858 includes font metrics, names and <a href="#character-map"><em>character
5859 map</em></a> data.
5861 <p>Specifically, font family name data is handled differently across
5862 platforms. For TrueType and OpenType fonts these names are contained in
5863 the ‘<code class=property>name</code>’ table, in name records with
5864 name ID 1. Mulitple names can be stored for different locales, but
5865 Microsoft recommends fonts always include at least a US English version of
5866 the name. On Windows, Microsoft made the decision for backwards
5867 compatibility to limit this family name to a maximum of four faces; for
5868 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
5869 ID 21) can be used. Other platforms such as OSX don't have this
5870 limitation, so the family name is used to define all possible groupings.
5872 <p>Other name table data provides names used to uniquely identify a
5873 specific face within a family. The full font name (name ID 4) and the
5874 Postscript name (name ID 6) describe a single face uniquely. For example,
5875 the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
5876 and a Postscript name of "GillSans-Bold". There can be multiple localized
5877 versions of the fullname for a given face, but the Postscript name is
5878 always a unique name made from a limited set of ASCII characters.
5880 <p>On various platforms, different names are used to search for a font. For
5881 example, with the Windows GDI CreateIndirectFont API, either a family or
5882 fullname can be used to lookup a face, while on Mac OS X the
5883 CTFontCreateWithName API call is used to lookup a given face using the
5884 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
5885 to be searched using any of these names. In situations where platform
5886 API's automatically substitute other font choices, it may be necessary to
5887 verify a returned font matches a given name.
5889 <p>The weight of a given face can be determined via the usWeightClass field
5890 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
5891 the width can be determined via the usWidthClass of the OS/2 table or
5892 inferred from the style name. For historical reasons related to synthetic
5893 bolding at weights 200 or lower with the Windows GDI API, font designers
5894 have sometimes skewed values in the OS/2 table to avoid these weights.
5896 <p>Rendering complex scripts that use contextual shaping such as Thai,
5897 Arabic and Devanagari requires features present only in OpenType or AAT
5898 fonts. Currently, complex script rendering is supported on Windows and
5899 Linux using OpenType font features while both OpenType and AAT font
5900 features are used under Mac OS X.
5902 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
5904 <h3 class=no-num id=recent-changes> Changes from the <a
5905 href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">July 2013 CSS3
5906 Fonts Last Call Working Draft</a></h3>
5908 <p>Major changes include:
5910 <ul>
5911 <li>reorder feature precedence such that features implied by other CSS
5912 properties override ‘<code class=property>font-variant</code>’
5913 settings
5914 </ul>
5916 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
5918 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
5919 their help and feedback. John Hudson was kind enough to take the time to
5920 explain the subtleties of OpenType language tags and provided the example
5921 of character variant usage for displaying text on Byzantine seals. Ken
5922 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
5923 and Unicode variation selectors. The idea for supporting font features by
5924 using <a href="#propdef-font-variant"
5925 title="font-variant!!property">‘<code
5926 class=property>font-variant</code>’</a> subproperties originated with
5927 Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
5928 of the initial design ideas for the <a
5929 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5930 rule. Thanks also to House Industries for allowing the use of Ed Interlock
5931 in the discretionary ligatures example.
5933 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
5934 that is <em>The Elements of Typographic Style</em>.
5936 <h2 class=no-num id=conformance> Conformance</h2>
5938 <h3 class=no-num id=conventions> Document Conventions</h3>
5940 <p>Conformance requirements are expressed with a combination of descriptive
5941 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
5942 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
5943 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
5944 normative parts of this document are to be interpreted as described in RFC
5945 2119. However, for readability, these words do not appear in all uppercase
5946 letters in this specification.
5948 <p>All of the text of this specification is normative except sections
5949 explicitly marked as non-normative, examples, and notes. <a
5950 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
5952 <p>Examples in this specification are introduced with the words “for
5953 example” or are set apart from the normative text with
5954 <code>class="example"</code>, like this:
5956 <div class=example>
5957 <p>This is an example of an informative example.
5958 </div>
5960 <p>Informative notes begin with the word “Note” and are set apart from
5961 the normative text with <code>class="note"</code>, like this:
5963 <p class=note>Note, this is an informative note.
5965 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
5967 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
5968 classes:
5970 <dl>
5971 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
5972 sheet</dfn>
5974 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
5975 style sheet</a>.
5977 <dt><dfn id=renderer>renderer</dfn>
5979 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5980 that interprets the semantics of a style sheet and renders documents that
5981 use them.
5983 <dt><dfn id=authoring-tool>authoring tool</dfn>
5985 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5986 that writes a style sheet.
5987 </dl>
5989 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
5990 declarations that use properties defined in this module have values that
5991 are valid according to the generic CSS grammar and the individual grammars
5992 of each property as given in this module.
5994 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
5995 interpreting the style sheet as defined by the appropriate specifications,
5996 it supports all the features defined by CSS Fonts Level 3 Module by
5997 parsing them correctly and rendering the document accordingly. However,
5998 the inability of a UA to correctly render a document due to limitations of
5999 the device does not make the UA non-conformant. (For example, a UA is not
6000 required to render color on a monochrome monitor.)
6002 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
6003 style sheets that are syntactically correct according to the generic CSS
6004 grammar and the individual grammars of each feature in this module, and
6005 meet all other conformance requirements of style sheets as described in
6006 this module.
6008 <h3 class=no-num id=partial> Partial Implementations</h3>
6010 <p>So that authors can exploit the forward-compatible parsing rules to
6011 assign fallback values, CSS renderers <strong>must</strong> treat as
6012 invalid (and <a
6013 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
6014 appropriate</a>) any at-rules, properties, property values, keywords, and
6015 other syntactic constructs for which they have no usable level of support.
6016 In particular, user agents <strong>must not</strong> selectively ignore
6017 unsupported component values and honor supported values in a single
6018 multi-value property declaration: if any value is considered invalid (as
6019 unsupported values must be), CSS requires that the entire declaration be
6020 ignored.
6022 <h3 class=no-num id=experimental> Experimental Implementations</h3>
6024 <p>To avoid clashes with future CSS features, the CSS2.1 specification
6025 reserves a <a
6026 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
6027 syntax</a> for proprietary and experimental extensions to CSS.
6029 <p>Prior to a specification reaching the Candidate Recommendation stage in
6030 the W3C process, all implementations of a CSS feature are considered
6031 experimental. The CSS Working Group recommends that implementations use a
6032 vendor-prefixed syntax for such features, including those in W3C Working
6033 Drafts. This avoids incompatibilities with future changes in the draft.
6035 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
6037 <p>Once a specification reaches the Candidate Recommendation stage,
6038 non-experimental implementations are possible, and implementors should
6039 release an unprefixed implementation of any CR-level feature they can
6040 demonstrate to be correctly implemented according to spec.
6042 <p>To establish and maintain the interoperability of CSS across
6043 implementations, the CSS Working Group requests that non-experimental CSS
6044 renderers submit an implementation report (and, if necessary, the
6045 testcases used for that implementation report) to the W3C before releasing
6046 an unprefixed implementation of any CSS features. Testcases submitted to
6047 W3C are subject to review and correction by the CSS Working Group.
6049 <p>Further information on submitting testcases and implementation reports
6050 can be found from on the CSS Working Group's website at <a
6051 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
6052 Questions should be directed to the <a
6053 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
6054 mailing list.
6056 <h2 class=no-num id=references>References</h2>
6058 <h3 class=no-num id=normative-references>Normative References</h3>
6059 <!--begin-normative-->
6060 <!-- Sorted by label -->
6062 <dl class=bibliography>
6063 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6064 <!---->
6066 <dt id=CHARMOD>[CHARMOD]
6068 <dd>Martin J. Dürst; et al. <a
6069 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
6070 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
6071 2005. W3C Recommendation. URL: <a
6072 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
6073 </dd>
6074 <!---->
6076 <dt id=CORS>[CORS]
6078 <dd>Anne van Kesteren. <a
6079 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
6080 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
6081 Recommendation. (Work in progress.) URL: <a
6082 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
6083 </dd>
6084 <!---->
6086 <dt id=CSS21>[CSS21]
6088 <dd>Bert Bos; et al. <a
6089 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
6090 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
6091 2011. W3C Recommendation. URL: <a
6092 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
6093 </dd>
6094 <!---->
6096 <dt id=CSS3VAL>[CSS3VAL]
6098 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
6099 href="http://www.w3.org/TR/2013/CR-css3-values-20130404/"><cite>CSS
6100 Values and Units Module Level 3.</cite></a> 4 April 2013. W3C Candidate
6101 Recommendation. (Work in progress.) URL: <a
6102 href="http://www.w3.org/TR/2013/CR-css3-values-20130404/">http://www.w3.org/TR/2013/CR-css3-values-20130404/</a>
6103 </dd>
6104 <!---->
6106 <dt id=HTML5>[HTML5]
6108 <dd>Ian Hickson. <a
6109 href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
6110 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
6111 <a
6112 href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
6113 </dd>
6114 <!---->
6116 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
6118 <dd><a
6119 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136"><cite>Information
6120 technology — Coding of audio-visual objects — Part 22: Open Font
6121 Format.</cite></a> International Organization for Standardization.
6122 ISO/IEC 14496-22:2009. URL: <a
6123 href="http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136">http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=52136</a>
6124 </dd>
6125 <!---->
6127 <dt id=OPENTYPE>[OPENTYPE]
6129 <dd><a
6130 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
6131 specification.</cite></a> Microsoft. URL: <a
6132 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
6133 </dd>
6134 <!---->
6136 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
6138 <dd><a
6139 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
6140 feature registry.</cite></a> Microsoft. URL: <a
6141 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
6142 </dd>
6143 <!---->
6145 <dt id=RFC2119>[RFC2119]
6147 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
6148 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
6149 RFC 2119. URL: <a
6150 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
6151 </dd>
6152 <!---->
6154 <dt id=UAX15>[UAX15]
6156 <dd>Mark Davis; Ken Whistler. <a
6157 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
6158 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
6159 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
6160 </dd>
6161 <!---->
6163 <dt id=UAX29>[UAX29]
6165 <dd>Mark Davis. <a
6166 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
6167 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
6168 URL: <a
6169 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
6170 </dd>
6171 <!---->
6173 <dt id=UNICODE6>[UNICODE6]
6175 <dd>The Unicode Consortium. <a
6176 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
6177 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
6178 Version 6.2.0 URL: <a
6179 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
6180 </dd>
6181 <!---->
6182 </dl>
6183 <!--end-normative-->
6184 <!--{{!CSS21}}-->
6185 <!--{{!CSS3VAL}}-->
6186 <!--{{!OPENTYPE}}-->
6187 <!--{{!OPENTYPE-FEATURES}}-->
6188 <!--{{!OPEN-FONT-FORMAT}}-->
6189 <!--{{!UNICODE6}}-->
6190 <!--{{!UAX15}}-->
6191 <!--{{!UAX29}}-->
6192 <!--{{!CORS}}-->
6193 <!--{{!HTML5}}-->
6194 <!--{{!CHARMOD}}-->
6196 <h3 class=no-num id=other-references>Other References</h3>
6197 <!--begin-informative-->
6198 <!-- Sorted by label -->
6200 <dl class=bibliography>
6201 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6202 <!---->
6204 <dt id=AAT-FEATURES>[AAT-FEATURES]
6206 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
6207 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
6208 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
6209 </dd>
6210 <!---->
6212 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
6214 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
6215 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
6216 <!---->
6218 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
6220 <dd>François Yergeau; et al. <a
6221 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
6222 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
6223 W3C Working Draft. (Work in progress.) URL: <a
6224 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
6225 </dd>
6226 <!---->
6228 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
6230 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
6231 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
6232 <!---->
6234 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
6236 <dd>L. David Baron. <a
6237 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/"><cite>CSS
6238 Conditional Rules Module Level 3.</cite></a> 4 April 2013. W3C Candidate
6239 Recommendation. (Work in progress.) URL: <a
6240 href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/">http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a>
6241 </dd>
6242 <!---->
6244 <dt id=CSS3TEXT>[CSS3TEXT]
6246 <dd>Elika J. Etemad; Koji Ishii. <a
6247 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
6248 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
6249 progress.) URL: <a
6250 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
6251 </dd>
6252 <!---->
6254 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
6256 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
6257 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
6258 ISBN 0-201-17633-5.</dd>
6259 <!---->
6261 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
6263 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
6264 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
6265 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
6266 2000. W3C Recommendation. URL: <a
6267 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/">http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/</a>
6268 </dd>
6269 <!---->
6271 <dt id=ELEMTYPO>[ELEMTYPO]
6273 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
6274 4.</cite> Hartley & Marks. 2013. ISBN 0-88179-212-8.</dd>
6275 <!---->
6277 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
6279 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
6280 ISBN 1-932026-01-0.</dd>
6281 <!---->
6283 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
6285 <dd><a
6286 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
6287 User Guide.</cite></a> FontShop International. URL: <a
6288 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
6289 </dd>
6290 <!---->
6292 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
6294 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
6295 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
6296 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
6297 <!---->
6299 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
6301 <dd>John Hudson. <a
6302 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
6303 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
6304 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
6305 </dd>
6306 <!---->
6307 </dl>
6308 <!--end-informative-->
6309 <!--{{ARABIC-TYPO}}-->
6310 <!--{{CJKV-INFO-PROCESSING}}-->
6311 <!--{{DIGITAL-TYPOGRAPHY}}-->
6312 <!--{{DOM-LEVEL-2-STYLE}}-->
6313 <!--{{ELEMTYPO}}-->
6314 <!--{{LANGCULTTYPE}}-->
6315 <!--{{OPENTYPE-FONT-GUIDE}}-->
6316 <!--{{RASTER-TRAGEDY}}-->
6317 <!--{{WINDOWS-GLYPH-PROC}}-->
6318 <!--{{CHARMOD-NORM}}-->
6319 <!--{{AAT-FEATURES}}-->
6320 <!--{{CSS3-CONDITIONAL}}-->
6321 <!--{{CSS3TEXT}}-->
6323 <h2 class=no-num id=index>Index</h2>
6324 <!--begin-index-->
6326 <ul class=indexlist>
6327 <li>100...900 weight values, <a href="#font-weight-numeric-values"
6328 title="100...900 weight values"><strong>3.2</strong></a>
6330 <li><var><absolute-size></var>, <a href="#absolute-size-value"
6331 title="<absolute-size>"><strong>3.5</strong></a>
6333 <li><var><common-lig-values></var>, <a href="#common-lig-values"
6334 title="<common-lig-values>"><strong>6.4</strong></a>
6336 <li><var><contextual-alt-values></var>, <a
6337 href="#contextual-alt-values"
6338 title="<contextual-alt-values>"><strong>6.4</strong></a>
6340 <li><var><discretionary-lig-values></var>, <a
6341 href="#discretionary-lig-values"
6342 title="<discretionary-lig-values>"><strong>6.4</strong></a>
6344 <li><var><east-asian-variant-values></var>, <a
6345 href="#east-asian-variant-values"
6346 title="<east-asian-variant-values>"><strong>6.10</strong></a>
6348 <li><var><east-asian-width-values></var>, <a
6349 href="#east-asian-width-values"
6350 title="<east-asian-width-values>"><strong>6.10</strong></a>
6352 <li><var><family-name></var>, <a href="#family-name-value"
6353 title="<family-name>"><strong>3.1</strong></a>
6355 <li><var><feature-tag-value></var>, <a href="#feature-tag-value"
6356 title="<feature-tag-value>"><strong>6.12</strong></a>
6358 <li><var><font-face-name></var>, <a href="#font-face-name-value"
6359 title="<font-face-name>"><strong>4.3</strong></a>
6361 <li><var><font-variant-css21></var>, <a
6362 href="#font-variant-css21-values"
6363 title="<font-variant-css21>"><strong>3.7</strong></a>
6365 <li><var><generic-family></var>, <a href="#generic-family-value"
6366 title="<generic-family>"><strong>3.1</strong></a>
6368 <li><var><historical-lig-values></var>, <a
6369 href="#historical-lig-values"
6370 title="<historical-lig-values>"><strong>6.4</strong></a>
6372 <li><var><length></var>, <a href="#length-size-value"
6373 title="<length>"><strong>3.5</strong></a>
6375 <li><var><number></var>, <a href="#aspect-ratio-value"
6376 title="<number>"><strong>3.6</strong></a>
6378 <li><var><numeric-figure-values></var>, <a
6379 href="#numeric-figure-values"
6380 title="<numeric-figure-values>"><strong>6.7</strong></a>
6382 <li><var><numeric-fraction-values></var>, <a
6383 href="#numeric-fraction-values"
6384 title="<numeric-fraction-values>"><strong>6.7</strong></a>
6386 <li><var><numeric-spacing-values></var>, <a
6387 href="#numeric-spacing-values"
6388 title="<numeric-spacing-values>"><strong>6.7</strong></a>
6390 <li><var><percentage></var>, <a href="#percentage-size-value"
6391 title="<percentage>"><strong>3.5</strong></a>
6393 <li><var><relative-size></var>, <a href="#relative-size-value"
6394 title="<relative-size>"><strong>3.5</strong></a>
6396 <li><var><string></var>, <a
6397 href="#font-language-override-string-value"
6398 title="<string>"><strong>6.13</strong></a>
6400 <li><var><urange></var>, <a href="#urange-value"
6401 title="<urange>"><strong>4.5</strong></a>
6403 <li><code>@font-face</code>, <a href="#at-font-face-rule"
6404 title="@font-face"><strong>4.1</strong></a>
6406 <li><code>@font-feature-values</code>, <a
6407 href="#at-font-feature-values-rule"
6408 title="@font-feature-values"><strong>6.9</strong></a>
6410 <li>all-petite-caps, <a href="#all-petite-caps"
6411 title=all-petite-caps><strong>6.6</strong></a>
6413 <li>all-small-caps, <a href="#all-small-caps"
6414 title=all-small-caps><strong>6.6</strong></a>
6416 <li>annotation, <a href="#annotation"
6417 title=annotation><strong>6.8</strong></a>
6419 <li>aspect value, <a href="#aspect-value0" title="aspect
6420 value"><strong>3.6</strong></a>
6422 <li>authoring tool, <a href="#authoring-tool" title="authoring
6423 tool"><strong>#</strong></a>
6425 <li>auto
6426 <ul>
6427 <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
6428 font-kerning"><strong>6.3</strong></a>
6430 <li>font-size-adjust, <a href="#font-size-adjust-auto-value"
6431 title="auto, font-size-adjust"><strong>3.6</strong></a>
6432 </ul>
6434 <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
6436 <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
6438 <li>character map, <a href="#character-map" title="character
6439 map"><strong>5.2</strong></a>
6441 <li>character-variant, <a href="#character-variant"
6442 title=character-variant><strong>6.8</strong></a>
6444 <li>common-ligatures, <a href="#common-ligatures"
6445 title=common-ligatures><strong>6.4</strong></a>
6447 <li>composite face, <a href="#composite-face" title="composite
6448 face"><strong>5.2</strong></a>
6450 <li>condensed, <a href="#condensed"
6451 title=condensed><strong>3.3</strong></a>
6453 <li>contextual, <a href="#contextual"
6454 title=contextual><strong>6.4</strong></a>
6456 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
6457 title=CSSFontFaceRule><strong>8.1</strong></a>
6459 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
6460 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
6462 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
6463 of"><strong>#</strong></a>
6465 <li>default face, <a href="#default-face" title="default
6466 face"><strong>5.2</strong></a>
6468 <li>descriptor_declaration, <a href="#descriptordeclaration"
6469 title="descriptor_declaration"><strong>4.1</strong></a>
6471 <li>diagonal-fractions, <a href="#diagonal-fractions"
6472 title=diagonal-fractions><strong>6.7</strong></a>
6474 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
6475 title=discretionary-ligatures><strong>6.4</strong></a>
6477 <li>effective character map, <a href="#effective-character-map"
6478 title="effective character map"><strong>4.5</strong></a>
6480 <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
6482 <li>extra-condensed, <a href="#extra-condensed"
6483 title=extra-condensed><strong>3.3</strong></a>
6485 <li>extra-expanded, <a href="#extra-expanded"
6486 title=extra-expanded><strong>3.3</strong></a>
6488 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
6489 of"><strong>#</strong></a>
6491 <li>feature_type, <a href="#featuretype"
6492 title="feature_type"><strong>6.9.1</strong></a>
6494 <li>feature_value_block, <a href="#featurevalueblock"
6495 title="feature_value_block"><strong>6.9.1</strong></a>
6497 <li>feature_value_definition, <a href="#featurevaluedefinition"
6498 title="feature_value_definition"><strong>6.9.1</strong></a>
6500 <li>first available font, <a href="#first-available-font" title="first
6501 available font"><strong>5.2</strong></a>
6503 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
6505 <li>font specific, <a href="#font-specific" title="font
6506 specific"><strong>6.8</strong></a>
6508 <li>font-family
6509 <ul>
6510 <li>descriptor, <a href="#descdef-font-family" title="font-family,
6511 descriptor"><strong>4.2</strong></a>
6513 <li>property, <a href="#propdef-font-family" title="font-family,
6514 property"><strong>3.1</strong></a>
6515 </ul>
6517 <li>font-feature-settings
6518 <ul>
6519 <li>descriptor, <a href="#descdef-font-feature-settings"
6520 title="font-feature-settings, descriptor"><strong>4.7</strong></a>
6522 <li>property, <a href="#propdef-font-feature-settings"
6523 title="font-feature-settings, property"><strong>6.12</strong></a>
6524 </ul>
6526 <li>font-kerning, <a href="#propdef-font-kerning"
6527 title=font-kerning><strong>6.3</strong></a>
6529 <li>font-language-override, <a href="#propdef-font-language-override"
6530 title=font-language-override><strong>6.13</strong></a>
6532 <li>font-size, <a href="#propdef-font-size"
6533 title=font-size><strong>3.5</strong></a>
6535 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
6536 title=font-size-adjust><strong>3.6</strong></a>
6538 <li>font-stretch
6539 <ul>
6540 <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
6541 descriptor"><strong>4.4</strong></a>
6543 <li>property, <a href="#propdef-font-stretch" title="font-stretch,
6544 property"><strong>3.3</strong></a>
6545 </ul>
6547 <li>font-style
6548 <ul>
6549 <li>descriptor, <a href="#descdef-font-style" title="font-style,
6550 descriptor"><strong>4.4</strong></a>
6552 <li>property, <a href="#propdef-font-style" title="font-style,
6553 property"><strong>3.4</strong></a>
6554 </ul>
6556 <li>font-synthesis, <a href="#propdef-font-synthesis"
6557 title=font-synthesis><strong>3.8</strong></a>
6559 <li>font-variant
6560 <ul>
6561 <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
6562 descriptor"><strong>4.7</strong></a>
6564 <li>property, <a href="#propdef-font-variant" title="font-variant,
6565 property"><strong>6.11</strong></a>
6566 </ul>
6568 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
6569 title=font-variant-alternates><strong>6.8</strong></a>
6571 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
6572 title=font-variant-caps><strong>6.6</strong></a>
6574 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
6575 title=font-variant-east-asian><strong>6.10</strong></a>
6577 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
6578 title=font-variant-ligatures><strong>6.4</strong></a>
6580 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
6581 title=font-variant-numeric><strong>6.7</strong></a>
6583 <li>font-variant-position, <a href="#propdef-font-variant-position"
6584 title=font-variant-position><strong>6.5</strong></a>
6586 <li>font-weight
6587 <ul>
6588 <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
6589 descriptor"><strong>4.4</strong></a>
6591 <li>property, <a href="#propdef-font-weight" title="font-weight,
6592 property"><strong>3.2</strong></a>
6593 </ul>
6595 <li>font_face_rule, <a href="#fontfacerule"
6596 title="font_face_rule"><strong>4.1</strong></a>
6598 <li>FONT_FACE_SYM, <a href="#fontfacesym"
6599 title="FONT_FACE_SYM"><strong>4.1</strong></a>
6601 <li>font_family_name, <a href="#fontfamilyname"
6602 title="font_family_name"><strong>6.9.1</strong></a>
6604 <li>font_family_name_list, <a href="#fontfamilynamelist"
6605 title="font_family_name_list"><strong>6.9.1</strong></a>
6607 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
6608 title="font_feature_values_rule"><strong>6.9.1</strong></a>
6610 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
6611 title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
6613 <li>full-width, <a href="#full-width"
6614 title=full-width><strong>6.10</strong></a>
6616 <li>historical-forms, <a href="#historical-forms"
6617 title=historical-forms><strong>6.8</strong></a>
6619 <li>historical-ligatures, <a href="#historical-ligatures"
6620 title=historical-ligatures><strong>6.4</strong></a>
6622 <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
6624 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
6626 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
6628 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
6630 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
6632 <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
6634 <li>lining-nums, <a href="#lining-nums"
6635 title=lining-nums><strong>6.7</strong></a>
6637 <li>monospace, definition of, <a href="#monospace0" title="monospace,
6638 definition of"><strong>#</strong></a>
6640 <li>no-common-ligatures, <a href="#no-common-ligatures"
6641 title=no-common-ligatures><strong>6.4</strong></a>
6643 <li>no-contextual, <a href="#no-contextual"
6644 title=no-contextual><strong>6.4</strong></a>
6646 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
6647 title=no-discretionary-ligatures><strong>6.4</strong></a>
6649 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
6650 title=no-historical-ligatures><strong>6.4</strong></a>
6652 <li>none
6653 <ul>
6654 <li>font-kerning, <a href="#font-kerning-none-value" title="none,
6655 font-kerning"><strong>6.3</strong></a>
6657 <li>font-size-adjust, <a href="#font-size-adjust-none-value"
6658 title="none, font-size-adjust"><strong>3.6</strong></a>
6660 <li>font-variant, <a href="#font-variant-none-value" title="none,
6661 font-variant"><strong>6.11</strong></a>
6663 <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
6664 title="none, font-variant-ligatures"><strong>6.4</strong></a>
6665 </ul>
6667 <li>normal
6668 <ul>
6669 <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
6670 title="normal, font-feature-settings"><strong>6.12</strong></a>
6672 <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
6673 font-kerning"><strong>6.3</strong></a>
6675 <li>font-language-override, <a
6676 href="#font-language-override-normal-value" title="normal,
6677 font-language-override"><strong>6.13</strong></a>
6679 <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
6680 font-stretch"><strong>3.3</strong></a>
6682 <li>font-style, <a href="#font-style-normal-value" title="normal,
6683 font-style"><strong>3.4</strong></a>
6685 <li>font-variant, <a href="#font-variant-normal-value" title="normal,
6686 font-variant"><strong>6.11</strong></a>
6688 <li>font-variant-alternates, <a
6689 href="#font-variant-alternates-normal-value" title="normal,
6690 font-variant-alternates"><strong>6.8</strong></a>
6692 <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
6693 title="normal, font-variant-caps"><strong>6.6</strong></a>
6695 <li>font-variant-east-asian, <a
6696 href="#font-variant-east-asian-normal-value" title="normal,
6697 font-variant-east-asian"><strong>6.10</strong></a>
6699 <li>font-variant-ligatures, <a
6700 href="#font-variant-ligatures-normal-value" title="normal,
6701 font-variant-ligatures"><strong>6.4</strong></a>
6703 <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
6704 title="normal, font-variant-numeric"><strong>6.7</strong></a>
6706 <li>font-variant-position, <a href="#font-variant-position-normal-value"
6707 title="normal, font-variant-position"><strong>6.5</strong></a>
6709 <li>font-weight, <a href="#font-weight-normal-value" title="normal,
6710 font-weight"><strong>3.2</strong></a>
6711 </ul>
6713 <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
6715 <li>oldstyle-nums, <a href="#oldstyle-nums"
6716 title=oldstyle-nums><strong>6.7</strong></a>
6718 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
6720 <li>ornaments, <a href="#ornaments"
6721 title=ornaments><strong>6.8</strong></a>
6723 <li>petite-caps, <a href="#petite-caps"
6724 title=petite-caps><strong>6.6</strong></a>
6726 <li>proportional-nums, <a href="#proportional-nums"
6727 title=proportional-nums><strong>6.7</strong></a>
6729 <li>proportional-width, <a href="#proportional-width"
6730 title=proportional-width><strong>6.10</strong></a>
6732 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
6734 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
6736 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
6737 definition of"><strong>#</strong></a>
6739 <li>semi-condensed, <a href="#semi-condensed-"
6740 title=semi-condensed><strong>3.3</strong></a>
6742 <li>semi-expanded, <a href="#semi-expanded"
6743 title=semi-expanded><strong>3.3</strong></a>
6745 <li>serif, definition of, <a href="#serif0" title="serif, definition
6746 of"><strong>#</strong></a>
6748 <li>simplified, <a href="#simplified"
6749 title=simplified><strong>6.10</strong></a>
6751 <li>slashed-zero, <a href="#slashed-zero"
6752 title=slashed-zero><strong>6.7</strong></a>
6754 <li>small-caps, <a href="#small-caps"
6755 title=small-caps><strong>6.6</strong></a>
6757 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
6759 <li>stacked-fractions, <a href="#stacked-fractions"
6760 title=stacked-fractions><strong>6.7</strong></a>
6762 <li>style sheet
6763 <ul>
6764 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
6765 conformance class"><strong>#</strong></a>
6766 </ul>
6768 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
6770 <li>stylistic, <a href="#stylistic"
6771 title=stylistic><strong>6.8</strong></a>
6773 <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
6775 <li>super, <a href="#super" title=super><strong>6.5</strong></a>
6777 <li>support, <a href="#support" title=support><strong>5.2</strong></a>
6779 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
6781 <li>system font fallback, <a href="#system-font-fallback" title="system
6782 font fallback"><strong>5.2</strong></a>
6784 <li>tabular-nums, <a href="#tabular-nums"
6785 title=tabular-nums><strong>6.7</strong></a>
6787 <li>titling-caps, <a href="#titling-caps"
6788 title=titling-caps><strong>6.6</strong></a>
6790 <li>traditional, <a href="#traditional"
6791 title=traditional><strong>6.10</strong></a>
6793 <li>ultra-condensed, <a href="#ultra-condensed"
6794 title=ultra-condensed><strong>3.3</strong></a>
6796 <li>ultra-expanded, <a href="#ultra-expanded"
6797 title=ultra-expanded><strong>3.3</strong></a>
6799 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
6801 <li>unicode-range, <a href="#descdef-unicode-range"
6802 title=unicode-range><strong>4.5</strong></a>
6804 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
6806 <li>width, <a href="#width" title=width><strong>2</strong></a>
6807 </ul>
6808 <!--end-index-->
6810 <h2 class=no-num id=property-index>Property index</h2>
6811 <!--begin-properties-->
6813 <table class=proptable>
6814 <thead>
6815 <tr>
6816 <th>Property
6818 <th>Values
6820 <th>Initial
6822 <th>Applies to
6824 <th>Inh.
6826 <th>Percentages
6828 <th>Media
6830 <tbody>
6831 <tr>
6832 <th><a class=property href="#propdef-font">font</a>
6834 <td>[ [ <‘font-style’> || <font-variant-css21> ||
6835 <‘font-weight’> || <‘font-stretch’ ]?
6836 <‘font-size’> [ / <‘line-height’> ]?
6837 <‘font-family’> ] | caption | icon | menu | message-box |
6838 small-caption | status-bar
6840 <td>see individual properties
6842 <td>all elements
6844 <td>yes
6846 <td>see individual properties
6848 <td>visual
6850 <tr>
6851 <th><span class=property>font-family</span>
6853 <td>[ <family-name> | <generic-family> ] #
6855 <td>depends on user agent
6857 <td>all elements
6859 <td>yes
6861 <td>N/A
6863 <td>visual
6865 <tr>
6866 <th><span class=property>font-feature-settings</span>
6868 <td>normal | <feature-tag-value> #
6870 <td>normal
6872 <td>all elements
6874 <td>yes
6876 <td>N/A
6878 <td>visual
6880 <tr>
6881 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
6883 <td>auto | normal | none
6885 <td>auto
6887 <td>all elements
6889 <td>yes
6891 <td>N/A
6893 <td>visual
6895 <tr>
6896 <th><a class=property
6897 href="#propdef-font-language-override">font-language-override</a>
6899 <td>normal | <string>
6901 <td>normal
6903 <td>all elements
6905 <td>yes
6907 <td>N/A
6909 <td>visual
6911 <tr>
6912 <th><a class=property href="#propdef-font-size">font-size</a>
6914 <td><absolute-size> | <relative-size> | <length> |
6915 <percentage>
6917 <td>medium
6919 <td>all elements
6921 <td>yes
6923 <td>refer to parent element's font size
6925 <td>visual
6927 <tr>
6928 <th><a class=property
6929 href="#propdef-font-size-adjust">font-size-adjust</a>
6931 <td>none | auto | <number>
6933 <td>none
6935 <td>all elements
6937 <td>yes
6939 <td>N/A
6941 <td>visual
6943 <tr>
6944 <th><span class=property>font-stretch</span>
6946 <td>normal | ultra-condensed | extra-condensed | condensed |
6947 semi-condensed | semi-expanded | expanded | extra-expanded |
6948 ultra-expanded
6950 <td>normal
6952 <td>all elements
6954 <td>yes
6956 <td>N/A
6958 <td>visual
6960 <tr>
6961 <th><span class=property>font-style</span>
6963 <td>normal | italic | oblique
6965 <td>normal
6967 <td>all elements
6969 <td>yes
6971 <td>N/A
6973 <td>visual
6975 <tr>
6976 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
6978 <td>none | [ weight || style ]
6980 <td>weight style
6982 <td>all elements
6984 <td>yes
6986 <td>N/A
6988 <td>visual
6990 <tr>
6991 <th><span class=property>font-variant</span>
6993 <td>normal | none | [ <common-lig-values> ||
6994 <discretionary-lig-values> || <historical-lig-values> ||
6995 <contextual-alt-values> || stylistic(<feature-value-name>)
6996 || historical-forms || styleset(<feature-value-name> #) ||
6997 character-variant(<feature-value-name> #) ||
6998 swash(<feature-value-name>) ||
6999 ornaments(<feature-value-name>) ||
7000 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7001 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7002 <numeric-figure-values> || <numeric-spacing-values> ||
7003 <numeric-fraction-values> || ordinal || slashed-zero ||
7004 <east-asian-variant-values> || <east-asian-width-values> ||
7005 ruby ]
7007 <td>normal
7009 <td>all elements
7011 <td>yes
7013 <td>see individual properties
7015 <td>visual
7017 <tr>
7018 <th><a class=property
7019 href="#propdef-font-variant-alternates">font-variant-alternates</a>
7021 <td>normal | [ stylistic(<feature-value-name>) || historical-forms
7022 || styleset(<feature-value-name> #) ||
7023 character-variant(<feature-value-name> #) ||
7024 swash(<feature-value-name>) ||
7025 ornaments(<feature-value-name>) ||
7026 annotation(<feature-value-name>) ]
7028 <td>normal
7030 <td>all elements
7032 <td>yes
7034 <td>N/A
7036 <td>visual
7038 <tr>
7039 <th><a class=property
7040 href="#propdef-font-variant-caps">font-variant-caps</a>
7042 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
7043 | unicase | titling-caps
7045 <td>normal
7047 <td>all elements
7049 <td>yes
7051 <td>N/A
7053 <td>visual
7055 <tr>
7056 <th><a class=property
7057 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
7059 <td>normal | [ <east-asian-variant-values> ||
7060 <east-asian-width-values> || ruby ]
7062 <td>normal
7064 <td>all elements
7066 <td>yes
7068 <td>N/A
7070 <td>visual
7072 <tr>
7073 <th><a class=property
7074 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
7076 <td>normal | none | [ <common-lig-values> ||
7077 <discretionary-lig-values> || <historical-lig-values> ||
7078 <contextual-alt-values> ]
7080 <td>normal
7082 <td>all elements
7084 <td>yes
7086 <td>N/A
7088 <td>visual
7090 <tr>
7091 <th><a class=property
7092 href="#propdef-font-variant-numeric">font-variant-numeric</a>
7094 <td>normal | [ <numeric-figure-values> ||
7095 <numeric-spacing-values> || <numeric-fraction-values> ||
7096 ordinal || slashed-zero ]
7098 <td>normal
7100 <td>all elements
7102 <td>yes
7104 <td>N/A
7106 <td>visual
7108 <tr>
7109 <th><a class=property
7110 href="#propdef-font-variant-position">font-variant-position</a>
7112 <td>normal | sub | super
7114 <td>normal
7116 <td>all elements
7118 <td>yes
7120 <td>N/A
7122 <td>visual
7124 <tr>
7125 <th><span class=property>font-weight</span>
7127 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
7128 | 700 | 800 | 900
7130 <td>normal
7132 <td>all elements
7134 <td>yes
7136 <td>N/A
7138 <td>visual
7139 </table>
7140 <!--end-properties-->
7141 <!--begin-descriptors-->
7143 <table class=proptable>
7144 <thead>
7145 <tr>
7146 <th>Descriptor
7148 <th>Value
7150 <th>Initial
7152 <th>Percentages
7154 <th>Media
7156 <tbody>
7157 <tr>
7158 <th><span class=property>font-family</span>
7160 <td><family-name>
7162 <td>N/A
7164 <tr>
7165 <th><span class=property>font-feature-settings</span>
7167 <td>normal | <feature-tag-value> #
7169 <td>normal
7171 <tr>
7172 <th><span class=property>font-stretch</span>
7174 <td>normal | ultra-condensed | extra-condensed | condensed |
7175 semi-condensed | semi-expanded | expanded | extra-expanded |
7176 ultra-expanded
7178 <td>normal
7180 <tr>
7181 <th><span class=property>font-style</span>
7183 <td>normal | italic | oblique
7185 <td>normal
7187 <tr>
7188 <th><span class=property>font-variant</span>
7190 <td>normal | none | [ <common-lig-values> ||
7191 <discretionary-lig-values> || <historical-lig-values> ||
7192 <contextual-alt-values> || stylistic(<feature-value-name>)
7193 || historical-forms || styleset(<feature-value-name> #) ||
7194 character-variant(<feature-value-name> #) ||
7195 swash(<feature-value-name>) ||
7196 ornaments(<feature-value-name>) ||
7197 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7198 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7199 <numeric-figure-values> || <numeric-spacing-values> ||
7200 <numeric-fraction-values> || ordinal || slashed-zero ||
7201 <east-asian-variant-values> || <east-asian-width-values> ||
7202 ruby ]
7204 <td>normal
7206 <tr>
7207 <th><span class=property>font-weight</span>
7209 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
7211 <td>normal
7213 <tr>
7214 <th><a class=property href="#descdef-src">src</a>
7216 <td>[ <url> [format(<string> #)]? | <font-face-name> ] #
7218 <td>N/A
7220 <tr>
7221 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
7223 <td><urange> #
7225 <td>U+0-10FFFF
7226 </table>
7227 <!--end-descriptors-->
7228 <script type="text/javascript">
7229 window.onload = function () {
7230 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
7231 var i, hiresElements = document.getElementsByClassName("hires");
7232 for (i = 0; i < hiresElements.length; i++) {
7233 var h = hiresElements[i];
7234 if (h.tagName != "IMG") continue;
7235 var src = h.getAttribute("src");
7236 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
7237 h.src = src2x;
7238 }
7239 }
7240 </script>
7241 </html>
7242 <!-- Keep this comment at the end of the file
7243 Local variables:
7244 mode: sgml
7245 sgml-declaration:"~/SGML/HTML4.decl"
7246 sgml-default-doctype-name:"html"
7247 sgml-minimize-attributes:t
7248 sgml-nofill-elements:("pre" "style" "br")
7249 sgml-live-element-indicator:t
7250 sgml-omittag:nil
7251 sgml-shorttag:nil
7252 sgml-namecase-general:t
7253 sgml-general-insert-case:lower
7254 sgml-always-quote-attributes:t
7255 sgml-indent-step:nil
7256 sgml-indent-data:t
7257 sgml-parent-document:nil
7258 sgml-exposed-tags:nil
7259 sgml-local-catalogs:nil
7260 sgml-local-ecat-files:nil
7261 End:
7262 -->
7263 <!--
7265 to do:
7267 - wording of OpenType family name handling
7268 - handling combining sequences in the font matching algorithm
7269 - fix-up fi ligature example
7271 -->