Fri, 07 Jun 2013 08:28:32 +0900
[css3-fonts] switch OM issue for @font-feature-values rule
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
4 <html lang=en>
5 <head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
7 <title>CSS Fonts Module Level 3</title>
8 <!--
9 FIXME when publishing: copy the current default.css and link to
10 "default.css" rather than "../default.css"
11 -->
12 <link href="../default.css" rel=stylesheet type="text/css">
13 <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
14 <!-- I'm just experimenting here, don't get your bee in a bonnet -->
15 <script src="http://use.typekit.com/xon2bky.js"
16 type="text/javascript"></script>
17 <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
19 <style type="text/css">
21 body, th, td, h1, h2, h3, h4, h5, h6 {
22 font-family: "myriad-pro", sans-serif !important;
23 }
25 body {
26 padding: 2em 70px 2em 70px;
27 }
29 p + p, p.mtb {
30 margin-top: 0.8em;
31 text-indent: 0px;
32 }
34 #bolderlighter {
35 width: 40%;
36 }
38 #bolderlighter th {
39 text-align: center;
40 }
42 #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
43 padding-right: 2em;
44 text-align: left;
45 }
47 dd {
48 margin-bottom: 1em;
49 }
51 #authors dd {
52 margin-bottom: 0;
53 }
55 #fontstylematchingalg {
56 list-style-type: lower-alpha;
57 }
59 #fontmatchingalg ul, #fontmatchingalg ol {
60 margin-top: 0.8em;
61 }
63 #fontmatchingalg li + li {
64 margin-top: 0.8em;
65 }
67 div.example {
68 padding: 1em;
69 margin-top: 1em;
70 }
72 div.example + div.example {
73 margin-top: 2em;
74 }
76 div.figure {
77 page-break-inside: avoid;
78 }
80 pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
82 div.featex {
83 width: 700px;
84 }
86 div.featex img {
87 margin: auto;
88 display: block;
89 }
91 span.tag {
92 font-family: monospace;
93 font-size: 120%;
94 }
96 ol ol {
97 list-style-type: lower-alpha;
98 }
100 .idl-code {
101 font-weight: bold;
102 color: #c50;
103 }
104 </style>
105 <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
106 type="text/css">
108 <body>
109 <div class=head> <!--begin-logo-->
110 <p><a href="http://www.w3.org/"><img alt=W3C height=48
111 src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
113 <h1>CSS Fonts Module Level 3</h1>
115 <h2 class="no-num no-toc" id=editors-draft-7-june-2013>Editor's Draft 7
116 June 2013</h2>
118 <dl id=authors>
119 <dt>This version:
121 <dd><a
122 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
123 <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css3-fonts-20130607/">http://www.w3.org/TR/2013/ED-css3-fonts-20130607/</a> -->
126 <dt>Latest version:
128 <dd><a
129 href="http://www.w3.org/TR/css3-fonts/">http://www.w3.org/TR/css3-fonts/</a>
131 <dt>Latest editor's draft:
133 <dd><a
134 href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
135 (<a
136 href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
137 log</a>)
139 <dt>Previous version:
141 <dd><a
142 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">http://www.w3.org/TR/2013/WD-css3-fonts-20130212/</a>
144 <dt>Issues List:
146 <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
147 issues in Tracker</a>
149 <dd><a
150 href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&product=CSS&component=Fonts&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED">CSS3
151 Fonts issues in Bugzilla</a>
153 <dt>Discussion:
155 <dd><a
156 href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
157 with subject line “<kbd>[css-fonts] <var>… message topic
158 …</var></kbd>” (<a
159 href="http://lists.w3.org/Archives/Public/www-style/"
160 rel=discussion>archives</a>)
162 <dt>Editor:
164 <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
165 </dl>
166 <!--begin-copyright-->
167 <p class=copyright><a
168 href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
169 rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
170 title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
171 href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
172 Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
173 title="European Research Consortium for Informatics and
174 Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
175 <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
176 <a
177 href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
178 <a
179 href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
180 and <a
181 href="http://www.w3.org/Consortium/Legal/copyright-documents">document
182 use</a> rules apply.</p>
183 <!--end-copyright-->
184 <hr title="Separator for header">
185 </div>
187 <h2 class="no-num no-toc" id=abstract>Abstract</h2>
189 <p>This CSS3 module describes how font properties are specified and how
190 font resources are loaded dynamically. The contents of this specification
191 are a consolidation of content previously divided into <a
192 href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
193 and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
194 Web Fonts</a> modules. The description of font load events was moved into
195 the <a href="http://dev.w3.org/csswg/css3-font-load-events/">CSS3 Font
196 Load Events</a> module.
198 <h2 class="no-num no-toc" id=status>Status of this document</h2>
199 <!--begin-status-->
201 <p>This is a public copy of the editors' draft. It is provided for
202 discussion only and may change at any moment. Its publication here does
203 not imply endorsement of its contents by W3C. Don't cite this document
204 other than as work in progress.
206 <p>The (<a
207 href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
208 mailing list <a
209 href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
210 www-style@w3.org</a> (see <a
211 href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
212 discussion of this specification. When sending e-mail, please put the text
213 “css3-fonts” in the subject, preferably like this:
214 “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
216 <p>This document was produced by the <a
217 href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
218 the <a href="http://www.w3.org/Style/">Style Activity</a>).
220 <p>This document was produced by a group operating under the <a
221 href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
222 2004 W3C Patent Policy</a>. W3C maintains a <a
223 href="http://www.w3.org/2004/01/pp-impl/32061/status"
224 rel=disclosure>public list of any patent disclosures</a> made in
225 connection with the deliverables of the group; that page also includes
226 instructions for disclosing a patent. An individual who has actual
227 knowledge of a patent which the individual believes contains <a
228 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
229 Claim(s)</a> must disclose the information in accordance with <a
230 href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
231 6 of the W3C Patent Policy</a>.</p>
232 <!--end-status-->
233 <!--
234 <h3 class="no-num no-toc" id="atrisk">Features at risk</h3>
236 <p>The following features are at risk and may be removed when exiting CR:</p>
238 <ul>
239 </ul>
240 -->
242 <h2 class="no-num no-toc" id=contents>Table of contents</h2>
243 <!--begin-toc-->
245 <ul class=toc>
246 <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
248 <li><a href="#typography-background"><span class=secno>2 </span>Typography
249 Background</a>
251 <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
252 Properties</a>
253 <ul class=toc>
254 <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
255 family: the font-family property</a>
256 <ul class=toc>
257 <li><a href="#generic-font-families"><span class=secno>3.1.1
258 </span>Generic font families</a>
259 </ul>
261 <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
262 weight: the font-weight property</a>
264 <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
265 width: the font-stretch property</a>
267 <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
268 the font-style property</a>
270 <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
271 the font-size property</a>
273 <li><a href="#font-size-adjust-prop"><span class=secno>3.6
274 </span>Relative sizing: the font-size-adjust property</a>
276 <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
277 property: the font property</a>
279 <li><a href="#font-synthesis-prop"><span class=secno>3.8
280 </span>Controlling synthetic faces: the font-synthesis property</a>
281 </ul>
283 <li><a href="#font-resources"><span class=secno>4 </span>Font
284 Resources</a>
285 <ul class=toc>
286 <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
287 <code>@font-face</code> rule</a>
289 <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
290 family: the font-family descriptor</a>
292 <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
293 src descriptor</a>
295 <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
296 descriptors: the font-style, font-weight, font-stretch descriptors</a>
298 <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
299 range: the unicode-range descriptor</a>
301 <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
302 character ranges to define composite fonts</a>
304 <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
305 features: the font-variant and font-feature-settings descriptors</a>
307 <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
308 loading guidelines</a>
310 <li><a href="#same-origin-restriction"><span class=secno>4.9
311 </span>Same-origin restriction for fonts</a>
312 <ul class=toc>
313 <li><a href="#default-same-origin-restriction"><span class=secno>4.9.1
314 </span>Default same-origin restriction</a>
316 <li><a href="#allowing-cross-origin-font-loading"><span
317 class=secno>4.9.2 </span>Allowing cross-origin font loading</a>
318 </ul>
319 </ul>
321 <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
322 Matching Algorithm</a>
323 <ul class=toc>
324 <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
325 sensitivity of font family names</a>
327 <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
328 font styles</a>
330 <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
331 matching</a>
333 <li><a href="#char-handling-issues"><span class=secno>5.4
334 </span>Character handling issues</a>
336 <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
337 matching changes since CSS 2.1</a>
339 <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
340 matching examples</a>
341 </ul>
343 <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
344 Properties</a>
345 <ul class=toc>
346 <li><a href="#glyph-selection-positioning"><span class=secno>6.1
347 </span>Glyph selection and positioning</a>
349 <li><a href="#language-specific-support"><span class=secno>6.2
350 </span>Language-specific display</a>
352 <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
353 the font-kerning property</a>
355 <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
356 </span>Ligatures: the font-variant-ligatures property</a>
358 <li><a href="#font-variant-position-prop"><span class=secno>6.5
359 </span>Subscript and superscript forms: the font-variant-position
360 property</a>
362 <li><a href="#font-variant-caps-prop"><span class=secno>6.6
363 </span>Capitalization: the font-variant-caps property</a>
365 <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
366 </span>Numerical formatting: the font-variant-numeric property</a>
368 <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
369 </span>Alternates and swashes: the font-variant-alternates property</a>
372 <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
373 font specific alternates: the <code>@font-feature-values</code>
374 rule</a>
375 <ul class=toc>
376 <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
377 syntax</a>
379 <li><a href="#multi-valued-feature-value-definitions"><span
380 class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
381 </ul>
383 <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
384 </span>East Asian text rendering: the font-variant-east-asian
385 property</a>
387 <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
388 shorthand for font rendering: the font-variant property</a>
390 <li><a href="#font-feature-settings-prop"><span class=secno>6.12
391 </span>Low-level font feature settings control: the
392 font-feature-settings property</a>
394 <li><a href="#font-language-override-prop"><span class=secno>6.13
395 </span>Font language override: the font-language-override property</a>
396 </ul>
398 <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
399 Feature Resolution </a>
400 <ul class=toc>
401 <li><a href="#default-features"><span class=secno>7.1 </span>Default
402 features</a>
404 <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
405 precedence</a>
407 <li><a href="#feature-precedence-examples"><span class=secno>7.3
408 </span>Feature precedence examples</a>
409 </ul>
411 <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
412 <ul class=toc>
413 <li><a href="#om-fontface"><span class=secno>8.1 </span>The
414 <code>CSSFontFaceRule</code> interface</a>
416 <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
417 <code>CSSFontFeatureValuesRule</code> interface</a>
418 </ul>
420 <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
421 platform font properties to CSS properties</a>
423 <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
424 <ul class=toc>
425 <li class=no-num><a href="#recent-changes"> Changes from the February
426 2013 CSS3 Fonts Working Draft</a>
427 </ul>
429 <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
431 <li class=no-num><a href="#conformance"> Conformance</a>
432 <ul class=toc>
433 <li class=no-num><a href="#conventions"> Document Conventions</a>
435 <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
438 <li class=no-num><a href="#partial"> Partial Implementations</a>
440 <li class=no-num><a href="#experimental"> Experimental
441 Implementations</a>
443 <li class=no-num><a href="#testing"> Non-Experimental
444 Implementations</a>
445 </ul>
447 <li class=no-num><a href="#references">References</a>
448 <ul class=toc>
449 <li class=no-num><a href="#normative-references">Normative
450 References</a>
452 <li class=no-num><a href="#other-references">Other References</a>
453 </ul>
455 <li class=no-num><a href="#index">Index</a>
457 <li class=no-num><a href="#property-index">Property index</a>
458 </ul>
459 <!--end-toc-->
461 <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
463 <p>A font provides a resource containing the visual representation of
464 characters. At the simplest level it contains information that maps
465 character codes to shapes (called glyphs) that represent these characters.
466 Fonts sharing a common design style are commonly grouped into font
467 families classified by a set of standard font properties. Within a family,
468 the shape displayed for a given character can vary by stroke weight, slant
469 or relative width, among others. An individual font face is described by a
470 unique combination of these properties. For a given range of text, CSS
471 font properties are used to select a font family and a specific font face
472 within that family to be used when rendering that text. As a simple
473 example, to use the bold form of Helvetica one could use:
475 <pre>body {
476 font-family: Helvetica;
477 font-weight: bold;
478 }</pre>
480 <p>Font resources may be installed locally on the system on which a user
481 agent is running or downloadable. For local font resources descriptive
482 information can be obtained directly from the font resource. For
483 downloadable font resources (sometimes referred to as web fonts), the
484 descriptive information is included with the reference to the font
485 resource.
487 <p>Families of fonts typically don't contain a single face for each
488 possible variation of font properties. The CSS font selection mechanism
489 describes how to match a given set of CSS font properties to a single font
490 face.
492 <h2 id=typography-background><span class=secno>2 </span>Typography
493 Background</h2>
495 <p><em>This section is non-normative.</em>
497 <p> Typographic traditions vary across the globe, so there is no unique way
498 to classify all fonts across languages and cultures. For even common Latin
499 letters, wide variations are possible:
501 <div class=figure><img alt="variations in glyphs for a single character"
502 src=aaaaaa.png>
503 <p class=caption>One character, many glyph variations
504 </div>
506 <p>Differences in the anatomy of letterforms is one way to distinguish
507 fonts. For Latin fonts, flourishes at the ends of a character's main
508 strokes, or serifs, can distinguish a font from those without. Similar
509 comparisons exist in non-Latin fonts between fonts with tapered strokes
510 and those using primarily uniform strokes:
512 <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
513 <p class=caption>Letterforms with and without serifs
514 </div>
516 <div class=figure><img alt="serif vs. non-serifs for japanese"
517 src=minchovsgothic.png>
518 <p class=caption>Similar groupings for Japanese typefaces
519 </div>
521 <p>Fonts contain letterforms and the data needed to map characters to these
522 letterforms. Often this may be a simple one-to-one mapping, but more
523 complex mappings are also possible. The use of combining diacritic marks
524 creates many variations for an underlying letterform:
526 <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
527 <p class=caption>Variations with diacritic marks
528 </div>
530 <p>A sequence of characters can be represented by a single glyph known as a
531 ligature:
533 <div class=figure><img alt="example of a fi ligature"
534 src=final-ligature.png>
535 <p class=caption>Ligature example
536 </div>
538 <p>Visual transformations based on textual context are often stylistic
539 option in European languages. They are required to correctly render
540 languages like Arabic, the lam and alef characters below <em>must</em> be
541 combined when they exist in sequence:
543 <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
544 <p class=caption>Required Arabic ligature
545 </div>
547 <p>The relative complexity of these shaping transformations requires
548 additional data within the font.
550 <p>Sets of font faces with various stylistic variations are often grouped
551 together into font families. In the simplest case a regular face is
552 supplemented with bold and italic faces, but much more extensive groupings
553 are possible. Variations in the thickness of letterform strokes, the <dfn
554 id=weight>weight</dfn>, and the overall proportions of the letterform, the
555 <dfn id=width>width</dfn>, are most common. In the example below, each
556 letter uses a different font face within the Univers font family. The
557 width used increases from top to bottom and the weight increases from left
558 to right:
560 <div class=figure><img alt="various width and weight variations within a
561 single family" src=weightwidthvariations.png>
562 <p class=caption>Weight and width variations within a single font family
563 </div>
565 <p>Creating fonts that support multiple scripts is a difficult task;
566 designers need to understand the cultural traditions surrounding the use
567 of type in different scripts and come up with letterforms that somehow
568 share a common theme. Many languages often share a common script and each
569 of these languages may have noticeable stylistic differences. For example,
570 the Arabic script is shared by Persian and Urdu and Cyrillic is used with
571 many languages, not just Russian.
573 <p>The <a href="#character-map"><em>character map</em></a> of a font
574 defines the mapping of characters to glyphs for that font. If a document
575 contains characters not supported by the <a href="#character-map"><em
576 title="character map">character maps</em></a> of the fonts contained in a
577 font family list, a user agent may use a <a
578 href="#system-font-fallback"><em>system font fallback</em></a> procedure
579 to locate an appropriate font that does. If no appropriate font can be
580 found, some form of "missing glyph" character will be rendered by the user
581 agent. System fallback can occur when the specified list of font families
582 does not include a font that supports a given character.
584 <p>Although the <a href="#character-map"><em>character map</em></a> of a
585 font maps a given character to a glyph for that character, modern font
586 technologies such as OpenType and AAT (Apple Advanced Typography) provide
587 ways of mapping a character to different glyphs based upon feature
588 settings. Fonts in these formats allow these features to be embedded in
589 the font itself and controlled by applications. Common typographic
590 features which can be specified this way include ligatures, swashes,
591 contextual alternates, proportional and tabular figures, and automatic
592 fractions, to list just a few. For a visual overview of OpenType features,
593 see the <a href="#OPENTYPE-FONT-GUIDE"
594 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
596 <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
598 <p>The particular font face used to render a character is determined by the
599 font family and other font properties that apply to a given element. This
600 structure allows settings to be varied independent of each other.</p>
601 <!-- prop: font-family -->
603 <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
604 href="#propdef-font-family">font-family</a> property</h3>
606 <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
607 <tbody>
608 <tr>
609 <td>Name:
611 <td><dfn id=propdef-font-family
612 title="font-family!!property">font-family</dfn>
614 <tr>
615 <td>Value:
617 <td>[ <a href="#family-name-value"><var><family-name></var></a> |
618 <a href="#generic-family-value"><var><generic-family></var></a> ]
619 #
621 <tr>
622 <td>Initial:
624 <td>depends on user agent
626 <tr>
627 <td>Applies to:
629 <td>all elements
631 <tr>
632 <td>Inherited:
634 <td>yes
636 <tr>
637 <td>Percentages:
639 <td>N/A
641 <tr>
642 <td>Media:
644 <td>visual
646 <tr>
647 <td>Computed value:
649 <td>as specified
651 <tr>
652 <td>Animatable:
654 <td>no
655 </table>
657 <p>This property specifies a prioritized list of font family names or
658 generic family names. A font family defines a set of faces that vary in
659 weight, width or slope. CSS uses the combination of a family name with
660 other style attributes to select an individual face. Using this selection
661 mechanism, rather than selecting a face via the style name as is often
662 done in design applications, allows some degree of regularity in textual
663 display when fallback occurs.
665 <p class=note>Designers should note that the CSS definition of font
666 attributes used for selection are explicitly not intended to define a font
667 taxonomy. A type designer's idea of a family may often extend to a set of
668 faces that vary along axes other than just the standard axes of weight,
669 width and slope. A family may extend to include both a set of serif faces
670 and a set of sans-serif faces or vary along axes that are unique to that
671 family. The CSS font selection mechanism merely provides a way to
672 determine the “closest” substitute when substitution is necessary.
674 <p>Unlike other CSS properties, component values are a comma-separated list
675 indicating alternatives. A user agent iterates through the list of family
676 names until it matches an available font that contains a glyph for the
677 character to be rendered. This allows for differences in available fonts
678 across platforms and for differences in the range of characters supported
679 by individual fonts.
681 <p>A font family name only specifies a name given to a set of font faces,
682 it does not specify an individual face. For example, given the
683 availability of the fonts below, Futura would match but Futura Medium
684 would not:
686 <div class=figure><img alt="family and face names"
687 src=familyvsfacename.png>
688 <p class=caption>Family and individual face names
689 </div>
691 <p>Consider the example below:
693 <div class=example>
694 <pre>body {
695 font-family: Helvetica, Verdana, sans-serif;
696 }</pre>
698 <p>If Helvetica is available it will be used when rendering. If neither
699 Helvetica nor Verdana is present, then the user-agent-defined sans serif
700 font will be used.</p>
701 </div>
703 <p>There are two types of font family names:
705 <dl>
706 <dt><dfn id=family-name-value><var><family-name></var></dfn>
708 <dd>The name of a font family of choice such as Helvetica or Verdana in
709 the previous example.
711 <dt><dfn id=generic-family-value><var><generic-family></var></dfn>
713 <dd> The following generic family keywords are defined: ‘<a
714 href="#serif"><code class=property>serif</code></a>’, ‘<a
715 href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
716 href="#cursive"><code class=property>cursive</code></a>’, ‘<a
717 href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
718 href="#monospace"><code class=property>monospace</code></a>’. These
719 keywords can be used as a general fallback mechanism when an author's
720 desired font choices are not available. As keywords, they must not be
721 quoted. Authors are encouraged to append a generic font family as a last
722 alternative for improved robustness.
723 </dl>
725 <p>Font family names other than generic families must either be given
726 quoted as <a
727 href="//www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or unquoted
728 as a sequence of one or more <a
729 href="//www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
730 This means most punctuation characters and digits at the start of each
731 token must be escaped in unquoted font family names.
733 <p>To illustrate this, the following declarations are invalid:
735 <pre>
736 font-family: Red/Black, sans-serif;
737 font-family: "Lucida" Grande, sans-serif;
738 font-family: Ahem!, sans-serif;
739 font-family: test@foo, sans-serif;
740 font-family: #POUND, sans-serif;
741 font-family: Hawaii 5-0, sans-serif;
742 </pre>
744 <p>If a sequence of identifiers is given as a font family name, the
745 computed value is the name converted to a string by joining all the
746 identifiers in the sequence by single spaces.
748 <p>To avoid mistakes in escaping, it is recommended to quote font family
749 names that contain white space, digits, or punctuation characters other
750 than hyphens:
752 <pre>
753 body { font-family: "New Century Schoolbook", serif }
755 <BODY STYLE="font-family: '21st Century', fantasy">
756 </pre>
758 <p>Font family <em>names</em> that happen to be the same as a keyword value
759 (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
760 class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
761 class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
762 class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
763 class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
764 class=property>cursive</code></a>’) must be quoted to prevent confusion
765 with the keywords with the same names. The keywords ‘<code
766 class=property>initial</code>’ and ‘<code
767 class=property>default</code>’ are reserved for future use and must also
768 be quoted when used as font names. UAs must not consider these keywords as
769 matching the <a
770 href="#family-name-value"><var><family-name></var></a> type.
772 <p>The precise way a set of fonts are grouped into font families varies
773 depending upon the platform font management API's. The Windows GDI API
774 only allows four faces to be grouped into a family while the DirectWrite
775 API and API's on OSX and other platforms support font families with a
776 variety of weights, widths and slopes (see <a
777 href="#platform-props-to-css">Appendix A</a> for more details).
779 <p>Some font formats allow fonts to carry multiple localizations of the
780 family name. User agents must recognize and correctly match all of these
781 names independent of the underlying platform localization, system API used
782 or document encoding:
784 <div class=figure><img alt="examples of localized family names"
785 src=localizedfamilynames.png>
786 <p class=caption>Localized family names
787 </div>
789 <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
790 families</h4>
792 <p>All five generic font families are defined to exist in all CSS
793 implementations (they need not necessarily map to five distinct actual
794 fonts). User agents should provide reasonable default choices for the
795 generic font families, which express the characteristics of each family as
796 well as possible within the limits allowed by the underlying technology.
797 User agents are encouraged to allow users to select alternative choices
798 for the generic fonts.
800 <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
801 definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
803 <p>Serif fonts represent the formal text style for a script. This often
804 means but is not limited to glyphs that have finishing strokes, flared or
805 tapering ends, or have actual serifed endings (including slab serifs).
806 Serif fonts are typically proportionately-spaced. They often display a
807 greater variation between thick and thin strokes than fonts from the ‘<a
808 href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
809 font family. CSS uses the term ‘<a href="#serif"><code
810 class=property>serif</code></a>’ to apply to a font for any script,
811 although other names may be more familiar for particular scripts, such as
812 Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
813 Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
814 class=property>serif</code></a>’ more due to its typographic role rather
815 than its actual design style. Any font that is so described may be used to
816 represent the generic ‘<a href="#serif"><code
817 class=property>serif</code></a>’ family.
819 <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
820 <p class=caption>Sample serif fonts
821 </div>
823 <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
824 title="sans-serif, definition of"> <a name=sans-serif-def><dfn
825 id=sans-serif>sans-serif</dfn></a></span></h5>
827 <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
828 low contrast (vertical and horizontal stems have the close to the same
829 thickness) and have stroke endings that are plain -- without any flaring,
830 cross stroke, or other ornamentation. Sans-serif fonts are typically
831 proportionately-spaced. They often have little variation between thick and
832 thin strokes, compared to fonts from the ‘<a href="#serif"><code
833 class=property>serif</code></a>’ family. CSS uses the term ‘<a
834 href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
835 to a font for any script, although other names may be more familiar for
836 particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
837 (Korean). Any font that is so described may be used to represent the
838 generic ‘<a href="#sans-serif"><code
839 class=property>sans-serif</code></a>’ family.
841 <div class=figure><img alt="sample sans-serif fonts"
842 src=sansserifexamples.png>
843 <p class=caption>Sample sans-serif fonts
844 </div>
846 <h5 class="no-num no-toc"> <span class=index-def id=cursive0
847 title="cursive, definition of"> <a name=cursive-def><dfn
848 id=cursive>cursive</dfn></a></span></h5>
850 <p>Glyphs in cursive fonts generally use a more informal script style, and
851 the result looks more like handwritten pen or brush writing than printed
852 letterwork. CSS uses the term ‘<a href="#cursive"><code
853 class=property>cursive</code></a>’ to apply to a font for any script,
854 although other names such as Chancery, Brush, Swing and Script are also
855 used in font names.
857 <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
858 <p class=caption>Sample cursive fonts
859 </div>
861 <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
862 title="fantasy, definition of"> <a name=fantasy-def><dfn
863 id=fantasy>fantasy</dfn></a></span></h5>
865 <p>Fantasy fonts are primarily decorative or expressive fonts that contain
866 playful representations of characters. These do not include Pi or Picture
867 fonts which do not represent actual characters.
869 <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
870 <p class=caption>Sample fantasy fonts
871 </div>
873 <h5 class="no-num no-toc"> <span class=index-def id=monospace0
874 title="monospace, definition of"> <a name=monospace-def><dfn
875 id=monospace>monospace</dfn></a></span></h5>
877 <p>The sole criterion of a monospace font is that all glyphs have the same
878 fixed width. This is often used to render samples of computer code.
880 <div class=figure><img alt="sample monospace fonts"
881 src=monospaceexamples.png>
882 <p class=caption>Sample monospace fonts
883 </div>
884 <!-- prop: font-weight -->
886 <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
887 href="#propdef-font-weight">font-weight</a> property</h3>
889 <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
890 <tbody>
891 <tr>
892 <td>Name:
894 <td><dfn id=propdef-font-weight
895 title="font-weight!!property">font-weight</dfn>
897 <tr>
898 <td>Value:
900 <td><a href="#font-weight-normal-value"
901 title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
902 href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
903 href="#font-weight-numeric-values" title="100...900 weight
904 values">100</a> | <a href="#font-weight-numeric-values"
905 title="100...900 weight values">200</a> | <a
906 href="#font-weight-numeric-values" title="100...900 weight
907 values">300</a> | <a href="#font-weight-numeric-values"
908 title="100...900 weight values">400</a> | <a
909 href="#font-weight-numeric-values" title="100...900 weight
910 values">500</a> | <a href="#font-weight-numeric-values"
911 title="100...900 weight values">600</a> | <a
912 href="#font-weight-numeric-values" title="100...900 weight
913 values">700</a> | <a href="#font-weight-numeric-values"
914 title="100...900 weight values">800</a> | <a
915 href="#font-weight-numeric-values" title="100...900 weight
916 values">900</a>
918 <tr>
919 <td>Initial:
921 <td>normal
923 <tr>
924 <td>Applies to:
926 <td>all elements
928 <tr>
929 <td>Inherited:
931 <td>yes
933 <tr>
934 <td>Percentages:
936 <td>N/A
938 <tr>
939 <td>Media:
941 <td>visual
943 <tr>
944 <td>Computed value:
946 <td>numeric weight value (see description)
948 <tr>
949 <td>Animatable:
951 <td>as <a
952 href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
953 weight</a>
954 </table>
956 <p>The <a href="#propdef-font-weight"
957 title="font-weight!!property">‘<code
958 class=property>font-weight</code>’</a> property specifies the weight of
959 glyphs in the font, their degree of blackness or stroke thickness.
961 <p>Values have the following meanings:
963 <dl>
964 <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
965 to 900</dfn>
967 <dd>These values form an ordered sequence, where each number indicates a
968 weight that is at least as dark as its predecessor. These roughly
969 correspond to the commonly used weight names below:
970 </dl>
972 <ul>
973 <li>100 - Thin
975 <li>200 - Extra Light (Ultra Light)
977 <li>300 - Light
979 <li>400 - Normal
981 <li>500 - Medium
983 <li>600 - Semi Bold (Demi Bold)
985 <li>700 - Bold
987 <li>800 - Extra Bold (Ultra Bold)
989 <li>900 - Black (Heavy)
990 </ul>
992 <dl>
993 <dt><dfn id=font-weight-normal-value
994 title="normal!!font-weight">normal</dfn>
996 <dd>Same as ‘<code class=css>400</code>’.
998 <dt><dfn id=bold>bold</dfn>
1000 <dd>Same as ‘<code class=css>700</code>’.
1002 <dt><dfn id=bolder>bolder</dfn>
1004 <dd>Specifies a bolder weight than the inherited value.
1006 <dt><dfn id=lighter>lighter</dfn>
1008 <dd>Specifies a lighter weight than the inherited value.
1009 </dl>
1011 <p>Font formats that use a scale other than a nine-step scale should map
1012 their scale onto the CSS scale so that 400 roughly corresponds with a face
1013 that would be labeled as Regular, Book, Roman and 700 roughly matches a
1014 face that would be labeled as Bold. Or weights may be inferred from the
1015 style names, ones that correspond roughly with the scale above. The scale
1016 is relative, so a face with a larger weight value must never appear
1017 lighter. If style names are used to infer weights, care should be taken to
1018 handle variations in style names across locales.
1020 <p>Quite often there are only a few weights available for a particular font
1021 family. When a weight is specified for which no face exists, a face with a
1022 nearby weight is used. In general, bold weights map to faces with heavier
1023 weights and light weights map to faces with lighter weights (see the <a
1024 href="#font-matching-algorithm">font matching section below</a> for a
1025 precise definition). The examples here illustrate which face is used for
1026 different weights, grey indicates a face for that weight does not exist so
1027 a face with a nearby weight is used:
1029 <div class=figure><img alt="weight mappings for a family with 400, 700 and
1030 900 weights" src=optimaweights.png>
1031 <p class=caption>Weight mappings for a font family with 400, 700 and 900
1032 weight faces
1033 </div>
1035 <div class=figure><img alt="weight mappings for a family with 300, 600
1036 weights" src=hiraginoweights.png>
1037 <p class=caption>Weight mappings for a font family with 300 and 600 weight
1038 faces
1039 </div>
1041 <p>Although the practice is not well-loved by typographers, bold faces are
1042 often synthesized by user agents for faces that lack actual bold faces.
1043 For the purposes of style matching, these faces must be treated as if they
1044 exist within the family. Authors can explicitly avoid this behavior by
1045 using the ‘<a href="#propdef-font-synthesis"><code
1046 class=property>font-synthesis</code></a>’ property.
1048 <p>Specified values of ‘<a href="#bolder"><code
1049 class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
1050 class=property>lighter</code></a>’ indicate weights relative to the
1051 weight of the parent element. The computed weight is calculated based on
1052 the inherited <a href="#propdef-font-weight"
1053 title="font-weight!!property">‘<code
1054 class=property>font-weight</code>’</a> value using the chart below.
1056 <table class=data id=bolderlighter summary="Bolder/lighter mappings">
1057 <thead>
1058 <tr>
1059 <th>Inherited value
1061 <th>bolder
1063 <th>lighter
1065 <tbody>
1066 <tr>
1067 <th>100
1069 <td>400
1071 <td>100
1073 <tr>
1074 <th>200
1076 <td>400
1078 <td>100
1080 <tr>
1081 <th>300
1083 <td>400
1085 <td>100
1087 <tr>
1088 <th>400
1090 <td>700
1092 <td>100
1094 <tr>
1095 <th>500
1097 <td>700
1099 <td>100
1101 <tr>
1102 <th>600
1104 <td>900
1106 <td>400
1108 <tr>
1109 <th>700
1111 <td>900
1113 <td>400
1115 <tr>
1116 <th>800
1118 <td>900
1120 <td>700
1122 <tr>
1123 <th>900
1125 <td>900
1127 <td>700
1128 </table>
1130 <p>The table above is equivalent to selecting the next relative bolder or
1131 lighter face, given a font family containing normal and bold faces along
1132 with a thin and a heavy face. Authors who desire finer control over the
1133 exact weight values used for a given element may use numerical values
1134 instead of relative weights.</p>
1135 <!-- prop: font-stretch -->
1137 <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
1138 href="#propdef-font-stretch">font-stretch</a> property</h3>
1140 <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
1141 <tbody>
1142 <tr>
1143 <td>Name:
1145 <td><dfn id=propdef-font-stretch
1146 title="font-stretch!!property">font-stretch</dfn>
1148 <tr>
1149 <td>Value:
1151 <td> <a href="#font-stretch-normal-value"
1152 title="normal!!font-stretch">normal</a> | <a
1153 href="#ultra-condensed">ultra-condensed</a> | <a
1154 href="#extra-condensed">extra-condensed</a> | <a
1155 href="#condensed">condensed</a> | <a
1156 href="#semi-condensed-">semi-condensed</a> | <a
1157 href="#semi-expanded">semi-expanded</a> | <a
1158 href="#expanded">expanded</a> | <a
1159 href="#extra-expanded">extra-expanded</a> | <a
1160 href="#ultra-expanded">ultra-expanded</a>
1162 <tr>
1163 <td>Initial:
1165 <td>normal
1167 <tr>
1168 <td>Applies to:
1170 <td>all elements
1172 <tr>
1173 <td>Inherited:
1175 <td>yes
1177 <tr>
1178 <td>Percentages:
1180 <td>N/A
1182 <tr>
1183 <td>Media:
1185 <td>visual
1187 <tr>
1188 <td>Computed value:
1190 <td>as specified
1192 <tr>
1193 <td>Animatable:
1195 <td>as <a href="#font-stretch-animation">font stretch</a>
1196 </table>
1198 <p>The <a href="#propdef-font-stretch"
1199 title="font-stretch!!property">‘<code
1200 class=property>font-stretch</code>’</a> property selects a normal,
1201 condensed, or expanded face from a font family. Absolute keyword values
1202 have the following ordering, from narrowest to widest:
1204 <ul>
1205 <li><dfn id=ultra-condensed>ultra-condensed</dfn>
1207 <li><dfn id=extra-condensed>extra-condensed</dfn>
1209 <li><dfn id=condensed>condensed</dfn>
1211 <li><dfn id=semi-condensed->semi-condensed </dfn>
1213 <li><dfn id=font-stretch-normal-value
1214 title="normal!!font-stretch">normal</dfn>
1216 <li><dfn id=semi-expanded>semi-expanded</dfn>
1218 <li><dfn id=expanded>expanded</dfn>
1220 <li><dfn id=extra-expanded>extra-expanded</dfn>
1222 <li><dfn id=ultra-expanded>ultra-expanded</dfn>
1223 </ul>
1225 <p>When a face does not exist for a given width, normal or condensed values
1226 map to a narrower face, otherwise a wider face. Conversely, expanded
1227 values map to a wider face, otherwise a narrower face. The figure below
1228 shows how the nine font-stretch property settings affect font selection
1229 for font family containing a variety of widths, grey indicates a width for
1230 which no face exists and a different width is substituted:
1232 <div class=figure><img alt="width mappings for a family with condensed,
1233 normal and expanded faces" src=universwidths.png>
1234 <p class=caption>Width mappings for a font family with condensed, normal
1235 and expanded width faces
1236 </div>
1238 <p id=font-stretch-animation>Animation of font stretch: Font stretch is
1239 interpolated in discrete steps. The interpolation happens as though the
1240 ordered values are equally spaced real numbers. The interpolation result
1241 is rounded to the nearest value, with values exactly halfway between two
1242 values rounded towards the later value in the list above.</p>
1243 <!-- prop: font-style -->
1245 <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
1246 href="#propdef-font-style">font-style</a> property</h3>
1248 <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
1249 <tbody>
1250 <tr>
1251 <td>Name:
1253 <td><dfn id=propdef-font-style
1254 title="font-style!!property">font-style</dfn>
1256 <tr>
1257 <td>Value:
1259 <td><a href="#font-style-normal-value"
1260 title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
1261 <a href="#oblique">oblique</a>
1263 <tr>
1264 <td>Initial:
1266 <td>normal
1268 <tr>
1269 <td>Applies to:
1271 <td>all elements
1273 <tr>
1274 <td>Inherited:
1276 <td>yes
1278 <tr>
1279 <td>Percentages:
1281 <td>N/A
1283 <tr>
1284 <td>Media:
1286 <td>visual
1288 <tr>
1289 <td>Computed value:
1291 <td>as specified
1293 <tr>
1294 <td>Animatable:
1296 <td>no
1297 </table>
1299 <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
1300 class=property>font-style</code>’</a> property allows italic or oblique
1301 faces to be selected. Italic forms are generally cursive in nature while
1302 oblique faces are typically sloped versions of the regular face. Oblique
1303 faces can be simulated by artificially sloping the glyphs of the regular
1304 face. Compare the artificially sloped renderings of Palatino ‘<code
1305 class=property>a</code>’ and Baskerville ‘<code
1306 class=property>N</code>’ in grey with the actual italic versions:
1308 <div class=figure><img alt="artificial sloping vs. real italics"
1309 src=realvsfakeitalics.png>
1310 <p class=caption>Artificial sloping versus real italics
1311 </div>
1313 <p>Values have the following meanings:
1315 <dl>
1316 <dt><dfn id=font-style-normal-value
1317 title="normal!!font-style">normal</dfn>
1319 <dd>selects a face that is classified as a normal face, one that is
1320 neither italic or obliqued
1322 <dt><dfn id=italic>italic</dfn>
1324 <dd>selects a font that is labeled as an italic face, or an oblique face
1325 if one is not
1327 <dt><dfn id=oblique>oblique</dfn>
1329 <dd>selects a font that is labeled as an oblique face, or an italic face
1330 if one is not
1331 </dl>
1333 <p>If no italic or oblique face is available, oblique faces can be
1334 synthesized by rendering non-obliqued faces with an artificial obliquing
1335 operation. The use of these artificially obliqued faces can be disabled
1336 using the ‘<a href="#propdef-font-synthesis"><code
1337 class=property>font-synthesis</code></a>’ property. The details of the
1338 obliquing operation are not explicitly defined.</p>
1339 <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
1341 <p>Many scripts lack the tradition of mixing a cursive form within text
1342 rendered with a normal face. Chinese, Japanese and Korean fonts almost
1343 always lack italic or oblique faces. Fonts that support a mixture of
1344 scripts will sometimes omit specific scripts such as Arabic from the set
1345 of glyphs supported in the italic face. User agents should be careful
1346 about making <a href="#character-map"><em>character map</em></a>
1347 assumptions across faces when implementing support for <a
1348 href="#system-font-fallback"><em>system font fallback</em></a>.</p>
1349 <!-- prop: font-size -->
1351 <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
1352 href="#propdef-font-size">font-size</a> property</h3>
1354 <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
1355 <tbody>
1356 <tr>
1357 <td>Name:
1359 <td><dfn id=propdef-font-size>font-size</dfn>
1361 <tr>
1362 <td>Value:
1364 <td><a href="#absolute-size-value"><var><absolute-size></var></a>
1365 | <a href="#relative-size-value"><var><relative-size></var></a> |
1366 <a href="#length-size-value"><var><length></var></a> | <a
1367 href="#percentage-size-value"><var><percentage></var></a>
1369 <tr>
1370 <td>Initial:
1372 <td>medium
1374 <tr>
1375 <td>Applies to:
1377 <td>all elements
1379 <tr>
1380 <td>Inherited:
1382 <td>yes
1384 <tr>
1385 <td>Percentages:
1387 <td>refer to parent element's font size
1389 <tr>
1390 <td>Media:
1392 <td>visual
1394 <tr>
1395 <td>Computed value:
1397 <td>absolute length
1399 <tr>
1400 <td>Animatable:
1402 <td>as <a
1403 href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
1404 </table>
1406 <p>This property indicates the desired height of glyphs from the font. For
1407 scalable fonts, the font-size is a scale factor applied to the EM unit of
1408 the font. (Note that certain glyphs may bleed outside their EM box.) For
1409 non-scalable fonts, the font-size is converted into absolute units and
1410 matched against the declared font-size of the font, using the same
1411 absolute coordinate space for both of the matched values. Values have the
1412 following meanings:
1414 <dl>
1415 <dt><dfn id=absolute-size-value><var><absolute-size></var></dfn>
1417 <dd> An <a
1418 href="#absolute-size-value"><var><absolute-size></var></a> keyword
1419 refers to an entry in a table of font sizes computed and kept by the user
1420 agent. Possible values are:
1421 <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
1423 <dt><dfn id=relative-size-value><var><relative-size></var></dfn>
1425 <dd> A <a href="#relative-size-value"><var><relative-size></var></a>
1426 keyword is interpreted relative to the table of font sizes and the
1427 computed ‘<a href="#propdef-font-size"><code
1428 class=property>font-size</code></a>’ of the parent element. Possible
1429 values are:
1430 <p> [ larger | smaller ]
1432 <p> For example, if the parent element has a font size of ‘<code
1433 class=property>medium</code>’, a value of ‘<code
1434 class=property>larger</code>’ will make the font size of the current
1435 element be ‘<code class=property>large</code>’. If the parent
1436 element's size is not close to a table entry, the user agent is free to
1437 interpolate between table entries or round off to the closest one. The
1438 user agent may have to extrapolate table values if the numerical value
1439 goes beyond the keywords.
1441 <dt><dfn id=length-size-value><var><length></var></dfn>
1443 <dd>A length value specifies an absolute font size (independent of the
1444 user agent's font table). Negative lengths are illegal.
1446 <dt><dfn id=percentage-size-value><var><percentage></var></dfn>
1448 <dd>A percentage value specifies an absolute font size relative to the
1449 parent element's font size. Use of percentage values, or values in
1450 ‘<code class=property>em</code>’s, leads to more robust and
1451 cascadable style sheets.
1452 </dl>
1454 <p>The following table provides user agent guidelines for the absolute-size
1455 scaling factor and their mapping to HTML heading and absolute font-sizes.
1456 The ‘<code class=property>medium</code>’ value is used as the
1457 reference middle value. The user agent may fine-tune these values for
1458 different fonts or different types of display devices.
1460 <table class=data>
1461 <thead>
1462 <tr>
1463 <th>CSS absolute-size values
1465 <th>xx-small
1467 <th>x-small
1469 <th>small
1471 <th>medium
1473 <th>large
1475 <th>x-large
1477 <th>xx-large
1479 <th>
1481 <tbody>
1482 <tr>
1483 <th>scaling factor
1485 <td>3/5
1487 <td>3/4
1489 <td>8/9
1491 <td>1
1493 <td>6/5
1495 <td>3/2
1497 <td>2/1
1499 <td>3/1
1501 <tr>
1502 <th>HTML headings
1504 <td>h6
1506 <td>
1508 <td>h5
1510 <td>h4
1512 <td>h3
1514 <td>h2
1516 <td>h1
1518 <td>
1520 <tr>
1521 <th>HTML font sizes
1523 <td>1
1525 <td>
1527 <td>2
1529 <td>3
1531 <td>4
1533 <td>5
1535 <td>6
1537 <td>7
1538 </table>
1540 <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
1541 applying these guidelines should nevertheless avoid creating font-size
1542 resulting in less than 9 device pixels per EM unit on a computer
1543 display.</em>
1545 <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
1546 factor between adjacent indexes was 1.5 which user experience proved to be
1547 too large. In CSS2, the suggested scaling factor for computer screen
1548 between adjacent indexes was 1.2 which still created issues for the small
1549 sizes. The new scaling factor varies between each index to provide a
1550 better readability.</em>
1552 <p>The actual value of this property may differ from the computed value due
1553 a numerical value on ‘<a href="#propdef-font-size-adjust"><code
1554 class=property>font-size-adjust</code></a>’ and the unavailability of
1555 certain font sizes.
1557 <p>Child elements inherit the computed <a class=noxref
1558 href="#font-size-prop"> <span class=property>‘<code
1559 class=property>font-size</code>’</span></a> value (otherwise, the effect
1560 of <a class=noxref href="#font-size-adjust-prop"><span
1561 class=property>‘<code
1562 class=property>font-size-adjust</code>’</span></a> would compound).
1564 <div class=example>
1565 <p style="display:none">Example(s):
1567 <p>
1569 <pre>p { font-size: 12pt; }
1570 blockquote { font-size: larger }
1571 em { font-size: 150% }
1572 em { font-size: 1.5em }
1573 </pre>
1574 </div>
1575 <!-- prop: font-size-adjust -->
1577 <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
1578 the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
1580 <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
1581 <tbody>
1582 <tr>
1583 <td>Name:
1585 <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
1587 <tr>
1588 <td>Value:
1590 <td><a href="#font-size-adjust-none-value"
1591 title="none!!font-size-adjust">none</a> | <a
1592 href="#font-size-adjust-auto-value"
1593 title="auto!!font-size-adjust">auto</a> | <a
1594 href="#aspect-ratio-value"><var><number></var></a>
1596 <tr>
1597 <td>Initial:
1599 <td>none
1601 <tr>
1602 <td>Applies to:
1604 <td>all elements
1606 <tr>
1607 <td>Inherited:
1609 <td>yes
1611 <tr>
1612 <td>Percentages:
1614 <td>N/A
1616 <tr>
1617 <td>Media:
1619 <td>visual
1621 <tr>
1622 <td>Computed value:
1624 <td>as specified
1626 <tr>
1627 <td>Animatable:
1629 <td>as <a
1630 href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
1631 </table>
1633 <p>For any given font size, the apparent size and legibility of text varies
1634 across fonts. For scripts such as Latin or Cyrillic that distinguish
1635 between upper and lowercase letters, the relative height of lowercase
1636 letters compared to their uppercase counterparts is a determining factor
1637 of legibility. This is commonly referred to as the <a class=index-def
1638 href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
1639 id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
1640 the x-height of a font divided by the font size.
1642 <p>In situations where font fallback occurs, fallback fonts may not share
1643 the same aspect ratio as the desired font family and will thus appear less
1644 readable. The font-size-adjust property is a way to preserve the
1645 readability of text when font fallback occurs. It does this by adjusting
1646 the font-size so that the x-height is the same regardless of the font
1647 used.
1649 <div class=example>
1650 <p>The style defined below defines Verdana as the desired font family, but
1651 if Verdana is not available Futura or Times will be used.</p>
1653 <pre>p {
1654 font-family: Verdana, Futura, Times;
1655 }
1657 <p>Lorem ipsum dolor sit amet, ...</p>
1658 </pre>
1660 <p>Verdana has a relatively high aspect ratio, lowercase letters are
1661 relatively tall compared to uppercase letters, so at small sizes text
1662 appears legible. Times has a lower aspect ratio and so if fallback
1663 occurs, the text will be less legible at small sizes than Verdana.</p>
1664 </div>
1666 <p>How text rendered in each of these fonts compares is shown below, the
1667 columns show text rendered in Verdana, Futura and Times. The same
1668 font-size value is used across cells within each row and red lines are
1669 included to show the differences in x-height. In the upper half each row
1670 is rendered in the same font-size value. The same is true for the lower
1671 half but in this half the font-size-adjust property is also set so that
1672 the actual font size is adjusted to preserve the x-height across each row.
1673 Note how small text remains relatively legible across each row in the
1674 lower half.
1676 <div class=figure><img alt="text with and without font-size-adjust"
1677 src=fontsizeadjust.png>
1678 <p class=caption>Text with and without the use of font-size-adjust
1679 </div>
1681 <p>This property allows authors to specify an aspect value for an element
1682 that will effectively preserve the x-height of the first choice font,
1683 whether it is substituted or not. Values have the following meanings:
1685 <dl>
1686 <dt><dfn id=font-size-adjust-none-value
1687 title="none!!font-size-adjust">none</dfn>
1689 <dd>Do not preserve the font's x-height.
1691 <dt><dfn id=font-size-adjust-auto-value
1692 title="auto!!font-size-adjust">auto</dfn>
1694 <dd>Behaves just like <number>, except the number used is the aspect
1695 value calculated by user agents for the first font in the list of fonts
1696 defined for the initial value of the <a href="#propdef-font-family"
1697 title="font-family!!property">‘<code
1698 class=property>font-family</code>’</a> property. Effectively this is
1699 the default font used when <a href="#propdef-font-family"
1700 title="font-family!!property">‘<code
1701 class=property>font-family</code>’</a> is not otherwise specified.
1702 <p>Authors can use this value to specify that font size should be
1703 normalized across fonts based on the x-height without the need to
1704 specify the aspect ratio explicitly.</p>
1706 <dt><dfn id=aspect-ratio-value><var><number></var></dfn>
1708 <dd>Specifies the aspect value used in the calculation below to calculate
1709 the adjusted font size:
1710 <pre>c = ( a / a' ) s
1711 </pre>
1713 <p>where:</p>
1715 <pre>s = font-size value
1716 a = aspect value as specified by the font-size-adjust property
1717 a' = aspect value of actual font
1718 c = adjusted font-size to use
1719 </pre>
1721 <p>This value applies to any font that is selected but in typical usage
1722 it should be based on the aspect value of the first font in the
1723 font-family list. If this is specified accurately, the <tt>(a/a')</tt>
1724 term in the formula above is effectively 1 for the first font and no
1725 adjustment occurs. If the value is specified inaccurately, text rendered
1726 using the first font in the family list will display differently in
1727 older user agents that don't support font-size-adjust.</p>
1728 </dl>
1730 <p>Authors can calculate the aspect value for a given font by comparing
1731 spans with the same content but different font-size-adjust properties. If
1732 the same font-size is used, the spans will match when the font-size-adjust
1733 value is accurate for the given font.
1735 <div class=example>
1736 <p>Two spans with borders are used to determine the aspect value of a
1737 font. The font-size is the same for both spans but the font-size-adjust
1738 property is specified only for the right span. Starting with a value of
1739 0.5, the aspect value can be adjusted until the borders around the two
1740 letters line up.</p>
1742 <pre>p {
1743 font-family: Futura;
1744 font-size: 500px;
1745 }
1747 span {
1748 border: solid 1px red;
1749 }
1751 .adjust {
1752 font-size-adjust: 0.5;
1753 }
1755 <p><span>b</span><span class="adjust">b</span></p>
1756 </pre>
1758 <div class=figure><img alt="Futura with an aspect value of 0.5"
1759 src=beforefontsizeadjust.png>
1760 <p class=caption>Futura with an aspect value of 0.5
1761 </div>
1763 <p>The box on the right is a bit bigger than the one on the left, so the
1764 aspect value of this font is something less than 0.5. Adjust the value
1765 until the boxes align.</p>
1766 </div>
1767 <!-- prop: font -->
1769 <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
1770 <a href="#propdef-font">font</a> property</h3>
1772 <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
1773 <tbody>
1774 <tr>
1775 <td>Name:
1777 <td><dfn id=propdef-font>font</dfn>
1779 <tr>
1780 <td>Value:
1782 <td>[ [ <var><<a href="#propdef-font-style"
1783 title="font-style!!property">‘<code
1784 class=property>font-style</code>’</a>></var> || <a
1785 href="#font-variant-css21-values"><var><font-variant-css21></var></a>
1786 || <var><<a href="#propdef-font-weight"
1787 title="font-weight!!property">‘<code
1788 class=property>font-weight</code>’</a>></var> || <var><<a
1789 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
1790 class=property>font-stretch</code>’</a></var> ]? <var><‘<a
1791 href="#propdef-font-size"><code
1792 class=property>font-size</code></a>’></var> [ / <var><‘<code
1793 class=property>line-height</code>’></var> ]? <var><<a
1794 href="#propdef-font-family" title="font-family!!property">‘<code
1795 class=property>font-family</code>’</a>></var> ] | caption | icon |
1796 menu | message-box | small-caption | status-bar
1798 <tr>
1799 <td>Initial:
1801 <td>see individual properties
1803 <tr>
1804 <td>Applies to:
1806 <td>all elements
1808 <tr>
1809 <td>Inherited:
1811 <td>yes
1813 <tr>
1814 <td>Percentages:
1816 <td>see individual properties
1818 <tr>
1819 <td>Media:
1821 <td>visual
1823 <tr>
1824 <td>Computed value:
1826 <td>see individual properties
1828 <tr>
1829 <td>Animatable:
1831 <td>see individual properties
1832 </table>
1834 <p>The <span class=property>‘<a href="#propdef-font"><code
1835 class=property>font</code></a>’</span> property is, except as described
1836 below, a shorthand property for setting <a href="#propdef-font-style"
1837 title="font-style!!property">‘<code
1838 class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
1839 title="font-variant!!property">‘<code
1840 class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
1841 title="font-weight!!property">‘<code
1842 class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
1843 title="font-stretch!!property">‘<code
1844 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1845 href="#propdef-font-size"><code
1846 class=property>font-size</code></a>’</span>, <a class=property
1847 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1848 class=property>line-height</code>’</a>, <a href="#propdef-font-family"
1849 title="font-family!!property">‘<code
1850 class=property>font-family</code>’</a> at the same place in the
1851 stylesheet. Values for the <a href="#propdef-font-variant"
1852 title="font-variant!!property">‘<code
1853 class=property>font-variant</code>’</a> property may also be included
1854 but only those supported in CSS 2.1, none of the <a
1855 href="#propdef-font-variant" title="font-variant!!property">‘<code
1856 class=property>font-variant</code>’</a> values added in this
1857 specification can be used in the <span class=property>‘<a
1858 href="#propdef-font"><code class=property>font</code></a>’</span>
1859 shorthand:
1861 <pre
1862 class=prod><dfn id=font-variant-css21-values><var><font-variant-css21></var></dfn> = [normal | small-caps]</pre>
1864 <p>The syntax of this property is based on a traditional typographical
1865 shorthand notation to set multiple properties related to fonts.
1867 <p>All subproperties of the ‘<a href="#propdef-font"><code
1868 class=property>font</code></a>’ property are first reset to their
1869 initial values, including those listed above plus <span
1870 class=property>‘<a href="#propdef-font-size-adjust"><code
1871 class=property>font-size-adjust</code></a>’</span>, <span
1872 class=property>‘<a href="#propdef-font-kerning"><code
1873 class=property>font-kerning</code></a>’</span>, subproperties of <a
1874 href="#propdef-font-variant" title="font-variant!!property">‘<code
1875 class=property>font-variant</code>’</a> and and <span>‘<a
1876 href="#propdef-font-language-override"><code
1877 class=property>font-language-override</code></a>’</span>. Then, those
1878 properties that are given explicit values in the <span
1879 class=property>‘<a href="#propdef-font"><code
1880 class=property>font</code></a>’</span> shorthand are set to those
1881 values. For a definition of allowed and initial values, see the previously
1882 defined properties. For reasons of backwards compatibility, it is not
1883 possible to set <span class=property>‘<a
1884 href="#propdef-font-size-adjust"><code
1885 class=property>font-size-adjust</code></a>’</span> to anything other
1886 than its initial value using the <span class=property>‘<a
1887 href="#propdef-font"><code class=property>font</code></a>’</span>
1888 shorthand property; instead, use the individual property.
1890 <div class=example>
1891 <p style="display:none">Example(s):
1893 <p>
1895 <pre>p { font: 12pt/14pt sans-serif }
1896 p { font: 80% sans-serif }
1897 p { font: x-large/110% "new century schoolbook", serif }
1898 p { font: bold italic large Palatino, serif }
1899 p { font: normal small-caps 120%/120% fantasy }
1900 p { font: condensed oblique 12pt "Helvetica Neue", serif; }
1901 </pre>
1903 <p> In the second rule, the font size percentage value (‘<code
1904 class=css>80%</code>’) refers to the computed ‘<a
1905 href="#propdef-font-size"><code class=property>font-size</code></a>’ of
1906 the parent element. In the third rule, the line height percentage
1907 (‘<code class=css>110%</code>’) refers to the font size of the
1908 element itself.
1910 <p>The first three rules do not specify the <a
1911 href="#propdef-font-variant" title="font-variant!!property">‘<code
1912 class=property>font-variant</code>’</a> and <a
1913 href="#propdef-font-weight" title="font-weight!!property">‘<code
1914 class=property>font-weight</code>’</a> explicitly, so these properties
1915 receive their initial values (‘<a href="#normal"><code
1916 class=property>normal</code></a>’). Notice that the font family name
1917 "new century schoolbook", which contains spaces, is enclosed in quotes.
1918 The fourth rule sets the <a href="#propdef-font-weight"
1919 title="font-weight!!property">‘<code
1920 class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
1921 class=property>bold</code></a>’, the <a href="#propdef-font-style"
1922 title="font-style!!property">‘<code
1923 class=property>font-style</code>’</a> to ‘<a href="#italic"><code
1924 class=property>italic</code></a>’, and implicitly sets <a
1925 href="#propdef-font-variant" title="font-variant!!property">‘<code
1926 class=property>font-variant</code>’</a> to ‘<a href="#normal"><code
1927 class=property>normal</code></a>’.
1929 <p> The fifth rule sets the <a href="#propdef-font-variant"
1930 title="font-variant!!property">‘<code
1931 class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
1932 class=property>small-caps</code></a>’), the <span class=property>‘<a
1933 href="#propdef-font-size"><code
1934 class=property>font-size</code></a>’</span> (120% of the parent's font
1935 size), the <a class=property
1936 href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
1937 class=property>line-height</code>’</a> (120% of the font size) and the
1938 <a href="#propdef-font-family" title="font-family!!property">‘<code
1939 class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
1940 class=property>fantasy</code></a>’). It follows that the keyword ‘<a
1941 href="#normal"><code class=property>normal</code></a>’ applies to the
1942 two remaining properties: <a href="#propdef-font-style"
1943 title="font-style!!property">‘<code
1944 class=property>font-style</code>’</a> and <a
1945 href="#propdef-font-weight" title="font-weight!!property">‘<code
1946 class=property>font-weight</code>’</a>.
1948 <p>The sixth rule sets the <a href="#propdef-font-style"
1949 title="font-style!!property">‘<code
1950 class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
1951 title="font-stretch!!property">‘<code
1952 class=property>font-stretch</code>’</a>, <span class=property>‘<a
1953 href="#propdef-font-size"><code
1954 class=property>font-size</code></a>’</span>, and <a
1955 href="#propdef-font-family" title="font-family!!property">‘<code
1956 class=property>font-family</code>’</a>, the other font properties being
1957 set to their initial values.
1958 </div>
1960 <p>Since the <a href="#propdef-font-stretch"
1961 title="font-stretch!!property">‘<code
1962 class=property>font-stretch</code>’</a> property was not defined in CSS
1963 2.1, when using <a href="#propdef-font-stretch"
1964 title="font-stretch!!property">‘<code
1965 class=property>font-stretch</code>’</a> values within ‘<a
1966 href="#propdef-font"><code class=property>font</code></a>’ rules,
1967 authors should include a extra version compatible with older user agents:
1969 <pre>p {
1970 font: 80% sans-serif; /* for older user agents */
1971 font: condensed 80% sans-serif;
1972 }</pre>
1974 <p>The following values refer to system fonts:
1976 <dl>
1977 <dt><strong>caption</strong>
1979 <dd>The font used for captioned controls (e.g., buttons, drop-downs,
1980 etc.).
1982 <dt><strong>icon</strong>
1984 <dd>The font used to label icons.
1986 <dt><strong>menu</strong>
1988 <dd>The font used in menus (e.g., dropdown menus and menu lists).
1990 <dt><strong>message-box</strong>
1992 <dd>The font used in dialog boxes.
1994 <dt><strong>small-caption</strong>
1996 <dd>The font used for labeling small controls.
1998 <dt><strong>status-bar</strong>
2000 <dd>The font used in window status bars.
2001 </dl>
2003 <p>System fonts may only be set as a whole; that is, the font family, size,
2004 weight, style, etc. are all set at the same time. These values may then be
2005 altered individually if desired. If no font with the indicated
2006 characteristics exists on a given platform, the user agent should either
2007 intelligently substitute (e.g., a smaller version of the ‘<code
2008 class=property>caption</code>’ font might be used for the ‘<code
2009 class=property>small-caption</code>’ font), or substitute a user agent
2010 default font. As for regular fonts, if, for a system font, any of the
2011 individual properties are not part of the operating system's available
2012 user preferences, those properties should be set to their initial values.
2014 <p>That is why this property is "almost" a shorthand property: system fonts
2015 can only be specified with this property, not with <a
2016 href="#propdef-font-family" title="font-family!!property">‘<code
2017 class=property>font-family</code>’</a> itself, so <span
2018 class=property>‘<a href="#propdef-font"><code
2019 class=property>font</code></a>’</span> allows authors to do more than
2020 the sum of its subproperties. However, the individual properties such as
2021 <a href="#propdef-font-weight" title="font-weight!!property">‘<code
2022 class=property>font-weight</code>’</a> are still given values taken from
2023 the system font, which can be independently varied.
2025 <p>Note that the keywords used for the system fonts listed above are only
2026 treated as keywords when they occur in the initial position, in other
2027 positions the same string is treated as part of the font family name:
2029 <pre> font: menu; /* use the font settings for system menus */
2030 font: large menu; /* use a font family named "menu" */</pre>
2032 <div class=example>
2033 <p style="display:none">Example(s):
2035 <p>
2037 <pre>button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
2038 button p { font: menu }
2039 button p em { font-weight: bolder }
2040 </pre>
2042 <p>If the font used for dropdown menus on a particular system happened to
2043 be, for example, 9-point Charcoal, with a weight of 600, then P elements
2044 that were descendants of BUTTON would be displayed as if this rule were
2045 in effect:
2047 <pre>button p { font: 600 9pt Charcoal }
2048 </pre>
2050 <p>Because the <span class=property>‘<a href="#propdef-font"><code
2051 class=property>font</code></a>’</span> shorthand resets to its initial
2052 value any property not explicitly given a value, this has the same effect
2053 as this declaration:
2055 <pre>button p {
2056 font-style: normal;
2057 font-variant: normal;
2058 font-weight: 600;
2059 font-size: 9pt;
2060 line-height: normal;
2061 font-family: Charcoal
2062 }
2063 </pre>
2064 </div>
2065 <!-- prop: font-synthesis -->
2067 <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
2068 synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
2069 property</h3>
2071 <table class=propdef id=namefont-synthesisvaluenone-weight-style>
2072 <tbody>
2073 <tr>
2074 <td>Name:
2076 <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
2078 <tr>
2079 <td>Value:
2081 <td>none | [ weight || style ]
2083 <tr>
2084 <td>Initial:
2086 <td>weight style
2088 <tr>
2089 <td>Applies to:
2091 <td>all elements
2093 <tr>
2094 <td>Inherited:
2096 <td>yes
2098 <tr>
2099 <td>Percentages:
2101 <td>N/A
2103 <tr>
2104 <td>Media:
2106 <td>visual
2108 <tr>
2109 <td>Computed value:
2111 <td>as specified
2113 <tr>
2114 <td>Animatable:
2116 <td>no
2117 </table>
2119 <p>This property controls whether user agents are allowed to synthesize
2120 bold or oblique font faces when a font family lacks bold or italic faces.
2121 If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
2122 specified, user agents must not synthesize bold faces and if ‘<code
2123 class=property>style</code>’ is not specified user agents must not
2124 synthesize italic faces. A value of ‘<code class=property>none</code>’
2125 disallows all synthetic faces.
2127 <div class=example>
2128 <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
2130 <pre>*:lang(ar) { font-synthesis: none; }
2131 </pre>
2132 </div>
2134 <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
2136 <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
2137 id=at-font-face-rule style="font-weight: inherit; font-style:
2138 inherit"><code>@font-face</code></dfn> rule</h3>
2140 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
2141 for linking to fonts that are automatically fetched and activated when
2142 needed. This allows authors to select a font that closely matches the
2143 design goals for a given page rather than limiting the font choice to a
2144 set of fonts available on all platforms. A set of font descriptors define
2145 the location of a font resource, either locally or externally, along with
2146 the style characteristics of an individual face. Multiple <a
2147 href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
2148 construct font families with a variety of faces. Using CSS font matching
2149 rules, a user agent can selectively download only those faces that are
2150 needed for a given piece of text.
2152 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2153 consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
2154 at-keyword followed by a block of descriptor declarations. In terms of the
2155 grammar, this specification defines the following productions:
2157 <pre><dfn id=fontfacerule>font_face_rule</dfn>
2158 : <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>*
2159 ;
2161 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
2162 : <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>
2163 ;</pre>
2165 <p>The following new definitions are introduced:
2167 <pre>- -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
2168 F f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
2170 <p>The following new token is introduced:
2172 <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
2174 <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2175 specifies a value for every font descriptor, either implicitly or
2176 explicitly. Those not given explicit values in the rule take the initial
2177 value listed with each descriptor in this specification. These descriptors
2178 apply solely within the context of the <a
2179 href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
2180 are defined, and do not apply to document language elements. There is no
2181 notion of which elements the descriptors apply to or whether the values
2182 are inherited by child elements. When a given descriptor occurs multiple
2183 times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
2184 rule, only the last descriptor declaration is used and all prior
2185 declarations for that descriptor are ignored.
2187 <div class=example>
2188 <p>To use a downloadable font called Gentium:</p>
2190 <pre>
2191 @font-face {
2192 font-family: Gentium;
2193 src: url(http://example.com/fonts/Gentium.ttf);
2194 }
2196 p { font-family: Gentium, serif; }
2197 </pre>
2199 <p>The user agent will download Gentium and use it when rendering text
2200 within paragraph elements. If for some reason the site serving the font
2201 is unavailable, the default serif font will be used.</p>
2202 </div>
2204 <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
2205 rules define a set of fonts available for use within the documents that
2206 contain these rules. When font matching is done, fonts defined using these
2207 rules are considered before other available fonts on a system.
2209 <p>Downloaded fonts are only available to documents that reference them.
2210 The process of activating these fonts must not make them available to
2211 other applications or to documents that don't directly link to the same
2212 font. User agent implementers might consider it convenient to use
2213 downloaded fonts when rendering characters in other documents for which no
2214 other available font exists as part of the <a
2215 href="#system-font-fallback"><em>system font fallback</em></a> procedure.
2216 However, this would cause a security leak since the contents of one page
2217 would be able to affect other pages, something an attacker could use as an
2218 attack vector. These restrictions do not affect caching behavior, fonts
2219 are cached the same way other web resources are cached.
2221 <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
2222 properties in a declaration block, declarations of any descriptors that
2223 are not supported by the user agent must be ignored. <a
2224 href="#at-font-face-rule"><code>@font-face</code></a> rules require a
2225 font-family and src descriptor; if either of these are missing, the <a
2226 href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
2227 must be ignored entirely.
2229 <p>In cases where user agents have limited platform resources or implement
2230 the ability to disable downloadable font resources, <a
2231 href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
2232 ignored; the behavior of individual descriptors as defined in this
2233 specification should not be altered.
2235 <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
2236 href="#descdef-font-family">font-family</a> descriptor</h3>
2238 <table class=descdef>
2239 <tbody>
2240 <tr>
2241 <td>Name:
2243 <td><dfn id=descdef-font-family
2244 title="font-family!!descriptor">font-family</dfn>
2246 <tr>
2247 <td>Value:
2249 <td><a href="#family-name-value"><var><family-name></var></a>
2251 <tr>
2252 <td><em>Initial:</em>
2254 <td>N/A
2255 </table>
2257 <p>This descriptor defines the font family name that will be used in all
2258 CSS font family name matching. It is required for the <a
2259 href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
2260 overrides the font family names contained in the underlying font data. If
2261 the font family name is the same as a font family available in a given
2262 user's environment, it effectively hides the underlying font for documents
2263 that use the stylesheet. This permits a web author to freely choose
2264 font-family names without worrying about conflicts with font family names
2265 present in a given user's environment. Likewise, platform substitutions
2266 for a given font family name must not be used.
2268 <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
2269 href="#descdef-src">src</a> descriptor</h3>
2271 <table class=descdef>
2272 <tbody>
2273 <tr>
2274 <td>Name:
2276 <td><dfn id=descdef-src>src</dfn>
2278 <tr>
2279 <td>Value:
2281 <td>[ <url> [format(<string> #)]? | <a
2282 href="#font-face-name-value"><var><font-face-name></var></a> ] #
2284 <tr>
2285 <td><em>Initial:</em>
2287 <td>N/A
2288 </table>
2290 <p>This descriptor specifies the resource containing font data. It is
2291 required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
2292 rule to be valid. Its value is a prioritized, comma-separated list of
2293 external references or locally-installed font face names. When a font is
2294 needed the user agent iterates over the set of references listed, using
2295 the first one it can successfully activate. Fonts containing invalid data
2296 or local font faces that are not found are ignored and the user agent
2297 loads the next font in the list.
2299 <p>As with other URLs in CSS, the URL may be relative, in which case it is
2300 resolved relative to the location of the style sheet containing the <a
2301 href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
2302 SVG fonts, the URL points to an element within a document containing SVG
2303 font definitions. If the element reference is omitted, a reference to the
2304 first defined font is implied. Similarly, font container formats that can
2305 contain more than one font must load one and only one of the fonts for a
2306 given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
2307 Fragment identifiers are used to indicate which font to load. If a
2308 container format lacks a defined fragment identifier scheme,
2309 implementations should use a simple 1-based indexing scheme (e.g.
2310 "font-collection#1" for the first font, "font-collection#2" for the second
2311 font).
2313 <pre>
2314 src: url(fonts/simple.ttf); /* load simple.ttf relative to stylesheet location */
2315 src: url(/fonts/simple.ttf); /* load simple.ttf from absolute location */
2316 src: url(fonts.svg#simple); /* load SVG font with id 'simple' */
2317 </pre>
2319 <p>External references consist of a URL, followed by an optional hint
2320 describing the format of the font resource referenced by that URL. The
2321 format hint contains a comma-separated list of format strings that denote
2322 well-known font formats. Conformant user agents must skip downloading a
2323 font resource if the format hints indicate only unsupported or unknown
2324 font formats. If no format hints are supplied, the user agent should
2325 download the font resource.
2327 <pre>
2328 /* load WOFF font if possible, otherwise use OpenType font */
2329 @font-face {
2330 font-family: bodytext;
2331 src: url(ideal-sans-serif.woff) format("woff"),
2332 url(basic-sans-serif.ttf) format("opentype");
2333 }
2334 </pre>
2336 <p>Format strings defined by this specification:
2338 <table class=data id=fontformats>
2339 <thead>
2340 <tr>
2341 <th>String
2343 <th>Font Format
2345 <th>Common extensions
2347 <tbody>
2348 <tr>
2349 <th>"woff"
2351 <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
2353 <td>.woff
2355 <tr>
2356 <th>"truetype"
2358 <td><a
2359 href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
2361 <td>.ttf
2363 <tr>
2364 <th>"opentype"
2366 <td><a
2367 href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
2369 <td>.ttf, .otf
2371 <tr>
2372 <th>"embedded-opentype"
2374 <td><a
2375 href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
2376 OpenType</a>
2378 <td>.eot
2380 <tr>
2381 <th>"svg"
2383 <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
2385 <td>.svg, .svgz
2386 </table>
2388 <p>Given the overlap in common usage between TrueType and OpenType, the
2389 format hints "truetype" and "opentype" must be considered as synonymous; a
2390 format hint of "opentype" does not imply that the font contains Postscript
2391 CFF style glyph data or that it contains OpenType layout information (see
2392 <a href="#platform-props-to-css">Appendix A</a> for more background on
2393 this).
2395 <p>When authors would prefer to use a locally available copy of a given
2396 font and download it if it's not, <code>local()</code> can be used. The
2397 locally-installed <dfn
2398 id=font-face-name-value><var><font-face-name></var></dfn> argument
2399 to <code>local()</code> is a format-specific string that uniquely
2400 identifies a single font face within a larger family. The syntax for a <a
2401 href="#font-face-name-value"><var><font-face-name></var></a> is a
2402 unique font face name enclosed by "local(" and ")". The name can
2403 optionally be enclosed in quotes. If unquoted, the unquoted font family
2404 name processing conventions apply; the name must be a sequence of
2405 identifiers separated by whitespace which is converted to a string by
2406 joining the identifiers together separated by a single space.
2408 <pre>
2409 /* regular face of Gentium */
2410 @font-face {
2411 font-family: MyGentium;
2412 src: local(Gentium), /* use locally available Gentium */
2413 url(Gentium.ttf); /* otherwise, download it */
2414 }
2415 </pre>
2417 <p>For OpenType and TrueType fonts, this string is used to match only the
2418 Postscript name or the full font name in the name table of locally
2419 available fonts. Which type of name is used varies by platform and font,
2420 so authors should include both of these names to assure proper matching
2421 across platforms. Platform substitutions for a given font name must not be
2422 used.
2424 <pre>
2425 /* bold face of Gentium */
2426 @font-face {
2427 font-family: MyGentium;
2428 src: local(Gentium Bold), /* full font name */
2429 local(Gentium-Bold), /* Postscript name */
2430 url(GentiumBold.ttf); /* otherwise, download it */
2431 font-weight: bold;
2432 }
2433 </pre>
2435 <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
2436 specifies the characteristics of a single font within a family, the unique
2437 name used with <code>local()</code> specifies a single font, not an entire
2438 font family. Defined in terms of OpenType font data, the Postscript name
2439 is found in the font's <a
2440 href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
2441 in the name record with nameID = 6 (see <a href="#OPENTYPE"
2442 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
2443 Postscript name is the commonly used key for all fonts on OSX and for
2444 Postscript CFF fonts under Windows. The full font name (nameID = 4) is
2445 used as a unique key for fonts with TrueType glyphs on Windows.
2447 <p>For OpenType fonts with multiple localizations of the full font name,
2448 the US English version is used (language ID = 0x409 for Windows and
2449 language ID = 0 for Macintosh) or the first localization when a US English
2450 full font name is not available (the OpenType specification recommends
2451 that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
2452 fonts minimally include US English names</a>). User agents that also match
2453 other full font names, e.g. matching the Dutch name when the current
2454 system locale is set to Dutch, are considered non-conformant. This is done
2455 not to prefer English but to avoid matching inconsistencies across font
2456 versions and OS localizations, since font style names (e.g. "Bold") are
2457 frequently localized into many languages and the set of localizations
2458 available varies widely across platform and font version. User agents that
2459 match a concatenation of family name (nameID = 1) with style name (nameID
2460 = 2) are considered non-conformant.
2462 <p>This also allows for referencing faces that belong to larger families
2463 that cannot otherwise be referenced.
2465 <div class=example>
2466 <p>Use a local font or reference an SVG font in another document:</p>
2468 <pre>
2469 @font-face {
2470 font-family: Headline;
2471 src: local(Futura-Medium),
2472 url(fonts.svg#MyGeometricModern) format("svg");
2473 }
2474 </pre>
2476 <p>Create an alias for local Japanese fonts on different platforms:</p>
2478 <pre>
2479 @font-face {
2480 font-family: jpgothic;
2481 src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
2482 }
2483 </pre>
2485 <p>Reference a font face that cannot be matched within a larger family:</p>
2487 <pre>
2488 @font-face {
2489 font-family: Hoefler Text Ornaments;
2490 /* has the same font properties as Hoefler Text Regular */
2491 src: local(HoeflerText-Ornaments);
2492 }
2493 </pre>
2495 <p>Since localized fullnames never match, a document with the header style
2496 rules below would always render using the default serif font, regardless
2497 whether a particular system locale parameter is set to Finnish or not:</p>
2499 <pre>
2500 @font-face {
2501 font-family: SectionHeader;
2502 src: local("Arial Lihavoitu"); /* Finnish fullname for Arial Bold, should fail */
2503 font-weight: bold;
2504 }
2506 h2 { font-family: SectionHeader, serif; }
2507 </pre>
2509 <p>A conformant user agent would never load the font ‘<code
2510 class=css>gentium.eot</code>’ in the example below, since it is
2511 included in the first definition of the ‘<a href="#descdef-src"><code
2512 class=property>src</code></a>’ descriptor which is overridden by the
2513 second definition in the same <a
2514 href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
2516 <pre>
2517 @font-face {
2518 font-family: MainText;
2519 src: url(gentium.eot); /* for use with older non-conformant user agents */
2520 src: local("Gentium"), url(gentium.ttf); /* Overrides src definition */
2521 }
2522 </pre>
2523 </div>
2525 <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
2526 descriptors: the <a href="#descdef-font-style">font-style</a>, <a
2527 href="#descdef-font-weight">font-weight</a>, <a
2528 href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
2530 <table class=descdef>
2531 <tbody>
2532 <tr>
2533 <td>Name:
2535 <td><dfn id=descdef-font-style
2536 title="font-style!!descriptor">font-style</dfn>
2538 <tr>
2539 <td>Value:
2541 <td>normal | italic | oblique
2543 <tr>
2544 <td><em>Initial:</em>
2546 <td>normal
2547 </table>
2549 <table class=descdef>
2550 <tbody>
2551 <tr>
2552 <td>Name:
2554 <td><dfn id=descdef-font-weight
2555 title="font-weight!!descriptor">font-weight</dfn>
2557 <tr>
2558 <td>Value:
2560 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
2562 <tr>
2563 <td><em>Initial:</em>
2565 <td>normal
2566 </table>
2568 <table class=descdef>
2569 <tbody>
2570 <tr>
2571 <td>Name:
2573 <td><dfn id=descdef-font-stretch
2574 title="font-stretch!!descriptor">font-stretch</dfn>
2576 <tr>
2577 <td>Value:
2579 <td>normal | ultra-condensed | extra-condensed | condensed |
2580 semi-condensed | semi-expanded | expanded | extra-expanded |
2581 ultra-expanded
2583 <tr>
2584 <td><em>Initial:</em>
2586 <td>normal
2587 </table>
2589 <p>These descriptors define the characteristics of a font face and are used
2590 in the process of matching styles to specific faces. For a font family
2591 defined with several <a
2592 href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
2593 can either download all faces in the family or use these descriptors to
2594 selectively download font faces that match actual styles used in document.
2595 The values for these descriptors are the same as those for the
2596 corresponding font properties except that relative keywords are not
2597 allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
2598 and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
2599 these descriptors are omitted, initial values are assumed.
2601 <p>The value for these font face style attributes is used in place of the
2602 style implied by the underlying font data. This allows authors to combine
2603 faces in flexible combinations, even in situations where the original font
2604 data was arranged differently. User agents that implement synthetic
2605 bolding and obliquing must only apply synthetic styling in cases where the
2606 font descriptors imply this is needed, rather than based on the style
2607 attributes implied by the font data.
2609 <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
2610 <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
2612 <table class=descdef>
2613 <tbody>
2614 <tr>
2615 <td>Name:
2617 <td><dfn id=descdef-unicode-range>unicode-range</dfn>
2619 <tr>
2620 <td>Value:
2622 <td><a href="#urange-value"><var><urange></var></a> #
2624 <tr>
2625 <td><em>Initial:</em>
2627 <td>U+0-10FFFF
2628 </table>
2630 <p>This descriptor defines the set of Unicode codepoints that may be
2631 supported by the font face for which it is declared. The descriptor value
2632 is a comma-delimited list of Unicode range (<a
2633 href="#urange-value"><var><urange></var></a>) values. The union of
2634 these ranges defines the set of codepoints that serves as a hint for user
2635 agents when deciding whether or not to download a font resource for a
2636 given text run.
2638 <p>Each <dfn id=urange-value><var><urange></var></dfn> value is a <a
2639 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2640 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
2641 "U+" or "u+" prefix followed by a codepoint range in one of the three
2642 forms listed below. Ranges that do not fit one of the these forms are
2643 invalid and cause the declaration to be ignored.
2645 <dl>
2646 <dt>single codepoint (e.g. U+416)
2648 <dd>a valid Unicode codepoint, represented as one to six hexadecimal
2649 digits
2651 <dt>interval range (e.g. U+400-4ff)
2653 <dd>represented as two hyphen-separated valid Unicode codepoints
2654 indicating the inclusive start and end codepoints of a range
2656 <dt>wildcard range (e.g. U+4??)
2658 <dd>defined by the set of codepoints implied when trailing ‘<code
2659 class=css>?</code>’ characters signify any hexadeximal digit
2660 </dl>
2662 <p>Individual codepoints are written using hexadecimal values that
2663 correspond to <a href="http://www.unicode.org/charts/">Unicode character
2664 codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
2665 inclusive. Digit values of codepoints are ASCII case-insensitive. For
2666 interval ranges, the start and end codepoints are valid Unicode values and
2667 the end codepoint is greater than or equal to the start codepoint.
2669 <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
2670 "U+???") are valid and equivalent to a wildcard range with an initial zero
2671 digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
2672 the range of valid Unicode codepoints are invalid. Because of this, the
2673 maximum number of trailing ‘<code class=css>?</code>’ wildcard
2674 characters is five, even though the <a
2675 href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
2676 title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
2678 <p>Within the comma-delimited list of Unicode ranges in a ‘<a
2679 href="#descdef-unicode-range"><code
2680 class=property>unicode-range</code></a>’ descriptor declaration, ranges
2681 may overlap. The union of these ranges defines the set of codepoints for
2682 which the corresponding font may be used. User agents must not download or
2683 use the font for codepoints outside this set. User agents may normalize
2684 the list of ranges into a list that is different but represents the same
2685 set of codepoints.
2687 <p>The associated font might not contain glyphs for the entire set of
2688 codepoints defined by the ‘<a href="#descdef-unicode-range"><code
2689 class=property>unicode-range</code></a>’ descriptor. When the font is
2690 used the effective <a href="#character-map"><em>character map</em></a> is
2691 the intersection of the codepoints defined by ‘<a
2692 href="#descdef-unicode-range"><code
2693 class=property>unicode-range</code></a>’ with the font's <a
2694 href="#character-map"><em>character map</em></a>. This allows authors to
2695 define supported ranges in terms of broad ranges without worrying about
2696 the precise codepoint ranges supported by the underlying font.
2698 <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
2699 to define composite fonts</h3>
2701 <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
2702 with different unicode ranges for the same family and style descriptor
2703 values can be used to create composite fonts that mix the glyphs from
2704 different fonts for different scripts. This can be used to combine fonts
2705 that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
2706 or it can be used by authors as a way of segmenting a font into fonts for
2707 commonly used characters and less frequently used characters. Since the
2708 user agent will only pull down the fonts it needs this helps reduce page
2709 bandwidth.
2711 <p>If the unicode ranges overlap for a set of <a
2712 href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
2713 family and style descriptor values, the rules are ordered in the reverse
2714 order they were defined; the last rule defined is the first to be checked
2715 for a given character.
2717 <p>Example ranges for specific languages or characters:
2719 <dl>
2720 <dt>unicode-range: U+A5;
2722 <dd>a single code point, the yen/yuan symbol
2724 <dt>unicode-range: U+0-7F;
2726 <dd>code range for basic ASCII characters
2728 <dt>unicode-range: U+590-5ff;
2730 <dd>code range for Hebrew characters
2732 <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
2734 <dd>code range for Japanese kanji, hiragana and katakana characters plus
2735 yen/yuan symbol
2736 </dl>
2738 <div class=example>
2739 <p>The BBC provides news services in a wide variety of languages, many
2740 that are not well supported across all platforms. Using an <a
2741 href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
2742 provide a font for any of these languages, as it already does via a
2743 manual font download.</p>
2745 <pre>
2746 @font-face {
2747 font-family: BBCBengali;
2748 src: url(fonts/BBCBengali.ttf) format("opentype");
2749 unicode-range: U+00-FF, U+980-9FF;
2750 }
2751 </pre>
2752 </div>
2754 <div class=example>
2755 <p>Technical documents often require a wide range of symbols. The STIX
2756 Fonts project is one project aimed at providing fonts to support a wide
2757 range of technical typesetting in a standardized way. The example below
2758 shows the use of a font that provides glyphs for many of the mathematical
2759 and technical symbol ranges within Unicode:</p>
2761 <pre>
2762 @font-face {
2763 font-family: STIXGeneral;
2764 src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
2765 unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
2766 }
2767 </pre>
2768 </div>
2770 <div class=example>
2771 <p>This example shows how an author can override the glyphs used for Latin
2772 characters in a Japanese font with glyphs from a different font. The
2773 first rule specifies no range so it defaults to the entire range. The
2774 range specified in the second rule overlaps but takes precedence because
2775 it is defined later.</p>
2777 <pre>
2778 @font-face {
2779 font-family: JapaneseWithGentium;
2780 src: local(MSMincho);
2781 /* no range specified, defaults to entire range */
2782 }
2784 @font-face {
2785 font-family: JapaneseWithGentium;
2786 src: url(../fonts/Gentium.ttf);
2787 unicode-range: U+0-2FF;
2788 }
2789 </pre>
2790 </div>
2792 <div class=example>
2793 <p>Consider a family constructed to optimize bandwidth by separating out
2794 Latin, Japanese and other characters into different font files:</p>
2796 <pre>
2797 /* fallback font - size: 4.5MB */
2798 @font-face {
2799 font-family: DroidSans;
2800 src: url(DroidSansFallback.ttf);
2801 /* no range specified, defaults to entire range */
2802 }
2804 /* Japanese glyphs - size: 1.2MB */
2805 @font-face {
2806 font-family: DroidSans;
2807 src: url(DroidSansJapanese.ttf);
2808 unicode-range: U+3000-9FFF, U+ff??;
2809 }
2811 /* Latin, Greek, Cyrillic along with some
2812 punctuation and symbols - size: 190KB */
2813 @font-face {
2814 font-family: DroidSans;
2815 src: url(DroidSans.ttf);
2816 unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
2817 }
2818 </pre>
2820 <p>For simple Latin text, only the font for Latin characters is
2821 downloaded:</p>
2823 <pre>
2824 body { font-family: DroidSans; }
2826 <p>This is that</p>
2827 </pre>
2829 <p>In this case the user agent first checks the unicode-range for the font
2830 containing Latin characters (DroidSans.ttf). Since all the characters
2831 above are in the range U+0-5FF, the user agent downloads the font and
2832 renders the text with that font.</p>
2834 <p>Next, consider text that makes use of an arrow character (⇨):</p>
2836 <pre>
2837 <p>This &#x21e8; that<p>
2838 </pre>
2840 <p>The user agent again first checks the unicode-range of the font
2841 containing Latin characters. Since U+2000-2300 includes the arrow code
2842 point (U+21E8), the user agent downloads the font. For this character
2843 however the Latin font does not have a matching glyph, so the effective
2844 unicode-range used for font matching excludes this code point. Next, the
2845 user agent evaluates the Japanese font. The unicode-range for the
2846 Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
2847 user agent does not download the Japanese font. Next the fallback font is
2848 considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
2849 rule for the fallback font does not define unicode-range so its value
2850 defaults to the range of all Unicode code points. The fallback font is
2851 downloaded and used to render the arrow character.</p>
2852 </div>
2854 <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
2855 href="#descdef-font-variant">font-variant</a> and <a
2856 href="#descdef-font-feature-settings">font-feature-settings</a>
2857 descriptors</h3>
2859 <table class=descdef>
2860 <tbody>
2861 <tr>
2862 <td>Name:
2864 <td><dfn id=descdef-font-variant
2865 title="font-variant!!descriptor">font-variant</dfn>
2867 <tr>
2868 <td>Value:
2870 <td><a href="#font-variant-normal-value"
2871 title="normal!!font-variant">normal</a> | <a
2872 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
2873 <a href="#common-lig-values"><var><common-lig-values></var></a>
2874 || <a
2875 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
2876 || <a
2877 href="#historical-lig-values"><var><historical-lig-values></var></a>
2878 || <a
2879 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
2880 || <a href="#stylistic"><var
2881 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
2882 href="#historical-forms"><var>historical-forms</var></a> || <a
2883 href="#styleset"><var
2884 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
2885 href="#character-variant"><var
2886 title=character-variant>character-variant(<feature-value-name>
2887 #)</var></a> || <a href="#swash"><var
2888 title=swash>swash(<feature-value-name>)</var></a> || <a
2889 href="#ornaments"><var
2890 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
2891 href="#annotation"><var
2892 title=annotation>annotation(<feature-value-name>)</var></a> || [
2893 <a href="#small-caps"><i>small-caps</i></a> | <a
2894 href="#all-small-caps"><i>all-small-caps</i></a> | <a
2895 href="#petite-caps"><i>petite-caps</i></a> | <a
2896 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
2897 href="#unicase"><i>unicase</i></a> | <a
2898 href="#titling-caps"><i>titling-caps</i></a> ] || <a
2899 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
2900 || <a
2901 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
2902 || <a
2903 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
2904 || <a href="#ordinal"><i>ordinal</i></a> || <a
2905 href="#slashed-zero"><i>slashed-zero</i></a> || <a
2906 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
2907 || <a
2908 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
2909 || <a href="#ruby"><i>ruby</i></a> ]
2911 <tr>
2912 <td><em>Initial:</em>
2914 <td>normal
2915 </table>
2917 <table class=descdef>
2918 <tbody>
2919 <tr>
2920 <td>Name:
2922 <td><dfn id=descdef-font-feature-settings
2923 title="font-feature-settings!!descriptor">font-feature-settings</dfn>
2925 <tr>
2926 <td>Value:
2928 <td><a href="#font-feature-settings-normal-value"
2929 title="normal!!font-feature-settings">normal</a> | <a
2930 href="#feature-tag-value"><var><feature-tag-value></var></a> #
2932 <tr>
2933 <td><em>Initial:</em>
2935 <td>normal
2936 </table>
2938 <p>These descriptors define initial settings that apply when the font
2939 defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
2940 rule is rendered. They do not affect font selection. Values are identical
2941 to those defined for the corresponding <a href="#propdef-font-variant"
2942 title="font-variant!!property">‘<code
2943 class=property>font-variant</code>’</a> and <a
2944 href="#propdef-font-feature-settings"
2945 title="font-feature-settings!!property">‘<code
2946 class=property>font-feature-settings</code>’</a> properties defined
2947 below except that the value ‘<code class=property>inherit</code>’ is
2948 omitted. When multiple font feature descriptors or properties are used,
2949 the cumulative effect on text rendering is detailed in the section <a
2950 href="#font-feature-resolution">Font Feature Resolution</a> below. In
2951 cases where specific values define synthesized fallback for certain <a
2952 href="#propdef-font-variant" title="font-variant!!property">‘<code
2953 class=property>font-variant</code>’</a> subproperties, the same
2954 synthesized fallback applies when used within those values are used with
2955 the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
2956 class=property>font-variant</code>’</a> descriptor.
2958 <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
2959 guidelines</h3>
2961 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
2962 designed to allow lazy loading of font resources that are only downloaded
2963 when used within a document. A stylesheet can include <a
2964 href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
2965 of fonts of which only a select set are used; user agents must only
2966 download those fonts that are referred to within the style rules
2967 applicable to a given page. User agents that download all fonts defined in
2968 <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
2969 considering whether those fonts are in fact used within a page are
2970 considered non-conformant. In cases where a font might be downloaded in
2971 character fallback cases, user agents may download a font if it's
2972 contained within the computed value of <a href="#propdef-font-family"
2973 title="font-family!!property">‘<code
2974 class=property>font-family</code>’</a> for a given text run.
2976 <pre>
2977 @font-face {
2978 font-family: GeometricModern;
2979 src: url(font.ttf);
2980 }
2982 p {
2983 /* font will be downloaded for pages with p elements */
2984 font-family: GeometricModern, sans-serif;
2985 }
2987 h2 {
2988 /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
2989 font-family: Futura, GeometricModern, sans-serif;
2990 }
2991 </pre>
2993 <p>In cases where textual content is loaded before downloadable fonts are
2994 available, user agents may render text as it would be rendered if
2995 downloadable font resources are not available or they may render text
2996 transparently with fallback fonts to avoid a flash of text using a
2997 fallback font. In cases where the font download fails user agents must
2998 display text, simply leaving transparent text is considered non-conformant
2999 behavior. Authors are advised to use fallback fonts in their font lists
3000 that closely match the vertical metrics of the downloadable fonts to avoid
3001 large page reflows where possible.
3003 <h3 id=same-origin-restriction><span class=secno>4.9 </span>Same-origin
3004 restriction for fonts</h3>
3006 <h4 id=default-same-origin-restriction><span class=secno>4.9.1
3007 </span>Default same-origin restriction</h4>
3008 <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
3009 http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
3010 http://www.w3.org/2011/10/31-webapps-minutes.html#item02
3011 -->
3013 <p>User agents must implement a same-origin restriction when loading fonts
3014 via the <a href="#at-font-face-rule"><code>@font-face</code></a>
3015 mechanism. This restriction limits the loading of fonts for a given
3016 document to fonts loaded from the same origin. Fonts can only be loaded
3017 via the same host, port, and method combination as the containing
3018 document, using the <a
3019 href="http://www.w3.org/TR/html5/browsers.html#origin">origin matching
3020 algorithm</a> described in the <a href="#HTML5"
3021 rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification. The origin of
3022 the stylesheet containing <a
3023 href="#at-font-face-rule"><code>@font-face</code></a> rules is not used
3024 when deciding whether a font is same origin or not, only the origin of the
3025 containing document is used. The restriction applies to all font types.
3027 <p>Given a document located at http://example.com/page.html, fonts defined
3028 with ‘<a href="#descdef-src"><code class=property>src</code></a>’
3029 definitions considered cross origin must not be loaded:
3031 <pre>
3032 /* same origin (i.e. domain, protocol, port match document) */
3033 src: url(fonts/simple.ttf);
3034 src: url(//fonts/simple.ttf);
3036 /* cross origin, different protocol */
3037 src: url(https://example.com/fonts/simple.ttf);
3039 /* cross origin, different domain */
3040 src: url(http://another.example.com/fonts/simple.ttf);
3041 </pre>
3043 <h4 id=allowing-cross-origin-font-loading><span class=secno>4.9.2
3044 </span>Allowing cross-origin font loading</h4>
3046 <p>User agents must also implement the ability to relax this restriction
3047 using cross-site origin controls <a href="#CORS"
3048 rel=biblioentry>[CORS]<!--{{!CORS}}--></a> for fonts loaded via HTTP.
3049 Sites can explicitly allow cross-site downloading of font data using the
3050 <code>Access-Control-Allow-Origin</code> HTTP header. For other protocols,
3051 no explicit relaxation mechanism is defined or required.
3053 <p>For font loads over HTTP, cross-origin requests must be made with the
3054 following parameter settings which are used in conjunction with the <a
3055 href="http://www.w3.org/TR/cors/#cross-origin-request-0"> <em>cross-origin
3056 request algorithm</em></a> <a href="#CORS"
3057 rel=biblioentry>[CORS]<!--{{!CORS}}--></a>:
3059 <ul>
3060 <li><em>request URL</em> — the URL of the font resource in the <a
3061 href="#descdef-src"><code>src</code></a> descriptor
3063 <li><em>request method</em> — GET
3065 <li><em>author request headers</em> — none
3067 <li><em>request entity body</em> — empty
3069 <li><em>source origin</em> — the origin of the page which linked to the
3070 stylesheet
3072 <li><em>manual redirect flag</em> — false
3074 <li><em>omit credentials flag</em> — true
3076 <li><em>force preflight flag</em> — false
3077 </ul>
3079 <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
3080 Algorithm</h2>
3082 <p>The algorithm below describes how fonts are associated with individual
3083 runs of text. For each character in the run a font family is chosen and a
3084 particular font face is selected containing a glyph for that character.
3086 <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
3087 font family names</h3>
3089 <p>As part of the font matching algorithm outlined below, user agents must
3090 match font family names used in style rules with actual font family names
3091 contained in fonts available in a given environment or defined via <a
3092 href="#at-font-face-rule"><code>@font-face</code></a> rules. User agents
3093 must match these names case insensitively, using the "Default Caseless
3094 Matching" algorithm outlined in the Unicode specification <a
3095 href="#UNICODE6" rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This
3096 algorithm is detailed in section 3.13 entitled "Default Case Algorithms".
3097 Specifically, the algorithm must be applied without normalizing the
3098 strings involved and without applying any language-specific tailorings.
3099 The case folding method specified by this algorithm uses the case mappings
3100 with status field ‘<code class=property>C</code>’ or ‘<code
3101 class=property>F</code>’ in the CaseFolding.txt file of the Unicode
3102 Character Database.
3104 <p class=note> Implementors should take care to verify that a given
3105 caseless string comparison implementation uses this precise algorithm and
3106 not assume that a given platform string matching routine follows it, as
3107 many of these have locale-specific behavior or use some level of string
3108 normalization.
3110 <p class=note> For authors this means that font family names are matched
3111 case insensitively, whether those names exist in a platform font or in the
3112 <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
3113 in a stylesheet. Authors should take care to ensure that names use a
3114 character sequence consistent with the actual font family name,
3115 particularly when using combining characters such as diacritical marks.
3116 For example, a family name that contains an uppercase A (U+0041) followed
3117 by a combining ring (U+030A) will <strong>not</strong> match a name that
3118 looks identical but which uses the precomposed lowercase a-ring character
3119 (U+00E5) instead of the combining sequence.
3121 <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
3122 styles</h3>
3124 <p>The procedure for choosing fonts consists of iterating over the font
3125 families determined by the font-family property, selecting a font face
3126 with the appropriate style based on other font properties and then
3127 determining whether a glyph exists for a given character. This is done
3128 using the <dfn id=character-map>character map</dfn> of the font, data
3129 which maps characters to the default glyph for that character. Codepoint
3130 sequences consisting of a base character followed by a sequence of
3131 combining characters are treated slightly differently, see the section on
3132 <a href="#cluster-matching">cluster matching</a> below.
3134 <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
3135 given font family is defined to be the face that would be selected if all
3136 font style properties were set to their initial value.
3138 <ol id=fontmatchingalg>
3139 <li>Using the computed font property values for a given element, the user
3140 agent starts with the first family name in the fontlist specified by the
3141 <a href="#propdef-font-family" title="font-family!!property">‘<code
3142 class=property>font-family</code>’</a> property.
3144 <li>If the family name is unquoted and is a generic family name, the user
3145 agent looks up the appropriate font family name to be used. User agents
3146 may choose the generic font family to use based on the language of the
3147 containing element or the Unicode range of the character.
3149 <li>For other family names, the user agent attempts to find the family
3150 name among fonts defined via <a
3151 href="#at-font-face-rule"><code>@font-face</code></a> rules and then
3152 among available system fonts, matching names with a case-insensitive
3153 comparison as outlined <a href="#font-family-casing">in the section
3154 above</a>. On systems containing fonts with multiple localized font
3155 family names, user agents must match any of these names independent of
3156 the underlying system locale or platform API used. If the font resources
3157 defined for a given face in an <a
3158 href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
3159 available or contain invalid font data, then the face should be treated
3160 as not present in the family. If no faces are present for a family
3161 defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
3162 rules, the family should be treated as missing; matching a platform font
3163 with the same name must not occur in this case.
3165 <li>If a font family match occurs, the user agent assembles the set of
3166 font faces in that family and then narrows the set to a single face using
3167 other font properties in the order given below:
3168 <ol id=fontstylematchingalg>
3169 <li><a href="#propdef-font-stretch"
3170 title="font-stretch!!property">‘<code
3171 class=property>font-stretch</code>’</a> is tried first. If the
3172 matching set contains faces with width values matching the <a
3173 href="#propdef-font-stretch" title="font-stretch!!property">‘<code
3174 class=property>font-stretch</code>’</a> value, faces with other width
3175 values are removed from the matching set. If there is no face that
3176 exactly matches the width value the nearest width is used instead. If
3177 the value of <a href="#propdef-font-stretch"
3178 title="font-stretch!!property">‘<code
3179 class=property>font-stretch</code>’</a> is ‘<a href="#normal"><code
3180 class=property>normal</code></a>’ or one of the condensed values,
3181 narrower width values are checked first, then wider values. If the
3182 value of <a href="#propdef-font-stretch"
3183 title="font-stretch!!property">‘<code
3184 class=property>font-stretch</code>’</a> is one of the expanded
3185 values, wider values are checked first, followed by narrower values.
3186 Once the closest matching width has been determined by this process,
3187 faces with other widths are removed from the matching set.
3189 <li><a href="#propdef-font-style" title="font-style!!property">‘<code
3190 class=property>font-style</code>’</a> is tried next. If the value of
3191 <a href="#propdef-font-style" title="font-style!!property">‘<code
3192 class=property>font-style</code>’</a> is ‘<a href="#italic"><code
3193 class=property>italic</code></a>’, italic faces are checked first,
3194 then oblique, then normal faces. If the value is ‘<a
3195 href="#oblique"><code class=property>oblique</code></a>’, oblique
3196 faces are checked first, then italic faces and then normal faces. If
3197 the value is ‘<a href="#normal"><code
3198 class=property>normal</code></a>’, normal faces are checked first,
3199 then oblique faces, then italic faces. Faces with other style values
3200 are excluded from the matching set. User agents are permitted to
3201 distinguish between italic and oblique faces within platform font
3202 families but this is not required, they may treat all italic or oblique
3203 faces as italic faces. However, within font families defined via <a
3204 href="#at-font-face-rule"><code>@font-face</code></a> rules, italic and
3205 oblique faces must be distinguished using the value of the <a
3206 href="#descdef-font-style" title="font-style!!descriptor">‘<code
3207 class=property>font-style</code>’</a> descriptor.
3209 <li><a href="#propdef-font-weight"
3210 title="font-weight!!property">‘<code
3211 class=property>font-weight</code>’</a> is matched next, it will
3212 always reduce the matching set to a single font face. If bolder/lighter
3213 relative weights are used, the effective weight is calculated based on
3214 the inherited weight value, as described in the definition of the <a
3215 href="#propdef-font-weight" title="font-weight!!property">‘<code
3216 class=property>font-weight</code>’</a> property. Given the desired
3217 weight and the weights of faces in the matching set after the steps
3218 above, if the desired weight is available that face matches. Otherwise,
3219 a weight is chosen using the rules below:
3220 <ul>
3221 <li>If the desired weight is less than 400, weights below the desired
3222 weight are checked in descending order followed by weights above the
3223 desired weight in ascending order until a match is found.
3225 <li>If the desired weight is greater than 500, weights above the
3226 desired weight are checked in ascending order followed by weights
3227 below the desired weight in descending order until a match is found.
3229 <li>If the desired weight is 400, 500 is checked first and then the
3230 rule for desired weights less than 400 is used.
3232 <li>If the desired weight is 500, 400 is checked first and then the
3233 rule for desired weights less than 400 is used.
3234 </ul>
3236 <li><span class=property>‘<a href="#propdef-font-size"><code
3237 class=property>font-size</code></a>’</span> must be matched within a
3238 UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
3239 are rounded to the nearest whole pixel, while the tolerance for
3240 bitmapped fonts could be as large as 20%.) Further computations, e.g.,
3241 by ‘<code class=property>em</code>’ values in other properties, are
3242 based on the <span class=property>‘<a href="#propdef-font-size"><code
3243 class=property>font-size</code></a>’</span> value that is used, not
3244 the one that is specified.
3245 </ol>
3247 <li>
3248 <p>If no matching face exists or the matched face does not contain a
3249 glyph for the character to be rendered, the next family name is selected
3250 and the previous two steps repeated. Glyphs from other faces in the
3251 family are not considered. The only exception is that user agents may
3252 optionally substitute a synthetic version of the <a
3253 href="#default-face"><em>default face</em></a> if that face supports a
3254 given glyph (e.g. a synthetic italic version of the regular face may be
3255 used if the italic face doesn't support glyphs for Arabic).</p>
3256 <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
3258 <p>If the matched font is defined via an <a
3259 href="#at-font-face-rule"><code>@font-face</code></a> rule and needs to
3260 be downloaded, the font resource is downloaded. While the download
3261 occurs, the user agent can either wait until the font is downloaded or
3262 render once with substituted font metrics and render again once the font
3263 is downloaded.</p>
3265 <li>If there are no more font families to be evaluated and no matching
3266 face has been found, then the user agent performs a <dfn
3267 id=system-font-fallback>system font fallback</dfn> procedure to find the
3268 best match for the character to be rendered. The result of this procedure
3269 may vary across user agents.
3271 <li>If a particular character cannot be displayed using any font, the user
3272 agent should indicate by some means that a character is not being
3273 displayed, displaying either a symbolic representation of the missing
3274 glyph (e.g. using a <a
3275 href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
3276 Font</a>) or using the missing character glyph from a default font.
3277 </ol>
3279 <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
3281 <p>When text contains characters such as combining diacritics, ideally the
3282 base character should be rendered using the same font as the diacritic,
3283 this assures proper placement of the diacritic. For this reason, the font
3284 matching algorithm for clusters is more specialized than the general case
3285 of matching a single character by itself. For sequences containing
3286 variation selectors, which indicate the precise glyph to be used for a
3287 given character, user agents always attempt <a
3288 href="#system-font-fallback"><em>system font fallback</em></a> to find the
3289 appropriate glyph before using the default glyph of the base character.
3291 <p>A font is considered to <em>support</em> a given character if (1) the
3292 character is contained in the font's <a
3293 href="#character-map"><em>character map</em></a> and (2) if required by
3294 the containing script, shaping information is available for that
3295 character. Some legacy fonts may include a given character in the <a
3296 href="#character-map"><em>character map</em></a> but lack the shaping
3297 information (e.g. <a
3298 href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
3299 layout tables</a> or <a
3300 href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&item_id=graphite_techAbout">Graphite
3301 tables</a>) necessary for correctly rendering text runs containing that
3302 character.
3304 <p>A sequence of codepoints containing combining diacritics or other
3305 modifiers is termed a grapheme cluster (see <a href="#CSS3TEXT"
3306 rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
3307 description). For a given cluster containing a base character, <em>b</em>
3308 and a sequence of combining characters <em>c1, c2…</em>, the entire
3309 cluster is matched using these steps:
3311 <ol>
3312 <li>For each family in the font list, a face is chosen using the style
3313 selection rules defined in the previous section.
3314 <ol>
3315 <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
3316 completely supported by the font, select this font for the sequence.
3318 <li>If a sequence of multiple codepoints is canonically equivalent to a
3319 single character and the font supports that character, select this font
3320 for the sequence.
3321 </ol>
3323 <li>If no font was found in the font list in step 1:
3324 <ol>
3325 <li>If <em>c1</em> is a variation selector, system fallback must be used
3326 to find a font that supports the full sequence of <em>b + c1</em>. If
3327 no font on the system supports the full sequence, match the single
3328 character <em>b</em> using the normal procedure for matching single
3329 characters and ignore the variation selector. Note: a sequence with
3330 more than one variation selector is treated as an encoding error and
3331 the trailing selectors are ignored.
3333 <li>Otherwise, the user agent may optionally use system font fallback to
3334 match a font that supports the entire cluster.
3335 </ol>
3337 <li>If no font is found in step 2, use the matching sequence from step 1
3338 to determine the longest sequence that is completely matched by a font in
3339 the font list and attempt to match the remaining combining characters
3340 separately using the rules for single characters.
3341 </ol>
3343 <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
3344 issues</h3>
3346 <p>The procedure above is always performed on text runs containing Unicode
3347 characters, documents using legacy encodings are assumed to have been
3348 transcoded before matching fonts. For fonts containing <a
3349 href="#character-map"><em title="character map">character maps</em></a>
3350 for both legacy encodings and Unicode, the contents of the legacy encoding
3351 <a href="#character-map"><em>character map</em></a> must have no effect on
3352 the results of the font matching process.
3354 <p>The font matching process does not assume that text runs are in either
3355 normalized or denormalized form (see <a href="#CHARMOD-NORM"
3356 rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
3357 details). Layout engines often convert base character plus combining
3358 character sequences into precomposed characters if they exist. The font
3359 matching algorithm outlined here supports both ways and fonts can
3360 generally support either but variations can occur. Authors should always
3361 tailor their choice of fonts to their content, including whether that
3362 content contains normalized or denormalized character streams.
3364 <p>If a given character is a Private-Use Area Unicode codepoint and none of
3365 the fonts in the fontlist contain a glyph for that codepoint, user agents
3366 must display some form of missing glyph symbol for that character rather
3367 than attempting <a href="#system-font-fallback"><em>system font
3368 fallback</em></a> for that codepoint. When matching the replacement
3369 character U+FFFD, user agents may skip the font matching process and
3370 immediately display some form of missing glyph symbol, they are not
3371 required to display the glyph from the font that would be selected by the
3372 font matching process.
3374 <p>In general, the fonts for a given family will all have the same or
3375 similar <a href="#character-map"><em title="character map">character
3376 maps</em></a>. The process outlined here is designed to handle even font
3377 families containing faces with widely variant <a href="#character-map"><em
3378 title="character map">character maps</em></a>. However, authors are
3379 cautioned that the use of such families can lead to unexpected results.
3381 <p>Optimizations of this process are allowed provided that an
3382 implementation behaves as if the algorithm had been followed exactly.
3383 Matching occurs in a well-defined order to insure that the results are as
3384 consistent as possible across user agents, given an identical set of
3385 available fonts and rendering technology.
3387 <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
3388 changes since CSS 2.1</h3>
3390 <p>The algorithm above is different from CSS 2.1 in a number of key places.
3391 These changes were made to better reflect actual font matching behavior
3392 across user agent implementations.
3394 <p>Differences compared to the font matching algorithm in CSS 2.1:
3396 <ul>
3397 <li>The algorithm includes font-stretch matching.
3399 <li>All possible font-style matching scenarios are delineated.
3401 <li>Small-caps fonts are not matched as part of the font matching process,
3402 they are now handled via font features.
3404 <li>Unicode variation selector matching is required.
3406 <li>Cluster sequences are matched as a unit.
3407 </ul>
3409 <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
3410 examples</h3>
3412 <div class=example>
3413 <p>It's useful to note that the CSS selector syntax may be used to create
3414 language-sensitive typography. For example, some Chinese and Japanese
3415 characters are unified to have the same Unicode code point, although the
3416 abstract glyphs are not the same in the two languages.
3418 <pre>*:lang(ja-jp) { font: 900 14pt/16pt "Heisei Mincho W9", serif; }
3419 *:lang(zh-tw) { font: 800 14pt/16.5pt "Li Sung", serif; }
3420 </pre>
3422 <p>This selects any element that has the given language - Japanese or
3423 Traditional Chinese - and uses the appropriate font.
3424 </div>
3426 <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
3428 <p>Modern font technologies support a variety of advanced typographic and
3429 language-specific font features. Using these features, a single font can
3430 provide glyphs for a wide range of ligatures, contextual and stylistic
3431 alternates, tabular and old-style figures, small capitals, automatic
3432 fractions, swashes, and alternates specific to a given language. To allow
3433 authors control over these font capabilities, the ‘<code
3434 class=property>font-variant</code>’ property has been expanded for CSS3.
3435 It now functions as a shorthand for a set of properties that provide
3436 control over stylistic font features.
3438 <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
3439 selection and positioning</h3>
3441 <p>Simple fonts used for displaying Latin text use a very basic processing
3442 model. Fonts contain a <a href="#character-map"><em>character map</em></a>
3443 which maps each character to a glyph for that character. Glyphs for
3444 subsequent characters are simply placed one after the other along a run of
3445 text. Modern font formats such as OpenType and AAT (Apple Advanced
3446 Typography) use a richer processing model. The glyph for a given character
3447 can be chosen and positioned not just based on the codepoint of the
3448 character itself, but also on adjacent characters as well as the language,
3449 script, and features enabled for the text. Font features may be required
3450 for specific scripts, or recommended as enabled by default or they might
3451 be stylistic features meant to be used under author control.
3453 <p>For a good visual overview of these features, see the <a
3454 href="#OPENTYPE-FONT-GUIDE"
3455 rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
3456 For a detailed description of glyph processing for OpenType fonts, see <a
3457 href="#WINDOWS-GLYPH-PROC"
3458 rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
3460 <p>Stylistic font features can be classified into two broad categories:
3461 ones that affect the harmonization of glyph shapes with the surrounding
3462 context, such as kerning and ligature features, and ones such as the
3463 small-caps, subscript/superscript and alternate features that affect shape
3464 selection.
3466 <p>The subproperties of <a href="#propdef-font-variant"
3467 title="font-variant!!property">‘<code
3468 class=property>font-variant</code>’</a> listed below are used to control
3469 these stylistic font features. They do not control features that are
3470 required for displaying certain scripts, such as the OpenType features
3471 used when displaying Arabic or Indic language text. They affect glyph
3472 selection and positioning, but do not affect font selection as described
3473 in the font matching section (except in cases required for compatibility
3474 with CSS 2.1).
3476 <p>To assure consistent behavior across user agents, the equivalent
3477 OpenType property settings are listed for individual properties and are
3478 normative. When using other font formats these should be used as a
3479 guideline to map CSS font feature property values to specific font
3480 features.
3482 <h3 id=language-specific-support><span class=secno>6.2
3483 </span>Language-specific display</h3>
3485 <p>OpenType also supports language-specific glyph selection and
3486 positioning, so that text can be displayed correctly in cases where the
3487 language dictates a specific display behavior. Many languages share a
3488 common script, but the shape of certain letters can vary across those
3489 languages. For example, certain Cyrillic letters have different shapes in
3490 Russian text than in Bulgarian. In Latin text, it's common to render "fi"
3491 with an explicit fi-ligature that lacks a dot on the "i". However, in
3492 languages such as Turkish which uses both a dotted-i and a dotless-i, it's
3493 important to not use this ligature or use a specialized version that
3494 contains a dot over the "i". The example below shows language-specific
3495 variations based on stylistic traditions found in Spanish, Italian and
3496 French orthography:
3498 <div class=featex><img alt="language specific forms, spanish"
3499 src=locl-1.png></div>
3501 <div class=featex><img alt="language specific forms, italian"
3502 src=locl-2.png></div>
3504 <div class=featex><img alt="language specific forms, french"
3505 src=locl-3.png></div>
3507 <p>If the content language of the element is known according to the rules
3508 of the <a
3509 href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
3510 language</a>, user agents are required to infer the OpenType language
3511 system from the content language and use that when selecting and
3512 positioning glyphs using an OpenType font.
3514 <p>For OpenType fonts, in some cases it may be necessary to explicitly
3515 declare the OpenType language to be used, for example when displaying text
3516 in a given language that uses the typographic conventions of another
3517 language or when the font does not explicitly support a given language but
3518 supports a language that shares common typographic conventions. The ‘<a
3519 href="#propdef-font-language-override"><code
3520 class=property>font-language-override</code></a>’ property is used for
3521 this purpose.</p>
3522 <!-- prop: font-kerning -->
3524 <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
3525 href="#propdef-font-kerning">font-kerning</a> property</h3>
3527 <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
3528 <tbody>
3529 <tr>
3530 <td>Name:
3532 <td><dfn id=propdef-font-kerning>font-kerning</dfn>
3534 <tr>
3535 <td>Value:
3537 <td><a href="#font-kerning-auto-value"
3538 title="auto!!font-kerning">auto</a> | <a
3539 href="#font-kerning-normal-value"
3540 title="normal!!font-kerning">normal</a> | <a
3541 href="#font-kerning-none-value" title="none!!font-kerning">none</a>
3543 <tr>
3544 <td>Initial:
3546 <td>auto
3548 <tr>
3549 <td>Applies to:
3551 <td>all elements
3553 <tr>
3554 <td>Inherited:
3556 <td>yes
3558 <tr>
3559 <td>Percentages:
3561 <td>N/A
3563 <tr>
3564 <td>Media:
3566 <td>visual
3568 <tr>
3569 <td>Computed value:
3571 <td>as specified
3573 <tr>
3574 <td>Animatable:
3576 <td>no
3577 </table>
3579 <p>Kerning is the contextual adjustment of inter-glyph spacing. This
3580 property controls metric kerning, kerning that utilizes adjustment data
3581 contained in the font.
3583 <dl>
3584 <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
3586 <dd>Specifies that kerning is applied at the discretion of the user agent
3588 <dt><dfn id=font-kerning-normal-value
3589 title="normal!!font-kerning">normal</dfn>
3591 <dd>Specifies that kerning is applied
3593 <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
3595 <dd>Specifies that kerning is not applied
3596 </dl>
3598 <p>For fonts that do not include kerning data this property will have no
3599 visible effect. When rendering with OpenType fonts, the <a
3600 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
3601 specification suggests that kerning be enabled by default. When kerning is
3602 enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
3603 vertical text runs the <span class=tag>vkrn</span> feature is enabled
3604 instead). User agents must also support fonts that only support kerning
3605 via data contained in a <span class=tag>kern</span> font table, as
3606 detailed in the OpenType specification. If the ‘<code
3607 class=property>letter-spacing</code>’ property is defined, kerning
3608 adjustments are considered part of the default spacing and letter spacing
3609 adjustments are made after kerning has been applied.
3611 <p>When set to ‘<code class=property>auto</code>’, user agents can
3612 determine whether to apply kerning or not based on a number of factors:
3613 text size, script, or other factors that influence text processing speed.
3614 Authors who want proper kerning should use ‘<a href="#normal"><code
3615 class=property>normal</code></a>’ to explicitly enable kerning.
3616 Likewise, some authors may prefer to disable kerning in situations where
3617 performance is more important than precise appearance. However, in
3618 well-designed modern implementations the use of kerning generally does not
3619 have a large impact on text rendering speed.</p>
3620 <!-- prop: font-variant-ligatures -->
3622 <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
3623 the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
3624 property</h3>
3626 <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
3627 <tbody>
3628 <tr>
3629 <td>Name:
3631 <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
3633 <tr>
3634 <td>Value:
3636 <td><a href="#font-variant-ligatures-normal-value"
3637 title="normal!!font-variant-ligatures">normal</a> | <a
3638 href="#font-variant-ligatures-none-value"
3639 title="none!!font-variant-ligatures">none</a> | [ <a
3640 href="#common-lig-values"><var><common-lig-values></var></a> ||
3641 <a
3642 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
3643 || <a
3644 href="#historical-lig-values"><var><historical-lig-values></var></a>
3645 || <a
3646 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
3647 ]
3649 <tr>
3650 <td>Initial:
3652 <td>normal
3654 <tr>
3655 <td>Applies to:
3657 <td>all elements
3659 <tr>
3660 <td>Inherited:
3662 <td>yes
3664 <tr>
3665 <td>Percentages:
3667 <td>N/A
3669 <tr>
3670 <td>Media:
3672 <td>visual
3674 <tr>
3675 <td>Computed value:
3677 <td>as specified
3679 <tr>
3680 <td>Animatable:
3682 <td>no
3683 </table>
3685 <p>Ligatures and contextual forms are ways of combining glyphs to produce
3686 more harmonized forms.
3688 <pre
3689 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>
3691 <pre
3692 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>
3694 <pre
3695 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>
3697 <pre
3698 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>
3700 <p>Individual values have the following meanings:
3702 <dl>
3703 <dt><dfn id=font-variant-ligatures-normal-value
3704 title="normal!!font-variant-ligatures">normal</dfn>
3706 <dd>A value of ‘<a href="#normal"><code
3707 class=property>normal</code></a>’ specifies that common default
3708 features are enabled, <a href="#font-feature-resolution">as described in
3709 detail in the next section</a>. For OpenType fonts, common ligatures and
3710 contextual forms are on by default, discretionary and historical
3711 ligatures are not.
3713 <dt><dfn id=font-variant-ligatures-none-value
3714 title="none!!font-variant-ligatures">none</dfn>
3716 <dd>Specifies that all types of ligatures and contextual forms covered by
3717 this property are explicitly disabled. In situations where ligatures are
3718 not considered necessary, this may improve the speed of text rendering.
3720 <dt><dfn id=common-ligatures>common-ligatures</dfn>
3722 <dd>Enables display of common ligatures (OpenType features: <span
3723 class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
3724 enabled by default.
3725 </dl>
3727 <div class=featex><img alt="common ligature example" src=liga.png></div>
3729 <dl>
3730 <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
3732 <dd>Disables display of common ligatures (OpenType features: <span
3733 class=tag>liga, clig</span>).
3735 <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
3737 <dd>Enables display of discretionary ligatures (OpenType feature: <span
3738 class=tag>dlig</span>). Which ligatures are discretionary or optional is
3739 decided by the type designer, so authors will need to refer to the
3740 documentation of a given font to understand which ligatures are
3741 considered discretionary.
3742 </dl>
3744 <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
3746 <dl>
3747 <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
3749 <dd>Disables display of discretionary ligatures (OpenType feature: <span
3750 class=tag>dlig</span>).
3752 <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
3754 <dd>Enables display of historical ligatures (OpenType feature: <span
3755 class=tag>hlig</span>).
3756 </dl>
3758 <div class=featex><img alt="historical ligature example" src=hlig.png></div>
3760 <dl>
3761 <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
3763 <dd>Disables display of historical ligatures (OpenType feature: <span
3764 class=tag>hlig</span>).
3766 <dt><dfn id=contextual>contextual</dfn>
3768 <dd>Enables display of contextual alternates (OpenType feature: <span
3769 class=tag>calt</span>). Although not strictly a ligature feature, like
3770 ligatures this feature is commonly used to harmonize the shapes of glyphs
3771 with the surrounding context. For OpenType fonts, this feature is on by
3772 default.
3773 </dl>
3775 <div class=featex><img alt="contextual alternate example" src=calt.png></div>
3777 <dl>
3778 <dt><dfn id=no-contextual>no-contextual</dfn>
3780 <dd>Disables display of contextual alternates (OpenType feature: <span
3781 class=tag>calt</span>).
3782 </dl>
3784 <p>Required ligatures, needed for correctly rendering complex scripts, are
3785 not affected by the settings above, including ‘<code
3786 class=property>none</code>’ (OpenType feature: <span
3787 class=tag>rlig</span>).</p>
3788 <!-- prop: font-variant-position -->
3790 <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
3791 and superscript forms: the <a
3792 href="#propdef-font-variant-position">font-variant-position</a> property</h3>
3794 <table class=propdef id=namefont-variant-positionvaluenormal-sub>
3795 <tbody>
3796 <tr>
3797 <td>Name:
3799 <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
3801 <tr>
3802 <td>Value:
3804 <td><span title="normal!!font-variant-position">normal</span> | <a
3805 href="#sub">sub</a> | <a href="#super">super</a>
3807 <tr>
3808 <td>Initial:
3810 <td>normal
3812 <tr>
3813 <td>Applies to:
3815 <td>all elements
3817 <tr>
3818 <td>Inherited:
3820 <td>yes
3822 <tr>
3823 <td>Percentages:
3825 <td>N/A
3827 <tr>
3828 <td>Media:
3830 <td>visual
3832 <tr>
3833 <td>Computed value:
3835 <td>as specified
3837 <tr>
3838 <td>Animatable:
3840 <td>no
3841 </table>
3843 <p>This property is used to enable typographic subscript and superscript
3844 glyphs. These are alternate glyphs designed within the same em-box as
3845 default glyphs and are intended to be laid out on the same baseline as the
3846 default glyphs, with no resizing or repositioning of the baseline. They
3847 are explicitly designed to match the surrounding text and to be more
3848 readable without affecting the line height.
3850 <div class=figure><img alt="comparison between real subscript glyphs and
3851 synthesized ones" src=realsubscripts.png>
3852 <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
3853 (bottom)
3854 </div>
3856 <p>Individual values have the following meanings:
3858 <dl>
3859 <dt><dfn id=normal>normal</dfn>
3861 <dd>None of the features listed below are enabled.
3863 <dt><dfn id=sub>sub</dfn>
3865 <dd>Enables display of subscript variants (OpenType feature: <span
3866 class=tag>subs</span>).
3868 <dt><dfn id=super>super</dfn>
3870 <dd>Enables display of superscript variants (OpenType feature: <span
3871 class=tag>sups</span>).
3872 </dl>
3874 <p>Because of the semantic nature of subscripts and superscripts, when the
3875 value is either ‘<a href="#sub"><code class=property>sub</code></a>’
3876 or ‘<a href="#super"><code class=property>super</code></a>’ for a
3877 given contiguous run of text, if a variant glyph is not available for all
3878 the characters in the run, simulated glyphs must be synthesized for all
3879 characters using reduced forms of the glyphs that would be used without
3880 this feature applied. This is done per run to avoid a mixture of variant
3881 glyphs and synthesized ones that would not align correctly. In the case of
3882 OpenType fonts that lack subscript or superscript glyphs for a given
3883 character, user agents must use the appropriate subscript and superscript
3884 metrics specified in the selected font's <a
3885 href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
3886 table</a> <a href="#OPENTYPE"
3887 rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
3888 and offset of the synthesized substitutes.
3890 <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
3891 using superscript metrics" src=superscript-alt-synth.png>
3892 <p class=caption>Superscript alternate glyph (left), synthesized
3893 superscript glyphs (middle), and incorrect mixture of the two (right)
3894 </div>
3896 <p>In the past, user agents have used font-size and vertical-align to
3897 simulate subscripts and superscripts for the <a class=tag
3898 href="#sub">sub</a> and <span class=tag>sup</span> elements. To allow a
3899 backwards compatible way of defining subscripts and superscripts, it is
3900 recommended that authors use conditional rules <a href="#CSS3-CONDITIONAL"
3901 rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
3902 older user agents will still render subscripts and superscripts via the
3903 older mechanism.
3905 <p>Authors should note that fonts typically only provide subscript and
3906 superscript glyphs for a subset of all characters supported by the font.
3907 For example, while subscript and superscript glyphs are often available
3908 for Latin numbers, glyphs for punctuation and letter characters are less
3909 frequently provided. The synthetic fallback rules defined for this
3910 property assure that subscripts and superscripts will always appear but
3911 the appearance may not match author expectations if the font used does not
3912 provide the appropriate alternate glyph for all characters contained in a
3913 subscript or superscript.
3915 <p>This property is not cumulative. Applying it to elements within a
3916 subscript or superscript won't nest the placement of a subscript or
3917 superscript glyph. Images contained within text runs where the value of
3918 this property is ‘<a href="#sub"><code class=property>sub</code></a>’
3919 or ‘<a href="#super"><code class=property>super</code></a>’ will be
3920 drawn just as they would if the value was ‘<a href="#normal"><code
3921 class=property>normal</code></a>’. The variant glyphs are laid out just
3922 as default glyphs are. There is no shift in the placement along the
3923 baseline, so the use of these glyphs doesn't affect the linebox height.</p>
3924 <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
3925 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
3927 <p>Because of these limitations, ‘<a
3928 href="#propdef-font-variant-position"><code
3929 class=property>font-variant-position</code></a>’ is not recommended for
3930 use in user agent stylesheets. Authors should use it in cases where
3931 subscripts or superscripts will only contain the narrow range of
3932 characters supported by the fonts specified.
3934 <div class=example>
3935 <p>A typical user agent default style for the <a class=tag
3936 href="#sub">sub</a> element:</p>
3938 <pre>sub {
3939 vertical-align: sub;
3940 font-size: smaller;
3941 line-height: normal;
3942 }
3943 </pre>
3945 <p>Using font-variant-position to specify typographic subscripts in a way
3946 that will still show subscripts in older user agents:</p>
3948 <pre>@supports ( font-variant-position: sub ) {
3950 sub {
3951 vertical-align: baseline;
3952 font-size: 100%;
3953 line-height: inherit;
3954 font-variant-position: sub;
3955 }
3957 }
3958 </pre>
3960 <p>User agents that support the ‘<a
3961 href="#propdef-font-variant-position"><code
3962 class=property>font-variant-position</code></a>’ property will select a
3963 subscript variant glyph and render this without adjusting the baseline or
3964 font-size. Older user agents will ignore the ‘<a
3965 href="#propdef-font-variant-position"><code
3966 class=property>font-variant-position</code></a>’ property definition
3967 and use the standard defaults for subscripts.</p>
3968 </div>
3969 <!-- prop: font-variant-caps -->
3971 <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
3972 the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
3974 <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
3975 <tbody>
3976 <tr>
3977 <td>Name:
3979 <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
3981 <tr>
3982 <td>Value:
3984 <td><a href="#font-variant-caps-normal-value"
3985 title="normal!!font-variant-caps">normal</a> | <a
3986 href="#small-caps">small-caps</a> | <a
3987 href="#all-small-caps">all-small-caps</a> | <a
3988 href="#petite-caps">petite-caps</a> | <a
3989 href="#all-petite-caps">all-petite-caps</a> | <a
3990 href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
3992 <tr>
3993 <td>Initial:
3995 <td>normal
3997 <tr>
3998 <td>Applies to:
4000 <td>all elements
4002 <tr>
4003 <td>Inherited:
4005 <td>yes
4007 <tr>
4008 <td>Percentages:
4010 <td>N/A
4012 <tr>
4013 <td>Media:
4015 <td>visual
4017 <tr>
4018 <td>Computed value:
4020 <td>as specified
4022 <tr>
4023 <td>Animatable:
4025 <td>no
4026 </table>
4028 <p>This property allows the selection of alternate glyphs used for small or
4029 petite capitals or for titling. These glyphs are specifically designed to
4030 blend well with the surrounding normal glyphs, to maintain the weight and
4031 readability which suffers when text is simply resized to fit this purpose.
4033 <p>Individual values have the following meanings:
4035 <dl>
4036 <dt><dfn id=font-variant-caps-normal-value
4037 title="normal!!font-variant-caps">normal</dfn>
4039 <dd>None of the features listed below are enabled.
4041 <dt><dfn id=small-caps>small-caps</dfn>
4043 <dd>Enables display of small capitals (OpenType feature: <span
4044 class=tag>smcp</span>). Small-caps glyphs typically use the form of
4045 uppercase letters but are reduced to the size of lowercase letters.
4046 </dl>
4048 <div class=featex><img alt="small-caps example" src=smcp.png></div>
4050 <dl>
4051 <dt><dfn id=all-small-caps>all-small-caps</dfn>
4053 <dd>Enables display of small capitals for both upper and lowercase letters
4054 (OpenType features: <span class=tag>c2sc, smcp</span>).
4056 <dt><dfn id=petite-caps>petite-caps</dfn>
4058 <dd>Enables display of petite capitals (OpenType feature: <span
4059 class=tag>pcap</span>).
4061 <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
4063 <dd>Enables display of petite capitals for both upper and lowercase
4064 letters (OpenType features: <span class=tag>c2pc, pcap</span>).
4066 <dt><dfn id=unicase>unicase</dfn>
4068 <dd>Enables display of mixture of small capitals for uppercase letters
4069 with normal lowercase letters (OpenType feature: <span
4070 class=tag>unic</span>).
4072 <dt><dfn id=titling-caps>titling-caps</dfn>
4074 <dd>Enables display of titling capitals (OpenType feature: <span
4075 class=tag>titl</span>). Uppercase letter glyphs are often designed for
4076 use with lowercase letters. When used in all uppercase titling sequences
4077 they can appear too strong. Titling capitals are designed specifically
4078 for this situation.
4079 </dl>
4081 <p>The availability of these glyphs is based on whether a given feature is
4082 defined or not in the feature list of the font. User agents can optionally
4083 decide this on a per-script basis but should explicitly not decide this on
4084 a per-character basis.
4086 <p>Some fonts may only support a subset or none of the features described
4087 for this property. For backwards compatibility with CSS 2.1, if ‘<a
4088 href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
4089 href="#all-small-caps"><code class=property>all-small-caps</code></a>’
4090 is specified but small-caps glyphs are not available for a given font,
4091 user agents should simulate a small-caps font, for example by taking a
4092 normal font and replacing the glyphs for lowercase letters with scaled
4093 versions of the glyphs for uppercase characters (replacing the glyphs for
4094 both upper and lowercase letters in the case of ‘<a
4095 href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
4097 <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
4098 real small-caps" class=hires src=synthetic-vs-real-small-caps.png
4099 width=512px>
4100 <p class=caption>Synthetic vs. real small-caps
4101 </div>
4103 <p>To match the surrounding text, a font may provide alternate glyphs for
4104 caseless characters when these features are enabled but when a user agent
4105 simulates small capitals, it must not attempt to simulate alternates for
4106 codepoints which are considered caseless.
4108 <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
4109 characters with small-caps, all-small-caps enabled" class=hires
4110 src=small-capitals-variations.png width=418px>
4111 <p class=caption>Caseless characters with small-caps, all-small-caps
4112 enabled
4113 </div>
4115 <p>If either ‘<a href="#petite-caps"><code
4116 class=property>petite-caps</code></a>’ or ‘<a
4117 href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
4118 is specified for a font that doesn't support these features, the property
4119 behaves as if ‘<a href="#small-caps"><code
4120 class=property>small-caps</code></a>’ or ‘<a
4121 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4122 respectively, had been specified. If ‘<a href="#unicase"><code
4123 class=property>unicase</code></a>’ is specified for a font that doesn't
4124 support that feature, the property behaves as if ‘<a
4125 href="#small-caps"><code class=property>small-caps</code></a>’ was
4126 applied only to lowercased uppercase letters. If ‘<a
4127 href="#titling-caps"><code class=property>titling-caps</code></a>’ is
4128 specified with a font that does not support this feature, this property
4129 has no visible effect. When simulated small capital glyphs are used, for
4130 scripts that lack uppercase and lowercase letters, ‘<a
4131 href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
4132 href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
4133 ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
4134 ‘<a href="#all-petite-caps"><code
4135 class=property>all-petite-caps</code></a>’ and ‘<a
4136 href="#unicase"><code class=property>unicase</code></a>’ have no visible
4137 effect.
4139 <p>When casing transforms are used to simulate small capitals, the casing
4140 transformations must match those used for the <span
4141 class=property>‘<code class=property>text-transform</code>’</span>
4142 property.
4144 <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
4145 replace glyphs in a small-caps font so that the text appears in all
4146 uppercase letters.
4148 <div class=figure style="padding: 0; margin: auto;"><img alt="using
4149 all-small-caps in acronym-laden text" class=hires
4150 src=acronym-laden-text.png width=596px>
4151 <p class=caption>Using small capitals to improve readability in
4152 acronym-laden text
4153 </div>
4155 <div class=example>
4156 <p>Quotes rendered italicised, with small-caps on the first line:</p>
4158 <pre>blockquote { font-style: italic; }
4159 blockquote:first-line { font-variant: small-caps; }
4161 <blockquote><a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/0036.html" style="text-decoration: none">I'll be honor-bound to slap them like a haddock.</a></blockquote>
4162 </pre>
4163 </div>
4164 <!-- prop: font-variant-numeric -->
4166 <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
4167 formatting: the <a
4168 href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
4170 <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
4171 <tbody>
4172 <tr>
4173 <td>Name:
4175 <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
4177 <tr>
4178 <td>Value:
4180 <td><a href="#font-variant-numeric-normal-value"
4181 title="normal!!font-variant-numeric">normal</a> | [ <a
4182 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
4183 || <a
4184 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
4185 || <a
4186 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
4187 || <a href="#ordinal">ordinal</a> || <a
4188 href="#slashed-zero">slashed-zero</a> ]
4190 <tr>
4191 <td>Initial:
4193 <td>normal
4195 <tr>
4196 <td>Applies to:
4198 <td>all elements
4200 <tr>
4201 <td>Inherited:
4203 <td>yes
4205 <tr>
4206 <td>Percentages:
4208 <td>N/A
4210 <tr>
4211 <td>Media:
4213 <td>visual
4215 <tr>
4216 <td>Computed value:
4218 <td>as specified
4220 <tr>
4221 <td>Animatable:
4223 <td>no
4224 </table>
4226 <p>Specifies control over numerical forms. The example below shows how some
4227 of these values can be combined to influence the rendering of tabular data
4228 with fonts that support these features. Within normal paragraph text,
4229 proportional numbers are used while tabular numbers are used so that
4230 columns of numbers line up properly:
4232 <div class=figure style="padding: 0; margin: auto;"><img alt="combining
4233 number styles" src=numberstyles.png>
4234 <p class=caption>Using number styles
4235 </div>
4237 <p>Possible combinations:
4239 <pre
4240 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>
4242 <pre
4243 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>
4245 <pre
4246 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>
4248 <p>Individual values have the following meanings:
4250 <dl>
4251 <dt><dfn id=font-variant-numeric-normal-value
4252 title="normal!!font-variant-numeric">normal</dfn>
4254 <dd>None of the features listed below are enabled.
4256 <dt><dfn id=lining-nums>lining-nums</dfn>
4258 <dd>Enables display of lining numerals (OpenType feature: <span
4259 class=tag>lnum</span>).
4261 <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
4263 <dd>Enables display of old-style numerals (OpenType feature: <span
4264 class=tag>onum</span>).
4266 <dt><dfn id=proportional-nums>proportional-nums</dfn>
4268 <dd>Enables display of proportional numerals (OpenType feature: <span
4269 class=tag>pnum</span>).
4271 <dt><dfn id=tabular-nums>tabular-nums</dfn>
4273 <dd>Enables display of tabular numerals (OpenType feature: <span
4274 class=tag>tnum</span>).
4276 <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
4278 <dd>Enables display of lining diagonal fractions (OpenType feature: <span
4279 class=tag>frac</span>).
4280 </dl>
4282 <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
4284 <dl>
4285 <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
4287 <dd>Enables display of lining stacked fractions (OpenType feature: <span
4288 class=tag>afrc</span>).
4289 </dl>
4291 <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
4293 <dl>
4294 <dt><dfn id=ordinal>ordinal</dfn>
4296 <dd>Enables display of forms used with ordinal numbers (OpenType feature:
4297 <span class=tag>ordn</span>).
4299 <dt><dfn id=slashed-zero>slashed-zero</dfn>
4301 <dd>Enables display of slashed zeros (OpenType feature: <span
4302 class=tag>zero</span>).
4303 </dl>
4305 <div class=featex><img alt="slashed zero example" src=zero.png></div>
4307 <div class=example id=steak-marinade>
4308 <p>A simple flank steak marinade recipe, rendered with automatic fractions
4309 and old-style numerals:</p>
4311 <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
4313 <h4>Steak marinade:</h4>
4314 <ul>
4315 <li><span class="amount">2</span> tbsp olive oil</li>
4316 <li><span class="amount">1</span> tbsp lemon juice</li>
4317 <li><span class="amount">1</span> tbsp soy sauce</li>
4318 <li><span class="amount">1 1/2</span> tbsp dry minced onion</li>
4319 <li><span class="amount">2 1/2</span> tsp italian seasoning</li>
4320 <li>Salt &amp; pepper</li>
4321 </ul>
4323 <p>Mix the meat with the marinade and let it sit covered in the refrigerator
4324 for a few hours or overnight.</p>
4325 </pre>
4327 <p>Note that the fraction feature is only applied to values not the entire
4328 paragraph. Fonts often implement this feature using contextual rules
4329 based on the use of the slash (‘<code class=css>/</code>’) character.
4330 As such, it's not suitable for use as a paragraph-level style.</p>
4331 </div>
4332 <!-- prop: font-variant-alternates -->
4334 <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
4335 and swashes: the <a
4336 href="#propdef-font-variant-alternates">font-variant-alternates</a>
4337 property</h3>
4339 <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
4340 <tbody>
4341 <tr>
4342 <td>Name:
4344 <td><dfn
4345 id=propdef-font-variant-alternates>font-variant-alternates</dfn>
4347 <tr>
4348 <td>Value:
4350 <td>normal | [ <a href="#stylistic"
4351 title=stylistic>stylistic(<feature-value-name>)</a> || <a
4352 href="#historical-forms">historical-forms</a> || <a href="#styleset"
4353 title=styleset>styleset(<feature-value-name> #)</a> || <a
4354 href="#character-variant"
4355 title=character-variant>character-variant(<feature-value-name>
4356 #)</a> || <a href="#swash"
4357 title=swash>swash(<feature-value-name>)</a> || <a
4358 href="#ornaments"
4359 title=ornaments>ornaments(<feature-value-name>)</a> || <a
4360 href="#annotation"
4361 title=annotation>annotation(<feature-value-name>)</a> ]
4363 <tr>
4364 <td>Initial:
4366 <td>normal
4368 <tr>
4369 <td>Applies to:
4371 <td>all elements
4373 <tr>
4374 <td>Inherited:
4376 <td>yes
4378 <tr>
4379 <td>Percentages:
4381 <td>N/A
4383 <tr>
4384 <td>Media:
4386 <td>visual
4388 <tr>
4389 <td>Computed value:
4391 <td>as specified
4393 <tr>
4394 <td>Animatable:
4396 <td>no
4397 </table>
4399 <p>For any given character, fonts can provide a variety of alternate glyphs
4400 in addition to the default glyph for that character. This property
4401 provides control over the selection of these alternate glyphs.
4403 <p>For many of the property values listed below, several different
4404 alternate glyphs are available. How many alternates are available and what
4405 they represent is font-specific, so these are each marked <dfn
4406 id=font-specific>font specific</dfn> in the value definitions below.
4407 Because the nature of these alternates is font-specific, the <a
4408 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4409 rule is used to define values for a specific font family or set of
4410 families that associate a font-specific numeric
4411 <code><feature-index></code> with a custom
4412 <code><feature-value-name></code>, which is then used in this
4413 property to select specific alternates:
4415 <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
4417 p {
4418 font-family: Noble Script;
4419 font-variant-alternates: swash(flowing); /* use swash alternate #2 */
4420 }</pre>
4422 <p>When a particular <code><feature-value-name></code> has not been
4423 defined for a given family or for a particular feature type, the computed
4424 value must be the same as if it had been defined. However, property values
4425 that contain these undefined <code><feature-value-name></code>
4426 identifiers must be ignored when choosing glyphs.
4428 <pre>/* these two style rules are effectively the same */
4429 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
4430 p { font-variant-alternates: normal; }
4431 </pre>
4433 <p>This allows values to be defined and used for a given set of font
4434 families but ignored if fallback occurs, since the font family name would
4435 be different. If a given value is outside the range supported by a given
4436 font, the value is ignored. These values never apply to generic font
4437 families.
4439 <p>Individual values have the following meanings:
4441 <dl>
4442 <dt><dfn id=font-variant-alternates-normal-value
4443 title="normal!!font-variant-alternates">normal</dfn>
4445 <dd>None of the features listed below are enabled.
4447 <dt><dfn id=historical-forms>historical-forms</dfn>
4449 <dd>Enables display of historical forms (OpenType feature: <span
4450 class=tag>hist</span>).
4451 </dl>
4453 <div class=featex><img alt="historical form example" src=hist.png></div>
4455 <dl>
4456 <dt><dfn id=stylistic
4457 title=stylistic>stylistic(<feature-value-name>)</dfn>
4459 <dd>Enables display of stylistic alternates (<a
4460 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4461 class=tag>salt <feature-index></span>).
4462 </dl>
4464 <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
4466 <dl>
4467 <dt><dfn id=styleset title=styleset>styleset(<feature-value-name>
4468 #)</dfn>
4470 <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
4471 specific</em></a>, OpenType feature: <span
4472 class=tag>ss<feature-index></span> OpenType currently defines <span
4473 class=tag>ss01</span> through <span class=tag>ss20</span>).
4474 </dl>
4476 <div class=featex><img alt="styleset example" src=ssnn.png></div>
4478 <dl>
4479 <dt><dfn id=character-variant
4480 title=character-variant>character-variant(<feature-value-name>
4481 #)</dfn>
4483 <dd>Enables display of specific character variants (<a
4484 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4485 class=tag>cv<feature-index></span> OpenType currently defines <span
4486 class=tag>cv01</span> through <span class=tag>cv99</span>).
4488 <dt><dfn id=swash title=swash>swash(<feature-value-name>)</dfn>
4490 <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
4491 specific</em></a>, OpenType feature: <span class=tag>swsh
4492 <feature-index>, cswh <feature-index></span>).
4493 </dl>
4495 <div class=featex><img alt="swash example" src=swsh.png></div>
4497 <dl>
4498 <dt><dfn id=ornaments
4499 title=ornaments>ornaments(<feature-value-name>)</dfn>
4501 <dd>Enables replacement of default glyphs with ornaments, if provided in
4502 the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
4503 feature: <span class=tag>ornm <feature-index></span>). Some fonts
4504 may offer ornament glyphs as alternates for a wide collection of
4505 characters; however, displaying arbitrary characters (e.g.,
4506 alphanumerics) as ornaments is poor practice as it distorts the semantics
4507 of the data. Font designers are encouraged to encode all ornaments
4508 (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
4509 alternates for the bullet character (U+2022) to allow authors to select
4510 the desired glyph using ‘<a href="#ornaments"><code
4511 class=property>ornaments</code></a>’.
4512 </dl>
4514 <div class=featex><img alt="ornaments example" src=ornm.png></div>
4516 <dl>
4517 <dt><dfn id=annotation
4518 title=annotation>annotation(<feature-value-name>)</dfn>
4520 <dd>Enables display of alternate annotation forms (<a
4521 href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
4522 class=tag>nalt <feature-index></span>).
4523 </dl>
4525 <div class=featex><img alt="alternate annotation form example"
4526 src=nalt.png></div>
4528 <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
4529 specific alternates: the <dfn id=at-font-feature-values-rule
4530 style="font-weight: inherit; font-style:
4531 inherit"><code>@font-feature-values</code></dfn> rule</h3>
4533 <p>Several of the possible values of ‘<a
4534 href="#propdef-font-variant-alternates"><code
4535 class=property>font-variant-alternates</code></a>’ listed above are
4536 labeled as <a href="#font-specific"><em>font specific</em></a>. For these
4537 features fonts may define not just a single glyph but a set of alternate
4538 glyphs with an index to select a given alternate. Since these are font
4539 family specific, the <a
4540 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4541 rule is used to define named values for these indices for a given family.
4543 <p class=note>See the <a href="#om-fontfeaturevalues">object model
4544 reference section</a> for a description of the interfaces used to modify
4545 these rules via the CSS Object Model.
4547 <div class=example>
4548 <p>In the case of the swash Q in the example shown above, the swash could
4549 be specified using these style rules:</p>
4551 <pre>
4553 @font-feature-values Jupiter Sans {
4554 @swash {
4555 delicate: 1;
4556 flowing: 2;
4557 }
4558 }
4560 h2 { font-family: Jupiter Sans, sans-serif; }
4562 /* show the second swash variant in h2 headings */
4563 h2:first-letter { font-variant-alternates: swash(flowing); }
4565 <h2>Quick</h2></pre>
4567 <p>When Jupiter Sans is present, the second alternate swash alternate will
4568 be displayed. When not present, no swash character will be shown, since
4569 the specific named value "flowing" is only defined for the Jupiter Sans
4570 family. The @-mark indicates the name of the property value for which a
4571 named value can be used. The name "flowing" is chosen by the author. The
4572 index that represents each alternate is defined within a given font's
4573 data.</p>
4574 </div>
4576 <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
4578 <p>An <a
4579 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4580 rule is composed of a list of font families followed by a block containing
4581 individual <a href="#featurevalueblock"><i
4582 title="feature_value_block">feature value blocks</i></a> that take the
4583 form of @-rules. Each block defines a set of named values for a specific
4584 font feature when a given set of font families is used. Effectively, they
4585 define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
4586 ⟨values⟩ are the numeric indices used for specific features defined
4587 for a given font.
4589 <p>In terms of the grammar, this specification defines the following
4590 productions:
4592 <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
4593 : <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>*
4594 '{' <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>*
4595 ;
4597 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
4598 : <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> ]*
4599 ;
4601 <dfn id=fontfamilyname>font_family_name</dfn>
4602 : <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> ]* ]
4603 ;
4605 <dfn id=featurevalueblock>feature_value_block</dfn>
4606 : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
4607 '{' <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>*
4608 ;
4610 <dfn id=featuretype>feature_type</dfn>:
4611 <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
4612 ;
4614 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
4615 : <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> ]*
4616 ;
4617 </pre>
4619 <p>The following new token is introduced:
4621 <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>;}
4622 </pre>
4624 <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
4625 value blocks</i></a> are handled as <a
4626 href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
4627 consist of everything up to the next block or semi-colon, whichever comes
4628 first.
4630 <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
4631 family list</i></a> is a comma-delimited list of <a
4632 href="#fontfamilyname"><i title="font_family_name">font family
4633 names</i></a> that match the definition of <a
4634 href="#family-name-value"><var><family-name></var></a> for the <a
4635 href="#propdef-font-family" title="font-family!!property">‘<code
4636 class=property>font-family</code>’</a> property. This means that only
4637 named font families are allowed, rules that include generic or system
4638 fonts in the list of font families are syntax errors. However, if a user
4639 agent defines a generic font to be a specific named font (e.g. Helvetica),
4640 the settings associated with that family name will be used. If syntax
4641 errors occur within the font family list, the entire rule must be ignored.
4643 <p>Within <a href="#featurevalueblock"><i
4644 title="feature_value_block">feature value blocks</i></a>, the <a
4645 href="#featuretype"><i title="feature_type">feature type</i></a> is
4646 ‘<code class=css>@</code>’ followed by the name of one of the <a
4647 href="#font-specific"><em>font specific</em></a> property values of ‘<a
4648 href="#propdef-font-variant-alternates"><code
4649 class=property>font-variant-alternates</code></a>’ (e.g. <a
4650 href="#swash"><code>@swash</code></a>). The identifiers used within
4651 feature value definitions follow the rules of CSS user identifiers and are
4652 case-sensitive. They are unique only for a given set of font families and
4653 <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
4654 same identifier used with a different <a href="#featuretype"><i
4655 title="feature_type">feature type</i></a> is treated as a separate and
4656 distinct value. If the same identifier is defined mulitple times for a
4657 given <a href="#featuretype"><i title="feature_type">feature type</i></a>
4658 and font family, the last defined value is used. Values associated with a
4659 given identifier are limited to integer values 0 or greater.
4661 <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
4662 title="feature_value_definition">feature value definition</i></a>, such as
4663 invalid identifiers or values, the entire <a
4664 href="#featurevaluedefinition"><i title="feature_value_definition">feature
4665 value definition</i></a> must be omitted, just as syntax errors in style
4666 declarations are handled. When the <a href="#featuretype"><i
4667 title="feature_type">feature type</i></a> is invalid, the entire
4668 associated <a href="#featurevalueblock"><i
4669 title="feature_value_block">feature value block</i></a> must be ignored.
4671 <div class=example>
4672 <p>Rules that are equivalent given syntax error handling:</p>
4674 <pre>@font-feature-values Bongo {
4675 @swash { ornate: 1; }
4676 annotation { boxed: 4; } /* should be @annotation! */
4677 @swash { double-loops: 1; flowing: -1; } /* negative value */
4678 @ornaments ; /* incomplete definition */
4679 @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
4680 <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a> /* random editing mistake */
4681 }</pre>
4683 <p>The example above is equivalent to:</p>
4685 <pre>@font-feature-values Bongo {
4686 @swash { ornate: 1; }
4687 @swash { double-loops: 1; }
4688 @styleset { double-W: 14; sharp-terminals: 16 1; }
4689 }</pre>
4690 </div>
4692 <p>If multiple <a
4693 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
4694 rules are defined for a given family, the resulting values definitions are
4695 the union of the definitions contained within these rules. This allows a
4696 set of named values to be defined for a given font family globally for a
4697 site and specific additions made per-page.
4699 <div class=example>
4700 <p>Using both site-wide and per-page feature values:</p>
4702 <pre>
4703 site.css:
4705 @font-feature-values Mercury Serif {
4706 @styleset {
4707 stacked-g: 3; /* "two-storey" versions of g, a */
4708 stacked-a: 4;
4709 }
4710 }
4712 page.css:
4714 @font-feature-values Mercury Serif {
4715 @styleset {
4716 geometric-m: 7; /* alternate version of m */
4717 }
4718 }
4720 body {
4721 font-family: Mercury Serif, serif;
4723 /* enable both the use of stacked g and alternate m */
4724 font-variant-alternates: styleset(stacked-g, geometric-m);
4725 }</pre>
4726 </div>
4728 <div class=example>
4729 <p>Using a commonly named value allows authors to use a single style rule
4730 to cover a set of fonts for which the underlying selector is different
4731 for each font. If either font in the example below is found, a circled
4732 number glyph will be used:</p>
4734 <pre>@font-feature-values Taisho Gothic {
4735 @annotation { boxed: 1; circled: 4; }
4736 }
4738 @font-feature-values Otaru Kisa {
4739 @annotation { circled: 1; black-boxed: 3; }
4740 }
4742 h3.title {
4743 /* circled form defined for both fonts */
4744 font-family: Taisho Gothic, Otaru Kisa;
4745 font-variant: annotation(circled);
4746 }</pre>
4747 </div>
4749 <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
4750 </span>Multi-valued feature value definitions</h4>
4752 <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
4753 href="#propdef-font-variant-alternates"><code
4754 class=property>font-variant-alternates</code></a>’ property values take
4755 a single value (e.g. ‘<a href="#swash"><code
4756 class=property>swash</code></a>’). The ‘<a
4757 href="#character-variant"><code
4758 class=property>character-variant</code></a>’ property value allows two
4759 values and ‘<a href="#styleset"><code
4760 class=property>styleset</code></a>’ allows an unlimited number.
4762 <p>For the styleset property value, multiple values indicate the style sets
4763 to be enabled. Values between 1 and 99 enable OpenType features <span
4764 class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
4765 OpenType standard only officially defines <span class=tag>ss01</span>
4766 through <span class=tag>ss20</span>. For OpenType fonts, values greater
4767 than 99 or equal to 0 do not generate a syntax error when parsed but
4768 enable no OpenType features.
4770 <pre>@font-feature-values Mars Serif {
4771 @styleset {
4772 alt-g: 1; /* implies ss01 = 1 */
4773 curly-quotes: 3; /* implies ss03 = 1 */
4774 code: 4 5; /* implies ss04 = 1, ss05 = 1 */
4775 }
4777 @styleset {
4778 dumb: 125; /* >99, ignored */
4779 }
4781 @swash {
4782 swishy: 3 5; /* more than 1 value for swash, syntax error */
4783 }
4784 }
4786 p.codeblock {
4787 /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
4788 font-variant-alternates: styleset(curly-quotes, code);
4789 }</pre>
4791 <p>For character-variant, a single value between 1 and 99 indicates the
4792 enabling of OpenType feature <span class=tag>cv01</span> through <span
4793 class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
4794 to 0 are ignored but do not generate a syntax error when parsed but enable
4795 no OpenType features. When two values are listed, the first value
4796 indicates the feature used and the second the value passed for that
4797 feature. If more than two values are assigned to a given name, a syntax
4798 error occurs and the entire <a href="#featurevaluedefinition"><i
4799 title="feature_value_definition">feature value definition</i></a> is
4800 ignored.
4802 <pre>@font-feature-values MM Greek {
4803 @character-variant { alpha-2: 1 2; } /* implies cv01 = 2 */
4804 @character-variant { beta-3: 2 3; } /* implies cv02 = 3 */
4805 @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
4806 @character-variant { gamma: 12; } /* implies cv12 = 1 */
4807 @character-variant { zeta: 20 3; } /* implies cv20 = 3 */
4808 @character-variant { zeta-2: 20 2; } /* implies cv20 = 2 */
4809 @character-variant { silly: 105; } /* >99, ignored */
4810 @character-variant { dumb: 323 3; } /* >99, ignored */
4811 }
4813 #title {
4814 /* use the third alternate beta, first alternate gamma */
4815 font-variant-alternates: character-variant(beta-3, gamma);
4816 }
4818 p {
4819 /* zeta-2 follows zeta, implies cv20 = 2 */
4820 font-variant-alternates: character-variant(zeta, zeta-2);
4821 }
4823 .special {
4824 /* zeta follows zeta-2, implies cv20 = 3 */
4825 font-variant-alternates: character-variant(zeta-2, zeta);
4826 }</pre>
4828 <div class=figure><img alt="Matching text on Byzantine seals using
4829 character variants" src=byzantineseal.png>
4830 <p class=caption>Byzantine seal text displayed with character variants
4831 </div>
4833 <div class=example>
4834 <p>In the figure above, the text in red is rendered using a font
4835 containing character variants that mimic the character forms found on a
4836 Byzantine seal from the 8th century A.D. Two lines below is the same text
4837 displayed in a font without variants. Note the two variants for U and N
4838 used on the seal.</p>
4840 <pre>@font-feature-values Athena Ruby {
4841 @character-variant {
4842 leo-B: 2 1;
4843 leo-M: 13 3;
4844 leo-alt-N: 14 1;
4845 leo-N: 14 2;
4846 leo-T: 20 1;
4847 leo-U: 21 2;
4848 leo-alt-U: 21 4;
4849 }
4850 }
4852 p {
4853 font-variant: discretionary-ligatures,
4854 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
4855 }
4857 span.alt-N {
4858 font-variant-alternates: character-variant(leo-alt-N);
4859 }
4861 span.alt-U {
4862 font-variant-alternates: character-variant(leo-alt-U);
4863 }
4865 <p>ENO....UP͞RSTU<span class="alt-U">U</span>͞<span class="alt-U">U</span>ΚΑΙTỤẠG̣IUPNS</p>
4867 <p>LEON|ΚΑΙCONSTA|NTI<span class="alt-N">N</span>OS..|STOIBAṢ.|LIṢROM|AIO<span class="alt-N">N</span></p>
4868 </pre>
4869 </div>
4871 <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
4872 Asian text rendering: the <a
4873 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
4874 property</h3>
4876 <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
4877 <tbody>
4878 <tr>
4879 <td>Name:
4881 <td><dfn
4882 id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
4884 <tr>
4885 <td>Value:
4887 <td><a href="#font-variant-east-asian-normal-value"
4888 title="normal!!font-variant-east-asian">normal</a> | [ <a
4889 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
4890 || <a
4891 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
4892 || <a href="#ruby">ruby</a> ]
4894 <tr>
4895 <td>Initial:
4897 <td>normal
4899 <tr>
4900 <td>Applies to:
4902 <td>all elements
4904 <tr>
4905 <td>Inherited:
4907 <td>yes
4909 <tr>
4910 <td>Percentages:
4912 <td>N/A
4914 <tr>
4915 <td>Media:
4917 <td>visual
4919 <tr>
4920 <td>Computed value:
4922 <td>as specified
4924 <tr>
4925 <td>Animatable:
4927 <td>no
4928 </table>
4930 <p>Allows control of glyph substitution and sizing in East Asian text.
4932 <pre
4933 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>
4935 <pre
4936 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>
4938 <p>Individual values have the following meanings:
4940 <dl>
4941 <dt><dfn id=font-variant-east-asian-normal-value
4942 title="normal!!font-variant-east-asian">normal</dfn>
4944 <dd>None of the features listed below are enabled.
4946 <dt><dfn id=jis78>jis78</dfn>
4948 <dd>Enables rendering of JIS78 forms (OpenType feature: <span
4949 class=tag>jp78</span>).
4950 </dl>
4952 <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
4954 <dl>
4955 <dt><dfn id=jis83>jis83</dfn>
4957 <dd>Enables rendering of JIS83 forms (OpenType feature: <span
4958 class=tag>jp83</span>).
4960 <dt><dfn id=jis90>jis90</dfn>
4962 <dd>Enables rendering of JIS90 forms (OpenType feature: <span
4963 class=tag>jp90</span>).
4965 <dt><dfn id=jis04>jis04</dfn>
4967 <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
4968 class=tag>jp04</span>).
4969 <p>The various JIS variants reflect the glyph forms defined in different
4970 Japanese national standards. Fonts generally include glyphs defined by
4971 the most recent national standard but it's sometimes necessary to use
4972 older variants, to match signage for example.</p>
4974 <dt><dfn id=simplified>simplified</dfn>
4976 <dd>Enables rendering of simplified forms (OpenType feature: <span
4977 class=tag>smpl</span>).
4979 <dt><dfn id=traditional>traditional</dfn>
4981 <dd>Enables rendering of traditional forms (OpenType feature: <span
4982 class=tag>trad</span>).
4983 </dl>
4985 <p>The ‘<a href="#simplified"><code
4986 class=property>simplified</code></a>’ and ‘<a
4987 href="#traditional"><code class=property>traditional</code></a>’ values
4988 allow control over the glyph forms for characters which have been
4989 simplified over time but for which the older, traditional form is still
4990 used in some contexts. The exact set of characters and glyph forms will
4991 vary to some degree by context for which a given font was designed.
4993 <div class=featex><img alt="tradtional form example" src=trad.png></div>
4995 <dl>
4996 <dt><dfn id=full-width>full-width</dfn>
4998 <dd>Enables rendering of full-width variants (OpenType feature: <span
4999 class=tag>fwid</span>).
5001 <dt><dfn id=proportional-width>proportional-width</dfn>
5003 <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
5004 <span class=tag>pwid</span>).
5005 </dl>
5007 <div class=featex><img alt="proportionally spaced Japanese example"
5008 src=pwid.png></div>
5010 <dl>
5011 <dt><dfn id=ruby>ruby</dfn>
5013 <dd>Enables display of ruby variant glyphs (OpenType feature: <span
5014 class=tag>ruby</span>). Since ruby text is generally smaller than the
5015 associated body text, font designers can design special glyphs for use
5016 with ruby that are more readable than scaled down versions of the default
5017 glyphs. Only glyph selection is affected, there is no associated font
5018 scaling or other change that affects line layout. The red ruby text below
5019 is shown with default glyphs (top) and with ruby variant glyphs (bottom).
5020 Note the slight difference in stroke thickness.
5021 </dl>
5023 <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
5025 <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
5026 for font rendering: the <a href="#propdef-font-variant">font-variant</a>
5027 property</h3>
5029 <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
5030 <tbody>
5031 <tr>
5032 <td>Name:
5034 <td><dfn id=propdef-font-variant
5035 title="font-variant!!property">font-variant</dfn>
5037 <tr>
5038 <td>Value:
5040 <td><a href="#font-variant-normal-value"
5041 title="normal!!font-variant">normal</a> | <a
5042 href="#font-variant-none-value" title="none!!font-variant">none</a> | [
5043 <a href="#common-lig-values"><var><common-lig-values></var></a>
5044 || <a
5045 href="#discretionary-lig-values"><var><discretionary-lig-values></var></a>
5046 || <a
5047 href="#historical-lig-values"><var><historical-lig-values></var></a>
5048 || <a
5049 href="#contextual-alt-values"><var><contextual-alt-values></var></a>
5050 || <a href="#stylistic"><var
5051 title=stylistic>stylistic(<feature-value-name>)</var></a> || <a
5052 href="#historical-forms"><var>historical-forms</var></a> || <a
5053 href="#styleset"><var
5054 title=styleset>styleset(<feature-value-name> #)</var></a> || <a
5055 href="#character-variant"><var
5056 title=character-variant>character-variant(<feature-value-name>
5057 #)</var></a> || <a href="#swash"><var
5058 title=swash>swash(<feature-value-name>)</var></a> || <a
5059 href="#ornaments"><var
5060 title=ornaments>ornaments(<feature-value-name>)</var></a> || <a
5061 href="#annotation"><var
5062 title=annotation>annotation(<feature-value-name>)</var></a> || [
5063 <a href="#small-caps"><i>small-caps</i></a> | <a
5064 href="#all-small-caps"><i>all-small-caps</i></a> | <a
5065 href="#petite-caps"><i>petite-caps</i></a> | <a
5066 href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
5067 href="#unicase"><i>unicase</i></a> | <a
5068 href="#titling-caps"><i>titling-caps</i></a> ] || <a
5069 href="#numeric-figure-values"><var><numeric-figure-values></var></a>
5070 || <a
5071 href="#numeric-spacing-values"><var><numeric-spacing-values></var></a>
5072 || <a
5073 href="#numeric-fraction-values"><var><numeric-fraction-values></var></a>
5074 || <a href="#ordinal"><i>ordinal</i></a> || <a
5075 href="#slashed-zero"><i>slashed-zero</i></a> || <a
5076 href="#east-asian-variant-values"><var><east-asian-variant-values></var></a>
5077 || <a
5078 href="#east-asian-width-values"><var><east-asian-width-values></var></a>
5079 || <a href="#ruby"><i>ruby</i></a> ]
5081 <tr>
5082 <td>Initial:
5084 <td>normal
5086 <tr>
5087 <td>Applies to:
5089 <td>all elements
5091 <tr>
5092 <td>Inherited:
5094 <td>yes
5096 <tr>
5097 <td>Percentages:
5099 <td>see individual properties
5101 <tr>
5102 <td>Media:
5104 <td>visual
5106 <tr>
5107 <td>Computed value:
5109 <td>see individual properties
5111 <tr>
5112 <td>Animatable:
5114 <td>see individual properties
5115 </table>
5117 <p>The <a href="#propdef-font-variant"
5118 title="font-variant!!property">‘<code
5119 class=property>font-variant</code>’</a> property is a shorthand for all
5120 font-variant subproperties. The value <dfn id=font-variant-normal-value
5121 title="normal!!font-variant">‘<code
5122 class=property>normal</code>’</dfn> resets all subproperties of <a
5123 href="#propdef-font-variant" title="font-variant!!property">‘<code
5124 class=property>font-variant</code>’</a> to their inital value. The <dfn
5125 id=font-variant-none-value title="none!!font-variant">‘<code
5126 class=property>none</code>’</dfn> value sets ‘<a
5127 href="#propdef-font-variant-ligatures"><code
5128 class=property>font-variant-ligatures</code></a>’ to ‘<code
5129 class=property>none</code>’ and resets all other font feature properties
5130 to their initial value. Like other shorthands, using <a
5131 href="#propdef-font-variant" title="font-variant!!property">‘<code
5132 class=property>font-variant</code>’</a> resets unspecified <a
5133 href="#propdef-font-variant" title="font-variant!!property">‘<code
5134 class=property>font-variant</code>’</a> subproperties to their initial
5135 values. It does not reset the values of either ‘<a
5136 href="#propdef-font-language-override"><code
5137 class=property>font-language-override</code></a>’ or <a
5138 href="#propdef-font-feature-settings"
5139 title="font-feature-settings!!property">‘<code
5140 class=property>font-feature-settings</code>’</a>.
5142 <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
5143 font feature settings control: the <a
5144 href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
5146 <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
5147 <tbody>
5148 <tr>
5149 <td>Name:
5151 <td><dfn id=propdef-font-feature-settings
5152 title="font-feature-settings!!property">font-feature-settings</dfn>
5154 <tr>
5155 <td>Value:
5157 <td><a href="#font-feature-settings-normal-value"
5158 title="normal!!font-feature-settings">normal</a> | <a
5159 href="#feature-tag-value"><var><feature-tag-value></var></a> #
5161 <tr>
5162 <td>Initial:
5164 <td>normal
5166 <tr>
5167 <td>Applies to:
5169 <td>all elements
5171 <tr>
5172 <td>Inherited:
5174 <td>yes
5176 <tr>
5177 <td>Percentages:
5179 <td>N/A
5181 <tr>
5182 <td>Media:
5184 <td>visual
5186 <tr>
5187 <td>Computed value:
5189 <td>as specified
5191 <tr>
5192 <td>Animatable:
5194 <td>no
5195 </table>
5197 <p>This property provides low-level control over OpenType font features. It
5198 is intended as a way of providing access to font features that are not
5199 widely used but are needed for a particular use case.
5201 <p>Authors should generally use <a href="#propdef-font-variant"
5202 title="font-variant!!property">‘<code
5203 class=property>font-variant</code>’</a> and its related subproperties
5204 whenever possible and only use this property for special cases where its
5205 use is the only way of accessing a particular infrequently used font
5206 feature.
5208 <pre>/* enable small caps and use second swash alternate */
5209 font-feature-settings: "smcp", "swsh" 2;</pre>
5211 <p>A value of <dfn id=font-feature-settings-normal-value
5212 title="normal!!font-feature-settings">‘<code
5213 class=property>normal</code>’</dfn> means that no change in glyph
5214 selection or positioning occurs due to this property.
5216 <p>Feature tag values have the following syntax:
5218 <pre
5219 class=prod><dfn id=feature-tag-value><var><feature-tag-value></var></dfn> = <string> [ <integer> | on | off ]?</pre>
5221 <p>The <string> is a case-sensitive OpenType feature tag. As
5222 specified in the OpenType specification, feature tags contain four ASCII
5223 characters. Tag strings longer or shorter than four characters, or
5224 containing characters outside the U+20–7E codepoint range are invalid.
5225 Feature tags need only match a feature tag defined in the font, so they
5226 are not limited to explicitly registered OpenType features. Fonts defining
5227 custom feature tags should follow the <a
5228 href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
5229 rules</a> defined in the OpenType specification <a
5230 href="#OPENTYPE-FEATURES"
5231 rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
5232 Feature tags not present in the font are ignored; a user agent must not
5233 attempt to synthesize fallback behavior based on these feature tags.
5235 <p>This means that explicitly disabling the <span class=tag>kern</span>
5236 feature will not affect the application of kerning data found in the
5237 ‘<code class=property>kern</code>’ table (as opposed to kerning data
5238 associated with the <span class=tag>kern</span> feature in the ‘<code
5239 class=property>GPOS</code>’ table). Authors should use the ‘<a
5240 href="#propdef-font-kerning"><code
5241 class=property>font-kerning</code></a>’ property to explictly enable or
5242 disable kerning since this property affects both types of kerning.
5244 <p>If present, a value indicates an index used for glyph selection. An
5245 <integer> value must be 0 or greater. A value of 0 indicates that
5246 the feature is disabled. For boolean features, a value of 1 enables the
5247 feature. For non-boolean features, a value of 1 or greater enables the
5248 feature and indicates the feature selection index. A value of ‘<code
5249 class=property>on</code>’ is synonymous with 1 and ‘<code
5250 class=property>off</code>’ is synonymous with 0. If the value is
5251 omitted, a value of 1 is assumed.
5253 <pre>
5254 font-feature-settings: "dlig" 1; /* dlig=1 enable discretionary ligatures */
5255 font-feature-settings: "smcp" on; /* smcp=1 enable small caps */
5256 font-feature-settings: 'c2sc'; /* c2sc=1 enable caps to small caps */
5257 font-feature-settings: "liga" off; /* liga=0 no common ligatures */
5258 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
5259 font-feature-settings: "tnum" "hist"; /* invalid, need a comma-delimited list */
5260 font-feature-settings: "palin" off; /* good idea but invalid tagname */
5261 font-feature-settings: "PKRN"; /* PKRN=1 enable custom feature */
5262 font-feature-settings: dlig; /* invalid, tag must be a string */
5263 </pre>
5265 <p>When values greater than the range supported by the font are specified,
5266 the behavior is explicitly undefined. For boolean features, in general
5267 these will enable the feature. For non-boolean features, out of range
5268 values will in general be equivalent to a 0 value. However, in both cases
5269 the exact behavior will depend upon the way the font is designed
5270 (specifically, which type of lookup is used to define the feature).
5272 <p>Although specifically defined for OpenType feature tags, feature tags
5273 for other modern font formats that support font features may be added in
5274 the future. Where possible, features defined for other font formats should
5275 attempt to follow the pattern of registered OpenType tags.
5277 <div class=example>
5278 <p>The Japanese text below will be rendered with half-width kana
5279 characters:</p>
5281 <pre lang=ja>
5282 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
5284 <p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない</p>
5285 </pre>
5286 </div>
5288 <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
5289 language override: the <a
5290 href="#propdef-font-language-override">font-language-override</a> property</h3>
5292 <table class=propdef id=namefont-language-overridevaluenormal-lt>
5293 <tbody>
5294 <tr>
5295 <td>Name:
5297 <td><dfn id=propdef-font-language-override>font-language-override</dfn>
5299 <tr>
5300 <td>Value:
5302 <td><a href="#font-language-override-normal-value"
5303 title="normal!!font-language-override">normal</a> | <a
5304 href="#font-language-override-string-value"><var><string></var></a>
5306 <tr>
5307 <td>Initial:
5309 <td><a href="#font-language-override-normal-value"
5310 title="normal!!font-language-override">normal</a>
5312 <tr>
5313 <td>Applies to:
5315 <td>all elements
5317 <tr>
5318 <td>Inherited:
5320 <td>yes
5322 <tr>
5323 <td>Percentages:
5325 <td>N/A
5327 <tr>
5328 <td>Media:
5330 <td>visual
5332 <tr>
5333 <td>Computed value:
5335 <td>as specified
5337 <tr>
5338 <td>Animatable:
5340 <td>no
5341 </table>
5343 <p>Normally, authors can control the use of language-specific glyph
5344 substitutions and positioning by setting the content language of an
5345 element, as <a href="#language-specific-support">described above</a>:
5347 <pre><!-- Display text using S'gaw Karen specific features -->
5348 <p lang="ksw">...</p></pre>
5350 <p>In some cases, authors may need to specify a language system that
5351 differs from the content language, for example due to the need to mimic
5352 another language's typographic traditions. The ‘<a
5353 href="#propdef-font-language-override"><code
5354 class=property>font-language-override</code></a>’ property allows
5355 authors to explicitly specify the language system of the font, overriding
5356 the language system implied by the content language.
5358 <p>Values have the following meanings:
5360 <dl>
5361 <dt><dfn id=font-language-override-normal-value
5362 title="normal!!font-language-override">normal</dfn>
5364 <dd>specifies that when rendering with OpenType fonts, the content
5365 language of the element is used to infer the OpenType language system
5367 <dt><dfn
5368 id=font-language-override-string-value><var><string></var></dfn>
5370 <dd>single three-letter OpenType <a
5371 href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
5372 system tag</a>, specifies the OpenType language system to be used instead
5373 of the language system implied by the language of the element
5374 </dl>
5376 <p>Use of invalid OpenType language system tags must not generate a parse
5377 error but must be ignored when doing glyph selection and placement.
5379 <div class=example>
5380 <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
5381 Declaration of Human Rights</a> has been translated into a wide variety
5382 of languages. In Turkish, Article 9 of this document might be marked up
5383 as below:</p>
5385 <pre lang=tr><body lang="tr">
5387 <h4>Madde 9</h4>
5388 <p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.</p>
5389 </pre>
5391 <p>Here the user agent uses the value of the ‘<code
5392 class=property>lang</code>’ attribute when rendering text and
5393 appropriately renders this text without ‘<code
5394 class=property>fi</code>’ ligatures. There is no need to use the ‘<a
5395 href="#propdef-font-language-override"><code
5396 class=property>font-language-override</code></a>’ property.</p>
5398 <p>However, a given font may lack support for a specific language. In this
5399 situation authors may need to use the typographic conventions of a
5400 related language that are supported by that font:</p>
5402 <pre lang=mk><body lang="mk"> <!-- Macedonian lang code -->
5404 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
5406 <h4>Члeн 9</h4>
5407 <p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.</p>
5409 </pre>
5411 <p>The Macedonian text here will be rendered using Serbian typographic
5412 conventions, with the assumption that the font specified supports
5413 Serbian.</p>
5414 </div>
5416 <p><a id=rendering-considerations></a>
5418 <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
5419 Resolution</h2>
5421 <p>As described in the previous section, font features can be enabled in a
5422 variety of ways, either via the use of <a href="#propdef-font-variant"
5423 title="font-variant!!property">‘<code
5424 class=property>font-variant</code>’</a> or <a
5425 href="#propdef-font-feature-settings"
5426 title="font-feature-settings!!property">‘<code
5427 class=property>font-feature-settings</code>’</a> in a style rule or
5428 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5429 The resolution order for the union of these settings is defined below.
5430 Features defined via CSS properties are applied on top of layout engine
5431 default features.
5433 <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
5435 <p>For OpenType fonts, user agents must enable the default features defined
5436 in the OpenType documentation for a given script and writing mode.
5437 Required ligatures, common ligatures and contextual forms must be enabled
5438 by default (OpenType features: <span class=tag>rlig, liga, clig,
5439 calt</span>), along with localized forms (OpenType feature: <span
5440 class=tag>locl</span>), and features required for proper display of
5441 composed characters and marks (OpenType features: <span class=tag>ccmp,
5442 mark, mkmk</span>). These features must always be enabled, even when the
5443 value of the <a href="#propdef-font-variant"
5444 title="font-variant!!property">‘<code
5445 class=property>font-variant</code>’</a> and <a
5446 href="#propdef-font-feature-settings"
5447 title="font-feature-settings!!property">‘<code
5448 class=property>font-feature-settings</code>’</a> properties is ‘<a
5449 href="#normal"><code class=property>normal</code></a>’. Individual
5450 features are only disabled when explicitly overridden by the author, as
5451 when ‘<a href="#propdef-font-variant-ligatures"><code
5452 class=property>font-variant-ligatures</code></a>’ is set to ‘<a
5453 href="#no-common-ligatures"><code
5454 class=property>no-common-ligatures</code></a>’. For handling complex
5455 scripts such as <a
5456 href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
5457 <a
5458 href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
5459 or <a
5460 href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
5461 additional features are required. For upright text within vertical text
5462 runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
5463 must be enabled.
5465 <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
5467 <p>General and <a href="#font-specific"><em>font specific</em></a> font
5468 feature property settings are resolved in the order below, in ascending
5469 order of precedence. This ordering is used to construct a combined list of
5470 font features that affect a given text run.
5472 <ol>
5473 <li>Font features enabled by default, including features required for a
5474 given script.
5476 <li>If the font is defined via an <a
5477 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5478 features implied by the font-variant descriptor in the <a
5479 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5481 <li>If the font is defined via an <a
5482 href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
5483 features implied by the font-feature-settings descriptor in the <a
5484 href="#at-font-face-rule"><code>@font-face</code></a> rule.
5486 <li>Feature settings determined by properties other than <a
5487 href="#propdef-font-variant" title="font-variant!!property">‘<code
5488 class=property>font-variant</code>’</a> or <a
5489 href="#propdef-font-feature-settings"
5490 title="font-feature-settings!!property">‘<code
5491 class=property>font-feature-settings</code>’</a>. For example, setting
5492 a non-default value for the ‘<code
5493 class=property>letter-spacing</code>’ property disables common
5494 ligatures.
5496 <li>Font features implied by the value of the <a
5497 href="#propdef-font-variant" title="font-variant!!property">‘<code
5498 class=property>font-variant</code>’</a> property, the related <a
5499 href="#propdef-font-variant" title="font-variant!!property">‘<code
5500 class=property>font-variant</code>’</a> subproperties and any other CSS
5501 property that uses OpenType features (e.g. the ‘<a
5502 href="#propdef-font-kerning"><code
5503 class=property>font-kerning</code></a>’ property).
5505 <li>Font features implied by the value of <a
5506 href="#propdef-font-feature-settings"
5507 title="font-feature-settings!!property">‘<code
5508 class=property>font-feature-settings</code>’</a> property.
5509 </ol>
5511 <p>This ordering allows authors to set up a general set of defaults for
5512 fonts within their <a
5513 href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
5514 them with property settings for specific elements. General property
5515 settings override the settings in <a
5516 href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
5517 font feature settings override <a href="#propdef-font-variant"
5518 title="font-variant!!property">‘<code
5519 class=property>font-variant</code>’</a> property settings.
5521 <p>For situations where the combined list of font feature settings contains
5522 more than one value for the same feature, the last value is used. When a
5523 font lacks support for a given underlying font feature, text is simply
5524 rendered as if that font feature was not enabled; font fallback does not
5525 occur and no attempt is made to synthesize the feature except where
5526 explicitly defined for specific properties.
5528 <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
5529 precedence examples</h3>
5531 <div class=example>
5532 <p>With the styles below, numbers are rendered proportionally when used
5533 within a paragraph but are shown in tabular form within tables of prices:</p>
5535 <pre>body {
5536 font-variant-numeric: proportional-nums;
5537 }
5539 table.prices td {
5540 font-variant-numeric: tabular-nums;
5541 }
5542 </pre>
5543 </div>
5545 <div class=example>
5546 <p>When the <a href="#descdef-font-variant"
5547 title="font-variant!!descriptor">font-variant</a> descriptor is used
5548 within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
5549 it only applies to the font defined by that rule.</p>
5551 <pre>@font-face {
5552 font-family: MainText;
5553 src: url(http://example.com/font.ttf);
5554 font-variant: oldstyle-nums proportional-nums styleset(1,3);
5555 }
5557 body {
5558 font-family: MainText, Helvetica;
5559 }
5561 table.prices td {
5562 font-variant-numeric: tabular-nums;
5563 }
5564 </pre>
5566 <p>In this case, old-style numerals will be used throughout but only where
5567 the font "MainText" is used. Just as in the previous example, tabular
5568 values will be used in price tables since ‘<a
5569 href="#tabular-nums"><code class=property>tabular-nums</code></a>’
5570 appears in a general style rule and its use is mutually exclusive with
5571 ‘<a href="#proportional-nums"><code
5572 class=property>proportional-nums</code></a>’. Stylistic alternate sets
5573 will only be used where MainText is used.</p>
5574 </div>
5576 <div class=example>
5577 <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
5578 also be used to access font features in locally available fonts via the
5579 use of <code>local()</code> in the ‘<a href="#descdef-src"><code
5580 class=property>src</code></a>’ descriptor of the <a
5581 href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
5583 <pre>@font-face {
5584 font-family: BodyText;
5585 src: local("HiraMaruPro-W4");
5586 font-variant: proportional-width;
5587 font-feature-settings: "ital"; /* Latin italics within CJK text feature */
5588 }
5590 body { font-family: BodyText, serif; }
5591 </pre>
5593 <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
5594 text rendering occurs, Japanese kana will be proportionally spaced and
5595 Latin text will be italicised. Text rendered with the fallback serif font
5596 will use default rendering properties.</p>
5597 </div>
5599 <div class=example>
5600 <p>In the example below, discretionary ligatures are enabled only for a
5601 downloadable font but are disabled within spans of class "special":</p>
5603 <pre>@font-face {
5604 font-family: main;
5605 src: url(fonts/ffmeta.woff) format("woff");
5606 font-variant: discretionary-ligatures;
5607 }
5609 body { font-family: main, Helvetica; }
5610 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5611 </pre>
5613 <p>Suppose one adds a rule using ‘<code
5614 class=property>font-feature-settings</code>’ to enable discretionary
5615 ligatures:</p>
5617 <pre>body { font-family: main, Helvetica; }
5618 span { font-feature-settings: "dlig"; }
5619 span.special { font-variant-ligatures: no-discretionary-ligatures; }
5620 </pre>
5622 <p>In this case, discretionary ligatures <em>will</em> be rendered within
5623 spans of class "special". This is because both the <a
5624 href="#propdef-font-feature-settings"
5625 title="font-feature-settings!!property">‘<code
5626 class=property>font-feature-settings</code>’</a> and ‘<a
5627 href="#propdef-font-variant-ligatures"><code
5628 class=property>font-variant-ligatures</code></a>’ properties apply to
5629 these spans. Although the ‘<code class=css>no-discretionary
5630 ligatures</code>’ setting of ‘<a
5631 href="#propdef-font-variant-ligatures"><code
5632 class=property>font-variant-ligatures</code></a>’ effectively disables
5633 the OpenType <span class=tag>dlig</span> feature, because the <a
5634 href="#propdef-font-feature-settings"
5635 title="font-feature-settings!!property">‘<code
5636 class=property>font-feature-settings</code>’</a> is resolved after
5637 that, the ‘<code class=property>dlig</code>’ value reenables
5638 discretionary ligatures.</p>
5639 </div>
5641 <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
5643 <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
5644 and <a
5645 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5646 rules can be accessed via the following extensions to the CSS Object
5647 Model.
5649 <h3 id=om-fontface><span class=secno>8.1 </span>The <a
5650 href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
5652 <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
5653 <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
5655 <pre class=idl>
5656 interface CSSFontFaceRule : CSSRule {
5657 attribute DOMString family;
5658 attribute DOMString src;
5659 attribute DOMString style;
5660 attribute DOMString weight;
5661 attribute DOMString stretch;
5662 attribute DOMString unicodeRange;
5663 attribute DOMString variant;
5664 attribute DOMString featureSettings;
5665 }</pre>
5667 <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
5668 rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
5669 defined a different variant of this rule. This definition supercedes that
5670 one.
5672 <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
5673 href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
5674 interface</h3>
5676 <p>The <code>CSSRule</code> interface is extended as follows:
5678 <pre class=idl>partial interface CSSRule {
5679 const unsigned short FONT_FEATURE_VALUES_RULE = 14;
5680 }</pre>
5682 <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
5683 interface represents a <a
5684 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5685 rule.
5687 <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
5688 readonly attribute DOMString familyList;
5689 readonly attribute DOMString valueText;
5690 };</pre>
5692 <dl class=idl-attributes>
5693 <dt><var>familyList</var> of type <code>DOMString</code>, readonly
5695 <dd>The list of one or more font families for which a given set of feature
5696 values is defined.
5698 <dt><var>valueText</var> of type <code>DOMString</code>, readonly
5700 <dd>Serialized set of feature values.
5701 </dl>
5703 <p class=issue>This needs to be reworked along the lines of <a
5704 href="http://lists.w3.org/Archives/Public/www-style/2013May/0781.html">Tab's
5705 proposal</a> for a rule containing a family list and map objects for each
5706 of the feature types.
5708 <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
5709 properties to CSS properties</h2>
5711 <p><em>This appendix is included as background for some of the problems and
5712 situations that are described in other sections. It should be viewed as
5713 informative only.</em>
5715 <p>Font properties in CSS are designed to be independent of the underlying
5716 font formats used; they can be used to specify bitmap fonts, Type1 fonts,
5717 SVG fonts in addition to the common TrueType and OpenType fonts. But there
5718 are facets of the TrueType and OpenType formats that often cause confusion
5719 for authors and present challenges to implementers on different platforms.
5721 <p>Originally developed at Apple, TrueType was designed as an outline font
5722 format for both screen and print. Microsoft joined Apple in developing the
5723 TrueType format and both platforms have supported TrueType fonts since
5724 then. Font data in the TrueType format consists of a set of tables
5725 distinguished with common four-letter tag names, each containing a
5726 specific type of data. For example, naming information, including
5727 copyright and license information, is stored in the ‘<code
5728 class=property>name</code>’ table. The <a
5729 href="#character-map"><em>character map</em></a> (‘<code
5730 class=property>cmap</code>’) table contains a mapping of character
5731 encodings to glyphs. Apple later added additional tables for supporting
5732 enhanced typographic functionality; these are now called Apple Advanced
5733 Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
5734 tables for advanced typography and called their format OpenType <a
5735 href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
5737 <p>In many cases the font data used under Microsoft Windows or Linux is
5738 slightly different from the data used under Apple's Mac OS X because the
5739 TrueType format allowed for explicit variation across platforms. This
5740 includes font metrics, names and <a href="#character-map"><em>character
5741 map</em></a> data.
5743 <p>Specifically, font family name data is handled differently across
5744 platforms. For TrueType and OpenType fonts these names are contained in
5745 the ‘<code class=property>name</code>’ table, in name records with
5746 name ID 1. Mulitple names can be stored for different locales, but
5747 Microsoft recommends fonts always include at least a US English version of
5748 the name. On Windows, Microsoft made the decision for backwards
5749 compatibility to limit this family name to a maximum of four faces; for
5750 larger groupings the "preferred family" (name ID 16) or "WWS family" (name
5751 ID 21) can be used. Other platforms such as OSX don't have this
5752 limitation, so the family name is used to define all possible groupings.
5754 <p>Other name table data provides names used to uniquely identify a
5755 specific face within a family. The full font name (name ID 4) and the
5756 Postscript name (name ID 6) describe a single face uniquely. For example,
5757 the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
5758 and a Postscript name of "GillSans-Bold". There can be multiple localized
5759 versions of the fullname for a given face, but the Postscript name is
5760 always a unique name made from a limited set of ASCII characters.
5762 <p>On various platforms, different names are used to search for a font. For
5763 example, with the Windows GDI CreateIndirectFont API, either a family or
5764 fullname can be used to lookup a face, while on Mac OS X the
5765 CTFontCreateWithName API call is used to lookup a given face using the
5766 fullname and Postscript name. Under Linux, the fontconfig API allows fonts
5767 to be searched using any of these names. In situations where platform
5768 API's automatically substitute other font choices, it may be necessary to
5769 verify a returned font matches a given name.
5771 <p>The weight of a given face can be determined via the usWeightClass field
5772 of the OS/2 table or inferred from the style name (name ID 2). Likewise,
5773 the width can be determined via the usWidthClass of the OS/2 table or
5774 inferred from the style name. For historical reasons related to synthetic
5775 bolding at weights 200 or lower with the Windows GDI API, font designers
5776 have sometimes skewed values in the OS/2 table to avoid these weights.
5778 <p>Rendering complex scripts that use contextual shaping such as Thai,
5779 Arabic and Devanagari requires features present only in OpenType or AAT
5780 fonts. Currently, complex script rendering is supported on Windows and
5781 Linux using OpenType font features while both OpenType and AAT font
5782 features are used under Mac OS X.
5784 <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
5786 <h3 class=no-num id=recent-changes> Changes from the <a
5787 href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">February 2013
5788 CSS3 Fonts Working Draft</a></h3>
5790 <p>Major changes include:
5792 <ul>
5793 <li>Moved font load events into a separate <a
5794 href="http://dev.w3.org/csswg/css3-font-load-events/">spec</a>
5796 <li>Tightened syntax rules for <a
5797 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5798 rules
5800 <li>Added grammar productions for <a
5801 href="#at-font-face-rule"><code>@font-face</code></a> and <a
5802 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5803 rules
5805 <li>Tightened definition of synthetic oblique
5807 <li>Revised definition of ‘<a href="#descdef-unicode-range"><code
5808 class=property>unicode-range</code></a>’ descriptor
5809 </ul>
5811 <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
5813 <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
5814 their help and feedback. John Hudson was kind enough to take the time to
5815 explain the subtleties of OpenType language tags and provided the example
5816 of character variant usage for displaying text on Byzantine seals. Ken
5817 Lunde and Eric Muller provided valuable feedback on CJK OpenType features
5818 and Unicode variation selectors. The idea for supporting font features by
5819 using <a href="#propdef-font-variant"
5820 title="font-variant!!property">‘<code
5821 class=property>font-variant</code>’</a> subproperties originated with
5822 Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
5823 of the initial design ideas for the <a
5824 href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
5825 rule. Thanks also to House Industries for allowing the use of Ed Interlock
5826 in the discretionary ligatures example.
5828 <p>A special thanks to Robert Bringhurst for the sublime mind expansion
5829 that is <em>The Elements of Typographic Style</em>.
5831 <h2 class=no-num id=conformance> Conformance</h2>
5833 <h3 class=no-num id=conventions> Document Conventions</h3>
5835 <p>Conformance requirements are expressed with a combination of descriptive
5836 assertions and RFC 2119 terminology. The key words “MUST”, “MUST
5837 NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
5838 “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
5839 normative parts of this document are to be interpreted as described in RFC
5840 2119. However, for readability, these words do not appear in all uppercase
5841 letters in this specification.
5843 <p>All of the text of this specification is normative except sections
5844 explicitly marked as non-normative, examples, and notes. <a
5845 href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
5847 <p>Examples in this specification are introduced with the words “for
5848 example” or are set apart from the normative text with
5849 <code>class="example"</code>, like this:
5851 <div class=example>
5852 <p>This is an example of an informative example.
5853 </div>
5855 <p>Informative notes begin with the word “Note” and are set apart from
5856 the normative text with <code>class="note"</code>, like this:
5858 <p class=note>Note, this is an informative note.
5860 <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
5862 <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
5863 classes:
5865 <dl>
5866 <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
5867 sheet</dfn>
5869 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
5870 style sheet</a>.
5872 <dt><dfn id=renderer>renderer</dfn>
5874 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5875 that interprets the semantics of a style sheet and renders documents that
5876 use them.
5878 <dt><dfn id=authoring-tool>authoring tool</dfn>
5880 <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
5881 that writes a style sheet.
5882 </dl>
5884 <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
5885 declarations that use properties defined in this module have values that
5886 are valid according to the generic CSS grammar and the individual grammars
5887 of each property as given in this module.
5889 <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
5890 interpreting the style sheet as defined by the appropriate specifications,
5891 it supports all the features defined by CSS Fonts Level 3 Module by
5892 parsing them correctly and rendering the document accordingly. However,
5893 the inability of a UA to correctly render a document due to limitations of
5894 the device does not make the UA non-conformant. (For example, a UA is not
5895 required to render color on a monochrome monitor.)
5897 <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
5898 style sheets that are syntactically correct according to the generic CSS
5899 grammar and the individual grammars of each feature in this module, and
5900 meet all other conformance requirements of style sheets as described in
5901 this module.
5903 <h3 class=no-num id=partial> Partial Implementations</h3>
5905 <p>So that authors can exploit the forward-compatible parsing rules to
5906 assign fallback values, CSS renderers <strong>must</strong> treat as
5907 invalid (and <a
5908 href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
5909 appropriate</a>) any at-rules, properties, property values, keywords, and
5910 other syntactic constructs for which they have no usable level of support.
5911 In particular, user agents <strong>must not</strong> selectively ignore
5912 unsupported component values and honor supported values in a single
5913 multi-value property declaration: if any value is considered invalid (as
5914 unsupported values must be), CSS requires that the entire declaration be
5915 ignored.
5917 <h3 class=no-num id=experimental> Experimental Implementations</h3>
5919 <p>To avoid clashes with future CSS features, the CSS2.1 specification
5920 reserves a <a
5921 href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
5922 syntax</a> for proprietary and experimental extensions to CSS.
5924 <p>Prior to a specification reaching the Candidate Recommendation stage in
5925 the W3C process, all implementations of a CSS feature are considered
5926 experimental. The CSS Working Group recommends that implementations use a
5927 vendor-prefixed syntax for such features, including those in W3C Working
5928 Drafts. This avoids incompatibilities with future changes in the draft.
5930 <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
5932 <p>Once a specification reaches the Candidate Recommendation stage,
5933 non-experimental implementations are possible, and implementors should
5934 release an unprefixed implementation of any CR-level feature they can
5935 demonstrate to be correctly implemented according to spec.
5937 <p>To establish and maintain the interoperability of CSS across
5938 implementations, the CSS Working Group requests that non-experimental CSS
5939 renderers submit an implementation report (and, if necessary, the
5940 testcases used for that implementation report) to the W3C before releasing
5941 an unprefixed implementation of any CSS features. Testcases submitted to
5942 W3C are subject to review and correction by the CSS Working Group.
5944 <p>Further information on submitting testcases and implementation reports
5945 can be found from on the CSS Working Group's website at <a
5946 href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
5947 Questions should be directed to the <a
5948 href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
5949 mailing list.
5951 <h2 class=no-num id=references>References</h2>
5953 <h3 class=no-num id=normative-references>Normative References</h3>
5954 <!--begin-normative-->
5955 <!-- Sorted by label -->
5957 <dl class=bibliography>
5958 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
5959 <!---->
5961 <dt id=CHARMOD>[CHARMOD]
5963 <dd>Martin J. Dürst; et al. <a
5964 href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
5965 Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
5966 2005. W3C Recommendation. URL: <a
5967 href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
5968 </dd>
5969 <!---->
5971 <dt id=CORS>[CORS]
5973 <dd>Anne van Kesteren. <a
5974 href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
5975 Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
5976 Recommendation. (Work in progress.) URL: <a
5977 href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
5978 </dd>
5979 <!---->
5981 <dt id=CSS21>[CSS21]
5983 <dd>Bert Bos; et al. <a
5984 href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
5985 Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
5986 2011. W3C Recommendation. URL: <a
5987 href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
5988 </dd>
5989 <!---->
5991 <dt id=CSS3VAL>[CSS3VAL]
5993 <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
5994 href="http://www.w3.org/TR/2012/CR-css3-values-20120828/"><cite>CSS
5995 Values and Units Module Level 3.</cite></a> 28 August 2012. W3C Candidate
5996 Recommendation. (Work in progress.) URL: <a
5997 href="http://www.w3.org/TR/2012/CR-css3-values-20120828/">http://www.w3.org/TR/2012/CR-css3-values-20120828/</a>
5998 </dd>
5999 <!---->
6001 <dt id=HTML5>[HTML5]
6003 <dd>Ian Hickson. <a
6004 href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
6005 17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
6006 <a
6007 href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
6008 </dd>
6009 <!---->
6011 <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
6013 <dd><a
6014 href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip"><cite>Information
6015 technology — Coding of audio-visual objects — Part 22: Open Font
6016 Format.</cite></a> International Organization for Standardization.
6017 ISO/IEC 14496-22:2009. URL: <a
6018 href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip</a>
6019 </dd>
6020 <!---->
6022 <dt id=OPENTYPE>[OPENTYPE]
6024 <dd><a
6025 href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
6026 specification.</cite></a> Microsoft. URL: <a
6027 href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
6028 </dd>
6029 <!---->
6031 <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
6033 <dd><a
6034 href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
6035 feature registry.</cite></a> Microsoft. URL: <a
6036 href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
6037 </dd>
6038 <!---->
6040 <dt id=RFC2119>[RFC2119]
6042 <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
6043 words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
6044 RFC 2119. URL: <a
6045 href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
6046 </dd>
6047 <!---->
6049 <dt id=UAX15>[UAX15]
6051 <dd>Mark Davis; Ken Whistler. <a
6052 href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
6053 Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
6054 href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
6055 </dd>
6056 <!---->
6058 <dt id=UAX29>[UAX29]
6060 <dd>Mark Davis. <a
6061 href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
6062 Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
6063 URL: <a
6064 href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
6065 </dd>
6066 <!---->
6068 <dt id=UNICODE6>[UNICODE6]
6070 <dd>The Unicode Consortium. <a
6071 href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
6072 Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
6073 Version 6.2.0 URL: <a
6074 href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
6075 </dd>
6076 <!---->
6077 </dl>
6078 <!--end-normative-->
6079 <!--{{!CSS21}}-->
6080 <!--{{!CSS3VAL}}-->
6081 <!--{{!OPENTYPE}}-->
6082 <!--{{!OPENTYPE-FEATURES}}-->
6083 <!--{{!OPEN-FONT-FORMAT}}-->
6084 <!--{{!UNICODE6}}-->
6085 <!--{{!UAX15}}-->
6086 <!--{{!UAX29}}-->
6087 <!--{{!CORS}}-->
6088 <!--{{!HTML5}}-->
6089 <!--{{!CHARMOD}}-->
6091 <h3 class=no-num id=other-references>Other References</h3>
6092 <!--begin-informative-->
6093 <!-- Sorted by label -->
6095 <dl class=bibliography>
6096 <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
6097 <!---->
6099 <dt id=AAT-FEATURES>[AAT-FEATURES]
6101 <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
6102 Advanced Typography font feature registry.</cite></a> Apple. URL: <a
6103 href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
6104 </dd>
6105 <!---->
6107 <dt id=ARABIC-TYPO>[ARABIC-TYPO]
6109 <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
6110 Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
6111 <!---->
6113 <dt id=CHARMOD-NORM>[CHARMOD-NORM]
6115 <dd>François Yergeau; et al. <a
6116 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
6117 Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
6118 W3C Working Draft. (Work in progress.) URL: <a
6119 href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
6120 </dd>
6121 <!---->
6123 <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
6125 <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
6126 O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
6127 <!---->
6129 <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
6131 <dd>L. David Baron. <a
6132 href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/"><cite>CSS
6133 Conditional Rules Module Level 3.</cite></a> 13 December 2012. W3C
6134 Working Draft. (Work in progress.) URL: <a
6135 href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">http://www.w3.org/TR/2012/WD-css3-conditional-20121213/</a>
6136 </dd>
6137 <!---->
6139 <dt id=CSS3TEXT>[CSS3TEXT]
6141 <dd>Elika J. Etemad; Koji Ishii. <a
6142 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
6143 Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
6144 progress.) URL: <a
6145 href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
6146 </dd>
6147 <!---->
6149 <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
6151 <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
6152 and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
6153 ISBN 0-201-17633-5.</dd>
6154 <!---->
6156 <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
6158 <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
6159 href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
6160 Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
6161 2000. W3C Recommendation. URL: <a
6162 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>
6163 </dd>
6164 <!---->
6166 <dt id=ELEMTYPO>[ELEMTYPO]
6168 <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
6169 4.</cite> Hartley & Marks. 2013. ISBN 0-88179-212-8.</dd>
6170 <!---->
6172 <dt id=LANGCULTTYPE>[LANGCULTTYPE]
6174 <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
6175 ISBN 1-932026-01-0.</dd>
6176 <!---->
6178 <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
6180 <dd><a
6181 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
6182 User Guide.</cite></a> FontShop International. URL: <a
6183 href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
6184 </dd>
6185 <!---->
6187 <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
6189 <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
6190 Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
6191 href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
6192 <!---->
6194 <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
6196 <dd>John Hudson. <a
6197 href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
6198 Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
6199 href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
6200 </dd>
6201 <!---->
6202 </dl>
6203 <!--end-informative-->
6204 <!--{{ARABIC-TYPO}}-->
6205 <!--{{CJKV-INFO-PROCESSING}}-->
6206 <!--{{DIGITAL-TYPOGRAPHY}}-->
6207 <!--{{DOM-LEVEL-2-STYLE}}-->
6208 <!--{{ELEMTYPO}}-->
6209 <!--{{LANGCULTTYPE}}-->
6210 <!--{{OPENTYPE-FONT-GUIDE}}-->
6211 <!--{{RASTER-TRAGEDY}}-->
6212 <!--{{WINDOWS-GLYPH-PROC}}-->
6213 <!--{{CHARMOD-NORM}}-->
6214 <!--{{AAT-FEATURES}}-->
6215 <!--{{CSS3-CONDITIONAL}}-->
6216 <!--{{CSS3TEXT}}-->
6218 <h2 class=no-num id=index>Index</h2>
6219 <!--begin-index-->
6221 <ul class=indexlist>
6222 <li>100...900 weight values, <a href="#font-weight-numeric-values"
6223 title="100...900 weight values"><strong>3.2</strong></a>
6225 <li><var><absolute-size></var>, <a href="#absolute-size-value"
6226 title="<absolute-size>"><strong>3.5</strong></a>
6228 <li><var><common-lig-values></var>, <a href="#common-lig-values"
6229 title="<common-lig-values>"><strong>6.4</strong></a>
6231 <li><var><contextual-alt-values></var>, <a
6232 href="#contextual-alt-values"
6233 title="<contextual-alt-values>"><strong>6.4</strong></a>
6235 <li><var><discretionary-lig-values></var>, <a
6236 href="#discretionary-lig-values"
6237 title="<discretionary-lig-values>"><strong>6.4</strong></a>
6239 <li><var><east-asian-variant-values></var>, <a
6240 href="#east-asian-variant-values"
6241 title="<east-asian-variant-values>"><strong>6.10</strong></a>
6243 <li><var><east-asian-width-values></var>, <a
6244 href="#east-asian-width-values"
6245 title="<east-asian-width-values>"><strong>6.10</strong></a>
6247 <li><var><family-name></var>, <a href="#family-name-value"
6248 title="<family-name>"><strong>3.1</strong></a>
6250 <li><var><feature-tag-value></var>, <a href="#feature-tag-value"
6251 title="<feature-tag-value>"><strong>6.12</strong></a>
6253 <li><var><font-face-name></var>, <a href="#font-face-name-value"
6254 title="<font-face-name>"><strong>4.3</strong></a>
6256 <li><var><font-variant-css21></var>, <a
6257 href="#font-variant-css21-values"
6258 title="<font-variant-css21>"><strong>3.7</strong></a>
6260 <li><var><generic-family></var>, <a href="#generic-family-value"
6261 title="<generic-family>"><strong>3.1</strong></a>
6263 <li><var><historical-lig-values></var>, <a
6264 href="#historical-lig-values"
6265 title="<historical-lig-values>"><strong>6.4</strong></a>
6267 <li><var><length></var>, <a href="#length-size-value"
6268 title="<length>"><strong>3.5</strong></a>
6270 <li><var><number></var>, <a href="#aspect-ratio-value"
6271 title="<number>"><strong>3.6</strong></a>
6273 <li><var><numeric-figure-values></var>, <a
6274 href="#numeric-figure-values"
6275 title="<numeric-figure-values>"><strong>6.7</strong></a>
6277 <li><var><numeric-fraction-values></var>, <a
6278 href="#numeric-fraction-values"
6279 title="<numeric-fraction-values>"><strong>6.7</strong></a>
6281 <li><var><numeric-spacing-values></var>, <a
6282 href="#numeric-spacing-values"
6283 title="<numeric-spacing-values>"><strong>6.7</strong></a>
6285 <li><var><percentage></var>, <a href="#percentage-size-value"
6286 title="<percentage>"><strong>3.5</strong></a>
6288 <li><var><relative-size></var>, <a href="#relative-size-value"
6289 title="<relative-size>"><strong>3.5</strong></a>
6291 <li><var><string></var>, <a
6292 href="#font-language-override-string-value"
6293 title="<string>"><strong>6.13</strong></a>
6295 <li><var><urange></var>, <a href="#urange-value"
6296 title="<urange>"><strong>4.5</strong></a>
6298 <li><code>@font-face</code>, <a href="#at-font-face-rule"
6299 title="@font-face"><strong>4.1</strong></a>
6301 <li><code>@font-feature-values</code>, <a
6302 href="#at-font-feature-values-rule"
6303 title="@font-feature-values"><strong>6.9</strong></a>
6305 <li>all-petite-caps, <a href="#all-petite-caps"
6306 title=all-petite-caps><strong>6.6</strong></a>
6308 <li>all-small-caps, <a href="#all-small-caps"
6309 title=all-small-caps><strong>6.6</strong></a>
6311 <li>annotation, <a href="#annotation"
6312 title=annotation><strong>6.8</strong></a>
6314 <li>aspect value, <a href="#aspect-value0" title="aspect
6315 value"><strong>3.6</strong></a>
6317 <li>authoring tool, <a href="#authoring-tool" title="authoring
6318 tool"><strong>#</strong></a>
6320 <li>auto
6321 <ul>
6322 <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
6323 font-kerning"><strong>6.3</strong></a>
6325 <li>font-size-adjust, <a href="#font-size-adjust-auto-value"
6326 title="auto, font-size-adjust"><strong>3.6</strong></a>
6327 </ul>
6329 <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
6331 <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
6333 <li>character map, <a href="#character-map" title="character
6334 map"><strong>5.2</strong></a>
6336 <li>character-variant, <a href="#character-variant"
6337 title=character-variant><strong>6.8</strong></a>
6339 <li>common-ligatures, <a href="#common-ligatures"
6340 title=common-ligatures><strong>6.4</strong></a>
6342 <li>condensed, <a href="#condensed"
6343 title=condensed><strong>3.3</strong></a>
6345 <li>contextual, <a href="#contextual"
6346 title=contextual><strong>6.4</strong></a>
6348 <li>CSSFontFaceRule, <a href="#cssfontfacerule"
6349 title=CSSFontFaceRule><strong>8.1</strong></a>
6351 <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
6352 title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
6354 <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
6355 of"><strong>#</strong></a>
6357 <li>default face, <a href="#default-face" title="default
6358 face"><strong>5.2</strong></a>
6360 <li>descriptor_declaration, <a href="#descriptordeclaration"
6361 title="descriptor_declaration"><strong>4.1</strong></a>
6363 <li>diagonal-fractions, <a href="#diagonal-fractions"
6364 title=diagonal-fractions><strong>6.7</strong></a>
6366 <li>discretionary-ligatures, <a href="#discretionary-ligatures"
6367 title=discretionary-ligatures><strong>6.4</strong></a>
6369 <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
6371 <li>extra-condensed, <a href="#extra-condensed"
6372 title=extra-condensed><strong>3.3</strong></a>
6374 <li>extra-expanded, <a href="#extra-expanded"
6375 title=extra-expanded><strong>3.3</strong></a>
6377 <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
6378 of"><strong>#</strong></a>
6380 <li>feature_type, <a href="#featuretype"
6381 title="feature_type"><strong>6.9.1</strong></a>
6383 <li>feature_value_block, <a href="#featurevalueblock"
6384 title="feature_value_block"><strong>6.9.1</strong></a>
6386 <li>feature_value_definition, <a href="#featurevaluedefinition"
6387 title="feature_value_definition"><strong>6.9.1</strong></a>
6389 <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
6391 <li>font specific, <a href="#font-specific" title="font
6392 specific"><strong>6.8</strong></a>
6394 <li>font-family
6395 <ul>
6396 <li>descriptor, <a href="#descdef-font-family" title="font-family,
6397 descriptor"><strong>4.2</strong></a>
6399 <li>property, <a href="#propdef-font-family" title="font-family,
6400 property"><strong>3.1</strong></a>
6401 </ul>
6403 <li>font-feature-settings
6404 <ul>
6405 <li>descriptor, <a href="#descdef-font-feature-settings"
6406 title="font-feature-settings, descriptor"><strong>4.7</strong></a>
6408 <li>property, <a href="#propdef-font-feature-settings"
6409 title="font-feature-settings, property"><strong>6.12</strong></a>
6410 </ul>
6412 <li>font-kerning, <a href="#propdef-font-kerning"
6413 title=font-kerning><strong>6.3</strong></a>
6415 <li>font-language-override, <a href="#propdef-font-language-override"
6416 title=font-language-override><strong>6.13</strong></a>
6418 <li>font-size, <a href="#propdef-font-size"
6419 title=font-size><strong>3.5</strong></a>
6421 <li>font-size-adjust, <a href="#propdef-font-size-adjust"
6422 title=font-size-adjust><strong>3.6</strong></a>
6424 <li>font-stretch
6425 <ul>
6426 <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
6427 descriptor"><strong>4.4</strong></a>
6429 <li>property, <a href="#propdef-font-stretch" title="font-stretch,
6430 property"><strong>3.3</strong></a>
6431 </ul>
6433 <li>font-style
6434 <ul>
6435 <li>descriptor, <a href="#descdef-font-style" title="font-style,
6436 descriptor"><strong>4.4</strong></a>
6438 <li>property, <a href="#propdef-font-style" title="font-style,
6439 property"><strong>3.4</strong></a>
6440 </ul>
6442 <li>font-synthesis, <a href="#propdef-font-synthesis"
6443 title=font-synthesis><strong>3.8</strong></a>
6445 <li>font-variant
6446 <ul>
6447 <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
6448 descriptor"><strong>4.7</strong></a>
6450 <li>property, <a href="#propdef-font-variant" title="font-variant,
6451 property"><strong>6.11</strong></a>
6452 </ul>
6454 <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
6455 title=font-variant-alternates><strong>6.8</strong></a>
6457 <li>font-variant-caps, <a href="#propdef-font-variant-caps"
6458 title=font-variant-caps><strong>6.6</strong></a>
6460 <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
6461 title=font-variant-east-asian><strong>6.10</strong></a>
6463 <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
6464 title=font-variant-ligatures><strong>6.4</strong></a>
6466 <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
6467 title=font-variant-numeric><strong>6.7</strong></a>
6469 <li>font-variant-position, <a href="#propdef-font-variant-position"
6470 title=font-variant-position><strong>6.5</strong></a>
6472 <li>font-weight
6473 <ul>
6474 <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
6475 descriptor"><strong>4.4</strong></a>
6477 <li>property, <a href="#propdef-font-weight" title="font-weight,
6478 property"><strong>3.2</strong></a>
6479 </ul>
6481 <li>font_face_rule, <a href="#fontfacerule"
6482 title="font_face_rule"><strong>4.1</strong></a>
6484 <li>FONT_FACE_SYM, <a href="#fontfacesym"
6485 title="FONT_FACE_SYM"><strong>4.1</strong></a>
6487 <li>font_family_name, <a href="#fontfamilyname"
6488 title="font_family_name"><strong>6.9.1</strong></a>
6490 <li>font_family_name_list, <a href="#fontfamilynamelist"
6491 title="font_family_name_list"><strong>6.9.1</strong></a>
6493 <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
6494 title="font_feature_values_rule"><strong>6.9.1</strong></a>
6496 <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
6497 title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
6499 <li>full-width, <a href="#full-width"
6500 title=full-width><strong>6.10</strong></a>
6502 <li>historical-forms, <a href="#historical-forms"
6503 title=historical-forms><strong>6.8</strong></a>
6505 <li>historical-ligatures, <a href="#historical-ligatures"
6506 title=historical-ligatures><strong>6.4</strong></a>
6508 <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
6510 <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
6512 <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
6514 <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
6516 <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
6518 <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
6520 <li>lining-nums, <a href="#lining-nums"
6521 title=lining-nums><strong>6.7</strong></a>
6523 <li>monospace, definition of, <a href="#monospace0" title="monospace,
6524 definition of"><strong>#</strong></a>
6526 <li>no-common-ligatures, <a href="#no-common-ligatures"
6527 title=no-common-ligatures><strong>6.4</strong></a>
6529 <li>no-contextual, <a href="#no-contextual"
6530 title=no-contextual><strong>6.4</strong></a>
6532 <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
6533 title=no-discretionary-ligatures><strong>6.4</strong></a>
6535 <li>no-historical-ligatures, <a href="#no-historical-ligatures"
6536 title=no-historical-ligatures><strong>6.4</strong></a>
6538 <li>none
6539 <ul>
6540 <li>font-kerning, <a href="#font-kerning-none-value" title="none,
6541 font-kerning"><strong>6.3</strong></a>
6543 <li>font-size-adjust, <a href="#font-size-adjust-none-value"
6544 title="none, font-size-adjust"><strong>3.6</strong></a>
6546 <li>font-variant, <a href="#font-variant-none-value" title="none,
6547 font-variant"><strong>6.11</strong></a>
6549 <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
6550 title="none, font-variant-ligatures"><strong>6.4</strong></a>
6551 </ul>
6553 <li>normal, <a href="#normal" title=normal><strong>6.5</strong></a>
6554 <ul>
6555 <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
6556 title="normal, font-feature-settings"><strong>6.12</strong></a>
6558 <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
6559 font-kerning"><strong>6.3</strong></a>
6561 <li>font-language-override, <a
6562 href="#font-language-override-normal-value" title="normal,
6563 font-language-override"><strong>6.13</strong></a>
6565 <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
6566 font-stretch"><strong>3.3</strong></a>
6568 <li>font-style, <a href="#font-style-normal-value" title="normal,
6569 font-style"><strong>3.4</strong></a>
6571 <li>font-variant, <a href="#font-variant-normal-value" title="normal,
6572 font-variant"><strong>6.11</strong></a>
6574 <li>font-variant-alternates, <a
6575 href="#font-variant-alternates-normal-value" title="normal,
6576 font-variant-alternates"><strong>6.8</strong></a>
6578 <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
6579 title="normal, font-variant-caps"><strong>6.6</strong></a>
6581 <li>font-variant-east-asian, <a
6582 href="#font-variant-east-asian-normal-value" title="normal,
6583 font-variant-east-asian"><strong>6.10</strong></a>
6585 <li>font-variant-ligatures, <a
6586 href="#font-variant-ligatures-normal-value" title="normal,
6587 font-variant-ligatures"><strong>6.4</strong></a>
6589 <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
6590 title="normal, font-variant-numeric"><strong>6.7</strong></a>
6592 <li>font-weight, <a href="#font-weight-normal-value" title="normal,
6593 font-weight"><strong>3.2</strong></a>
6594 </ul>
6596 <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
6598 <li>oldstyle-nums, <a href="#oldstyle-nums"
6599 title=oldstyle-nums><strong>6.7</strong></a>
6601 <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
6603 <li>ornaments, <a href="#ornaments"
6604 title=ornaments><strong>6.8</strong></a>
6606 <li>petite-caps, <a href="#petite-caps"
6607 title=petite-caps><strong>6.6</strong></a>
6609 <li>proportional-nums, <a href="#proportional-nums"
6610 title=proportional-nums><strong>6.7</strong></a>
6612 <li>proportional-width, <a href="#proportional-width"
6613 title=proportional-width><strong>6.10</strong></a>
6615 <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
6617 <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
6619 <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
6620 definition of"><strong>#</strong></a>
6622 <li>semi-condensed, <a href="#semi-condensed-"
6623 title=semi-condensed><strong>3.3</strong></a>
6625 <li>semi-expanded, <a href="#semi-expanded"
6626 title=semi-expanded><strong>3.3</strong></a>
6628 <li>serif, definition of, <a href="#serif0" title="serif, definition
6629 of"><strong>#</strong></a>
6631 <li>simplified, <a href="#simplified"
6632 title=simplified><strong>6.10</strong></a>
6634 <li>slashed-zero, <a href="#slashed-zero"
6635 title=slashed-zero><strong>6.7</strong></a>
6637 <li>small-caps, <a href="#small-caps"
6638 title=small-caps><strong>6.6</strong></a>
6640 <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
6642 <li>stacked-fractions, <a href="#stacked-fractions"
6643 title=stacked-fractions><strong>6.7</strong></a>
6645 <li>style sheet
6646 <ul>
6647 <li>as conformance class, <a href="#style-sheet" title="style sheet, as
6648 conformance class"><strong>#</strong></a>
6649 </ul>
6651 <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
6653 <li>stylistic, <a href="#stylistic"
6654 title=stylistic><strong>6.8</strong></a>
6656 <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
6658 <li>super, <a href="#super" title=super><strong>6.5</strong></a>
6660 <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
6662 <li>system font fallback, <a href="#system-font-fallback" title="system
6663 font fallback"><strong>5.2</strong></a>
6665 <li>tabular-nums, <a href="#tabular-nums"
6666 title=tabular-nums><strong>6.7</strong></a>
6668 <li>titling-caps, <a href="#titling-caps"
6669 title=titling-caps><strong>6.6</strong></a>
6671 <li>traditional, <a href="#traditional"
6672 title=traditional><strong>6.10</strong></a>
6674 <li>ultra-condensed, <a href="#ultra-condensed"
6675 title=ultra-condensed><strong>3.3</strong></a>
6677 <li>ultra-expanded, <a href="#ultra-expanded"
6678 title=ultra-expanded><strong>3.3</strong></a>
6680 <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
6682 <li>unicode-range, <a href="#descdef-unicode-range"
6683 title=unicode-range><strong>4.5</strong></a>
6685 <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
6687 <li>width, <a href="#width" title=width><strong>2</strong></a>
6688 </ul>
6689 <!--end-index-->
6691 <h2 class=no-num id=property-index>Property index</h2>
6692 <!--begin-properties-->
6694 <table class=proptable>
6695 <thead>
6696 <tr>
6697 <th>Property
6699 <th>Values
6701 <th>Initial
6703 <th>Applies to
6705 <th>Inh.
6707 <th>Percentages
6709 <th>Media
6711 <tbody>
6712 <tr>
6713 <th><a class=property href="#propdef-font">font</a>
6715 <td>[ [ <‘font-style’> || <font-variant-css21> ||
6716 <‘font-weight’> || <‘font-stretch’ ]?
6717 <‘font-size’> [ / <‘line-height’> ]?
6718 <‘font-family’> ] | caption | icon | menu | message-box |
6719 small-caption | status-bar
6721 <td>see individual properties
6723 <td>all elements
6725 <td>yes
6727 <td>see individual properties
6729 <td>visual
6731 <tr>
6732 <th><span class=property>font-family</span>
6734 <td>[ <family-name> | <generic-family> ] #
6736 <td>depends on user agent
6738 <td>all elements
6740 <td>yes
6742 <td>N/A
6744 <td>visual
6746 <tr>
6747 <th><span class=property>font-feature-settings</span>
6749 <td>normal | <feature-tag-value> #
6751 <td>normal
6753 <td>all elements
6755 <td>yes
6757 <td>N/A
6759 <td>visual
6761 <tr>
6762 <th><a class=property href="#propdef-font-kerning">font-kerning</a>
6764 <td>auto | normal | none
6766 <td>auto
6768 <td>all elements
6770 <td>yes
6772 <td>N/A
6774 <td>visual
6776 <tr>
6777 <th><a class=property
6778 href="#propdef-font-language-override">font-language-override</a>
6780 <td>normal | <string>
6782 <td>normal
6784 <td>all elements
6786 <td>yes
6788 <td>N/A
6790 <td>visual
6792 <tr>
6793 <th><a class=property href="#propdef-font-size">font-size</a>
6795 <td><absolute-size> | <relative-size> | <length> |
6796 <percentage>
6798 <td>medium
6800 <td>all elements
6802 <td>yes
6804 <td>refer to parent element's font size
6806 <td>visual
6808 <tr>
6809 <th><a class=property
6810 href="#propdef-font-size-adjust">font-size-adjust</a>
6812 <td>none | auto | <number>
6814 <td>none
6816 <td>all elements
6818 <td>yes
6820 <td>N/A
6822 <td>visual
6824 <tr>
6825 <th><span class=property>font-stretch</span>
6827 <td>normal | ultra-condensed | extra-condensed | condensed |
6828 semi-condensed | semi-expanded | expanded | extra-expanded |
6829 ultra-expanded
6831 <td>normal
6833 <td>all elements
6835 <td>yes
6837 <td>N/A
6839 <td>visual
6841 <tr>
6842 <th><span class=property>font-style</span>
6844 <td>normal | italic | oblique
6846 <td>normal
6848 <td>all elements
6850 <td>yes
6852 <td>N/A
6854 <td>visual
6856 <tr>
6857 <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
6859 <td>none | [ weight || style ]
6861 <td>weight style
6863 <td>all elements
6865 <td>yes
6867 <td>N/A
6869 <td>visual
6871 <tr>
6872 <th><span class=property>font-variant</span>
6874 <td>normal | none | [ <common-lig-values> ||
6875 <discretionary-lig-values> || <historical-lig-values> ||
6876 <contextual-alt-values> || stylistic(<feature-value-name>)
6877 || historical-forms || styleset(<feature-value-name> #) ||
6878 character-variant(<feature-value-name> #) ||
6879 swash(<feature-value-name>) ||
6880 ornaments(<feature-value-name>) ||
6881 annotation(<feature-value-name>) || [ small-caps | all-small-caps
6882 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
6883 <numeric-figure-values> || <numeric-spacing-values> ||
6884 <numeric-fraction-values> || ordinal || slashed-zero ||
6885 <east-asian-variant-values> || <east-asian-width-values> ||
6886 ruby ]
6888 <td>normal
6890 <td>all elements
6892 <td>yes
6894 <td>see individual properties
6896 <td>visual
6898 <tr>
6899 <th><a class=property
6900 href="#propdef-font-variant-alternates">font-variant-alternates</a>
6902 <td>normal | [ stylistic(<feature-value-name>) || historical-forms
6903 || styleset(<feature-value-name> #) ||
6904 character-variant(<feature-value-name> #) ||
6905 swash(<feature-value-name>) ||
6906 ornaments(<feature-value-name>) ||
6907 annotation(<feature-value-name>) ]
6909 <td>normal
6911 <td>all elements
6913 <td>yes
6915 <td>N/A
6917 <td>visual
6919 <tr>
6920 <th><a class=property
6921 href="#propdef-font-variant-caps">font-variant-caps</a>
6923 <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
6924 | unicase | titling-caps
6926 <td>normal
6928 <td>all elements
6930 <td>yes
6932 <td>N/A
6934 <td>visual
6936 <tr>
6937 <th><a class=property
6938 href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
6940 <td>normal | [ <east-asian-variant-values> ||
6941 <east-asian-width-values> || ruby ]
6943 <td>normal
6945 <td>all elements
6947 <td>yes
6949 <td>N/A
6951 <td>visual
6953 <tr>
6954 <th><a class=property
6955 href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
6957 <td>normal | none | [ <common-lig-values> ||
6958 <discretionary-lig-values> || <historical-lig-values> ||
6959 <contextual-alt-values> ]
6961 <td>normal
6963 <td>all elements
6965 <td>yes
6967 <td>N/A
6969 <td>visual
6971 <tr>
6972 <th><a class=property
6973 href="#propdef-font-variant-numeric">font-variant-numeric</a>
6975 <td>normal | [ <numeric-figure-values> ||
6976 <numeric-spacing-values> || <numeric-fraction-values> ||
6977 ordinal || slashed-zero ]
6979 <td>normal
6981 <td>all elements
6983 <td>yes
6985 <td>N/A
6987 <td>visual
6989 <tr>
6990 <th><a class=property
6991 href="#propdef-font-variant-position">font-variant-position</a>
6993 <td>normal | sub | super
6995 <td>normal
6997 <td>all elements
6999 <td>yes
7001 <td>N/A
7003 <td>visual
7005 <tr>
7006 <th><span class=property>font-weight</span>
7008 <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
7009 | 700 | 800 | 900
7011 <td>normal
7013 <td>all elements
7015 <td>yes
7017 <td>N/A
7019 <td>visual
7020 </table>
7021 <!--end-properties-->
7022 <!--begin-descriptors-->
7024 <table class=proptable>
7025 <thead>
7026 <tr>
7027 <th>Descriptor
7029 <th>Value
7031 <th>Initial
7033 <th>Percentages
7035 <th>Media
7037 <tbody>
7038 <tr>
7039 <th><span class=property>font-family</span>
7041 <td><family-name>
7043 <td>N/A
7045 <tr>
7046 <th><span class=property>font-feature-settings</span>
7048 <td>normal | <feature-tag-value> #
7050 <td>normal
7052 <tr>
7053 <th><span class=property>font-stretch</span>
7055 <td>normal | ultra-condensed | extra-condensed | condensed |
7056 semi-condensed | semi-expanded | expanded | extra-expanded |
7057 ultra-expanded
7059 <td>normal
7061 <tr>
7062 <th><span class=property>font-style</span>
7064 <td>normal | italic | oblique
7066 <td>normal
7068 <tr>
7069 <th><span class=property>font-variant</span>
7071 <td>normal | none | [ <common-lig-values> ||
7072 <discretionary-lig-values> || <historical-lig-values> ||
7073 <contextual-alt-values> || stylistic(<feature-value-name>)
7074 || historical-forms || styleset(<feature-value-name> #) ||
7075 character-variant(<feature-value-name> #) ||
7076 swash(<feature-value-name>) ||
7077 ornaments(<feature-value-name>) ||
7078 annotation(<feature-value-name>) || [ small-caps | all-small-caps
7079 | petite-caps | all-petite-caps | unicase | titling-caps ] ||
7080 <numeric-figure-values> || <numeric-spacing-values> ||
7081 <numeric-fraction-values> || ordinal || slashed-zero ||
7082 <east-asian-variant-values> || <east-asian-width-values> ||
7083 ruby ]
7085 <td>normal
7087 <tr>
7088 <th><span class=property>font-weight</span>
7090 <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
7092 <td>normal
7094 <tr>
7095 <th><a class=property href="#descdef-src">src</a>
7097 <td>[ <url> [format(<string> #)]? | <font-face-name> ] #
7099 <td>N/A
7101 <tr>
7102 <th><a class=property href="#descdef-unicode-range">unicode-range</a>
7104 <td><urange> #
7106 <td>U+0-10FFFF
7107 </table>
7108 <!--end-descriptors-->
7109 <script type="text/javascript">
7110 window.onload = function () {
7111 if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
7112 var i, hiresElements = document.getElementsByClassName("hires");
7113 for (i = 0; i < hiresElements.length; i++) {
7114 var h = hiresElements[i];
7115 if (h.tagName != "IMG") continue;
7116 var src = h.getAttribute("src");
7117 var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
7118 h.src = src2x;
7119 }
7120 }
7121 </script>
7122 </html>
7123 <!-- Keep this comment at the end of the file
7124 Local variables:
7125 mode: sgml
7126 sgml-declaration:"~/SGML/HTML4.decl"
7127 sgml-default-doctype-name:"html"
7128 sgml-minimize-attributes:t
7129 sgml-nofill-elements:("pre" "style" "br")
7130 sgml-live-element-indicator:t
7131 sgml-omittag:nil
7132 sgml-shorttag:nil
7133 sgml-namecase-general:t
7134 sgml-general-insert-case:lower
7135 sgml-always-quote-attributes:t
7136 sgml-indent-step:nil
7137 sgml-indent-data:t
7138 sgml-parent-document:nil
7139 sgml-exposed-tags:nil
7140 sgml-local-catalogs:nil
7141 sgml-local-ecat-files:nil
7142 End:
7143 -->
7144 <!--
7146 to do:
7148 - wording of OpenType family name handling
7149 - handling combining sequences in the font matching algorithm
7150 - fix-up fi ligature example
7152 -->