css-fonts/Fonts.html

Wed, 29 May 2013 09:58:56 +0900

author
John Daggett <jdaggett@mozilla.com>
date
Wed, 29 May 2013 09:58:56 +0900
changeset 8272
5e29c9d80cca
parent 8246
fd72a8d4ecfd
child 8276
bf52664a49ae
permissions
-rw-r--r--

[css-fonts] fixes based on comments

     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-29-may-2013>Editor's Draft 29
   116     May 2013</h2>
   118    <dl id=authors>
   119     <dt>This version:
   121     <dd><a
   122      href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
   123      <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css3-fonts-20130529/">http://www.w3.org/TR/2013/ED-css3-fonts-20130529/</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&amp;product=CSS&amp;component=Fonts&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">CSS3
   151      Fonts issues in Bugzilla</a>
   153     <dt>Discussion:
   155     <dd><a
   156      href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
   157      with subject line “<kbd>[css-fonts] <var>… message topic
   158      …</var></kbd>” (<a
   159      href="http://lists.w3.org/Archives/Public/www-style/"
   160      rel=discussion>archives</a>)
   162     <dt>Editor:
   164     <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
   165    </dl>
   166    <!--begin-copyright-->
   167    <p class=copyright><a
   168     href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
   169     rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
   170     title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
   171     href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
   172     Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
   173     title="European Research Consortium for Informatics and
   174     Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
   175     <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
   176     <a
   177     href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
   178     <a
   179     href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
   180     and <a
   181     href="http://www.w3.org/Consortium/Legal/copyright-documents">document
   182     use</a> rules apply.</p>
   183    <!--end-copyright-->
   184    <hr title="Separator for header">
   185   </div>
   187   <h2 class="no-num no-toc" id=abstract>Abstract</h2>
   189   <p>This CSS3 module describes how font properties are specified and how
   190    font resources are loaded dynamically. The contents of this specification
   191    are a consolidation of content previously divided into <a
   192    href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
   193    and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
   194    Web Fonts</a> modules. The description of font load events was moved into
   195    the <a href="http://dev.w3.org/csswg/css3-font-load-events/">CSS3 Font
   196    Load Events</a> module.
   198   <h2 class="no-num no-toc" id=status>Status of this document</h2>
   199   <!--begin-status-->
   201   <p>This is a public copy of the editors' draft. It is provided for
   202    discussion only and may change at any moment. Its publication here does
   203    not imply endorsement of its contents by W3C. Don't cite this document
   204    other than as work in progress.
   206   <p>The (<a
   207    href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
   208    mailing list <a
   209    href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
   210    www-style@w3.org</a> (see <a
   211    href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
   212    discussion of this specification. When sending e-mail, please put the text
   213    “css3-fonts” in the subject, preferably like this:
   214    “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
   216   <p>This document was produced by the <a
   217    href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
   218    the <a href="http://www.w3.org/Style/">Style Activity</a>).
   220   <p>This document was produced by a group operating under the <a
   221    href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
   222    2004 W3C Patent Policy</a>. W3C maintains a <a
   223    href="http://www.w3.org/2004/01/pp-impl/32061/status"
   224    rel=disclosure>public list of any patent disclosures</a> made in
   225    connection with the deliverables of the group; that page also includes
   226    instructions for disclosing a patent. An individual who has actual
   227    knowledge of a patent which the individual believes contains <a
   228    href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
   229    Claim(s)</a> must disclose the information in accordance with <a
   230    href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   231    6 of the W3C Patent Policy</a>.</p>
   232   <!--end-status-->
   233   <!--
   234 <h3 class="no-num no-toc" id="atrisk">Features at risk</h3>
   236 <p>The following features are at risk and may be removed when exiting CR:</p>
   238 <ul>
   239 </ul>
   240 -->
   242   <h2 class="no-num no-toc" id=contents>Table of contents</h2>
   243   <!--begin-toc-->
   245   <ul class=toc>
   246    <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
   248    <li><a href="#typography-background"><span class=secno>2 </span>Typography
   249     Background</a>
   251    <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
   252     Properties</a>
   253     <ul class=toc>
   254      <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
   255       family: the font-family property</a>
   256       <ul class=toc>
   257        <li><a href="#generic-font-families"><span class=secno>3.1.1
   258         </span>Generic font families</a>
   259       </ul>
   261      <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
   262       weight: the font-weight property</a>
   264      <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
   265       width: the font-stretch property</a>
   267      <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
   268       the font-style property</a>
   270      <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
   271       the font-size property</a>
   273      <li><a href="#font-size-adjust-prop"><span class=secno>3.6
   274       </span>Relative sizing: the font-size-adjust property</a>
   276      <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
   277       property: the font property</a>
   279      <li><a href="#font-synthesis-prop"><span class=secno>3.8
   280       </span>Controlling synthetic faces: the font-synthesis property</a>
   281     </ul>
   283    <li><a href="#font-resources"><span class=secno>4 </span>Font
   284     Resources</a>
   285     <ul class=toc>
   286      <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
   287       <code>@font-face</code> rule</a>
   289      <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
   290       family: the font-family descriptor</a>
   292      <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
   293       src descriptor</a>
   295      <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
   296       descriptors: the font-style, font-weight, font-stretch descriptors</a>
   298      <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
   299       range: the unicode-range descriptor</a>
   301      <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
   302       character ranges to define composite fonts</a>
   304      <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
   305       features: the font-variant and font-feature-settings descriptors</a>
   307      <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
   308       loading guidelines</a>
   310      <li><a href="#same-origin-restriction"><span class=secno>4.9
   311       </span>Same-origin restriction for fonts</a>
   312       <ul class=toc>
   313        <li><a href="#default-same-origin-restriction"><span class=secno>4.9.1
   314         </span>Default same-origin restriction</a>
   316        <li><a href="#allowing-cross-origin-font-loading"><span
   317         class=secno>4.9.2 </span>Allowing cross-origin font loading</a>
   318       </ul>
   319     </ul>
   321    <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
   322     Matching Algorithm</a>
   323     <ul class=toc>
   324      <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
   325       sensitivity of font family names</a>
   327      <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
   328       font styles</a>
   330      <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
   331       matching</a>
   333      <li><a href="#char-handling-issues"><span class=secno>5.4
   334       </span>Character handling issues</a>
   336      <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
   337       matching changes since CSS 2.1</a>
   339      <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
   340       matching examples</a>
   341     </ul>
   343    <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
   344     Properties</a>
   345     <ul class=toc>
   346      <li><a href="#glyph-selection-positioning"><span class=secno>6.1
   347       </span>Glyph selection and positioning</a>
   349      <li><a href="#language-specific-support"><span class=secno>6.2
   350       </span>Language-specific display</a>
   352      <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
   353       the font-kerning property</a>
   355      <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
   356       </span>Ligatures: the font-variant-ligatures property</a>
   358      <li><a href="#font-variant-position-prop"><span class=secno>6.5
   359       </span>Subscript and superscript forms: the font-variant-position
   360       property</a>
   362      <li><a href="#font-variant-caps-prop"><span class=secno>6.6
   363       </span>Capitalization: the font-variant-caps property</a>
   365      <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
   366       </span>Numerical formatting: the font-variant-numeric property</a>
   368      <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
   369       </span>Alternates and swashes: the font-variant-alternates property</a>
   372      <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
   373       font specific alternates: the <code>@font-feature-values</code>
   374       rule</a>
   376      <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
   377       </span>East Asian text rendering: the font-variant-east-asian
   378       property</a>
   380      <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
   381       shorthand for font rendering: the font-variant property</a>
   383      <li><a href="#font-feature-settings-prop"><span class=secno>6.12
   384       </span>Low-level font feature settings control: the
   385       font-feature-settings property</a>
   387      <li><a href="#font-language-override-prop"><span class=secno>6.13
   388       </span>Font language override: the font-language-override property</a>
   389     </ul>
   391    <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
   392     Feature Resolution </a>
   393     <ul class=toc>
   394      <li><a href="#default-features"><span class=secno>7.1 </span>Default
   395       features</a>
   397      <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
   398       precedence</a>
   400      <li><a href="#feature-precedence-examples"><span class=secno>7.3
   401       </span>Feature precedence examples</a>
   402     </ul>
   404    <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
   405     <ul class=toc>
   406      <li><a href="#om-fontface"><span class=secno>8.1 </span>The
   407       <code>CSSFontFaceRule</code> interface</a>
   409      <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
   410       <code>CSSFontFeatureValuesRule</code> interface</a>
   411     </ul>
   413    <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
   414     platform font properties to CSS properties</a>
   416    <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
   417     <ul class=toc>
   418      <li class=no-num><a href="#recent-changes"> Changes from the February
   419       2013 CSS3 Fonts Working Draft</a>
   420     </ul>
   422    <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
   424    <li class=no-num><a href="#conformance"> Conformance</a>
   425     <ul class=toc>
   426      <li class=no-num><a href="#conventions"> Document Conventions</a>
   428      <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
   431      <li class=no-num><a href="#partial"> Partial Implementations</a>
   433      <li class=no-num><a href="#experimental"> Experimental
   434       Implementations</a>
   436      <li class=no-num><a href="#testing"> Non-Experimental
   437       Implementations</a>
   438     </ul>
   440    <li class=no-num><a href="#references">References</a>
   441     <ul class=toc>
   442      <li class=no-num><a href="#normative-references">Normative
   443       References</a>
   445      <li class=no-num><a href="#other-references">Other References</a>
   446     </ul>
   448    <li class=no-num><a href="#index">Index</a>
   450    <li class=no-num><a href="#property-index">Property index</a>
   451   </ul>
   452   <!--end-toc-->
   454   <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
   456   <p>A font provides a resource containing the visual representation of
   457    characters. At the simplest level it contains information that maps
   458    character codes to shapes (called glyphs) that represent these characters.
   459    Fonts sharing a common design style are commonly grouped into font
   460    families classified by a set of standard font properties. Within a family,
   461    the shape displayed for a given character can vary by stroke weight, slant
   462    or relative width, among others. An individual font face is described by a
   463    unique combination of these properties. For a given range of text, CSS
   464    font properties are used to select a font family and a specific font face
   465    within that family to be used when rendering that text. As a simple
   466    example, to use the bold form of Helvetica one could use:
   468   <pre>body { 
   469     font-family: Helvetica; 
   470     font-weight: bold; 
   471 }</pre>
   473   <p>Font resources may be installed locally on the system on which a user
   474    agent is running or downloadable. For local font resources descriptive
   475    information can be obtained directly from the font resource. For
   476    downloadable font resources (sometimes referred to as web fonts), the
   477    descriptive information is included with the reference to the font
   478    resource.
   480   <p>Families of fonts typically don't contain a single face for each
   481    possible variation of font properties. The CSS font selection mechanism
   482    describes how to match a given set of CSS font properties to a single font
   483    face.
   485   <h2 id=typography-background><span class=secno>2 </span>Typography
   486    Background</h2>
   488   <p><em>This section is non-normative.</em>
   490   <p> Typographic traditions vary across the globe, so there is no unique way
   491    to classify all fonts across languages and cultures. For even common Latin
   492    letters, wide variations are possible:
   494   <div class=figure><img alt="variations in glyphs for a single character"
   495    src=aaaaaa.png>
   496    <p class=caption>One character, many glyph variations
   497   </div>
   499   <p>Differences in the anatomy of letterforms is one way to distinguish
   500    fonts. For Latin fonts, flourishes at the ends of a character's main
   501    strokes, or serifs, can distinguish a font from those without. Similar
   502    comparisons exist in non-Latin fonts between fonts with tapered strokes
   503    and those using primarily uniform strokes:
   505   <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
   506    <p class=caption>Letterforms with and without serifs
   507   </div>
   509   <div class=figure><img alt="serif vs. non-serifs for japanese"
   510    src=minchovsgothic.png>
   511    <p class=caption>Similar groupings for Japanese typefaces
   512   </div>
   514   <p>Fonts contain letterforms and the data needed to map characters to these
   515    letterforms. Often this may be a simple one-to-one mapping, but more
   516    complex mappings are also possible. The use of combining diacritic marks
   517    creates many variations for an underlying letterform:
   519   <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
   520    <p class=caption>Variations with diacritic marks
   521   </div>
   523   <p>A sequence of characters can be represented by a single glyph known as a
   524    ligature:
   526   <div class=figure><img alt="example of a fi ligature"
   527    src=final-ligature.png>
   528    <p class=caption>Ligature example
   529   </div>
   531   <p>Visual transformations based on textual context are often stylistic
   532    option in European languages. They are required to correctly render
   533    languages like Arabic, the lam and alef characters below <em>must</em> be
   534    combined when they exist in sequence:
   536   <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
   537    <p class=caption>Required Arabic ligature
   538   </div>
   540   <p>The relative complexity of these shaping transformations requires
   541    additional data within the font.
   543   <p>Sets of font faces with various stylistic variations are often grouped
   544    together into font families. In the simplest case a regular face is
   545    supplemented with bold and italic faces, but much more extensive groupings
   546    are possible. Variations in the thickness of letterform strokes, the <dfn
   547    id=weight>weight</dfn>, and the overall proportions of the letterform, the
   548    <dfn id=width>width</dfn>, are most common. In the example below, each
   549    letter uses a different font face within the Univers font family. The
   550    width used increases from top to bottom and the weight increases from left
   551    to right:
   553   <div class=figure><img alt="various width and weight variations within a
   554    single family" src=weightwidthvariations.png>
   555    <p class=caption>Weight and width variations within a single font family
   556   </div>
   558   <p>Creating fonts that support multiple scripts is a difficult task;
   559    designers need to understand the cultural traditions surrounding the use
   560    of type in different scripts and come up with letterforms that somehow
   561    share a common theme. Many languages often share a common script and each
   562    of these languages may have noticeable stylistic differences. For example,
   563    the Arabic script is shared by Persian and Urdu and Cyrillic is used with
   564    many languages, not just Russian.
   566   <p>The <a href="#character-map"><em>character map</em></a> of a font
   567    defines the mapping of characters to glyphs for that font. If a document
   568    contains characters not supported by the <a href="#character-map"><em
   569    title="character map">character maps</em></a> of the fonts contained in a
   570    font family list, a user agent may use a system font fallback procedure to
   571    locate an appropriate font that does. If no appropriate font can be found,
   572    some form of "missing glyph" character will be rendered by the user agent.
   573    System fallback can occur when the specified list of font families does
   574    not include a font that supports a given character.
   576   <p>Although the <a href="#character-map"><em>character map</em></a> of a
   577    font maps a given character to a glyph for that character, modern font
   578    technologies such as OpenType and AAT (Apple Advanced Typography) provide
   579    ways of mapping a character to different glyphs based upon feature
   580    settings. Fonts in these formats allow these features to be embedded in
   581    the font itself and controlled by applications. Common typographic
   582    features which can be specified this way include ligatures, swashes,
   583    contextual alternates, proportional and tabular figures, and automatic
   584    fractions, to list just a few. For a visual overview of OpenType features,
   585    see the <a href="#OPENTYPE-FONT-GUIDE"
   586    rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
   588   <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
   590   <p>The particular font face used to render a character is determined by the
   591    font family and other font properties that apply to a given element. This
   592    structure allows settings to be varied independent of each other.</p>
   593   <!-- prop: font-family -->
   595   <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
   596    href="#propdef-font-family">font-family</a> property</h3>
   598   <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
   599    <tbody>
   600     <tr>
   601      <td>Name:
   603      <td><dfn id=propdef-font-family>font-family</dfn>
   605     <tr>
   606      <td>Value:
   608      <td>[ <a href="#family-name-value"><var>&lt;family-name&gt;</var></a> |
   609       <a href="#generic-family-value"><var>&lt;generic-family&gt;</var></a> ]
   610       #
   612     <tr>
   613      <td>Initial:
   615      <td>depends on user agent
   617     <tr>
   618      <td>Applies to:
   620      <td>all elements
   622     <tr>
   623      <td>Inherited:
   625      <td>yes
   627     <tr>
   628      <td>Percentages:
   630      <td>N/A
   632     <tr>
   633      <td>Media:
   635      <td>visual
   637     <tr>
   638      <td>Computed value:
   640      <td>as specified
   642     <tr>
   643      <td>Animatable:
   645      <td>no
   646   </table>
   648   <p>This property specifies a prioritized list of font family names or
   649    generic family names. A font family defines a set of faces that vary in
   650    weight, width or slope. CSS uses the combination of a family name with
   651    other style attributes to select an individual face. Using this selection
   652    mechanism, rather than selecting a face via the style name as is often
   653    done in design applications, allows some degree of regularity in textual
   654    display when fallback occurs.
   656   <p class=note>Designers should note that the CSS definition of font
   657    attributes used for selection are explicitly not intended to define a font
   658    taxonomy. A type designer's idea of a family may often extend to a set of
   659    faces that vary along axes other than just the standard axes of weight,
   660    width and slope. A family may extend to include both a set of serif faces
   661    and a set of sans-serif faces or vary along axes that are unique to that
   662    family. The CSS font selection mechanism merely provides a way to
   663    determine the “closest” substitute when substitution is necessary.
   665   <p>Unlike other CSS properties, component values are a comma-separated list
   666    indicating alternatives. A user agent iterates through the list of family
   667    names until it matches an available font that contains a glyph for the
   668    character to be rendered. This allows for differences in available fonts
   669    across platforms and for differences in the range of characters supported
   670    by individual fonts.
   672   <p>A font family name only specifies a name given to a set of font faces,
   673    it does not specify an individual face. For example, given the
   674    availability of the fonts below, Futura would match but Futura Medium
   675    would not:
   677   <div class=figure><img alt="family and face names"
   678    src=familyvsfacename.png>
   679    <p class=caption>Family and individual face names
   680   </div>
   682   <p>Consider the example below:
   684   <div class=example>
   685    <pre>body { 
   686     font-family: Helvetica, Verdana, sans-serif; 
   687 }</pre>
   689    <p>If Helvetica is available it will be used when rendering. If neither
   690     Helvetica nor Verdana is present, then the user-agent-defined sans serif
   691     font will be used.</p>
   692   </div>
   694   <p>There are two types of font family names:
   696   <dl>
   697    <dt><dfn id=family-name-value><var>&lt;family-name&gt;</var></dfn>
   699    <dd>The name of a font family of choice such as Helvetica or Verdana in
   700     the previous example.
   702    <dt><dfn id=generic-family-value><var>&lt;generic-family&gt;</var></dfn>
   704    <dd> The following generic family keywords are defined: ‘<a
   705     href="#serif"><code class=property>serif</code></a>’, ‘<a
   706     href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
   707     href="#cursive"><code class=property>cursive</code></a>’, ‘<a
   708     href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
   709     href="#monospace"><code class=property>monospace</code></a>’. These
   710     keywords can be used as a general fallback mechanism when an author's
   711     desired font choices are not available. As keywords, they must not be
   712     quoted. Authors are encouraged to append a generic font family as a last
   713     alternative for improved robustness.
   714   </dl>
   716   <p>Font family names other than generic families must either be given
   717    quoted as <a
   718    href="//www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or unquoted
   719    as a sequence of one or more <a
   720    href="//www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
   721    This means most punctuation characters and digits at the start of each
   722    token must be escaped in unquoted font family names.
   724   <p>To illustrate this, the following declarations are invalid:
   726   <pre>
   727 font-family: Red/Black, sans-serif;
   728 font-family: "Lucida" Grande, sans-serif;
   729 font-family: Ahem!, sans-serif;
   730 font-family: test@foo, sans-serif;
   731 font-family: #POUND, sans-serif;
   732 font-family: Hawaii 5-0, sans-serif;
   733 </pre>
   735   <p>If a sequence of identifiers is given as a font family name, the
   736    computed value is the name converted to a string by joining all the
   737    identifiers in the sequence by single spaces.
   739   <p>To avoid mistakes in escaping, it is recommended to quote font family
   740    names that contain white space, digits, or punctuation characters other
   741    than hyphens:
   743   <pre>
   744 body { font-family: "New Century Schoolbook", serif }
   746 &lt;BODY STYLE="font-family: '21st Century', fantasy">
   747 </pre>
   749   <p>Font family <em>names</em> that happen to be the same as a keyword value
   750    (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
   751    class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
   752    class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
   753    class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
   754    class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
   755    class=property>cursive</code></a>’) must be quoted to prevent confusion
   756    with the keywords with the same names. The keywords ‘<code
   757    class=property>initial</code>’ and ‘<code
   758    class=property>default</code>’ are reserved for future use and must also
   759    be quoted when used as font names. UAs must not consider these keywords as
   760    matching the <a
   761    href="#family-name-value"><var>&lt;family-name&gt;</var></a> type.
   763   <p>The precise way a set of fonts are grouped into font families varies
   764    depending upon the platform font management API's. The Windows GDI API
   765    only allows four faces to be grouped into a family while the DirectWrite
   766    API and API's on OSX and other platforms support font families with a
   767    variety of weights, widths and slopes (see <a
   768    href="#platform-props-to-css">Appendix A</a> for more details).
   770   <p>Some font formats allow fonts to carry multiple localizations of the
   771    family name. User agents must recognize and correctly match all of these
   772    names independent of the underlying platform localization, system API used
   773    or document encoding:
   775   <div class=figure><img alt="examples of localized family names"
   776    src=localizedfamilynames.png>
   777    <p class=caption>Localized family names
   778   </div>
   780   <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
   781    families</h4>
   783   <p>All five generic font families are defined to exist in all CSS
   784    implementations (they need not necessarily map to five distinct actual
   785    fonts). User agents should provide reasonable default choices for the
   786    generic font families, which express the characteristics of each family as
   787    well as possible within the limits allowed by the underlying technology.
   788    User agents are encouraged to allow users to select alternative choices
   789    for the generic fonts.
   791   <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
   792    definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
   794   <p>Serif fonts represent the formal text style for a script. This often
   795    means but is not limited to glyphs that have finishing strokes, flared or
   796    tapering ends, or have actual serifed endings (including slab serifs).
   797    Serif fonts are typically proportionately-spaced. They often display a
   798    greater variation between thick and thin strokes than fonts from the ‘<a
   799    href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
   800    font family. CSS uses the term ‘<a href="#serif"><code
   801    class=property>serif</code></a>’ to apply to a font for any script,
   802    although other names may be more familiar for particular scripts, such as
   803    Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
   804    Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
   805    class=property>serif</code></a>’ more due to its typographic role rather
   806    than its actual design style. Any font that is so described may be used to
   807    represent the generic ‘<a href="#serif"><code
   808    class=property>serif</code></a>’ family.
   810   <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
   811    <p class=caption>Sample serif fonts
   812   </div>
   814   <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
   815    title="sans-serif, definition of"> <a name=sans-serif-def><dfn
   816    id=sans-serif>sans-serif</dfn></a></span></h5>
   818   <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
   819    low contrast (vertical and horizontal stems have the close to the same
   820    thickness) and have stroke endings that are plain -- without any flaring,
   821    cross stroke, or other ornamentation. Sans-serif fonts are typically
   822    proportionately-spaced. They often have little variation between thick and
   823    thin strokes, compared to fonts from the ‘<a href="#serif"><code
   824    class=property>serif</code></a>’ family. CSS uses the term ‘<a
   825    href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
   826    to a font for any script, although other names may be more familiar for
   827    particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
   828    (Korean). Any font that is so described may be used to represent the
   829    generic ‘<a href="#sans-serif"><code
   830    class=property>sans-serif</code></a>’ family.
   832   <div class=figure><img alt="sample sans-serif fonts"
   833    src=sansserifexamples.png>
   834    <p class=caption>Sample sans-serif fonts
   835   </div>
   837   <h5 class="no-num no-toc"> <span class=index-def id=cursive0
   838    title="cursive, definition of"> <a name=cursive-def><dfn
   839    id=cursive>cursive</dfn></a></span></h5>
   841   <p>Glyphs in cursive fonts generally use a more informal script style, and
   842    the result looks more like handwritten pen or brush writing than printed
   843    letterwork. CSS uses the term ‘<a href="#cursive"><code
   844    class=property>cursive</code></a>’ to apply to a font for any script,
   845    although other names such as Chancery, Brush, Swing and Script are also
   846    used in font names.
   848   <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
   849    <p class=caption>Sample cursive fonts
   850   </div>
   852   <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
   853    title="fantasy, definition of"> <a name=fantasy-def><dfn
   854    id=fantasy>fantasy</dfn></a></span></h5>
   856   <p>Fantasy fonts are primarily decorative or expressive fonts that contain
   857    playful representations of characters. These do not include Pi or Picture
   858    fonts which do not represent actual characters.
   860   <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
   861    <p class=caption>Sample fantasy fonts
   862   </div>
   864   <h5 class="no-num no-toc"> <span class=index-def id=monospace0
   865    title="monospace, definition of"> <a name=monospace-def><dfn
   866    id=monospace>monospace</dfn></a></span></h5>
   868   <p>The sole criterion of a monospace font is that all glyphs have the same
   869    fixed width. This is often used to render samples of computer code.
   871   <div class=figure><img alt="sample monospace fonts"
   872    src=monospaceexamples.png>
   873    <p class=caption>Sample monospace fonts
   874   </div>
   875   <!-- prop: font-weight -->
   877   <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
   878    href="#propdef-font-weight">font-weight</a> property</h3>
   880   <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
   881    <tbody>
   882     <tr>
   883      <td>Name:
   885      <td><dfn id=propdef-font-weight>font-weight</dfn>
   887     <tr>
   888      <td>Value:
   890      <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
   891       | 700 | 800 | 900
   893     <tr>
   894      <td>Initial:
   896      <td>normal
   898     <tr>
   899      <td>Applies to:
   901      <td>all elements
   903     <tr>
   904      <td>Inherited:
   906      <td>yes
   908     <tr>
   909      <td>Percentages:
   911      <td>N/A
   913     <tr>
   914      <td>Media:
   916      <td>visual
   918     <tr>
   919      <td>Computed value:
   921      <td>numeric weight value (see description)
   923     <tr>
   924      <td>Animatable:
   926      <td>as <a
   927       href="http://dev.w3.org/csswg/css3-transitions/#animtype-font-weight">font
   928       weight</a>
   929   </table>
   931   <p>The <a class=noxref href="#font-weight-prop"><span
   932    class=property>‘<code class=property>font-weight</code>’</span></a>
   933    property specifies the weight of glyphs in the font, their degree of
   934    blackness or stroke thickness.
   936   <p>Values have the following meanings:
   938   <dl>
   939    <dt>100 to 900
   941    <dd>These values form an ordered sequence, where each number indicates a
   942     weight that is at least as dark as its predecessor. These roughly
   943     correspond to the commonly used weight names below:
   944   </dl>
   946   <ul>
   947    <li>100 - Thin
   949    <li>200 - Extra Light (Ultra Light)
   951    <li>300 - Light
   953    <li>400 - Normal
   955    <li>500 - Medium
   957    <li>600 - Semi Bold (Demi Bold)
   959    <li>700 - Bold
   961    <li>800 - Extra Bold (Ultra Bold)
   963    <li>900 - Black (Heavy)
   964   </ul>
   966   <dl>
   967    <dt><a href="#normal2"><strong>normal</strong></a>
   969    <dd>Same as ‘<code class=css>400</code>’.
   971    <dt><strong>bold</strong>
   973    <dd>Same as ‘<code class=css>700</code>’.
   975    <dt><strong>bolder</strong>
   977    <dd>Specifies a bolder weight than the inherited value.
   979    <dt><strong>lighter</strong>
   981    <dd>Specifies a lighter weight than the inherited value.
   982   </dl>
   984   <p>Font formats that use a scale other than a nine-step scale should map
   985    their scale onto the CSS scale so that 400 roughly corresponds with a face
   986    that would be labeled as Regular, Book, Roman and 700 roughly matches a
   987    face that would be labeled as Bold. Or weights may be inferred from the
   988    style names, ones that correspond roughly with the scale above. The scale
   989    is relative, so a face with a larger weight value must never appear
   990    lighter. If style names are used to infer weights, care should be taken to
   991    handle variations in style names across locales.
   993   <p>Quite often there are only a few weights available for a particular font
   994    family. When a weight is specified for which no face exists, a face with a
   995    nearby weight is used. In general, bold weights map to faces with heavier
   996    weights and light weights map to faces with lighter weights (see the <a
   997    href="#font-matching-algorithm">font matching section below</a> for a
   998    precise definition). The examples here illustrate which face is used for
   999    different weights, grey indicates a face for that weight does not exist so
  1000    a face with a nearby weight is used:
  1002   <div class=figure><img alt="weight mappings for a family with 400, 700 and
  1003    900 weights" src=optimaweights.png>
  1004    <p class=caption>Weight mappings for a font family with 400, 700 and 900
  1005     weight faces
  1006   </div>
  1008   <div class=figure><img alt="weight mappings for a family with 300, 600
  1009    weights" src=hiraginoweights.png>
  1010    <p class=caption>Weight mappings for a font family with 300 and 600 weight
  1011     faces
  1012   </div>
  1014   <p>Although the practice is not well-loved by typographers, bold faces are
  1015    often synthesized by user agents for faces that lack actual bold faces.
  1016    For the purposes of style matching, these faces must be treated as if they
  1017    exist within the family. Authors can explicitly avoid this behavior by
  1018    using the ‘<a href="#propdef-font-synthesis"><code
  1019    class=property>font-synthesis</code></a>’ property.
  1021   <p>Specified values of ‘<code class=property>bolder</code>’ and
  1022    ‘<code class=property>lighter</code>’ indicate weights relative to the
  1023    weight of the parent element. The computed weight is calculated based on
  1024    the inherited ‘<a href="#propdef-font-weight"><code
  1025    class=property>font-weight</code></a>’ value using the chart below.
  1027   <table class=data id=bolderlighter summary="Bolder/lighter mappings">
  1028    <thead>
  1029     <tr>
  1030      <th>Inherited value
  1032      <th>bolder
  1034      <th>lighter
  1036    <tbody>
  1037     <tr>
  1038      <th>100
  1040      <td>400
  1042      <td>100
  1044     <tr>
  1045      <th>200
  1047      <td>400
  1049      <td>100
  1051     <tr>
  1052      <th>300
  1054      <td>400
  1056      <td>100
  1058     <tr>
  1059      <th>400
  1061      <td>700
  1063      <td>100
  1065     <tr>
  1066      <th>500
  1068      <td>700
  1070      <td>100
  1072     <tr>
  1073      <th>600
  1075      <td>900
  1077      <td>400
  1079     <tr>
  1080      <th>700
  1082      <td>900
  1084      <td>400
  1086     <tr>
  1087      <th>800
  1089      <td>900
  1091      <td>700
  1093     <tr>
  1094      <th>900
  1096      <td>900
  1098      <td>700
  1099   </table>
  1101   <p>The table above is equivalent to selecting the next relative bolder or
  1102    lighter face, given a font family containing normal and bold faces along
  1103    with a thin and a heavy face. Authors who desire finer control over the
  1104    exact weight values used for a given element may use numerical values
  1105    instead of relative weights.</p>
  1106   <!-- prop: font-stretch -->
  1108   <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
  1109    href="#propdef-font-stretch">font-stretch</a> property</h3>
  1111   <table class=propdef id=namefont-stretchvaluenormal-ultra-conden>
  1112    <tbody>
  1113     <tr>
  1114      <td>Name:
  1116      <td><dfn id=propdef-font-stretch>font-stretch</dfn>
  1118     <tr>
  1119      <td>Value:
  1121      <td>normal | ultra-condensed | extra-condensed | condensed |
  1122       semi-condensed | semi-expanded | expanded | extra-expanded |
  1123       ultra-expanded
  1125     <tr>
  1126      <td>Initial:
  1128      <td>normal
  1130     <tr>
  1131      <td>Applies to:
  1133      <td>all elements
  1135     <tr>
  1136      <td>Inherited:
  1138      <td>yes
  1140     <tr>
  1141      <td>Percentages:
  1143      <td>N/A
  1145     <tr>
  1146      <td>Media:
  1148      <td>visual
  1150     <tr>
  1151      <td>Computed value:
  1153      <td>as specified
  1155     <tr>
  1156      <td>Animatable:
  1158      <td>as <a href="#font-stretch-animation">font stretch</a>
  1159   </table>
  1161   <p>The <a class=noxref href="#font-stretch-prop"><span
  1162    class=property>‘<code class=property>font-stretch</code>’</span></a>
  1163    property selects a normal, condensed, or expanded face from a font family.
  1164    Absolute keyword values have the following ordering, from narrowest to
  1165    widest:
  1167   <ul>
  1168    <li><code>ultra-condensed</code>
  1170    <li><code>extra-condensed</code>
  1172    <li><code>condensed</code>
  1174    <li><code>semi-condensed </code>
  1176    <li><code>normal</code>
  1178    <li><code>semi-expanded</code>
  1180    <li><code>expanded</code>
  1182    <li><code>extra-expanded</code>
  1184    <li><code>ultra-expanded</code>
  1185   </ul>
  1187   <p>When a face does not exist for a given width, normal or condensed values
  1188    map to a narrower face, otherwise a wider face. Conversely, expanded
  1189    values map to a wider face, otherwise a narrower face. The figure below
  1190    shows how the nine font-stretch property settings affect font selection
  1191    for font family containing a variety of widths, grey indicates a width for
  1192    which no face exists and a different width is substituted:
  1194   <div class=figure><img alt="width mappings for a family with condensed,
  1195    normal and expanded faces" src=universwidths.png>
  1196    <p class=caption>Width mappings for a font family with condensed, normal
  1197     and expanded width faces
  1198   </div>
  1200   <p id=font-stretch-animation>Animation of font stretch: Font stretch is
  1201    interpolated in discrete steps. The interpolation happens as though the
  1202    ordered values are equally spaced real numbers. The interpolation result
  1203    is rounded to the nearest value, with values exactly halfway between two
  1204    values rounded towards the later value in the list above.</p>
  1205   <!-- prop: font-style -->
  1207   <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
  1208    href="#propdef-font-style">font-style</a> property</h3>
  1210   <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
  1211    <tbody>
  1212     <tr>
  1213      <td>Name:
  1215      <td><dfn id=propdef-font-style>font-style</dfn>
  1217     <tr>
  1218      <td>Value:
  1220      <td>normal | italic | oblique
  1222     <tr>
  1223      <td>Initial:
  1225      <td>normal
  1227     <tr>
  1228      <td>Applies to:
  1230      <td>all elements
  1232     <tr>
  1233      <td>Inherited:
  1235      <td>yes
  1237     <tr>
  1238      <td>Percentages:
  1240      <td>N/A
  1242     <tr>
  1243      <td>Media:
  1245      <td>visual
  1247     <tr>
  1248      <td>Computed value:
  1250      <td>as specified
  1252     <tr>
  1253      <td>Animatable:
  1255      <td>no
  1256   </table>
  1258   <p>The <a class=noxref href="#font-style-prop"><span
  1259    class=property>‘<code class=property>font-style</code>’</span></a>
  1260    property allows italic or oblique faces to be selected. Italic forms are
  1261    generally cursive in nature while oblique faces are typically sloped
  1262    versions of the regular face. Oblique faces can be simulated by
  1263    artificially sloping the glyphs of the regular face. Compare the
  1264    artificially sloped renderings of Palatino ‘<code
  1265    class=property>a</code>’ and Baskerville ‘<code
  1266    class=property>N</code>’ in grey with the actual italic versions:
  1268   <div class=figure><img alt="artificial sloping vs. real italics"
  1269    src=realvsfakeitalics.png>
  1270    <p class=caption>Artificial sloping versus real italics
  1271   </div>
  1273   <p>A value of ‘<a href="#normal2"><code
  1274    class=property>normal</code></a>’ selects a face that is classified as
  1275    ‘<a href="#normal2"><code class=property>normal</code></a>’, while
  1276    ‘<code class=property>oblique</code>’ selects a font that is labeled
  1277    ‘<code class=property>oblique</code>’. A value of ‘<code
  1278    class=property>italic</code>’ selects a font that is labeled ‘<code
  1279    class=property>italic</code>’, or, if that is not available, one labeled
  1280    ‘<code class=property>oblique</code>’. If no italic or oblique face is
  1281    available, oblique faces can be synthesized by rendering non-obliqued
  1282    faces with a right sloping transformation applied. When synthesizing these
  1283    faces, the transformation should apply to all glyphs in the same way and
  1284    not vary based on codepoint or due to horizontal or vertical line
  1285    orientation.
  1287   <p>Many scripts lack the tradition of mixing a cursive form within text
  1288    rendered with a normal face. Chinese, Japanese and Korean fonts almost
  1289    always lack italic or oblique faces. Fonts that support a mixture of
  1290    scripts will sometimes omit specific scripts such as Arabic from the set
  1291    of glyphs supported in the italic face. User agents should be careful
  1292    about making <a href="#character-map"><em>character map</em></a>
  1293    assumptions across faces.
  1295   <p class=issue>For synthetic italics in vertical runs of Chinese, Japanese,
  1296    or Korean text, is there a need to define explicitly the direction of the
  1297    faux oblique for runs that include a mixture of ideographic and Latin
  1298    text?</p>
  1299   <!-- prop: font-size -->
  1301   <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
  1302    href="#propdef-font-size">font-size</a> property</h3>
  1304   <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
  1305    <tbody>
  1306     <tr>
  1307      <td>Name:
  1309      <td><dfn id=propdef-font-size>font-size</dfn>
  1311     <tr>
  1312      <td>Value:
  1314      <td><a href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a>
  1315       | <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a> |
  1316       <a href="#length-size-value"><var>&lt;length&gt;</var></a> | <a
  1317       href="#percentage-size-value"><var>&lt;percentage&gt;</var></a>
  1319     <tr>
  1320      <td>Initial:
  1322      <td>medium
  1324     <tr>
  1325      <td>Applies to:
  1327      <td>all elements
  1329     <tr>
  1330      <td>Inherited:
  1332      <td>yes
  1334     <tr>
  1335      <td>Percentages:
  1337      <td>refer to parent element's font size
  1339     <tr>
  1340      <td>Media:
  1342      <td>visual
  1344     <tr>
  1345      <td>Computed value:
  1347      <td>absolute length
  1349     <tr>
  1350      <td>Animatable:
  1352      <td>as <a
  1353       href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
  1354   </table>
  1356   <p>This property indicates the desired height of glyphs from the font. For
  1357    scalable fonts, the font-size is a scale factor applied to the EM unit of
  1358    the font. (Note that certain glyphs may bleed outside their EM box.) For
  1359    non-scalable fonts, the font-size is converted into absolute units and
  1360    matched against the declared font-size of the font, using the same
  1361    absolute coordinate space for both of the matched values. Values have the
  1362    following meanings:
  1364   <dl>
  1365    <dt><dfn id=absolute-size-value><var>&lt;absolute-size&gt;</var></dfn>
  1367    <dd> An <a
  1368     href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a> keyword
  1369     refers to an entry in a table of font sizes computed and kept by the user
  1370     agent. Possible values are:
  1371     <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
  1373    <dt><dfn id=relative-size-value><var>&lt;relative-size&gt;</var></dfn>
  1375    <dd> A <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a>
  1376     keyword is interpreted relative to the table of font sizes and the
  1377     computed ‘<a href="#propdef-font-size"><code
  1378     class=property>font-size</code></a>’ of the parent element. Possible
  1379     values are:
  1380     <p> [ larger | smaller ]
  1382     <p> For example, if the parent element has a font size of ‘<code
  1383      class=property>medium</code>’, a value of ‘<code
  1384      class=property>larger</code>’ will make the font size of the current
  1385      element be ‘<code class=property>large</code>’. If the parent
  1386      element's size is not close to a table entry, the user agent is free to
  1387      interpolate between table entries or round off to the closest one. The
  1388      user agent may have to extrapolate table values if the numerical value
  1389      goes beyond the keywords.
  1391    <dt><dfn id=length-size-value><var>&lt;length&gt;</var></dfn>
  1393    <dd>A length value specifies an absolute font size (independent of the
  1394     user agent's font table). Negative lengths are illegal.
  1396    <dt><dfn id=percentage-size-value><var>&lt;percentage&gt;</var></dfn>
  1398    <dd>A percentage value specifies an absolute font size relative to the
  1399     parent element's font size. Use of percentage values, or values in
  1400     ‘<code class=property>em</code>’s, leads to more robust and
  1401     cascadable style sheets.
  1402   </dl>
  1404   <p>The following table provides user agent guidelines for the absolute-size
  1405    scaling factor and their mapping to HTML heading and absolute font-sizes.
  1406    The ‘<code class=property>medium</code>’ value is used as the
  1407    reference middle value. The user agent may fine-tune these values for
  1408    different fonts or different types of display devices.
  1410   <table class=data>
  1411    <thead>
  1412     <tr>
  1413      <th>CSS absolute-size values
  1415      <th>xx-small
  1417      <th>x-small
  1419      <th>small
  1421      <th>medium
  1423      <th>large
  1425      <th>x-large
  1427      <th>xx-large
  1429      <th> 
  1431    <tbody>
  1432     <tr>
  1433      <th>scaling factor
  1435      <td>3/5
  1437      <td>3/4
  1439      <td>8/9
  1441      <td>1
  1443      <td>6/5
  1445      <td>3/2
  1447      <td>2/1
  1449      <td>3/1
  1451     <tr>
  1452      <th>HTML headings
  1454      <td>h6
  1456      <td> 
  1458      <td>h5
  1460      <td>h4
  1462      <td>h3
  1464      <td>h2
  1466      <td>h1
  1468      <td> 
  1470     <tr>
  1471      <th>HTML font sizes
  1473      <td>1
  1475      <td> 
  1477      <td>2
  1479      <td>3
  1481      <td>4
  1483      <td>5
  1485      <td>6
  1487      <td>7
  1488   </table>
  1490   <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
  1491    applying these guidelines should nevertheless avoid creating font-size
  1492    resulting in less than 9 device pixels per EM unit on a computer
  1493    display.</em>
  1495   <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
  1496    factor between adjacent indexes was 1.5 which user experience proved to be
  1497    too large. In CSS2, the suggested scaling factor for computer screen
  1498    between adjacent indexes was 1.2 which still created issues for the small
  1499    sizes. The new scaling factor varies between each index to provide a
  1500    better readability.</em>
  1502   <p>The actual value of this property may differ from the computed value due
  1503    a numerical value on ‘<a href="#propdef-font-size-adjust"><code
  1504    class=property>font-size-adjust</code></a>’ and the unavailability of
  1505    certain font sizes.
  1507   <p>Child elements inherit the computed <a class=noxref
  1508    href="#font-size-prop"> <span class=property>‘<code
  1509    class=property>font-size</code>’</span></a> value (otherwise, the effect
  1510    of <a class=noxref href="#font-size-adjust-prop"><span
  1511    class=property>‘<code
  1512    class=property>font-size-adjust</code>’</span></a> would compound).
  1514   <div class=example>
  1515    <p style="display:none">Example(s):
  1517    <p>
  1519    <pre>p { font-size: 12pt; }
  1520 blockquote { font-size: larger }
  1521 em { font-size: 150% }
  1522 em { font-size: 1.5em }
  1523 </pre>
  1524   </div>
  1525   <!-- prop: font-size-adjust -->
  1527   <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
  1528    the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
  1530   <table class=propdef id=namefont-size-adjustvaluenone-auto-ltnum>
  1531    <tbody>
  1532     <tr>
  1533      <td>Name:
  1535      <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
  1537     <tr>
  1538      <td>Value:
  1540      <td>none | auto | <a
  1541       href="#aspect-ratio-value"><var>&lt;number&gt;</var></a>
  1543     <tr>
  1544      <td>Initial:
  1546      <td>none
  1548     <tr>
  1549      <td>Applies to:
  1551      <td>all elements
  1553     <tr>
  1554      <td>Inherited:
  1556      <td>yes
  1558     <tr>
  1559      <td>Percentages:
  1561      <td>N/A
  1563     <tr>
  1564      <td>Media:
  1566      <td>visual
  1568     <tr>
  1569      <td>Computed value:
  1571      <td>as specified
  1573     <tr>
  1574      <td>Animatable:
  1576      <td>as <a
  1577       href="http://dev.w3.org/csswg/css3-transitions/#animtype-number">number</a>
  1578   </table>
  1580   <p>For any given font size, the apparent size and legibility of text varies
  1581    across fonts. For scripts such as Latin or Cyrillic that distinguish
  1582    between upper and lowercase letters, the relative height of lowercase
  1583    letters compared to their uppercase counterparts is a determining factor
  1584    of legibility. This is commonly referred to as the <a class=index-def
  1585    href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
  1586    id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
  1587    the x-height of a font divided by the font size.
  1589   <p>In situations where font fallback occurs, fallback fonts may not share
  1590    the same aspect ratio as the desired font family and will thus appear less
  1591    readable. The font-size-adjust property is a way to preserve the
  1592    readability of text when font fallback occurs. It does this by adjusting
  1593    the font-size so that the x-height is the same regardless of the font
  1594    used.
  1596   <div class=example>
  1597    <p>The style defined below defines Verdana as the desired font family, but
  1598     if Verdana is not available Futura or Times will be used.</p>
  1600    <pre>p { 
  1601     font-family: Verdana, Futura, Times; 
  1604 &lt;p>Lorem ipsum dolor sit amet, ...&lt;/p>
  1605 </pre>
  1607    <p>Verdana has a relatively high aspect ratio, lowercase letters are
  1608     relatively tall compared to uppercase letters, so at small sizes text
  1609     appears legible. Times has a lower aspect ratio and so if fallback
  1610     occurs, the text will be less legible at small sizes than Verdana.</p>
  1611   </div>
  1613   <p>How text rendered in each of these fonts compares is shown below, the
  1614    columns show text rendered in Verdana, Futura and Times. The same
  1615    font-size value is used across cells within each row and red lines are
  1616    included to show the differences in x-height. In the upper half each row
  1617    is rendered in the same font-size value. The same is true for the lower
  1618    half but in this half the font-size-adjust property is also set so that
  1619    the actual font size is adjusted to preserve the x-height across each row.
  1620    Note how small text remains relatively legible across each row in the
  1621    lower half.
  1623   <div class=figure><img alt="text with and without font-size-adjust"
  1624    src=fontsizeadjust.png>
  1625    <p class=caption>Text with and without the use of font-size-adjust
  1626   </div>
  1628   <p>This property allows authors to specify an aspect value for an element
  1629    that will effectively preserve the x-height of the first choice font,
  1630    whether it is substituted or not. Values have the following meanings:
  1632   <dl>
  1633    <dt><strong>none</strong>
  1635    <dd>Do not preserve the font's x-height.
  1637    <dt><strong>auto</strong>
  1639    <dd>Behaves just like &lt;number>, except the number used is the aspect
  1640     value calculated by user agents for the first font in the list of fonts
  1641     defined for the initial value of the ‘<a
  1642     href="#descdef-font-family"><code
  1643     class=property>font-family</code></a>’ property. Effectively this is
  1644     the default font used when ‘<a href="#descdef-font-family"><code
  1645     class=property>font-family</code></a>’ is not otherwise specified.
  1646     <p>Authors can use this value to specify that font size should be
  1647      normalized across fonts based on the x-height without the need to
  1648      specify the aspect ratio explicitly.</p>
  1650    <dt><dfn id=aspect-ratio-value><var>&lt;number&gt;</var></dfn>
  1652    <dd>Specifies the aspect value used in the calculation below to calculate
  1653     the adjusted font size:
  1654     <pre>c  =  ( a / a' ) s 
  1655 </pre>
  1657     <p>where:</p>
  1659     <pre>s  =  font-size value
  1660 a  =  aspect value as specified by the font-size-adjust property
  1661 a' =  aspect value of actual font
  1662 c  =  adjusted font-size to use
  1663 </pre>
  1665     <p>This value applies to any font that is selected but in typical usage
  1666      it should be based on the aspect value of the first font in the
  1667      font-family list. If this is specified accurately, the <tt>(a/a')</tt>
  1668      term in the formula above is effectively 1 for the first font and no
  1669      adjustment occurs. If the value is specified inaccurately, text rendered
  1670      using the first font in the family list will display differently in
  1671      older user agents that don't support font-size-adjust.</p>
  1672   </dl>
  1674   <p>Authors can calculate the aspect value for a given font by comparing
  1675    spans with the same content but different font-size-adjust properties. If
  1676    the same font-size is used, the spans will match when the font-size-adjust
  1677    value is accurate for the given font.
  1679   <div class=example>
  1680    <p>Two spans with borders are used to determine the aspect value of a
  1681     font. The font-size is the same for both spans but the font-size-adjust
  1682     property is specified only for the right span. Starting with a value of
  1683     0.5, the aspect value can be adjusted until the borders around the two
  1684     letters line up.</p>
  1686    <pre>p {
  1687     font-family: Futura;
  1688     font-size: 500px;
  1691 span {
  1692     border: solid 1px red;
  1695 .adjust {
  1696     font-size-adjust: 0.5;
  1699 &lt;p>&lt;span>b&lt;/span>&lt;span class="adjust">b&lt;/span>&lt;/p>
  1700 </pre>
  1702    <div class=figure><img alt="Futura with an aspect value of 0.5"
  1703     src=beforefontsizeadjust.png>
  1704     <p class=caption>Futura with an aspect value of 0.5
  1705    </div>
  1707    <p>The box on the right is a bit bigger than the one on the left, so the
  1708     aspect value of this font is something less than 0.5. Adjust the value
  1709     until the boxes align.</p>
  1710   </div>
  1711   <!-- prop: font -->
  1712   <!-- jtdfix, crap, preprocessor is inserting links to descriptors rather than properties.  bert, make it stop... -->
  1713   <!-- <a href="#font-stretch-prop" class="noxref"><span class="property">'font-stretch'</span></a> -->
  1715   <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
  1716    <a href="#propdef-font">font</a> property</h3>
  1718   <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
  1719    <tbody>
  1720     <tr>
  1721      <td>Name:
  1723      <td><dfn id=propdef-font>font</dfn>
  1725     <tr>
  1726      <td>Value:
  1728      <td>[ [ <var>&lt;‘<a href="#propdef-font-style"><code
  1729       class=property>font-style</code></a>’&gt;</var> || <a
  1730       href="#font-variant-css21-values"><var>&lt;font-variant-css21&gt;</var></a>
  1731       || <var>&lt;‘<a href="#propdef-font-weight"><code
  1732       class=property>font-weight</code></a>’&gt;</var> || <var>&lt;‘<a
  1733       href="#propdef-font-stretch"><code
  1734       class=property>font-stretch</code></a>’</var> ]? <var>&lt;‘<a
  1735       href="#propdef-font-size"><code
  1736       class=property>font-size</code></a>’&gt;</var> [ / <var>&lt;‘<code
  1737       class=property>line-height</code>’&gt;</var> ]? <var>&lt;‘<a
  1738       href="#descdef-font-family"><code
  1739       class=property>font-family</code></a>’&gt;</var> ] | caption | icon |
  1740       menu | message-box | small-caption | status-bar
  1742     <tr>
  1743      <td>Initial:
  1745      <td>see individual properties
  1747     <tr>
  1748      <td>Applies to:
  1750      <td>all elements
  1752     <tr>
  1753      <td>Inherited:
  1755      <td>yes
  1757     <tr>
  1758      <td>Percentages:
  1760      <td>see individual properties
  1762     <tr>
  1763      <td>Media:
  1765      <td>visual
  1767     <tr>
  1768      <td>Computed value:
  1770      <td>see individual properties
  1772     <tr>
  1773      <td>Animatable:
  1775      <td>see individual properties
  1776   </table>
  1778   <p>The <span class=property>‘<a href="#propdef-font"><code
  1779    class=property>font</code></a>’</span> property is, except as described
  1780    below, a shorthand property for setting ‘<a
  1781    href="#propdef-font-style"><code class=property>font-style</code></a>’,
  1782    <span class=property>‘<a href="#propdef-font-variant"><code
  1783    class=property>font-variant</code></a>’</span>, <span
  1784    class=property>‘<a href="#propdef-font-weight"><code
  1785    class=property>font-weight</code></a>’</span>, <span
  1786    class=property>‘<a href="#propdef-font-stretch"><code
  1787    class=property>font-stretch</code></a>’</span>, <span
  1788    class=property>‘<a href="#propdef-font-size"><code
  1789    class=property>font-size</code></a>’</span>, ‘<code
  1790    class=property>line-height</code>’, <span class=property>‘<a
  1791    href="#descdef-font-family"><code
  1792    class=property>font-family</code></a>’</span> at the same place in the
  1793    stylesheet. Values for the <span class=property>‘<a
  1794    href="#propdef-font-variant"><code
  1795    class=property>font-variant</code></a>’</span> property may also be
  1796    included but only those supported in CSS 2.1, none of the font-variant
  1797    values added in this specification can be used in the <span
  1798    class=property>‘<a href="#propdef-font"><code
  1799    class=property>font</code></a>’</span> shorthand:
  1801   <pre
  1802    class=prod><dfn id=font-variant-css21-values><var>&lt;font-variant-css21&gt;</var></dfn> = [normal | small-caps]</pre>
  1804   <p>The syntax of this property is based on a traditional typographical
  1805    shorthand notation to set multiple properties related to fonts.
  1807   <p>All subproperties of the ‘<a href="#propdef-font"><code
  1808    class=property>font</code></a>’ property are first reset to their
  1809    initial values, including those listed above plus <span
  1810    class=property>‘<a href="#propdef-font-size-adjust"><code
  1811    class=property>font-size-adjust</code></a>’</span>, <span
  1812    class=property>‘<a href="#propdef-font-kerning"><code
  1813    class=property>font-kerning</code></a>’</span>, subproperties of <span
  1814    class=property>‘<a href="#propdef-font-variant"><code
  1815    class=property>font-variant</code></a>’</span> and and <span
  1816    class=property>‘<a href="#propdef-font-language-override"><code
  1817    class=property>font-language-override</code></a>’</span>. Then, those
  1818    properties that are given explicit values in the <span
  1819    class=property>‘<a href="#propdef-font"><code
  1820    class=property>font</code></a>’</span> shorthand are set to those
  1821    values. For a definition of allowed and initial values, see the previously
  1822    defined properties. For reasons of backwards compatibility, it is not
  1823    possible to set <span class=property>‘<a
  1824    href="#propdef-font-size-adjust"><code
  1825    class=property>font-size-adjust</code></a>’</span> to anything other
  1826    than its initial value using the <span class=property>‘<a
  1827    href="#propdef-font"><code class=property>font</code></a>’</span>
  1828    shorthand property; instead, use the individual property.
  1830   <div class=example>
  1831    <p style="display:none">Example(s):
  1833    <p>
  1835    <pre>p { font: 12pt/14pt sans-serif }
  1836 p { font: 80% sans-serif }
  1837 p { font: x-large/110% &quot;new century schoolbook&quot;, serif }
  1838 p { font: bold italic large Palatino, serif }
  1839 p { font: normal small-caps 120%/120% fantasy }
  1840 p { font: condensed oblique 12pt &quot;Helvetica Neue&quot;, serif; }
  1841 </pre>
  1843    <p> In the second rule, the font size percentage value (‘<code
  1844     class=css>80%</code>’) refers to the computed ‘<a
  1845     href="#propdef-font-size"><code class=property>font-size</code></a>’ of
  1846     the parent element. In the third rule, the line height percentage
  1847     (‘<code class=css>110%</code>’) refers to the font size of the
  1848     element itself.
  1850    <p>The first three rules do not specify the <span class=property>‘<a
  1851     href="#propdef-font-variant"><code
  1852     class=property>font-variant</code></a>’</span> and <span
  1853     class=property>‘<a href="#propdef-font-weight"><code
  1854     class=property>font-weight</code></a>’</span> explicitly, so these
  1855     properties receive their initial values (‘<a href="#normal2"><code
  1856     class=property>normal</code></a>’). Notice that the font family name
  1857     "new century schoolbook", which contains spaces, is enclosed in quotes.
  1858     The fourth rule sets the <span class=property>‘<a
  1859     href="#propdef-font-weight"><code
  1860     class=property>font-weight</code></a>’</span> to ‘<code
  1861     class=property>bold</code>’, the <span class=property>‘<a
  1862     href="#propdef-font-style"><code
  1863     class=property>font-style</code></a>’</span> to ‘<code
  1864     class=property>italic</code>’, and implicitly sets <span
  1865     class=property>‘<a href="#propdef-font-variant"><code
  1866     class=property>font-variant</code></a>’</span> to ‘<a
  1867     href="#normal2"><code class=property>normal</code></a>’.
  1869    <p> The fifth rule sets the <span class=property>‘<a
  1870     href="#propdef-font-variant"><code
  1871     class=property>font-variant</code></a>’</span> (‘<a
  1872     href="#small-caps"><code class=property>small-caps</code></a>’), the
  1873     <span class=property>‘<a href="#propdef-font-size"><code
  1874     class=property>font-size</code></a>’</span> (120% of the parent's font
  1875     size), the <span class=property>‘<code
  1876     class=property>line-height</code>’</span> (120% of the font size) and
  1877     the <span class=property>‘<a href="#descdef-font-family"><code
  1878     class=property>font-family</code></a>’</span> (‘<a
  1879     href="#fantasy"><code class=property>fantasy</code></a>’). It follows
  1880     that the keyword ‘<a href="#normal2"><code
  1881     class=property>normal</code></a>’ applies to the two remaining
  1882     properties: <span class=property>‘<a href="#propdef-font-style"><code
  1883     class=property>font-style</code></a>’</span> and <span
  1884     class=property>‘<a href="#propdef-font-weight"><code
  1885     class=property>font-weight</code></a>’</span>.
  1887    <p>The sixth rule sets the <span class=property>‘<a
  1888     href="#propdef-font-style"><code
  1889     class=property>font-style</code></a>’</span>, <span
  1890     class=property>‘<a href="#propdef-font-stretch"><code
  1891     class=property>font-stretch</code></a>’</span>, <span
  1892     class=property>‘<a href="#propdef-font-size"><code
  1893     class=property>font-size</code></a>’</span>, and <span
  1894     class=property>‘<a href="#descdef-font-family"><code
  1895     class=property>font-family</code></a>’</span>, the other font
  1896     properties being set to their initial values.
  1897   </div>
  1899   <p>Since the ‘<a href="#propdef-font-stretch"><code
  1900    class=property>font-stretch</code></a>’ property was not defined in CSS
  1901    2.1, when using ‘<a href="#propdef-font-stretch"><code
  1902    class=property>font-stretch</code></a>’ values within ‘<a
  1903    href="#propdef-font"><code class=property>font</code></a>’ rules,
  1904    authors should include a extra version compatible with older user agents:
  1906   <pre>p {
  1907   font: 80% sans-serif;   /* for older user agents */
  1908   font: condensed 80% sans-serif;
  1909 }</pre>
  1911   <p>The following values refer to system fonts:
  1913   <dl>
  1914    <dt><strong>caption</strong>
  1916    <dd>The font used for captioned controls (e.g., buttons, drop-downs,
  1917     etc.).
  1919    <dt><strong>icon</strong>
  1921    <dd>The font used to label icons.
  1923    <dt><strong>menu</strong>
  1925    <dd>The font used in menus (e.g., dropdown menus and menu lists).
  1927    <dt><strong>message-box</strong>
  1929    <dd>The font used in dialog boxes.
  1931    <dt><strong>small-caption</strong>
  1933    <dd>The font used for labeling small controls.
  1935    <dt><strong>status-bar</strong>
  1937    <dd>The font used in window status bars.
  1938   </dl>
  1940   <p>System fonts may only be set as a whole; that is, the font family, size,
  1941    weight, style, etc. are all set at the same time. These values may then be
  1942    altered individually if desired. If no font with the indicated
  1943    characteristics exists on a given platform, the user agent should either
  1944    intelligently substitute (e.g., a smaller version of the ‘<code
  1945    class=property>caption</code>’ font might be used for the ‘<code
  1946    class=property>small-caption</code>’ font), or substitute a user agent
  1947    default font. As for regular fonts, if, for a system font, any of the
  1948    individual properties are not part of the operating system's available
  1949    user preferences, those properties should be set to their initial values.
  1951   <p>That is why this property is "almost" a shorthand property: system fonts
  1952    can only be specified with this property, not with <span
  1953    class=property>‘<a href="#descdef-font-family"><code
  1954    class=property>font-family</code></a>’</span> itself, so <span
  1955    class=property>‘<a href="#propdef-font"><code
  1956    class=property>font</code></a>’</span> allows authors to do more than
  1957    the sum of its subproperties. However, the individual properties such as
  1958    <span class=property>‘<a href="#propdef-font-weight"><code
  1959    class=property>font-weight</code></a>’</span> are still given values
  1960    taken from the system font, which can be independently varied.
  1962   <p>Note that the keywords used for the system fonts listed above are only
  1963    treated as keywords when they occur in the initial position, in other
  1964    positions the same string is treated as part of the font family name:
  1966   <pre>  font: menu;        /* use the font settings for system menus */
  1967   font: large menu;  /* use a font family named "menu" */</pre>
  1969   <div class=example>
  1970    <p style="display:none">Example(s):
  1972    <p>
  1974    <pre>button { font: 300 italic 1.3em/1.7em &quot;FB Armada&quot;, sans-serif }
  1975 button p { font: menu }
  1976 button p em { font-weight: bolder }
  1977 </pre>
  1979    <p>If the font used for dropdown menus on a particular system happened to
  1980     be, for example, 9-point Charcoal, with a weight of 600, then P elements
  1981     that were descendants of BUTTON would be displayed as if this rule were
  1982     in effect:
  1984    <pre>button p { font: 600 9pt Charcoal }
  1985 </pre>
  1987    <p>Because the <span class=property>‘<a href="#propdef-font"><code
  1988     class=property>font</code></a>’</span> shorthand resets to its initial
  1989     value any property not explicitly given a value, this has the same effect
  1990     as this declaration:
  1992    <pre>button p {
  1993   font-style: normal;
  1994   font-variant: normal;
  1995   font-weight: 600;
  1996   font-size: 9pt;
  1997   line-height: normal;
  1998   font-family: Charcoal
  2000 </pre>
  2001   </div>
  2002   <!-- prop: font-synthesis -->
  2004   <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
  2005    synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
  2006    property</h3>
  2008   <table class=propdef id=namefont-synthesisvaluenone-weight-style>
  2009    <tbody>
  2010     <tr>
  2011      <td>Name:
  2013      <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
  2015     <tr>
  2016      <td>Value:
  2018      <td>none | [ weight || style ]
  2020     <tr>
  2021      <td>Initial:
  2023      <td>weight style
  2025     <tr>
  2026      <td>Applies to:
  2028      <td>all elements
  2030     <tr>
  2031      <td>Inherited:
  2033      <td>yes
  2035     <tr>
  2036      <td>Percentages:
  2038      <td>N/A
  2040     <tr>
  2041      <td>Media:
  2043      <td>visual
  2045     <tr>
  2046      <td>Computed value:
  2048      <td>as specified
  2050     <tr>
  2051      <td>Animatable:
  2053      <td>no
  2054   </table>
  2056   <p>This property controls whether user agents are allowed to synthesize
  2057    bold or oblique font faces when a font family lacks bold or italic faces.
  2058    If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
  2059    specified, user agents must not synthesize bold faces and if ‘<code
  2060    class=property>style</code>’ is not specified user agents must not
  2061    synthesize italic faces. A value of ‘<code class=property>none</code>’
  2062    disallows all synthetic faces.
  2064   <div class=example>
  2065    <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
  2067    <pre>*:lang(ar) { font-synthesis: none; }
  2068 </pre>
  2069   </div>
  2071   <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
  2073   <h3 id=font-face-rule><span class=secno>4.1 </span>The
  2074    <code>@font-face</code> rule</h3>
  2076   <p>The <code>@font-face</code> rule allows for linking to fonts that are
  2077    automatically fetched and activated when needed. This allows authors to
  2078    select a font that closely matches the design goals for a given page
  2079    rather than limiting the font choice to a set of fonts available on all
  2080    platforms. A set of font descriptors define the location of a font
  2081    resource, either locally or externally, along with the style
  2082    characteristics of an individual face. Multiple <code>@font-face</code>
  2083    rules can be used to construct font families with a variety of faces.
  2084    Using CSS font matching rules, a user agent can selectively download only
  2085    those faces that are needed for a given piece of text.
  2087   <p>The @font-face rule consists of the @font-face at-keyword followed by a
  2088    block of descriptor declarations. In terms of the grammar, this
  2089    specification defines the following productions:
  2091   <pre><dfn id=fontfacerule>font_face_rule</dfn>
  2092   : <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>*
  2095 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
  2096   : <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>
  2097   ;</pre>
  2099   <p>The following new definitions are introduced:
  2101   <pre>-    -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
  2102 F    f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
  2104   <p>The following new token is introduced:
  2106   <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
  2108   <p>Each <span class=index-inst id=font-face
  2109    title="@font-face"><code>@font-face</code></span> rule specifies a value
  2110    for every font descriptor, either implicitly or explicitly. Those not
  2111    given explicit values in the rule take the initial value listed with each
  2112    descriptor in this specification. These descriptors apply solely within
  2113    the context of the <code>@font-face</code> rule in which they are defined,
  2114    and do not apply to document language elements. There is no notion of
  2115    which elements the descriptors apply to or whether the values are
  2116    inherited by child elements. When a given descriptor occurs multiple times
  2117    in a given <code>@font-face</code> rule, only the last descriptor
  2118    declaration is used and all prior declarations for that descriptor are
  2119    ignored.
  2121   <div class=example>
  2122    <p>To use a downloadable font called Gentium:</p>
  2124    <pre>
  2125 @font-face {
  2126   font-family: Gentium;
  2127   src: url(http://example.com/fonts/Gentium.ttf);
  2130 p { font-family: Gentium, serif; }
  2131 </pre>
  2133    <p>The user agent will download Gentium and use it when rendering text
  2134     within paragraph elements. If for some reason the site serving the font
  2135     is unavailable, the default serif font will be used.</p>
  2136   </div>
  2138   <p>A given set of <code>@font-face</code> rules define a set of fonts
  2139    available for use within the documents that contain these rules. When font
  2140    matching is done, fonts defined using these rules are considered before
  2141    other available fonts on a system.
  2143   <p>Downloaded fonts are only available to documents that reference them.
  2144    The process of activating these fonts must not make them available to
  2145    other applications or to documents that don't directly link to the same
  2146    font. User agent implementers might consider it convenient to use
  2147    downloaded fonts when rendering characters in other documents for which no
  2148    other available font exists as part of the system font fallback procedure.
  2149    However, this would cause a security leak since the contents of one page
  2150    would be able to affect other pages, something an attacker could use as an
  2151    attack vector. These restrictions do not affect caching behavior, fonts
  2152    are cached the same way other web resources are cached.
  2154   <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
  2155    properties in a declaration block, declarations of any descriptors that
  2156    are not supported by the user agent must be ignored.
  2157    <code>@font-face</code> rules require a font-family and src descriptor; if
  2158    either of these are missing, the <code>@font-face</code> rule is invalid
  2159    and must be ignored entirely.
  2161   <p>In cases where user agents have limited platform resources or implement
  2162    the ability to disable downloadable font resources,
  2163    <code>@font-face</code> rules must simply be ignored; the behavior of
  2164    individual descriptors as defined in this specification should not be
  2165    altered.
  2167   <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
  2168    href="#descdef-font-family">font-family</a> descriptor</h3>
  2170   <table class=descdef>
  2171    <tbody>
  2172     <tr>
  2173      <td>Name:
  2175      <td><dfn id=descdef-font-family>font-family</dfn>
  2177     <tr>
  2178      <td>Value:
  2180      <td><a href="#family-name-value"><var>&lt;family-name&gt;</var></a>
  2182     <tr>
  2183      <td><em>Initial:</em>
  2185      <td>N/A
  2186   </table>
  2188   <p>This descriptor defines the font family name that will be used in all
  2189    CSS font family name matching. It is required for the @font-face rule to
  2190    be valid. It overrides the font family names contained in the underlying
  2191    font data. If the font family name is the same as a font family available
  2192    in a given user's environment, it effectively hides the underlying font
  2193    for documents that use the stylesheet. This permits a web author to freely
  2194    choose font-family names without worrying about conflicts with font family
  2195    names present in a given user's environment. Likewise, platform
  2196    substitutions for a given font family name must not be used.
  2198   <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
  2199    href="#descdef-src">src</a> descriptor</h3>
  2201   <table class=descdef>
  2202    <tbody>
  2203     <tr>
  2204      <td>Name:
  2206      <td><dfn id=descdef-src>src</dfn>
  2208     <tr>
  2209      <td>Value:
  2211      <td>[ &lt;url> [format(&lt;string> #)]? | <a
  2212       href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> ] #
  2214     <tr>
  2215      <td><em>Initial:</em>
  2217      <td>N/A
  2218   </table>
  2220   <p>This descriptor specifies the resource containing font data. It is
  2221    required for the <code>@font-face</code> rule to be valid. Its value is a
  2222    prioritized, comma-separated list of external references or
  2223    locally-installed font face names. When a font is needed the user agent
  2224    iterates over the set of references listed, using the first one it can
  2225    successfully activate. Fonts containing invalid data or local font faces
  2226    that are not found are ignored and the user agent loads the next font in
  2227    the list.
  2229   <p>As with other URLs in CSS, the URL may be relative, in which case it is
  2230    resolved relative to the location of the style sheet containing the <span
  2231    class=index-inst id=font-face0
  2232    title="@font-face"><code>@font-face</code></span> rule. In the case of SVG
  2233    fonts, the URL points to an element within a document containing SVG font
  2234    definitions. If the element reference is omitted, a reference to the first
  2235    defined font is implied. Similarly, font container formats that can
  2236    contain more than one font must load one and only one of the fonts for a
  2237    given <code>@font-face</code> rule. Fragment identifiers are used to
  2238    indicate which font to load. If a container format lacks a defined
  2239    fragment identifier scheme, implementations should use a simple 1-based
  2240    indexing scheme (e.g. "font-collection#1" for the first font,
  2241    "font-collection#2" for the second font).
  2243   <pre>
  2244 src: url(fonts/simple.ttf);   /* load simple.ttf relative to stylesheet location */
  2245 src: url(/fonts/simple.ttf);  /* load simple.ttf from absolute location */
  2246 src: url(fonts.svg#simple);   /* load SVG font with id 'simple' */
  2247 </pre>
  2249   <p>External references consist of a URL, followed by an optional hint
  2250    describing the format of the font resource referenced by that URL. The
  2251    format hint contains a comma-separated list of format strings that denote
  2252    well-known font formats. Conformant user agents must skip downloading a
  2253    font resource if the format hints indicate only unsupported or unknown
  2254    font formats. If no format hints are supplied, the user agent should
  2255    download the font resource.
  2257   <pre>
  2258 /* load WOFF font if possible, otherwise use OpenType font */
  2259 @font-face {
  2260   font-family: bodytext;
  2261   src: url(ideal-sans-serif.woff) format("woff"),
  2262        url(basic-sans-serif.ttf) format("opentype");
  2264 </pre>
  2266   <p>Format strings defined by this specification:
  2268   <table class=data id=fontformats>
  2269    <thead>
  2270     <tr>
  2271      <th>String
  2273      <th>Font Format
  2275      <th>Common extensions
  2277    <tbody>
  2278     <tr>
  2279      <th>"woff"
  2281      <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
  2283      <td>.woff
  2285     <tr>
  2286      <th>"truetype"
  2288      <td><a
  2289       href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
  2291      <td>.ttf
  2293     <tr>
  2294      <th>"opentype"
  2296      <td><a
  2297       href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
  2299      <td>.ttf, .otf
  2301     <tr>
  2302      <th>"embedded-opentype"
  2304      <td><a
  2305       href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
  2306       OpenType</a>
  2308      <td>.eot
  2310     <tr>
  2311      <th>"svg"
  2313      <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
  2315      <td>.svg, .svgz
  2316   </table>
  2318   <p>Given the overlap in common usage between TrueType and OpenType, the
  2319    format hints "truetype" and "opentype" must be considered as synonymous; a
  2320    format hint of "opentype" does not imply that the font contains Postscript
  2321    CFF style glyph data or that it contains OpenType layout information (see
  2322    <a href="#platform-props-to-css">Appendix A</a> for more background on
  2323    this).
  2325   <p>When authors would prefer to use a locally available copy of a given
  2326    font and download it if it's not, <code>local()</code> can be used. The
  2327    locally-installed <dfn
  2328    id=font-face-name-value><var>&lt;font-face-name&gt;</var></dfn> argument
  2329    to <code>local()</code> is a format-specific string that uniquely
  2330    identifies a single font face within a larger family. The syntax for a <a
  2331    href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> is a
  2332    unique font face name enclosed by "local(" and ")". The name can
  2333    optionally be enclosed in quotes. If unquoted, the unquoted font family
  2334    name processing conventions apply; the name must be a sequence of
  2335    identifiers separated by whitespace which is converted to a string by
  2336    joining the identifiers together separated by a single space.
  2338   <pre>
  2339 /* regular face of Gentium */
  2340 @font-face {
  2341   font-family: MyGentium;
  2342   src: local(Gentium),   /* use locally available Gentium */
  2343        url(Gentium.ttf); /* otherwise, download it */
  2345 </pre>
  2347   <p>For OpenType and TrueType fonts, this string is used to match only the
  2348    Postscript name or the full font name in the name table of locally
  2349    available fonts. Which type of name is used varies by platform and font,
  2350    so authors should include both of these names to assure proper matching
  2351    across platforms. Platform substitutions for a given font name must not be
  2352    used.
  2354   <pre>
  2355 /* bold face of Gentium */
  2356 @font-face {
  2357   font-family: MyGentium;
  2358   src: local(Gentium Bold),   /* full font name */
  2359        local(Gentium-Bold),   /* Postscript name */
  2360        url(GentiumBold.ttf);  /* otherwise, download it */
  2361   font-weight: bold;
  2363 </pre>
  2365   <p>Just as a <code>@font-face</code> rule specifies the characteristics of
  2366    a single font within a family, the unique name used with
  2367    <code>local()</code> specifies a single font, not an entire font family.
  2368    Defined in terms of OpenType font data, the Postscript name is found in
  2369    the font's <a
  2370    href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
  2371    in the name record with nameID = 6 (see <a href="#OPENTYPE"
  2372    rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
  2373    Postscript name is the commonly used key for all fonts on OSX and for
  2374    Postscript CFF fonts under Windows. The full font name (nameID = 4) is
  2375    used as a unique key for fonts with TrueType glyphs on Windows.
  2377   <p>For OpenType fonts with multiple localizations of the full font name,
  2378    the US English version is used (language ID = 0x409 for Windows and
  2379    language ID = 0 for Macintosh) or the first localization when a US English
  2380    full font name is not available (the OpenType specification recommends
  2381    that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
  2382    fonts minimally include US English names</a>). User agents that also match
  2383    other full font names, e.g. matching the Dutch name when the current
  2384    system locale is set to Dutch, are considered non-conformant. This is done
  2385    not to prefer English but to avoid matching inconsistencies across font
  2386    versions and OS localizations, since font style names (e.g. "Bold") are
  2387    frequently localized into many languages and the set of localizations
  2388    available varies widely across platform and font version. User agents that
  2389    match a concatenation of family name (nameID = 1) with style name (nameID
  2390    = 2) are considered non-conformant.
  2392   <p>This also allows for referencing faces that belong to larger families
  2393    that cannot otherwise be referenced.
  2395   <div class=example>
  2396    <p>Use a local font or reference an SVG font in another document:</p>
  2398    <pre>
  2399 @font-face {
  2400   font-family: Headline;
  2401   src: local(Futura-Medium), 
  2402        url(fonts.svg#MyGeometricModern) format("svg");
  2404 </pre>
  2406    <p>Create an alias for local Japanese fonts on different platforms:</p>
  2408    <pre>
  2409 @font-face {
  2410   font-family: jpgothic;
  2411   src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
  2413 </pre>
  2415    <p>Reference a font face that cannot be matched within a larger family:</p>
  2417    <pre>
  2418 @font-face {
  2419   font-family: Hoefler Text Ornaments;
  2420   /* has the same font properties as Hoefler Text Regular */
  2421   src: local(HoeflerText-Ornaments); 
  2423 </pre>
  2425    <p>Since localized fullnames never match, a document with the header style
  2426     rules below would always render using the default serif font, regardless
  2427     whether a particular system locale parameter is set to Finnish or not:</p>
  2429    <pre>
  2430 @font-face {
  2431   font-family: SectionHeader;
  2432   src: local("Arial Lihavoitu");  /* Finnish fullname for Arial Bold, should fail */
  2433   font-weight: bold;
  2436 h2 { font-family: SectionHeader, serif; }
  2437 </pre>
  2439    <p>A conformant user agent would never load the font ‘<code
  2440     class=css>gentium.eot</code>’ in the example below, since it is
  2441     included in the first definition of the ‘<a href="#descdef-src"><code
  2442     class=property>src</code></a>’ descriptor which is overridden by the
  2443     second definition in the same <code>@font-face</code> rule:</p>
  2445    <pre>
  2446 @font-face {
  2447   font-family: MainText;
  2448   src: url(gentium.eot); /* for use with older non-conformant user agents */
  2449   src: local("Gentium"), url(gentium.ttf);  /* Overrides src definition */
  2451 </pre>
  2452   </div>
  2454   <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
  2455    descriptors: the <a href="#descdef-font-style">font-style</a>, <a
  2456    href="#descdef-font-weight">font-weight</a>, <a
  2457    href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
  2459   <table class=descdef>
  2460    <tbody>
  2461     <tr>
  2462      <td>Name:
  2464      <td><dfn id=descdef-font-style title="font-style
  2465       (descriptor)">font-style</dfn>
  2467     <tr>
  2468      <td>Value:
  2470      <td>normal | italic | oblique
  2472     <tr>
  2473      <td><em>Initial:</em>
  2475      <td>normal
  2476   </table>
  2478   <table class=descdef>
  2479    <tbody>
  2480     <tr>
  2481      <td>Name:
  2483      <td><dfn id=descdef-font-weight title="font-weight
  2484       (descriptor)">font-weight</dfn>
  2486     <tr>
  2487      <td>Value:
  2489      <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
  2491     <tr>
  2492      <td><em>Initial:</em>
  2494      <td>normal
  2495   </table>
  2497   <table class=descdef>
  2498    <tbody>
  2499     <tr>
  2500      <td>Name:
  2502      <td><dfn id=descdef-font-stretch title="font-stretch
  2503       (descriptor)">font-stretch</dfn>
  2505     <tr>
  2506      <td>Value:
  2508      <td>normal | ultra-condensed | extra-condensed | condensed |
  2509       semi-condensed | semi-expanded | expanded | extra-expanded |
  2510       ultra-expanded
  2512     <tr>
  2513      <td><em>Initial:</em>
  2515      <td>normal
  2516   </table>
  2518   <p>These descriptors define the characteristics of a font face and are used
  2519    in the process of matching styles to specific faces. For a font family
  2520    defined with several <code>@font-face</code> rules, user agents can either
  2521    download all faces in the family or use these descriptors to selectively
  2522    download font faces that match actual styles used in document. The values
  2523    for these descriptors are the same as those for the corresponding font
  2524    properties except that relative keywords are not allowed, ‘<code
  2525    class=property>bolder</code>’ and ‘<code
  2526    class=property>lighter</code>’. If these descriptors are omitted,
  2527    initial values are assumed.
  2529   <p>The value for these font face style attributes is used in place of the
  2530    style implied by the underlying font data. This allows authors to combine
  2531    faces in flexible combinations, even in situations where the original font
  2532    data was arranged differently. User agents that implement synthetic
  2533    bolding and obliquing must only apply synthetic styling in cases where the
  2534    font descriptors imply this is needed, rather than based on the style
  2535    attributes implied by the font data.
  2537   <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
  2538    <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
  2540   <table class=descdef>
  2541    <tbody>
  2542     <tr>
  2543      <td>Name:
  2545      <td><dfn id=descdef-unicode-range>unicode-range</dfn>
  2547     <tr>
  2548      <td>Value:
  2550      <td><a href="#urange-value"><var>&lt;urange&gt;</var></a> #
  2552     <tr>
  2553      <td><em>Initial:</em>
  2555      <td>U+0-10FFFF
  2556   </table>
  2558   <p>This descriptor defines the set of Unicode codepoints that may be
  2559    supported by the font face for which it is declared. The descriptor value
  2560    is a comma-delimited list of Unicode range (<a
  2561    href="#urange-value"><var>&lt;urange&gt;</var></a>) values. The union of
  2562    these ranges defines the set of codepoints that serves as a hint for user
  2563    agents when deciding whether or not to download a font resource for a
  2564    given text run.
  2566   <p>Each <dfn id=urange-value><var>&lt;urange&gt;</var></dfn> value is a <a
  2567    href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
  2568    title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
  2569    "U+" or "u+" prefix followed by a codepoint range in one of the three
  2570    forms listed below. Ranges that do not fit one of the these forms are
  2571    invalid and cause the declaration to be ignored.
  2573   <dl>
  2574    <dt>single codepoint (e.g. U+416)
  2576    <dd>a valid Unicode codepoint, represented as one to six hexadecimal
  2577     digits
  2579    <dt>interval range (e.g. U+400-4ff)
  2581    <dd>represented as two hyphen-separated valid Unicode codepoints
  2582     indicating the inclusive start and end codepoints of a range
  2584    <dt>wildcard range (e.g. U+4??)
  2586    <dd>defined by the set of codepoints implied when trailing ‘<code
  2587     class=css>?</code>’ characters signify any hexadeximal digit
  2588   </dl>
  2590   <p>Individual codepoints are written using hexadecimal values that
  2591    correspond to <a href="http://www.unicode.org/charts/">Unicode character
  2592    codepoints</a>. Valid Unicode codepoint values vary between 0 and 10FFFF
  2593    inclusive. Digit values of codepoints are ASCII case-insensitive. For
  2594    interval ranges, the start and end codepoints must be valid Unicode values
  2595    and the end codepoint must be greater than or equal to the start
  2596    codepoint.
  2598   <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
  2599    "U+???") are valid and equivalent to a wildcard range with an initial zero
  2600    digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
  2601    the range of valid Unicode codepoints are invalid. Because of this, the
  2602    maximum number of trailing ‘<code class=css>?</code>’ wildcard
  2603    characters is five, even though the <a
  2604    href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
  2605    title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
  2607   <p>Within the comma-delimited list of Unicode ranges in a ‘<a
  2608    href="#descdef-unicode-range"><code
  2609    class=property>unicode-range</code></a>’ descriptor declaration, ranges
  2610    may overlap. The union of these ranges defines the set of codepoints for
  2611    which the corresponding font may be used. User agents must not download or
  2612    use the font for codepoints outside this set. User agents may normalize
  2613    the list of ranges into a list that is different but represents the same
  2614    set of codepoints.
  2616   <p>The associated font might not contain glyphs for the entire set of
  2617    codepoints defined by the ‘<a href="#descdef-unicode-range"><code
  2618    class=property>unicode-range</code></a>’ descriptor. When the font is
  2619    used the effective <a href="#character-map"><em>character map</em></a> is
  2620    the intersection of the codepoints defined by ‘<a
  2621    href="#descdef-unicode-range"><code
  2622    class=property>unicode-range</code></a>’ with the font's <a
  2623    href="#character-map"><em>character map</em></a>. This allows authors to
  2624    define supported ranges in terms of broad ranges without worrying about
  2625    the precise codepoint ranges supported by the underlying font.
  2627   <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
  2628    to define composite fonts</h3>
  2630   <p>Multiple <code>@font-face</code> rules with different unicode ranges for
  2631    the same family and style descriptor values can be used to create
  2632    composite fonts that mix the glyphs from different fonts for different
  2633    scripts. This can be used to combine fonts that only contain glyphs for a
  2634    single script (e.g. Latin, Greek, Cyrillic) or it can be used by authors
  2635    as a way of segmenting a font into fonts for commonly used characters and
  2636    less frequently used characters. Since the user agent will only pull down
  2637    the fonts it needs this helps reduce page bandwidth.
  2639   <p>If the unicode ranges overlap for a set of <code>@font-face</code> rules
  2640    with the same family and style descriptor values, the rules are ordered in
  2641    the reverse order they were defined; the last rule defined is the first to
  2642    be checked for a given character.
  2644   <p>Example ranges for specific languages or characters:
  2646   <dl>
  2647    <dt>unicode-range: U+A5;
  2649    <dd>a single code point, the yen/yuan symbol
  2651    <dt>unicode-range: U+0-7F;
  2653    <dd>code range for basic ASCII characters
  2655    <dt>unicode-range: U+590-5ff;
  2657    <dd>code range for Hebrew characters
  2659    <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
  2661    <dd>code range for Japanese kanji, hiragana and katakana characters plus
  2662     yen/yuan symbol
  2663   </dl>
  2665   <div class=example>
  2666    <p>The BBC provides news services in a wide variety of languages, many
  2667     that are not well supported across all platforms. Using an
  2668     <code>@font-face</code> rule, the BBC could provide a font for any of
  2669     these languages, as it already does via a manual font download.</p>
  2671    <pre>
  2672 @font-face {
  2673   font-family: BBCBengali;
  2674   src: url(fonts/BBCBengali.ttf) format("opentype");
  2675   unicode-range: U+00-FF, U+980-9FF;
  2677 </pre>
  2678   </div>
  2680   <div class=example>
  2681    <p>Technical documents often require a wide range of symbols. The STIX
  2682     Fonts project is one project aimed at providing fonts to support a wide
  2683     range of technical typesetting in a standardized way. The example below
  2684     shows the use of a font that provides glyphs for many of the mathematical
  2685     and technical symbol ranges within Unicode:</p>
  2687    <pre>
  2688 @font-face {
  2689   font-family: STIXGeneral;
  2690   src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
  2691   unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
  2693 </pre>
  2694   </div>
  2696   <div class=example>
  2697    <p>This example shows how an author can override the glyphs used for Latin
  2698     characters in a Japanese font with glyphs from a different font. The
  2699     first rule specifies no range so it defaults to the entire range. The
  2700     range specified in the second rule overlaps but takes precedence because
  2701     it is defined later.</p>
  2703    <pre>
  2704 @font-face {
  2705   font-family: JapaneseWithGentium;
  2706   src: local(MSMincho);
  2707   /* no range specified, defaults to entire range */
  2710 @font-face {
  2711   font-family: JapaneseWithGentium;
  2712   src: url(../fonts/Gentium.ttf);
  2713   unicode-range: U+0-2FF;
  2715 </pre>
  2716   </div>
  2718   <div class=example>
  2719    <p>Consider a family constructed to optimize bandwidth by separating out
  2720     Latin, Japanese and other characters into different font files:</p>
  2722    <pre>
  2723 /* fallback font - size: 4.5MB */
  2724 @font-face {
  2725   font-family: DroidSans;
  2726   src: url(DroidSansFallback.ttf);
  2727   /* no range specified, defaults to entire range */
  2730 /* Japanese glyphs - size: 1.2MB */
  2731 @font-face {
  2732   font-family: DroidSans;
  2733   src: url(DroidSansJapanese.ttf);
  2734   unicode-range: U+3000-9FFF, U+ff??;
  2737 /* Latin, Greek, Cyrillic along with some 
  2738    punctuation and symbols - size: 190KB */
  2739 @font-face {
  2740   font-family: DroidSans;
  2741   src: url(DroidSans.ttf);
  2742   unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
  2744 </pre>
  2746    <p>For simple Latin text, only the font for Latin characters is
  2747     downloaded:</p>
  2749    <pre>
  2750 body { font-family: DroidSans; }
  2752 &lt;p>This is that&lt;/p>
  2753 </pre>
  2755    <p>In this case the user agent first checks the unicode-range for the font
  2756     containing Latin characters (DroidSans.ttf). Since all the characters
  2757     above are in the range U+0-5FF, the user agent downloads the font and
  2758     renders the text with that font.</p>
  2760    <p>Next, consider text that makes use of an arrow character (⇨):</p>
  2762    <pre>
  2763 &lt;p>This &amp;#x21e8; that&lt;p>
  2764 </pre>
  2766    <p>The user agent again first checks the unicode-range of the font
  2767     containing Latin characters. Since U+2000-2300 includes the arrow code
  2768     point (U+21E8), the user agent downloads the font. For this character
  2769     however the Latin font does not have a matching glyph, so the effective
  2770     unicode-range used for font matching excludes this code point. Next, the
  2771     user agent evaluates the Japanese font. The unicode-range for the
  2772     Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
  2773     user agent does not download the Japanese font. Next the fallback font is
  2774     considered. The <code>@font-face</code> rule for the fallback font does
  2775     not define unicode-range so its value defaults to the range of all
  2776     Unicode code points. The fallback font is downloaded and used to render
  2777     the arrow character.</p>
  2778   </div>
  2780   <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
  2781    href="#descdef-font-variant">font-variant</a> and <a
  2782    href="#descdef-font-feature-settings">font-feature-settings</a>
  2783    descriptors</h3>
  2785   <table class=descdef>
  2786    <tbody>
  2787     <tr>
  2788      <td>Name:
  2790      <td><dfn id=descdef-font-variant title="font-variant
  2791       (descriptor)">font-variant</dfn>
  2793     <tr>
  2794      <td>Value:
  2796      <td>normal | none | [ <a
  2797       href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a> ||
  2798       <a
  2799       href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
  2800       || <a
  2801       href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
  2802       || <a
  2803       href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
  2804       || <a href="#stylistic"><var
  2805       title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
  2806       href="#historical-forms"><var>historical-forms</var></a> || <a
  2807       href="#styleset"><var
  2808       title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
  2809       href="#character-variant"><var
  2810       title=character-variant>character-variant(&lt;feature-value-name&gt;
  2811       #)</var></a> || <a href="#swash"><var
  2812       title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
  2813       href="#ornaments"><var
  2814       title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
  2815       href="#annotation"><var
  2816       title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
  2817       <a href="#small-caps"><i>small-caps</i></a> | <a
  2818       href="#all-small-caps"><i>all-small-caps</i></a> | <a
  2819       href="#petite-caps"><i>petite-caps</i></a> | <a
  2820       href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
  2821       href="#unicase"><i>unicase</i></a> | <a
  2822       href="#titling-caps"><i>titling-caps</i></a> ] || <a
  2823       href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
  2824       || <a
  2825       href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
  2826       || <a
  2827       href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
  2828       || <a href="#ordinal"><i>ordinal</i></a> || <a
  2829       href="#slashed-zero"><i>slashed-zero</i></a> || <a
  2830       href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
  2831       || <a
  2832       href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
  2833       || <a href="#ruby"><i>ruby</i></a> ]
  2835     <tr>
  2836      <td><em>Initial:</em>
  2838      <td>normal
  2839   </table>
  2841   <table class=descdef>
  2842    <tbody>
  2843     <tr>
  2844      <td>Name:
  2846      <td><dfn id=descdef-font-feature-settings title="font-feature-settings
  2847       (descriptor)">font-feature-settings</dfn>
  2849     <tr>
  2850      <td>Value:
  2852      <td>normal | <a
  2853       href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
  2855     <tr>
  2856      <td><em>Initial:</em>
  2858      <td>normal
  2859   </table>
  2861   <p>These descriptors define initial settings that apply when the font
  2862    defined by an <code>@font-face</code> rule is rendered. They do not affect
  2863    font selection. Values are identical to those defined for the
  2864    corresponding ‘<a href="#propdef-font-variant"><code
  2865    class=property>font-variant</code></a>’ and ‘<a
  2866    href="#propdef-font-feature-settings"><code
  2867    class=property>font-feature-settings</code></a>’ properties defined
  2868    below except that the value ‘<code class=property>inherit</code>’ is
  2869    omitted. When multiple font feature descriptors or properties are used,
  2870    the cumulative effect on text rendering is detailed in the section <a
  2871    href="#font-feature-resolution">Font Feature Resolution</a> below. In
  2872    cases where specific values define synthesized fallback for certain ‘<a
  2873    href="#propdef-font-variant"><code
  2874    class=property>font-variant</code></a>’ subproperties, the same
  2875    synthesized fallback applies when used within those values are used with
  2876    the <a href="#descdef-font-variant">‘<code
  2877    class=property>font-variant</code>’</a> descriptor.
  2879   <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
  2880    guidelines</h3>
  2882   <p>The <code>@font-face</code> rule is designed to allow lazy loading of
  2883    font resources that are only downloaded when used within a document. A
  2884    stylesheet can include <code>@font-face</code> rules for a library of
  2885    fonts of which only a select set are used; user agents must only download
  2886    those fonts that are referred to within the style rules applicable to a
  2887    given page. User agents that download all fonts defined in
  2888    <code>@font-face</code> rules without considering whether those fonts are
  2889    in fact used within a page are considered non-conformant. In cases where a
  2890    font might be downloaded in character fallback cases, user agents may
  2891    download a font if it's listed in a font list but is not actually used for
  2892    a given text run.
  2894   <pre>
  2895 @font-face {
  2896   font-family: GeometricModern;
  2897   src: url(font.ttf);
  2900 p {
  2901   /* font will be downloaded for pages with p elements */
  2902   font-family: GeometricModern, sans-serif;
  2905 h2 {
  2906   /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
  2907   font-family: Futura, GeometricModern, sans-serif;
  2909 </pre>
  2911   <p>In cases where textual content is loaded before downloadable fonts are
  2912    available, user agents may render text as it would be rendered if
  2913    downloadable font resources are not available or they may render text
  2914    transparently with fallback fonts to avoid a flash of text using a
  2915    fallback font. In cases where the font download fails user agents must
  2916    display text, simply leaving transparent text is considered non-conformant
  2917    behavior. Authors are advised to use fallback fonts in their font lists
  2918    that closely match the vertical metrics of the downloadable fonts to avoid
  2919    large page reflows where possible.
  2921   <h3 id=same-origin-restriction><span class=secno>4.9 </span>Same-origin
  2922    restriction for fonts</h3>
  2924   <h4 id=default-same-origin-restriction><span class=secno>4.9.1
  2925    </span>Default same-origin restriction</h4>
  2926   <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
  2927   http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
  2928   http://www.w3.org/2011/10/31-webapps-minutes.html#item02
  2929 -->
  2931   <p>User agents must implement a same-origin restriction when loading fonts
  2932    via the <code>@font-face</code> mechanism. This restriction limits the
  2933    loading of fonts for a given document to fonts loaded from the same
  2934    origin. Fonts can only be loaded via the same host, port, and method
  2935    combination as the containing document, using the <a
  2936    href="http://www.w3.org/TR/html5/browsers.html#origin">origin matching
  2937    algorithm</a> described in the <a href="#HTML5"
  2938    rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification. The origin of
  2939    the stylesheet containing <code>@font-face</code> rules is not used when
  2940    deciding whether a font is same origin or not, only the origin of the
  2941    containing document is used. The restriction applies to all font types.
  2943   <p>Given a document located at http://example.com/page.html, fonts defined
  2944    with ‘<a href="#descdef-src"><code class=property>src</code></a>’
  2945    definitions considered cross origin must not be loaded:
  2947   <pre>
  2948 /* same origin (i.e. domain, protocol, port match document) */
  2949 src: url(fonts/simple.ttf);                     
  2950 src: url(//fonts/simple.ttf);                     
  2952 /* cross origin, different protocol */
  2953 src: url(https://example.com/fonts/simple.ttf);              
  2955 /* cross origin, different domain */
  2956 src: url(http://another.example.com/fonts/simple.ttf); 
  2957 </pre>
  2959   <h4 id=allowing-cross-origin-font-loading><span class=secno>4.9.2
  2960    </span>Allowing cross-origin font loading</h4>
  2962   <p>User agents must also implement the ability to relax this restriction
  2963    using cross-site origin controls <a href="#CORS"
  2964    rel=biblioentry>[CORS]<!--{{!CORS}}--></a> for fonts loaded via HTTP.
  2965    Sites can explicitly allow cross-site downloading of font data using the
  2966    <code>Access-Control-Allow-Origin</code> HTTP header. For other protocols,
  2967    no explicit relaxation mechanism is defined or required.
  2969   <p>For font loads over HTTP, cross-origin requests must be made with the
  2970    following parameter settings which are used in conjunction with the <a
  2971    href="http://www.w3.org/TR/cors/#cross-origin-request-0"> <em>cross-origin
  2972    request algorithm</em></a> <a href="#CORS"
  2973    rel=biblioentry>[CORS]<!--{{!CORS}}--></a>:
  2975   <ul>
  2976    <li><em>request URL</em> — the URL of the font resource in the <a
  2977     href="#descdef-src"><code>src</code></a> descriptor
  2979    <li><em>request method</em> — GET
  2981    <li><em>author request headers</em> — none
  2983    <li><em>request entity body</em> — empty
  2985    <li><em>source origin</em> — the origin of the page which linked to the
  2986     stylesheet
  2988    <li><em>manual redirect flag</em> — false
  2990    <li><em>omit credentials flag</em> — true
  2992    <li><em>force preflight flag</em> — false
  2993   </ul>
  2995   <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
  2996    Algorithm</h2>
  2998   <p>The algorithm below describes how fonts are associated with individual
  2999    runs of text. For each character in the run a font family is chosen and a
  3000    particular font face is selected containing a glyph for that character.
  3002   <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
  3003    font family names</h3>
  3005   <p>As part of the font matching algorithm outlined below, user agents must
  3006    match font family names used in style rules with actual font family names
  3007    contained in fonts available in a given environment or defined via
  3008    <code>@font-face</code> rules. User agents must match these names case
  3009    insensitively, using the "Default Caseless Matching" algorithm outlined in
  3010    the Unicode specification <a href="#UNICODE6"
  3011    rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
  3012    detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
  3013    the algorithm must be applied without normalizing the strings involved and
  3014    without applying any language-specific tailorings. The case folding method
  3015    specified by this algorithm uses the case mappings with status field
  3016    ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
  3017    in the CaseFolding.txt file of the Unicode Character Database.
  3019   <p class=note> Implementors should take care to verify that a given
  3020    caseless string comparison implementation uses this precise algorithm and
  3021    not assume that a given platform string matching routine follows it, as
  3022    many of these have locale-specific behavior or use some level of string
  3023    normalization.
  3025   <p class=note> For authors this means that font family names are matched
  3026    case insensitively, whether those names exist in a platform font or in the
  3027    <code>@font-face</code> rules contained in a stylesheet. Authors should
  3028    take care to ensure that names use a character sequence consistent with
  3029    the actual font family name, particularly when using combining characters
  3030    such as diacritical marks. For example, a family name that contains an
  3031    uppercase A (U+0041) followed by a combining ring (U+030A) will
  3032    <strong>not</strong> match a name that looks identical but which uses the
  3033    precomposed lowercase a-ring character (U+00E5) instead of the combining
  3034    sequence.
  3036   <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
  3037    styles</h3>
  3039   <p>The procedure for choosing fonts consists of iterating over the font
  3040    families determined by the font-family property, selecting a font face
  3041    with the appropriate style based on other font properties and then
  3042    determining whether a glyph exists for a given character. This is done
  3043    using the <dfn id=character-map>character map</dfn> of the font, data
  3044    which maps characters to the default glyph for that character. Codepoint
  3045    sequences consisting of a base character followed by a sequence of
  3046    combining characters are treated slightly differently, see the section on
  3047    <a href="#cluster-matching">cluster matching</a> below.
  3049   <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
  3050    given font family is defined to be the face that would be selected if all
  3051    font style properties were set to their initial value.
  3053   <ol id=fontmatchingalg>
  3054    <li>Using the computed font property values for a given element, the user
  3055     agent starts with the first family name in the fontlist specified by the
  3056     <span class=property>‘<a href="#descdef-font-family"><code
  3057     class=property>font-family</code></a>’</span> property.
  3059    <li>If the family name is unquoted and is a generic family name, the user
  3060     agent looks up the appropriate font family name to be used. User agents
  3061     may choose the generic font family to use based on the language of the
  3062     containing element or the Unicode range of the character.
  3064    <li>For other family names, the user agent attempts to find the family
  3065     name among fonts defined via <code>@font-face</code> rules and then among
  3066     available system fonts, matching names with a case-insensitive comparison
  3067     as outlined <a href="#font-family-casing">in the section above</a>. On
  3068     systems containing fonts with multiple localized font family names, user
  3069     agents must match any of these names independent of the underlying system
  3070     locale or platform API used. If the font resources defined for a given
  3071     face in an @font-face rule are either not available or contain invalid
  3072     font data, then the face should be treated as not present in the family.
  3073     If no faces are present for a family defined via @font-face rules, the
  3074     family should be treated as missing; matching a platform font with the
  3075     same name must not occur in this case.
  3077    <li>If a font family match occurs, the user agent assembles the set of
  3078     font faces in that family and then narrows the set to a single face using
  3079     other font properties in the order given below:
  3080     <ol id=fontstylematchingalg>
  3081      <li><span class=property>‘<a href="#propdef-font-stretch"><code
  3082       class=property>font-stretch</code></a>’</span> is tried first. If the
  3083       matching set contains faces with width values matching the ‘<a
  3084       href="#propdef-font-stretch"><code
  3085       class=property>font-stretch</code></a>’ value, faces with other width
  3086       values are removed from the matching set. If there is no face that
  3087       exactly matches the width value the nearest width is used instead. If
  3088       the value of ‘<a href="#propdef-font-stretch"><code
  3089       class=property>font-stretch</code></a>’ is ‘<a
  3090       href="#normal2"><code class=property>normal</code></a>’ or one of the
  3091       condensed values, narrower width values are checked first, then wider
  3092       values. If the value of ‘<a href="#propdef-font-stretch"><code
  3093       class=property>font-stretch</code></a>’ is one of the expanded
  3094       values, wider values are checked first, followed by narrower values.
  3095       Once the closest matching width has been determined by this process,
  3096       faces with other widths are removed from the matching set.
  3098      <li><span class=property>‘<a href="#propdef-font-style"><code
  3099       class=property>font-style</code></a>’</span> is tried next. If the
  3100       value of ‘<a href="#propdef-font-style"><code
  3101       class=property>font-style</code></a>’ is ‘<code
  3102       class=property>italic</code>’, italic faces are checked first, then
  3103       oblique, then normal faces. If the value is ‘<code
  3104       class=property>oblique</code>’, oblique faces are checked first, then
  3105       italic faces and then normal faces. If the value is ‘<a
  3106       href="#normal2"><code class=property>normal</code></a>’, normal faces
  3107       are checked first, then oblique faces, then italic faces. Faces with
  3108       other style values are excluded from the matching set. User agents are
  3109       permitted to distinguish between italic and oblique faces within
  3110       platform font families but this is not required, they may treat all
  3111       italic or oblique faces as italic faces. However, within font families
  3112       defined via <code>@font-face</code> rules, italic and oblique faces
  3113       must be distinguished using the value of the ‘<a
  3114       href="#propdef-font-style"><code
  3115       class=property>font-style</code></a>’ descriptor.
  3117      <li><span class=property>‘<a href="#propdef-font-weight"><code
  3118       class=property>font-weight</code></a>’</span> is matched next, it
  3119       will always reduce the matching set to a single font face. If
  3120       bolder/lighter relative weights are used, the effective weight is
  3121       calculated based on the inherited weight value, as described in the
  3122       definition of the ‘<a href="#propdef-font-weight"><code
  3123       class=property>font-weight</code></a>’ property. Given the desired
  3124       weight and the weights of faces in the matching set after the steps
  3125       above, if the desired weight is available that face matches. Otherwise,
  3126       a weight is chosen using the rules below:
  3127       <ul>
  3128        <li>If the desired weight is less than 400, weights below the desired
  3129         weight are checked in descending order followed by weights above the
  3130         desired weight in ascending order until a match is found.
  3132        <li>If the desired weight is greater than 500, weights above the
  3133         desired weight are checked in ascending order followed by weights
  3134         below the desired weight in descending order until a match is found.
  3136        <li>If the desired weight is 400, 500 is checked first and then the
  3137         rule for desired weights less than 400 is used.
  3139        <li>If the desired weight is 500, 400 is checked first and then the
  3140         rule for desired weights less than 400 is used.
  3141       </ul>
  3143      <li><span class=property>‘<a href="#propdef-font-size"><code
  3144       class=property>font-size</code></a>’</span> must be matched within a
  3145       UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
  3146       are rounded to the nearest whole pixel, while the tolerance for
  3147       bitmapped fonts could be as large as 20%.) Further computations, e.g.,
  3148       by ‘<code class=property>em</code>’ values in other properties, are
  3149       based on the <span class=property>‘<a href="#propdef-font-size"><code
  3150       class=property>font-size</code></a>’</span> value that is used, not
  3151       the one that is specified.
  3152     </ol>
  3154    <li>
  3155     <p>If no matching face exists or the matched face does not contain a
  3156      glyph for the character to be rendered, the next family name is selected
  3157      and the previous two steps repeated. Glyphs from other faces in the
  3158      family are not considered. The only exception is that user agents may
  3159      optionally substitute a synthetic version of the <a
  3160      href="#default-face"><em>default face</em></a> if that face supports a
  3161      given glyph (e.g. a synthetic italic version of the regular face may be
  3162      used if the italic face doesn't support glyphs for Arabic).</p>
  3163     <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
  3165     <p>If the matched font is defined via an <code>@font-face</code> rule and
  3166      needs to be downloaded, the font resource is downloaded. While the
  3167      download occurs, the user agent can either wait until the font is
  3168      downloaded or render once with substituted font metrics and render again
  3169      once the font is downloaded.</p>
  3171    <li>If there are no more font families to be evaluated and no matching
  3172     face has been found, then the user agent performs a <em>system font
  3173     fallback</em> procedure to find the best match for the character to be
  3174     rendered. The result of this procedure may vary across user agents.
  3176    <li>If a particular character cannot be displayed using any font, the user
  3177     agent should indicate by some means that a character is not being
  3178     displayed, displaying either a symbolic representation of the missing
  3179     glyph (e.g. using a <a
  3180     href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
  3181     Font</a>) or using the missing character glyph from a default font.
  3182   </ol>
  3184   <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
  3186   <p>When text contains characters such as combining diacritics, ideally the
  3187    base character should be rendered using the same font as the diacritic,
  3188    this assures proper placement of the diacritic. For this reason, the font
  3189    matching algorithm for clusters is more specialized than the general case
  3190    of matching a single character by itself. For sequences containing
  3191    variation selectors, which indicate the precise glyph to be used for a
  3192    given character, user agents always attempt system font fallback to find
  3193    the appropriate glyph before using the default glyph of the base
  3194    character.
  3196   <p>A font is considered to <em>support</em> a given character if (1) the
  3197    character is contained in the font's <a
  3198    href="#character-map"><em>character map</em></a> and (2) if required by
  3199    the containing script, shaping information is available for that
  3200    character. Some legacy fonts may include a given character in the <a
  3201    href="#character-map"><em>character map</em></a> but lack the shaping
  3202    information (e.g. <a
  3203    href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
  3204    layout tables</a> or <a
  3205    href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&amp;item_id=graphite_techAbout">Graphite
  3206    tables</a>) necessary for correctly rendering text runs containing that
  3207    character.
  3209   <p>A sequence of codepoints containing combining diacritics or other
  3210    modifiers is termed a grapheme cluster (see <a href="#CSS3TEXT"
  3211    rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
  3212    description). For a given cluster containing a base character, <em>b</em>
  3213    and a sequence of combining characters <em>c1, c2…</em>, the entire
  3214    cluster is matched using these steps:
  3216   <ol>
  3217    <li>For each family in the font list, a face is chosen using the style
  3218     selection rules defined in the previous section.
  3219     <ol>
  3220      <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
  3221       completely supported by the font, select this font for the sequence.
  3223      <li>If a sequence of multiple codepoints is canonically equivalent to a
  3224       single character and the font supports that character, select this font
  3225       for the sequence.
  3226     </ol>
  3228    <li>If no font was found in the font list in step 1:
  3229     <ol>
  3230      <li>If <em>c1</em> is a variation selector, system fallback must be used
  3231       to find a font that supports the full sequence of <em>b + c1</em>. If
  3232       no font on the system supports the full sequence, match the single
  3233       character <em>b</em> using the normal procedure for matching single
  3234       characters and ignore the variation selector. Note: a sequence with
  3235       more than one variation selector is treated as an encoding error and
  3236       the trailing selectors are ignored.
  3238      <li>Otherwise, the user agent may optionally use system font fallback to
  3239       match a font that supports the entire cluster.
  3240     </ol>
  3242    <li>If no font is found in step 2, use the matching sequence from step 1
  3243     to determine the longest sequence that is completely matched by a font in
  3244     the font list and attempt to match the remaining combining characters
  3245     separately using the rules for single characters.
  3246   </ol>
  3248   <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
  3249    issues</h3>
  3251   <p>The procedure above is always performed on text runs containing Unicode
  3252    characters, documents using legacy encodings are assumed to have been
  3253    transcoded before matching fonts. For fonts containing <a
  3254    href="#character-map"><em title="character map">character maps</em></a>
  3255    for both legacy encodings and Unicode, the contents of the legacy encoding
  3256    <a href="#character-map"><em>character map</em></a> must have no effect on
  3257    the results of the font matching process.
  3259   <p>The font matching process does not assume that text runs are in either
  3260    normalized or denormalized form (see <a href="#CHARMOD-NORM"
  3261    rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
  3262    details). Layout engines often convert base character plus combining
  3263    character sequences into precomposed characters if they exist. The font
  3264    matching algorithm outlined here supports both ways and fonts can
  3265    generally support either but variations can occur. Authors should always
  3266    tailor their choice of fonts to their content, including whether that
  3267    content contains normalized or denormalized character streams.
  3269   <p>If a given character is a Private-Use Area Unicode codepoint and none of
  3270    the fonts in the fontlist contain a glyph for that codepoint, user agents
  3271    must display some form of missing glyph symbol for that character rather
  3272    than attempting system font fallback for that codepoint. When matching the
  3273    replacement character U+FFFD, user agents may skip the font matching
  3274    process and immediately display some form of missing glyph symbol, they
  3275    are not required to display the glyph from the font that would be selected
  3276    by the font matching process.
  3278   <p>In general, the fonts for a given family will all have the same or
  3279    similar <a href="#character-map"><em title="character map">character
  3280    maps</em></a>. The process outlined here is designed to handle even font
  3281    families containing faces with widely variant <a href="#character-map"><em
  3282    title="character map">character maps</em></a>. However, authors are
  3283    cautioned that the use of such families can lead to unexpected results.
  3285   <p>Optimizations of this process are allowed provided that an
  3286    implementation behaves as if the algorithm had been followed exactly.
  3287    Matching occurs in a well-defined order to insure that the results are as
  3288    consistent as possible across user agents, given an identical set of
  3289    available fonts and rendering technology.
  3291   <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
  3292    changes since CSS 2.1</h3>
  3294   <p>The algorithm above is different from CSS 2.1 in a number of key places.
  3295    These changes were made to better reflect actual font matching behavior
  3296    across user agent implementations.
  3298   <p>Differences compared to the font matching algorithm in CSS 2.1:
  3300   <ul>
  3301    <li>The algorithm includes font-stretch matching.
  3303    <li>All possible font-style matching scenarios are delineated.
  3305    <li>Small-caps fonts are not matched as part of the font matching process,
  3306     they are now handled via font features.
  3308    <li>Unicode variation selector matching is required.
  3310    <li>Cluster sequences are matched as a unit.
  3311   </ul>
  3313   <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
  3314    examples</h3>
  3316   <div class=example>
  3317    <p>It's useful to note that the CSS selector syntax may be used to create
  3318     language-sensitive typography. For example, some Chinese and Japanese
  3319     characters are unified to have the same Unicode code point, although the
  3320     abstract glyphs are not the same in the two languages.
  3322    <pre>*:lang(ja-jp) { font: 900 14pt/16pt &quot;Heisei Mincho W9&quot;, serif; }
  3323 *:lang(zh-tw) { font: 800 14pt/16.5pt &quot;Li Sung&quot;, serif; }
  3324 </pre>
  3326    <p>This selects any element that has the given language - Japanese or
  3327     Traditional Chinese - and uses the appropriate font.
  3328   </div>
  3330   <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
  3332   <p>Modern font technologies support a variety of advanced typographic and
  3333    language-specific font features. Using these features, a single font can
  3334    provide glyphs for a wide range of ligatures, contextual and stylistic
  3335    alternates, tabular and old-style figures, small capitals, automatic
  3336    fractions, swashes, and alternates specific to a given language. To allow
  3337    authors control over these font capabilities, the font-variant property
  3338    has been expanded for CSS3, it now functions as a shorthand for a set of
  3339    properties that provide control over stylistic font features.
  3341   <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
  3342    selection and positioning</h3>
  3344   <p>Simple fonts used for displaying Latin text use a very basic processing
  3345    model, fonts contain a <a href="#character-map"><em>character map</em></a>
  3346    which maps a given character to a glyph for that character. Glyphs for
  3347    subsequent characters are simply placed next in line along a run of text.
  3348    Font formats such as OpenType and AAT (Apple Advanced Typography) use a
  3349    richer processing model, the glyph for a given character can be chosen and
  3350    positioned not just based on a single character, but also based on
  3351    surrounding characters along with the language, script, and features
  3352    enabled for the text. Font features may be required for specific scripts,
  3353    or recommended as enabled by default or they may be stylistic features
  3354    meant to be used under author control.
  3356   <p>For a good visual overview of these features, see the <a
  3357    href="#OPENTYPE-FONT-GUIDE"
  3358    rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
  3359    For a detailed description of glyph processing for OpenType fonts, see <a
  3360    href="#WINDOWS-GLYPH-PROC"
  3361    rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
  3363   <p>Stylistic font features can be classified into two broad categories,
  3364    ones that affect the harmonization of glyph shapes with the surrounding
  3365    context, such as kerning and ligature features, and those such as the
  3366    small-caps, subscript/superscript and alternate features that affect shape
  3367    selection.
  3369   <p>The subproperties of font-variant listed below are used to control these
  3370    stylistic font features; they do not control features that are required
  3371    for displaying certain scripts, such as the OpenType features used when
  3372    displaying Arabic or Indic language text. They affect glyph selection and
  3373    positioning, they do not affect font selection as described in the font
  3374    matching section (except in cases required for compatibility with CSS
  3375    2.1).
  3377   <p>To assure consistent behavior across user agents, the equivalent
  3378    OpenType property settings are listed for individual properties and must
  3379    be considered normative. When using other font formats these should be
  3380    used as a guideline to map CSS font feature property values to specific
  3381    font features.
  3383   <h3 id=language-specific-support><span class=secno>6.2
  3384    </span>Language-specific display</h3>
  3386   <p>OpenType also supports language-specific glyph selection and
  3387    positioning, so that text can be displayed correctly in cases where the
  3388    language dictates a specific display behavior. Languages often share a
  3389    common script but the shape of certain letters may vary across those
  3390    languages, such as the variations in certain Cyrillic letters used in
  3391    Russian and Bulgarian text. In Latin text, it's common to render "fi" with
  3392    an explicit fi-ligature that lacks a dot on the "i". However, in languages
  3393    such as Turkish which uses both a dotted-i and a dotless-i, it's important
  3394    to not use this ligature or use a specialized version that contains a dot
  3395    over the "i". The example below shows language-specific variations based
  3396    on stylistic traditions found in Spanish, Italian and French orthography:
  3398   <div class=featex><img alt="language specific forms, spanish"
  3399    src=locl-1.png></div>
  3401   <div class=featex><img alt="language specific forms, italian"
  3402    src=locl-2.png></div>
  3404   <div class=featex><img alt="language specific forms, french"
  3405    src=locl-3.png></div>
  3407   <p>If the content language of the element is known, according to the rules
  3408    of the <a
  3409    href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
  3410    language</a>, user agents are required to infer the OpenType language
  3411    system from the content language and use that when selecting and
  3412    positioning glyphs using an OpenType font.
  3414   <p>For OpenType fonts, in some cases it may be necessary to explicitly
  3415    declare the OpenType language to be used, for example when displaying text
  3416    in a given language that uses the typographic conventions of another
  3417    language or when the font does not explicitly support a given language but
  3418    supports a language that shares common typographic conventions. The ‘<a
  3419    href="#propdef-font-language-override"><code
  3420    class=property>font-language-override</code></a>’ property is used for
  3421    this purpose.</p>
  3422   <!-- prop: font-kerning -->
  3424   <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
  3425    href="#propdef-font-kerning">font-kerning</a> property</h3>
  3427   <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
  3428    <tbody>
  3429     <tr>
  3430      <td>Name:
  3432      <td><dfn id=propdef-font-kerning>font-kerning</dfn>
  3434     <tr>
  3435      <td>Value:
  3437      <td>auto | normal | none
  3439     <tr>
  3440      <td>Initial:
  3442      <td>auto
  3444     <tr>
  3445      <td>Applies to:
  3447      <td>all elements
  3449     <tr>
  3450      <td>Inherited:
  3452      <td>yes
  3454     <tr>
  3455      <td>Percentages:
  3457      <td>N/A
  3459     <tr>
  3460      <td>Media:
  3462      <td>visual
  3464     <tr>
  3465      <td>Computed value:
  3467      <td>as specified
  3469     <tr>
  3470      <td>Animatable:
  3472      <td>no
  3473   </table>
  3475   <p>Kerning is the contextual adjustment of inter-glyph spacing. This
  3476    property controls metric kerning, kerning that utilizes adjustment data
  3477    contained in the font. The value ‘<a href="#normal2"><code
  3478    class=property>normal</code></a>’ implies that kerning is applied while
  3479    the value ‘<code class=property>none</code>’ implies that kerning is
  3480    not applied when rendering text. If the value is ‘<code
  3481    class=property>auto</code>’, a user agent is free to choose whether
  3482    kerning is enabled or not by default and to vary that default based on the
  3483    underlying text script.
  3485   <p>For fonts that do not include kerning data this property will have no
  3486    visible effect. When rendering with OpenType fonts, the <a
  3487    href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
  3488    specification suggests that kerning be enabled by default. When kerning is
  3489    enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
  3490    vertical text runs the <span class=tag>vkrn</span> feature is enabled).
  3491    User agents must also support fonts that only support kerning via data
  3492    contained in a ‘<code class=property>kern</code>’ font table, as
  3493    detailed in the OpenType specification. Authors may prefer to disable
  3494    kerning in situations where performance is more important than precise
  3495    appearance. If the ‘<code class=property>letter-spacing</code>’
  3496    property is defined, kerning adjustments are considered part of the
  3497    default spacing, letter spacing adjustments are made after kerning has
  3498    been applied.</p>
  3499   <!-- prop: font-variant-ligatures -->
  3501   <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
  3502    the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
  3503    property</h3>
  3505   <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
  3506    <tbody>
  3507     <tr>
  3508      <td>Name:
  3510      <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
  3512     <tr>
  3513      <td>Value:
  3515      <td>normal | none | [ <a
  3516       href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a> ||
  3517       <a
  3518       href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
  3519       || <a
  3520       href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
  3521       || <a
  3522       href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
  3525     <tr>
  3526      <td>Initial:
  3528      <td>normal
  3530     <tr>
  3531      <td>Applies to:
  3533      <td>all elements
  3535     <tr>
  3536      <td>Inherited:
  3538      <td>yes
  3540     <tr>
  3541      <td>Percentages:
  3543      <td>N/A
  3545     <tr>
  3546      <td>Media:
  3548      <td>visual
  3550     <tr>
  3551      <td>Computed value:
  3553      <td>as specified
  3555     <tr>
  3556      <td>Animatable:
  3558      <td>no
  3559   </table>
  3561   <p>Ligatures and contextual forms are ways of combining glyphs to produce
  3562    more harmonized forms. A value of ‘<a href="#normal2"><code
  3563    class=property>normal</code></a>’ implies that common default features
  3564    are enabled, <a href="#font-feature-resolution">as described in detail in
  3565    the next section</a>. For OpenType fonts, common ligatures and contextual
  3566    forms are on by default, discretionary and historical ligatures are not. A
  3567    value of ‘<code class=property>none</code>’ implies that all types of
  3568    ligatures and contextual forms covered by this property are explicitly
  3569    disabled. In situations where ligatures are not considered necessary, this
  3570    may improve the speed of text rendering.
  3572   <pre
  3573    class=prod><dfn id=common-lig-values><var>&lt;common-lig-values&gt;</var></dfn>        = [ <a href="#common-ligatures">common-ligatures</a> | <a href="#no-common-ligatures">no-common-ligatures</a> ]</pre>
  3575   <pre
  3576    class=prod><dfn id=discretionary-lig-values><var>&lt;discretionary-lig-values&gt;</var></dfn> = [ <a href="#discretionary-ligatures">discretionary-ligatures</a> | <a href="#no-discretionary-ligatures">no-discretionary-ligatures</a> ]</pre>
  3578   <pre
  3579    class=prod><dfn id=historical-lig-values><var>&lt;historical-lig-values&gt;</var></dfn>    = [ <a href="#historical-ligatures">historical-ligatures</a> | <a href="#no-historical-ligatures">no-historical-ligatures</a> ]</pre>
  3581   <pre
  3582    class=prod><dfn id=contextual-alt-values><var>&lt;contextual-alt-values&gt;</var></dfn>    = [ <a href="#contextual">contextual</a> | <a href="#no-contextual">no-contextual</a> ]</pre>
  3584   <p>Individual values have the following meanings:
  3586   <dl>
  3587    <dt><dfn id=common-ligatures>common-ligatures</dfn>
  3589    <dd>Enables display of common ligatures (OpenType features: <span
  3590     class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
  3591     enabled by default.
  3592   </dl>
  3594   <div class=featex><img alt="common ligature example" src=liga.png></div>
  3596   <dl>
  3597    <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
  3599    <dd>Disables display of common ligatures (OpenType features: <span
  3600     class=tag>liga, clig</span>).
  3602    <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
  3604    <dd>Enables display of discretionary ligatures (OpenType feature: <span
  3605     class=tag>dlig</span>). Which ligatures are discretionary, or optional,
  3606     is decided by the type designer so authors will need to refer to the
  3607     documentation of a given font to understand which ligatures are
  3608     considered discretionary.
  3609   </dl>
  3611   <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
  3613   <dl>
  3614    <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
  3616    <dd>Disables display of discretionary ligatures (OpenType feature: <span
  3617     class=tag>dlig</span>).
  3619    <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
  3621    <dd>Enables display of historical ligatures (OpenType feature: <span
  3622     class=tag>hlig</span>).
  3623   </dl>
  3625   <div class=featex><img alt="historical ligature example" src=hlig.png></div>
  3627   <dl>
  3628    <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
  3630    <dd>Disables display of historical ligatures (OpenType feature: <span
  3631     class=tag>hlig</span>).
  3633    <dt><dfn id=contextual>contextual</dfn>
  3635    <dd>Enables display of contextual alternates (OpenType feature: <span
  3636     class=tag>calt</span>). Although not strictly a ligature feature, like
  3637     ligatures this feature is commonly used to harmonize the shapes of glyphs
  3638     with the surrounding context. For OpenType fonts, this feature is on by
  3639     default.
  3640   </dl>
  3642   <div class=featex><img alt="contextual alternate example" src=calt.png></div>
  3644   <dl>
  3645    <dt><dfn id=no-contextual>no-contextual</dfn>
  3647    <dd>Disables display of contextual alternates (OpenType feature: <span
  3648     class=tag>calt</span>).
  3649   </dl>
  3651   <p>Required ligatures, needed for correctly rendering complex scripts, are
  3652    not affected by the settings above, including ‘<code
  3653    class=property>none</code>’ (OpenType feature: <span
  3654    class=tag>rlig</span>).</p>
  3655   <!-- prop: font-variant-position -->
  3657   <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
  3658    and superscript forms: the <a
  3659    href="#propdef-font-variant-position">font-variant-position</a> property</h3>
  3661   <table class=propdef id=namefont-variant-positionvaluenormal-sub>
  3662    <tbody>
  3663     <tr>
  3664      <td>Name:
  3666      <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
  3668     <tr>
  3669      <td>Value:
  3671      <td>normal | sub | super
  3673     <tr>
  3674      <td>Initial:
  3676      <td>normal
  3678     <tr>
  3679      <td>Applies to:
  3681      <td>all elements
  3683     <tr>
  3684      <td>Inherited:
  3686      <td>yes
  3688     <tr>
  3689      <td>Percentages:
  3691      <td>N/A
  3693     <tr>
  3694      <td>Media:
  3696      <td>visual
  3698     <tr>
  3699      <td>Computed value:
  3701      <td>as specified
  3703     <tr>
  3704      <td>Animatable:
  3706      <td>no
  3707   </table>
  3709   <p>This property is used to enable typographic subscript and superscript
  3710    glyphs. These are alternate glyphs designed within the same em-box as
  3711    default glyphs and are intended to be laid out on the same baseline as the
  3712    default glyphs, with no resizing or repositioning of the baseline. They
  3713    are explicitly designed to match the surrounding text and to be more
  3714    readable without affecting the line height.
  3716   <div class=figure><img alt="comparison between real subscript glyphs and
  3717    synthesized ones" src=realsubscripts.png>
  3718    <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
  3719     (bottom)
  3720   </div>
  3722   <p>The values ‘<code class=property>sub</code>’ and ‘<code
  3723    class=property>super</code>’ imply the appropriate variant glyph is
  3724    displayed when available in the font (OpenType features: <span
  3725    class=tag>subs, sups</span>). A value of ‘<a href="#normal2"><code
  3726    class=property>normal</code></a>’ implies neither of these alternate
  3727    glyphs are substituted.
  3729   <p>Because of the semantic nature of subscripts and superscripts, when the
  3730    value is either ‘<code class=property>sub</code>’ or ‘<code
  3731    class=property>super</code>’ for a given contiguous run of text, if a
  3732    variant glyph is not available for all the characters in the run,
  3733    simulated glyphs must be synthesized for all characters using reduced
  3734    forms of the glyphs that would be used without this feature applied. This
  3735    is done to avoid a mixture of variant glyphs and synthesized ones that
  3736    would not align correctly.
  3738   <p>In the case of OpenType fonts that lack subscript or superscript glyphs
  3739    for a given character, user agents must use the appropriate subscript and
  3740    superscript metrics specified in the selected font's <a
  3741    href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
  3742    table</a> <a href="#OPENTYPE"
  3743    rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
  3744    and offset of the synthesized substitutes.
  3746   <p>In the past, user agents have used font-size and vertical-align to
  3747    simulate subscripts and superscripts for the <span class=tag>sub</span>
  3748    and <span class=tag>sup</span> elements. To allow a backwards compatible
  3749    way of defining subscripts and superscripts, it is recommended that
  3750    authors use conditional rules <a href="#CSS3-CONDITIONAL"
  3751    rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
  3752    older user agents will still render subscripts and superscripts via the
  3753    older mechanism.
  3755   <p>Authors should note that fonts typically only provide subscript and
  3756    superscript glyphs for a subset of all characters supported by the font.
  3757    While subscript and superscript glyphs are often available for Latin
  3758    numbers, glyphs for punctuation and letter characters are less frequently
  3759    provided. The synthetic fallback rules defined for this property assure
  3760    that subscripts and superscripts will always appear but the appearance may
  3761    not match author expectations if the font used does not provide the
  3762    appropriate alternate glyph for all characters contained in a subscript or
  3763    superscript.
  3765   <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
  3766    using superscript metrics" src=superscript-alt-synth.png>
  3767    <p class=caption>Superscript alternate glyph (left), synthesized
  3768     superscript glyphs (middle), and incorrect mixture of the two (right)
  3769   </div>
  3771   <p>This property is not cumulative, applying it to subelements within a
  3772    subscript or superscript won't nest the placement of a subscript or
  3773    superscript glyph. Images contained within text runs where the value of
  3774    this property is ‘<code class=property>sub</code>’ or ‘<code
  3775    class=property>super</code>’ will be drawn just as they would if the
  3776    value was ‘<a href="#normal2"><code class=property>normal</code></a>’.
  3777    Likewise, text decorations such as underlines or emphasis marks will
  3778    render in the same position as they would for the default glyphs, since
  3779    this property does not affect the baseline position.
  3781   <p>Because of these limitations, font-variant-position is not recommended
  3782    for use in user agent stylesheets. Authors should use it in cases where
  3783    subscripts or superscripts will only contain the narrow range of
  3784    characters supported by the fonts specified.
  3786   <div class=example>
  3787    <p>A typical user agent default style for the <span class=tag>sub</span>
  3788     element:</p>
  3790    <pre>sub {
  3791   vertical-align: sub;
  3792   font-size: smaller;
  3793   line-height: normal;
  3795 </pre>
  3797    <p>Using font-variant-position to specify typographic subscripts in a way
  3798     that will still show subscripts in older user agents:</p>
  3800    <pre>@supports ( font-variant-position: sub ) {
  3802   sub {
  3803     vertical-align: inherit;
  3804     font-size: 100%;
  3805     line-height: inherit;
  3806     font-variant-position: sub;
  3810 </pre>
  3812    <p>User agents that support the ‘<a
  3813     href="#propdef-font-variant-position"><code
  3814     class=property>font-variant-position</code></a>’ property will select a
  3815     subscript variant glyph and render this without adjusting the baseline or
  3816     font-size. Older user agents will ignore the ‘<a
  3817     href="#propdef-font-variant-position"><code
  3818     class=property>font-variant-position</code></a>’ property definition
  3819     and use the standard defaults for subscripts.</p>
  3820   </div>
  3821   <!-- prop: font-variant-caps -->
  3823   <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
  3824    the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
  3826   <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
  3827    <tbody>
  3828     <tr>
  3829      <td>Name:
  3831      <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
  3833     <tr>
  3834      <td>Value:
  3836      <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
  3837       | unicase | titling-caps
  3839     <tr>
  3840      <td>Initial:
  3842      <td>normal
  3844     <tr>
  3845      <td>Applies to:
  3847      <td>all elements
  3849     <tr>
  3850      <td>Inherited:
  3852      <td>yes
  3854     <tr>
  3855      <td>Percentages:
  3857      <td>N/A
  3859     <tr>
  3860      <td>Media:
  3862      <td>visual
  3864     <tr>
  3865      <td>Computed value:
  3867      <td>as specified
  3869     <tr>
  3870      <td>Animatable:
  3872      <td>no
  3873   </table>
  3875   <p>Specifies control over capitalized forms.
  3877   <p>Individual values have the following meanings:
  3879   <dl>
  3880    <dt><dfn id=normal>normal</dfn>
  3882    <dd>None of the features listed below are enabled.
  3884    <dt><dfn id=small-caps>small-caps</dfn>
  3886    <dd>Enables display of small capitals (OpenType feature: <span
  3887     class=tag>smcp</span>). Small-caps glyphs typically use the form of
  3888     uppercase letters but are reduced to the size of lowercase letters.
  3889   </dl>
  3891   <div class=featex><img alt="small-caps example" src=smcp.png></div>
  3893   <dl>
  3894    <dt><dfn id=all-small-caps>all-small-caps</dfn>
  3896    <dd>Enables display of small capitals for both upper and lowercase letters
  3897     (OpenType features: <span class=tag>c2sc, smcp</span>).
  3899    <dt><dfn id=petite-caps>petite-caps</dfn>
  3901    <dd>Enables display of petite capitals (OpenType feature: <span
  3902     class=tag>pcap</span>).
  3904    <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
  3906    <dd>Enables display of petite capitals for both upper and lowercase
  3907     letters (OpenType features: <span class=tag>c2pc, pcap</span>).
  3909    <dt><dfn id=unicase>unicase</dfn>
  3911    <dd>Enables display of mixture of small capitals for uppercase letters
  3912     with normal lowercase letters (OpenType feature: <span
  3913     class=tag>unic</span>).
  3915    <dt><dfn id=titling-caps>titling-caps</dfn>
  3917    <dd>Enables display of titling capitals (OpenType feature: <span
  3918     class=tag>titl</span>). Uppercase letter glyphs are often designed for
  3919     use with lowercase letters. When used in all uppercase titling sequences
  3920     they can appear too strong. Titling capitals are designed specifically
  3921     for this situation.
  3922   </dl>
  3924   <p>This property allows the selection of alternate glyphs used for small or
  3925    petite capitals or for titling. These glyphs are specifically designed to
  3926    blend well with the surrounding normal glyphs, to maintain the weight and
  3927    readability which suffers when text is simply resized to fit this purpose.
  3929   <p>The availability of these glyphs is based on whether a given feature is
  3930    defined or not in the feature list of the font. User agents can optionally
  3931    decide this on a per-script basis but should explicitly not decide this on
  3932    a per-character basis.
  3934   <p>Some fonts may only support a subset or none of the features described
  3935    for this property. For backwards compatibility with CSS 2.1, if ‘<a
  3936    href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
  3937    href="#all-small-caps"><code class=property>all-small-caps</code></a>’
  3938    is specified but small-caps glyphs are not available for a given font,
  3939    user agents should simulate a small-caps font, for example by taking a
  3940    normal font and replacing the glyphs for lowercase letters with scaled
  3941    versions of the glyphs for uppercase characters (replacing the glyphs for
  3942    both upper and lowercase letters in the case of ‘<a
  3943    href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
  3945   <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
  3946    real small-caps" class=hires src=synthetic-vs-real-small-caps.png
  3947    width=512px>
  3948    <p class=caption>Synthetic vs. real small-caps
  3949   </div>
  3951   <p>To match the surrounding text, a font may provide alternate glyphs for
  3952    caseless characters when these features are enabled but when a user agent
  3953    simulates small capitals, it must not attempt to simulate alternates for
  3954    codepoints which are considered caseless.
  3956   <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
  3957    characters with small-caps, all-small-caps enabled" class=hires
  3958    src=small-capitals-variations.png width=418px>
  3959    <p class=caption>Caseless characters with small-caps, all-small-caps
  3960     enabled
  3961   </div>
  3963   <p>If either ‘<a href="#petite-caps"><code
  3964    class=property>petite-caps</code></a>’ or ‘<a
  3965    href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
  3966    is specified for a font that doesn't support these features, the property
  3967    behaves as if ‘<a href="#small-caps"><code
  3968    class=property>small-caps</code></a>’ or ‘<a
  3969    href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
  3970    respectively, had been specified. If ‘<a href="#unicase"><code
  3971    class=property>unicase</code></a>’ is specified for a font that doesn't
  3972    support that feature, the property behaves as if ‘<a
  3973    href="#small-caps"><code class=property>small-caps</code></a>’ was
  3974    applied only to lowercased uppercase letters. If ‘<a
  3975    href="#titling-caps"><code class=property>titling-caps</code></a>’ is
  3976    specified with a font that does not support this feature, this property
  3977    has no visible effect. When simulated small capital glyphs are used, for
  3978    scripts that lack uppercase and lowercase letters, ‘<a
  3979    href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
  3980    href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
  3981    ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
  3982    ‘<a href="#all-petite-caps"><code
  3983    class=property>all-petite-caps</code></a>’ and ‘<a
  3984    href="#unicase"><code class=property>unicase</code></a>’ have no visible
  3985    effect.
  3987   <p>When casing transforms are used to simulate small capitals, the casing
  3988    transformations should match those used for the <span
  3989    class=property>‘<code class=property>text-transform</code>’</span>
  3990    property.
  3992   <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
  3993    replace glyphs in a small-caps font so that the text appears in all
  3994    uppercase letters.
  3996   <div class=figure style="padding: 0; margin: auto;"><img alt="using
  3997    all-small-caps in acronym-laden text" class=hires
  3998    src=acronym-laden-text.png width=596px>
  3999    <p class=caption>Using small capitals to improve readability in
  4000     acronym-laden text
  4001   </div>
  4003   <div class=example>
  4004    <p>Quotes rendered italicised, with small-caps on the first line:</p>
  4006    <pre>blockquote            { font-style: italic; }
  4007 blockquote:first-line { font-variant: small-caps; }
  4009 &lt;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>&lt;/blockquote>
  4010 </pre>
  4011   </div>
  4012   <!-- prop: font-variant-numeric -->
  4014   <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
  4015    formatting: the <a
  4016    href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
  4018   <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
  4019    <tbody>
  4020     <tr>
  4021      <td>Name:
  4023      <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
  4025     <tr>
  4026      <td>Value:
  4028      <td>normal | [ <a
  4029       href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
  4030       || <a
  4031       href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
  4032       || <a
  4033       href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
  4034       || <a href="#ordinal">ordinal</a> || <a
  4035       href="#slashed-zero">slashed-zero</a> ]
  4037     <tr>
  4038      <td>Initial:
  4040      <td>normal
  4042     <tr>
  4043      <td>Applies to:
  4045      <td>all elements
  4047     <tr>
  4048      <td>Inherited:
  4050      <td>yes
  4052     <tr>
  4053      <td>Percentages:
  4055      <td>N/A
  4057     <tr>
  4058      <td>Media:
  4060      <td>visual
  4062     <tr>
  4063      <td>Computed value:
  4065      <td>as specified
  4067     <tr>
  4068      <td>Animatable:
  4070      <td>no
  4071   </table>
  4073   <p>Specifies control over numerical forms.
  4075   <pre
  4076    class=prod><dfn id=numeric-figure-values><var>&lt;numeric-figure-values&gt;</var></dfn>   = [ <a href="#lining-nums">lining-nums</a> | <a href="#oldstyle-nums">oldstyle-nums</a> ]</pre>
  4078   <pre
  4079    class=prod><dfn id=numeric-spacing-values><var>&lt;numeric-spacing-values&gt;</var></dfn>  = [ <a href="#proportional-nums">proportional-nums</a> | <a href="#tabular-nums">tabular-nums</a> ]</pre>
  4081   <pre
  4082    class=prod><dfn id=numeric-fraction-values><var>&lt;numeric-fraction-values&gt;</var></dfn> = [ <a href="#diagonal-fractions">diagonal-fractions</a> | <a href="#stacked-fractions">stacked-fractions</a> ]</pre>
  4084   <p>Individual values have the following meanings:
  4086   <dl>
  4087    <dt><dfn id=normal0>normal</dfn>
  4089    <dd>None of the features listed below are enabled.
  4091    <dt><dfn id=lining-nums>lining-nums</dfn>
  4093    <dd>Enables display of lining numerals (OpenType feature: <span
  4094     class=tag>lnum</span>).
  4096    <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
  4098    <dd>Enables display of old-style numerals (OpenType feature: <span
  4099     class=tag>onum</span>).
  4101    <dt><dfn id=proportional-nums>proportional-nums</dfn>
  4103    <dd>Enables display of proportional numerals (OpenType feature: <span
  4104     class=tag>pnum</span>).
  4106    <dt><dfn id=tabular-nums>tabular-nums</dfn>
  4108    <dd>Enables display of tabular numerals (OpenType feature: <span
  4109     class=tag>tnum</span>).
  4110   </dl>
  4112   <p>The example below shows how these different properties can be combined
  4113    to influence the rendering of tabular data with fonts that support these
  4114    features. Within normal paragraph text, proportional numbers are used
  4115    while tabular numbers are used so that columns of numbers line up
  4116    properly:
  4118   <div class=figure style="padding: 0; margin: auto;"><img alt="combining
  4119    number styles" src=numberstyles.png>
  4120    <p class=caption>Using number styles
  4121   </div>
  4123   <dl>
  4124    <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
  4126    <dd>Enables display of lining diagonal fractions (OpenType feature: <span
  4127     class=tag>frac</span>).
  4128   </dl>
  4130   <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
  4132   <dl>
  4133    <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
  4135    <dd>Enables display of lining stacked fractions (OpenType feature: <span
  4136     class=tag>afrc</span>).
  4137   </dl>
  4139   <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
  4141   <dl>
  4142    <dt><dfn id=ordinal>ordinal</dfn>
  4144    <dd>Enables display of forms used with ordinal numbers (OpenType feature:
  4145     <span class=tag>ordn</span>).
  4147    <dt><dfn id=slashed-zero>slashed-zero</dfn>
  4149    <dd>Enables display of slashed zeros (OpenType feature: <span
  4150     class=tag>zero</span>).
  4151   </dl>
  4153   <div class=featex><img alt="slashed zero example" src=zero.png></div>
  4155   <div class=example id=steak-marinade>
  4156    <p>A simple flank steak marinade recipe, rendered with automatic fractions
  4157     and old-style numerals:</p>
  4159    <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
  4161 &lt;h4>Steak marinade:&lt;/h4>
  4162 &lt;ul>
  4163   &lt;li>&lt;span class="amount">2&lt;/span> tbsp olive oil&lt;/li>
  4164   &lt;li>&lt;span class="amount">1&lt;/span> tbsp lemon juice&lt;/li>
  4165   &lt;li>&lt;span class="amount">1&lt;/span> tbsp soy sauce&lt;/li>
  4166   &lt;li>&lt;span class="amount">1 1/2&lt;/span> tbsp dry minced onion&lt;/li>
  4167   &lt;li>&lt;span class="amount">2 1/2&lt;/span> tsp italian seasoning&lt;/li>
  4168   &lt;li>Salt &amp;amp; pepper&lt;/li>
  4169 &lt;/ul>
  4171 &lt;p>Mix the meat with the marinade and let it sit covered in the refrigerator
  4172 for a few hours or overnight.&lt;/p>
  4173 </pre>
  4174   </div>
  4175   <!-- prop: font-variant-alternates -->
  4177   <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
  4178    and swashes: the <a
  4179    href="#propdef-font-variant-alternates">font-variant-alternates</a>
  4180    property</h3>
  4182   <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
  4183    <tbody>
  4184     <tr>
  4185      <td>Name:
  4187      <td><dfn
  4188       id=propdef-font-variant-alternates>font-variant-alternates</dfn>
  4190     <tr>
  4191      <td>Value:
  4193      <td>normal | [ <a href="#stylistic"
  4194       title=stylistic>stylistic(&lt;feature-value-name&gt;)</a> || <a
  4195       href="#historical-forms">historical-forms</a> || <a href="#styleset"
  4196       title=styleset>styleset(&lt;feature-value-name&gt; #)</a> || <a
  4197       href="#character-variant"
  4198       title=character-variant>character-variant(&lt;feature-value-name&gt;
  4199       #)</a> || <a href="#swash"
  4200       title=swash>swash(&lt;feature-value-name&gt;)</a> || <a
  4201       href="#ornaments"
  4202       title=ornaments>ornaments(&lt;feature-value-name&gt;)</a> || <a
  4203       href="#annotation"
  4204       title=annotation>annotation(&lt;feature-value-name&gt;)</a> ]
  4206     <tr>
  4207      <td>Initial:
  4209      <td>normal
  4211     <tr>
  4212      <td>Applies to:
  4214      <td>all elements
  4216     <tr>
  4217      <td>Inherited:
  4219      <td>yes
  4221     <tr>
  4222      <td>Percentages:
  4224      <td>N/A
  4226     <tr>
  4227      <td>Media:
  4229      <td>visual
  4231     <tr>
  4232      <td>Computed value:
  4234      <td>as specified
  4236     <tr>
  4237      <td>Animatable:
  4239      <td>no
  4240   </table>
  4242   <p>For any given character, fonts can provide a variety of alternate glyphs
  4243    in addition to the default glyph for that character. This property
  4244    provides control over the selection of these alternate glyphs.
  4246   <p>In cases where multiple alternates are possible, authors define a
  4247    <code>&lt;feature-value-name&gt;</code> using the
  4248    <code>@font-feature-values</code> rule described below to indicate the
  4249    specific alternate to be used. The nature of these alternates is font
  4250    specific, so the rule defines values for a specific font family or set of
  4251    families. When a particular value has not been defined for a given family,
  4252    the named value is treated as if the feature had omitted from the style
  4253    rule. If a given value is outside the range supported by a given font, the
  4254    value is ignored. These values never apply to generic font families, nor
  4255    to families selected as part of system font fallback. Values that behave
  4256    this way are marked as <em>font specific</em>.
  4258   <p>Individual values have the following meanings:
  4260   <dl>
  4261    <dt><dfn id=normal1>normal</dfn>
  4263    <dd>None of the features listed below are enabled.
  4265    <dt><dfn id=stylistic
  4266     title=stylistic>stylistic(&lt;feature-value-name&gt;)</dfn>
  4268    <dd>Enables display of stylistic alternates (<em>font specific</em>,
  4269     OpenType feature: <span class=tag>salt
  4270     &lt;feature-value-name&gt;</span>).
  4271   </dl>
  4273   <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
  4275   <dl>
  4276    <dt><dfn id=historical-forms>historical-forms</dfn>
  4278    <dd>Enables display of historical forms (OpenType feature: <span
  4279     class=tag>hist</span>).
  4280   </dl>
  4282   <div class=featex><img alt="historical form example" src=hist.png></div>
  4284   <dl>
  4285    <dt><dfn id=styleset title=styleset>styleset(&lt;feature-value-name&gt;
  4286     #)</dfn>
  4288    <dd>Enables display with stylistic sets (<em>font specific</em>, OpenType
  4289     feature: <span class=tag>ss&lt;feature-index&gt;</span> OpenType
  4290     currently defines <span class=tag>ss01</span> through <span
  4291     class=tag>ss20</span>).
  4292   </dl>
  4294   <div class=featex><img alt="styleset example" src=ssnn.png></div>
  4296   <dl>
  4297    <dt><dfn id=character-variant
  4298     title=character-variant>character-variant(&lt;feature-value-name&gt;
  4299     #)</dfn>
  4301    <dd>Enables display of specific character variants (<em>font
  4302     specific</em>, OpenType feature: <span
  4303     class=tag>cv&lt;feature-index&gt;</span> OpenType currently defines <span
  4304     class=tag>cv01</span> through <span class=tag>cv99</span>).
  4306    <dt><dfn id=swash title=swash>swash(&lt;feature-value-name&gt;)</dfn>
  4308    <dd>Enables display of swash glyphs (<em>font specific</em>, OpenType
  4309     feature: <span class=tag>swsh &lt;feature-index&gt;, cswh
  4310     &lt;feature-index&gt;</span>).
  4311   </dl>
  4313   <div class=featex><img alt="swash example" src=swsh.png></div>
  4315   <dl>
  4316    <dt><dfn id=ornaments
  4317     title=ornaments>ornaments(&lt;feature-value-name&gt;)</dfn>
  4319    <dd>Enables replacement of default glyphs with ornaments, if provided in
  4320     the font (<em>font specific</em>, OpenType feature: <span class=tag>ornm
  4321     &lt;feature-index&gt;</span>). Some fonts may offer ornament glyphs as
  4322     alternates for a wide collection of characters; however, displaying
  4323     arbitrary characters (e.g., alphanumerics) as ornaments is poor practice
  4324     as it distorts the semantics of the data. Font designers are encouraged
  4325     to encode all ornaments (except those explicitly encoded in the Unicode
  4326     Dingbats blocks, etc.) as alternates for the bullet character (U+2022) to
  4327     allow authors to select the desired glyph using
  4328     &lt;feature-value-name&gt;.
  4329   </dl>
  4331   <div class=featex><img alt="ornaments example" src=ornm.png></div>
  4333   <dl>
  4334    <dt><dfn id=annotation
  4335     title=annotation>annotation(&lt;feature-value-name&gt;)</dfn>
  4337    <dd>Enables display of alternate annotation forms (<em>font specific</em>,
  4338     OpenType feature: <span class=tag>nalt &lt;feature-index&gt;</span>).
  4339   </dl>
  4341   <div class=featex><img alt="alternate annotation form example"
  4342    src=nalt.png></div>
  4344   <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
  4345    specific alternates: the <code>@font-feature-values</code> rule</h3>
  4347   <p>Several of the possible values of ‘<a
  4348    href="#propdef-font-variant-alternates"><code
  4349    class=property>font-variant-alternates</code></a>’ listed above are
  4350    labeled as "font specific". For these features fonts may define not just a
  4351    single glyph but a set of alternate glyphs with an index to select a given
  4352    alternate. Since these are font family specific, the
  4353    <code>@font-feature-values</code> rule is used to define named-values for
  4354    these indices for a given family.
  4356   <p>In the case of the swash Q in the example shown above, the swash could
  4357    be specified using these style rules:
  4359   <pre>
  4361 @font-feature-values Jupiter Sans {
  4362   @swash {
  4363     delicate: 1;
  4364     flowing: 2;
  4368 h2 { font-family: Jupiter Sans, sans-serif; }
  4370 /* show the second swash variant in h2 headings */
  4371 h2:first-letter { font-variant-alternates: swash(flowing); }
  4373 &lt;h2>Quick&lt;/h2></pre>
  4375   <p>When Jupiter Sans is present, the second alternate swash alternate will
  4376    be displayed. When not present, no swash character will be shown, since
  4377    the specific named-value "flowing" is only defined for the Jupiter Sans
  4378    family. The @-mark indicates the name of the property value for which a
  4379    named-value can be used. The name "flowing" is chosen by the author, the
  4380    values specified within a given font's data.
  4382   <p>In terms of the grammar, this specification defines the following
  4383    productions:</p>
  4384   <!--
  4385 <pre><dfn>supports_rule</dfn>
  4386   : <i>SUPPORTS_SYM</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>group_rule_body</i>
  4389 <dfn>supports_condition</dfn>
  4390   : <i>supports_negation</i> | <i>supports_conjunction</i> | <i>supports_disjunction</i> |
  4391     <i>supports_condition_in_parens</i>
  4394 <dfn>supports_condition_in_parens</dfn>
  4395   : ( '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <i>supports_condition</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* ')' ) | <i>supports_declaration_condition</i> |
  4396     <i>general_enclosed</i>
  4399 <dfn>supports_negation</dfn>
  4400   : <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>NOT</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i>
  4403 <dfn>supports_conjunction</dfn>
  4404   : <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <a href="http://www.w3.org/TR/css3-mediaqueries/#syntax"><i>AND</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
  4407 <dfn>supports_disjunction</dfn>
  4408   : <i>supports_condition_in_parens</i> ( <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>OR</i> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>+ <i>supports_condition_in_parens</i> )+
  4411 <dfn>supports_declaration_condition</dfn>
  4412   : '(' <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>* <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>declaration</i></a> ')'
  4415 <dfn>general_enclosed</dfn>
  4416   : ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>FUNCTION</i></a> | '(' ) ( <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>any</i></a> | <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>unused</i></a> )* ')'
  4418 </pre>
  4420 -->
  4422   <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
  4423   : <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>*
  4424     '{' <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>*
  4427 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
  4428   : <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> ]*
  4431 <dfn id=fontfamilyname>font_family_name</dfn>
  4432   : <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> ]* ]
  4435 <dfn id=featurevalueblock>feature_value_block</dfn>
  4436   : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
  4437     '{' <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>*
  4440 <dfn id=featuretype>feature_type</dfn>:
  4441   <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
  4444 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
  4445   : <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> ]*
  4447 </pre>
  4449   <p>The following new token is introduced:
  4451   <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>;}
  4452 </pre>
  4454   <p>Feature value blocks are treated <a
  4455    href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">similar to
  4456    at-rules</a>, they consist of everything up to the next block or
  4457    semi-colon, whichever comes first.
  4459   <p>Font feature values rules define a set of values for a specific font
  4460    feature as used for a given set of families. Effectively, they define a
  4461    mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
  4462    ⟨values⟩ are the indices used for specific features defined for a
  4463    given font.
  4465   <p>The font family list uses the same syntax as that used for the ‘<a
  4466    href="#descdef-font-family"><code class=property>font-family</code></a>’
  4467    property. Within feature value blocks, the feature type is ‘<code
  4468    class=css>@</code>’ followed by the name of the font-specific property
  4469    value (e.g. <a href="#swash"><code>@swash</code></a>). The feature type
  4470    must match, using an ASCII case-insensitive comparison, one of the
  4471    <em>font specific</em> values of the <a
  4472    href="#propdef-font-variant-alternates"><code>font-variant-alternates</code></a>
  4473    property. The values associated with a given idenitifier are limited to
  4474    integer values 0 or greater.
  4476   <p>If syntax errors occur within the font family list, the entire rule must
  4477    be ignored. When syntax errors occur within a feature value definition,
  4478    such as invalid identifiers or values, the entire feature value definition
  4479    must be omitted, similar to the way syntax errors in style declarations
  4480    are handled. When the <code>&lt;feature-type></code> is invalid, the
  4481    entire associated feature value block must be ignored.
  4483   <pre>@font-feature-values Bongo {
  4484   @swash { ornate: 1; }
  4485   annotation { boxed: 4; } /* should be @annotation! */
  4486   @swash { double-loops: 1; flowing: -1; } /* negative value */
  4487   @ornaments ; /* incomplete definition */
  4488   @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
  4489   <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none;">redrum</a>  /* random editing mistake */
  4490 }</pre>
  4492   <p>The example above is equivalent to:
  4494   <pre>@font-feature-values Bongo {
  4495   @swash { ornate: 1; }
  4496   @swash { double-loops: 1; }
  4497   @styleset { double-W: 14; sharp-terminals: 16 1; }
  4498 }</pre>
  4500   <p>If multiple <code>@font-feature-values</code> rules are defined for a
  4501    given family, the resulting values defined are the union of these rules.
  4502    This allows a set of named-values to be defined for a given font family
  4503    globally for a site and specific additions made per-page. If the same
  4504    &lt;feature-value-name&gt; is defined mulitple times for a given
  4505    font-variant value, the last defined value is used.
  4507   <pre>
  4508 site.css:
  4510   @font-feature-values Mercury Serif {
  4511     @styleset {
  4512       stacked-g: 3; /* "two-storey" versions of g, a */
  4513       stacked-a: 4;
  4517 page.css:
  4519   @font-feature-values Mercury Serif {
  4520     @styleset {
  4521       geometric-m: 7; /* alternate version of m */
  4525   body {
  4526     font-family: Mercury Serif, serif;
  4528     /* enable both the use of stacked g and alternate m */
  4529     font-variant-alternates: styleset(stacked-g, geometric-m);
  4530   }</pre>
  4532   <p>Only named font families are allowed for &lt;font-family&gt;, rules that
  4533    include generic or system fonts in the list of font families are
  4534    considered syntax errors and the contents of the rules are ignored.
  4535    However, if a user agent defines a generic font to be a specific named
  4536    font (e.g. Helvetica), the settings associated with that family name will
  4537    be used.
  4539   <p>For &lt;font-variant-property-value>, only font specific property value
  4540    names supported by the ‘<a href="#propdef-font-variant"><code
  4541    class=property>font-variant</code></a>’ property are recognized,
  4542    definitions for other value names cause a syntax error and are ignored.
  4543    Each property value that is font specific is clearly marked as such.
  4544    Feature value names follow the rules of CSS user identifiers and are
  4545    case-sensitive. They are unique only for a given set of font families and
  4546    font-variant property value; the same identifier used with a different
  4547    font-variant property value is treated as a separate and distinct value.
  4549   <p>Using a commonly named value allows authors to use a single style rule
  4550    to cover a set of fonts for which the underlying selector is different for
  4551    each font. If either font in the example below is found, a circled number
  4552    glyph will be used:
  4554   <pre>@font-feature-values Taisho Gothic {
  4555   @annotation { boxed: 1; circled: 4; }
  4558 @font-feature-values Otaru Kisa {
  4559   @annotation { circled: 1; black-boxed: 3; }
  4562 h3.title {
  4563   /* circled form defined for both fonts */
  4564   font-family: Taisho Gothic, Otaru Kisa;
  4565   font-variant: annotation(circled);
  4566 }</pre>
  4568   <p>Most font specific font-variant property values take a single value
  4569    (e.g. swash). The character-variant property value allows two values and
  4570    styleset allows an unlimited number. If a larger number of values are
  4571    assigned to a given name, a syntax error occurs and the entire
  4572    &lt;font-feature-values-declaration&gt; is ignored.
  4574   <p>For the styleset property value, multiple values indicate the style sets
  4575    to be enabled. Values between 1 and 99 enable OpenType features <span
  4576    class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
  4577    OpenType standard only officially defines <span class=tag>ss01</span>
  4578    through <span class=tag>ss20</span>. Values greater than 99 or equal to 0
  4579    are ignored but do not generate a syntax error when parsed.
  4581   <pre>@font-feature-values Mars Serif {
  4582   @styleset { 
  4583     alt-g: 1;        /* implies ss01 = 1 */
  4584     curly-quotes: 3; /* implies ss03 = 1 */
  4585     code: 4 5;       /* implies ss04 = 1, ss05 = 1 */
  4588   @styleset {
  4589     dumb: 125;        /* &gt;99, ignored */
  4592   @swash {
  4593     swishy: 3 5;     /* more than 1 value for swash, syntax error */
  4597 p.codeblock {
  4598   /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
  4599   font-variant-alternates: styleset(curly-quotes, code);
  4600 }</pre>
  4602   <p>For character-variant, a single value between 1 and 99 indicates the
  4603    enabling of OpenType feature <span class=tag>cv01</span> through <span
  4604    class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
  4605    to 0 are ignored but do not generate a syntax error when parsed. When two
  4606    values are listed, the first value indicates the feature used and the
  4607    second the value passed for that feature. When two value names imply
  4608    different settings for the same underlying feature the last setting is
  4609    used.
  4611   <pre>@font-feature-values MM Greek {
  4612   @character-variant { alpha-2: 1 2; }   /* implies cv01 = 2 */
  4613   @character-variant { beta-3: 2 3; }    /* implies cv02 = 3 */
  4614   @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, ignored */
  4615   @character-variant { gamma: 12; }      /* implies cv12 = 1 */
  4616   @character-variant { zeta:   20 3; }   /* implies cv20 = 3 */
  4617   @character-variant { zeta-2: 20 2; }   /* implies cv20 = 2 */
  4618   @character-variant { silly: 105; }     /* &gt;99, ignored */
  4619   @character-variant { dumb: 323 3; }    /* &gt;99, ignored */
  4622 #title {
  4623   /* use the third alternate beta, first alternate gamma */
  4624   font-variant-alternates: character-variant(beta-3, gamma);
  4627 p {
  4628   /* zeta-2 follows zeta, implies cv20 = 2  */
  4629   font-variant-alternates: character-variant(zeta, zeta-2);
  4632 .special {
  4633   /* zeta follows zeta-2, implies cv20 = 3  */
  4634   font-variant-alternates: character-variant(zeta-2, zeta);
  4635 }</pre>
  4637   <p>See the <a href="#om-fontfeaturevalues">object model reference
  4638    section</a> for a description of the interfaces used to modify these rules
  4639    via the CSS Object Model.
  4641   <div class=figure><img alt="Matching text on Byzantine seals using
  4642    character variants" src=byzantineseal.png>
  4643    <p class=caption>Byzantine seal text displayed with character variants
  4644   </div>
  4646   <div class=example>
  4647    <p>In the figure above, the text in red is rendered using a font
  4648     containing character variants that mimic the character forms found on a
  4649     Byzantine seal from the 8th century A.D. Two lines below is the same text
  4650     displayed in a font without variants. Note the two variants for U and N
  4651     used on the seal.</p>
  4653    <pre>@font-feature-values Athena Ruby {
  4654   @character-variant {
  4655     leo-B: 2 1;
  4656     leo-M: 13 3;
  4657     leo-alt-N: 14 1;
  4658     leo-N: 14 2;
  4659     leo-T: 20 1; 
  4660     leo-U: 21 2;
  4661     leo-alt-U: 21 4;
  4665 p {
  4666   font-variant: discretionary-ligatures,
  4667                 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
  4670 span.alt-N { 
  4671   font-variant-alternates: character-variant(leo-alt-N);
  4674 span.alt-U {
  4675   font-variant-alternates: character-variant(leo-alt-U);
  4678 &lt;p>ENO....UP͞RSTU&lt;span class="alt-U">U&lt;/span>͞&lt;span class="alt-U">U&lt;/span>ΚΑΙTỤẠG̣IUPNS&lt;/p>
  4680 &lt;p>LEON|ΚΑΙCONSTA|NTI&lt;span class="alt-N">N&lt;/span>OS..|STOIBAṢ.|LIṢROM|AIO&lt;span class="alt-N">N&lt;/span>&lt;/p> 
  4681 </pre>
  4682   </div>
  4684   <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
  4685    Asian text rendering: the <a
  4686    href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
  4687    property</h3>
  4689   <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
  4690    <tbody>
  4691     <tr>
  4692      <td>Name:
  4694      <td><dfn
  4695       id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
  4697     <tr>
  4698      <td>Value:
  4700      <td>normal | [ <a
  4701       href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
  4702       || <a
  4703       href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
  4704       || <a href="#ruby">ruby</a> ]
  4706     <tr>
  4707      <td>Initial:
  4709      <td>normal
  4711     <tr>
  4712      <td>Applies to:
  4714      <td>all elements
  4716     <tr>
  4717      <td>Inherited:
  4719      <td>yes
  4721     <tr>
  4722      <td>Percentages:
  4724      <td>N/A
  4726     <tr>
  4727      <td>Media:
  4729      <td>visual
  4731     <tr>
  4732      <td>Computed value:
  4734      <td>as specified
  4736     <tr>
  4737      <td>Animatable:
  4739      <td>no
  4740   </table>
  4742   <p>Allows control of glyph substitution and sizing in East Asian text.
  4744   <pre
  4745    class=prod><dfn id=east-asian-variant-values><var>&lt;east-asian-variant-values&gt;</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>
  4747   <pre
  4748    class=prod><dfn id=east-asian-width-values><var>&lt;east-asian-width-values&gt;</var></dfn>   = [ <a href="#full-width">full-width</a> | <a href="#proportional-width">proportional-width</a> ]</pre>
  4750   <p>Individual values have the following meanings:
  4752   <dl>
  4753    <dt><dfn id=normal2>normal</dfn>
  4755    <dd>None of the features listed below are enabled.
  4757    <dt><dfn id=jis78>jis78</dfn>
  4759    <dd>Enables rendering of JIS78 forms (OpenType feature: <span
  4760     class=tag>jp78</span>).
  4761   </dl>
  4763   <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
  4765   <dl>
  4766    <dt><dfn id=jis83>jis83</dfn>
  4768    <dd>Enables rendering of JIS83 forms (OpenType feature: <span
  4769     class=tag>jp83</span>).
  4771    <dt><dfn id=jis90>jis90</dfn>
  4773    <dd>Enables rendering of JIS90 forms (OpenType feature: <span
  4774     class=tag>jp90</span>).
  4776    <dt><dfn id=jis04>jis04</dfn>
  4778    <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
  4779     class=tag>jp04</span>).
  4780     <p>The various JIS variants reflect the glyph forms defined in different
  4781      Japanese national standards. Fonts generally include glyphs defined by
  4782      the most recent national standard but it's sometimes necessary to use
  4783      older variants, to match signage for example.</p>
  4785    <dt><dfn id=simplified>simplified</dfn>
  4787    <dd>Enables rendering of simplified forms (OpenType feature: <span
  4788     class=tag>smpl</span>).
  4789     <p>The ‘<a href="#simplified"><code
  4790      class=property>simplified</code></a>’ and ‘<a
  4791      href="#traditional"><code class=property>traditional</code></a>’
  4792      values allow control over the glyph forms for characters which have been
  4793      simplified over time but for which the older, traditional form is still
  4794      used in some contexts. The exact set of characters and glyph forms will
  4795      vary to some degree by context for which a given font was designed.</p>
  4797    <dt><dfn id=traditional>traditional</dfn>
  4799    <dd>Enables rendering of traditional forms (OpenType feature: <span
  4800     class=tag>trad</span>).
  4801   </dl>
  4803   <div class=featex><img alt="tradtional form example" src=trad.png></div>
  4805   <dl>
  4806    <dt><dfn id=full-width>full-width</dfn>
  4808    <dd>Enables rendering of full-width variants (OpenType feature: <span
  4809     class=tag>fwid</span>).
  4811    <dt><dfn id=proportional-width>proportional-width</dfn>
  4813    <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
  4814     <span class=tag>pwid</span>).
  4815   </dl>
  4817   <div class=featex><img alt="proportionally spaced Japanese example"
  4818    src=pwid.png></div>
  4820   <dl>
  4821    <dt><dfn id=ruby>ruby</dfn>
  4823    <dd>Enables display of ruby variant glyphs (OpenType feature: <span
  4824     class=tag>ruby</span>). Since ruby text is generally smaller than the
  4825     associated body text, font designers can design special glyphs for use
  4826     with ruby that are more readable than scaled down versions of the default
  4827     glyphs. Only glyph selection is affected, there is no associated font
  4828     scaling or other change that affects line layout. The red ruby text below
  4829     is shown with default glyphs (top) and with ruby variant glyphs (bottom).
  4830     Note the slight difference in stroke thickness.
  4831   </dl>
  4833   <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
  4835   <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
  4836    for font rendering: the <a href="#propdef-font-variant">font-variant</a>
  4837    property</h3>
  4839   <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
  4840    <tbody>
  4841     <tr>
  4842      <td>Name:
  4844      <td><dfn id=propdef-font-variant>font-variant</dfn>
  4846     <tr>
  4847      <td>Value:
  4849      <td>normal | none | [ <a
  4850       href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a> ||
  4851       <a
  4852       href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
  4853       || <a
  4854       href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
  4855       || <a
  4856       href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
  4857       || <a href="#stylistic"><var
  4858       title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
  4859       href="#historical-forms"><var>historical-forms</var></a> || <a
  4860       href="#styleset"><var
  4861       title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
  4862       href="#character-variant"><var
  4863       title=character-variant>character-variant(&lt;feature-value-name&gt;
  4864       #)</var></a> || <a href="#swash"><var
  4865       title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
  4866       href="#ornaments"><var
  4867       title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
  4868       href="#annotation"><var
  4869       title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
  4870       <a href="#small-caps"><i>small-caps</i></a> | <a
  4871       href="#all-small-caps"><i>all-small-caps</i></a> | <a
  4872       href="#petite-caps"><i>petite-caps</i></a> | <a
  4873       href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
  4874       href="#unicase"><i>unicase</i></a> | <a
  4875       href="#titling-caps"><i>titling-caps</i></a> ] || <a
  4876       href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
  4877       || <a
  4878       href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
  4879       || <a
  4880       href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
  4881       || <a href="#ordinal"><i>ordinal</i></a> || <a
  4882       href="#slashed-zero"><i>slashed-zero</i></a> || <a
  4883       href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
  4884       || <a
  4885       href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
  4886       || <a href="#ruby"><i>ruby</i></a> ]
  4888     <tr>
  4889      <td>Initial:
  4891      <td>normal
  4893     <tr>
  4894      <td>Applies to:
  4896      <td>all elements
  4898     <tr>
  4899      <td>Inherited:
  4901      <td>yes
  4903     <tr>
  4904      <td>Percentages:
  4906      <td>see individual properties
  4908     <tr>
  4909      <td>Media:
  4911      <td>visual
  4913     <tr>
  4914      <td>Computed value:
  4916      <td>see individual properties
  4918     <tr>
  4919      <td>Animatable:
  4921      <td>see individual properties
  4922   </table>
  4924   <p>The value ‘<a href="#normal2"><code
  4925    class=property>normal</code></a>’ resets all other font feature
  4926    properties to their inital value. The ‘<code
  4927    class=property>none</code>’ value sets ‘<a
  4928    href="#propdef-font-variant-ligatures"><code
  4929    class=property>font-variant-ligatures</code></a>’ to ‘<code
  4930    class=property>none</code>’ and resets all other font feature properties
  4931    to their initial value. Like other shorthands, using ‘<a
  4932    href="#propdef-font-variant"><code
  4933    class=property>font-variant</code></a>’ resets unspecified font-variant
  4934    subproperties to their initial values. It does not reset the values of
  4935    either ‘<a href="#propdef-font-language-override"><code
  4936    class=property>font-language-override</code></a>’ or ‘<a
  4937    href="#propdef-font-feature-settings"><code
  4938    class=property>font-feature-settings</code></a>’.
  4940   <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
  4941    font feature settings control: the <a
  4942    href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
  4944   <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
  4945    <tbody>
  4946     <tr>
  4947      <td>Name:
  4949      <td><dfn id=propdef-font-feature-settings>font-feature-settings</dfn>
  4951     <tr>
  4952      <td>Value:
  4954      <td>normal | <a
  4955       href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
  4957     <tr>
  4958      <td>Initial:
  4960      <td>normal
  4962     <tr>
  4963      <td>Applies to:
  4965      <td>all elements
  4967     <tr>
  4968      <td>Inherited:
  4970      <td>yes
  4972     <tr>
  4973      <td>Percentages:
  4975      <td>N/A
  4977     <tr>
  4978      <td>Media:
  4980      <td>visual
  4982     <tr>
  4983      <td>Computed value:
  4985      <td>as specified
  4987     <tr>
  4988      <td>Animatable:
  4990      <td>no
  4991   </table>
  4993   <p>This property provides low-level control over OpenType font features. It
  4994    is intended as a way of providing access to font features that are not
  4995    widely used but are needed for a particular use case. A value of ‘<a
  4996    href="#normal2"><code class=property>normal</code></a>’ means that no
  4997    change in glyph selection or positioning occurs due to this property.
  4999   <p>
  5001   <pre>/* enable small caps and use second swash alternate */
  5002 font-feature-settings: "smcp", "swsh" 2;</pre>
  5004   <p>Feature tag values have the following syntax:
  5006   <pre
  5007    class=prod><dfn id=feature-tag-value><var>&lt;feature-tag-value&gt;</var></dfn> = &lt;string&gt; [ &lt;integer&gt; | on | off ]?</pre>
  5009   <p>The &lt;string&gt; is a case-sensitive OpenType feature tag. As
  5010    specified in the OpenType specification, feature tags contain four ASCII
  5011    characters. Tag strings longer or shorter than four characters, or
  5012    containing characters outside the U+20–7E codepoint range are invalid.
  5013    User agents must not use a feature tag created by truncating or padding
  5014    the string to four characters. Feature tags need only match a feature tag
  5015    defined in the font, they are not limited to explicitly registered
  5016    OpenType features. Fonts defining custom feature tags should follow the <a
  5017    href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
  5018    rules</a> defined in the OpenType specification <a
  5019    href="#OPENTYPE-FEATURES"
  5020    rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
  5021    Feature tags not present in the font are ignored; a user agent must not
  5022    attempt to synthesize fallback behavior based on these feature tags.
  5024   <p>This means that explicitly disabling the <span class=tag>kern</span>
  5025    feature will not affect the application of kerning data found in the
  5026    ‘<code class=property>kern</code>’ table (as opposed to kerning data
  5027    associated with the <span class=tag>kern</span> feature in the ‘<code
  5028    class=property>GPOS</code>’ table). Authors should use the ‘<a
  5029    href="#propdef-font-kerning"><code
  5030    class=property>font-kerning</code></a>’ property to explictly enable or
  5031    disable kerning since this property affects both types of kerning.
  5033   <p>If present, a value indicates an index used for glyph selection. An
  5034    &lt;integer&gt; value must be 0 or greater. A value of 0 indicates that
  5035    the feature is disabled. For boolean features, a value of 1 enables the
  5036    feature. For non-boolean features, a value of 1 or greater enables the
  5037    feature and indicates the feature selection index. A value of ‘<code
  5038    class=property>on</code>’ is synonymous with 1 and ‘<code
  5039    class=property>off</code>’ is synonymous with 0. If the value is
  5040    omitted, a value of 1 is assumed.
  5042   <pre>
  5043 font-feature-settings: "dlig" 1;       /* dlig=1 enable discretionary ligatures */
  5044 font-feature-settings: "smcp" on;      /* smcp=1 enable small caps */
  5045 font-feature-settings: 'c2sc';         /* c2sc=1 enable caps to small caps */
  5046 font-feature-settings: "liga" off;     /* liga=0 no common ligatures */
  5047 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
  5048 font-feature-settings: "tnum" "hist";  /* invalid, need a comma-delimited list */
  5049 font-feature-settings: "palin" off;    /* good idea but invalid tagname */
  5050 font-feature-settings: "PKRN";         /* PKRN=1 enable custom feature */
  5051 font-feature-settings: dlig;           /* invalid, tag must be a string */
  5052 </pre>
  5054   <p>When values greater than the range supported by the font are specified,
  5055    the behavior is explicitly undefined. For boolean features, in general
  5056    these will enable the feature. For non-boolean features, out of range
  5057    values will in general be equivalent to a 0 value. However, in both cases
  5058    the exact behavior will depend upon the way the font is designed
  5059    (specifically, which type of lookup is used to define the feature).
  5061   <p>Authors should generally use ‘<a href="#propdef-font-variant"><code
  5062    class=property>font-variant</code></a>’ and its related subproperties
  5063    whenever possible and only use this property for special cases where its
  5064    use is the only way of accessing a particular infrequently used font
  5065    feature.
  5067   <p>Although specifically defined for OpenType feature tags, feature tags
  5068    for other modern font formats that support font features may be added in
  5069    the future. Where possible, features defined for other font formats should
  5070    attempt to follow the pattern of registered OpenType tags.
  5072   <div class=example>
  5073    <p>The Japanese text below will be rendered with half-width kana
  5074     characters:</p>
  5076    <pre lang=ja>
  5077 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
  5079 &lt;p>毎日<a href="http://images.google.com/images?q=%E3%82%AB%E3%83%AC%E3%83%BC" style="text-decoration: none;">カレー</a>食べてるのに、飽きない&lt;/p>
  5080 </pre>
  5081   </div>
  5083   <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
  5084    language override: the <a
  5085    href="#propdef-font-language-override">font-language-override</a> property</h3>
  5087   <table class=propdef id=namefont-language-overridevaluenormal-lt>
  5088    <tbody>
  5089     <tr>
  5090      <td>Name:
  5092      <td><dfn id=propdef-font-language-override>font-language-override</dfn>
  5094     <tr>
  5095      <td>Value:
  5097      <td>normal | &lt;string&gt;
  5099     <tr>
  5100      <td>Initial:
  5102      <td>normal
  5104     <tr>
  5105      <td>Applies to:
  5107      <td>all elements
  5109     <tr>
  5110      <td>Inherited:
  5112      <td>yes
  5114     <tr>
  5115      <td>Percentages:
  5117      <td>N/A
  5119     <tr>
  5120      <td>Media:
  5122      <td>visual
  5124     <tr>
  5125      <td>Computed value:
  5127      <td>as specified
  5129     <tr>
  5130      <td>Animatable:
  5132      <td>no
  5133   </table>
  5135   <p>The value of ‘<a href="#normal2"><code
  5136    class=property>normal</code></a>’ implies that when rendering with
  5137    OpenType fonts the language of the document is used to infer the OpenType
  5138    language system, used to select language specific features when rendering.
  5139    The value of the &lt;string&gt; is a single three-letter OpenType <a
  5140    href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
  5141    system tag</a>, defined in the layout tag registry of the OpenType
  5142    specification.
  5144   <div class=example>
  5145    <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
  5146     Declaration of Human Rights</a> has been translated into a wide variety
  5147     of languages. In Turkish, Article 9 of this document might be marked up
  5148     as below:</p>
  5150    <pre lang=tr>&lt;body lang="tr">
  5152 &lt;h4>Madde 9&lt;/h4>
  5153 &lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
  5154 </pre>
  5156    <p>Here the user agent uses the value of the ‘<code
  5157     class=property>lang</code>’ attribute when rendering text and
  5158     appropriately renders this text without ‘<code
  5159     class=property>fi</code>’ ligatures. There is no need to use the ‘<a
  5160     href="#propdef-font-language-override"><code
  5161     class=property>font-language-override</code></a>’ property.</p>
  5163    <p>However, a given font may lack support for a specific language. In this
  5164     situation authors may need to use the typographic conventions of a
  5165     related language that are supported by that font:</p>
  5167    <pre lang=mk>&lt;body lang="mk">     &lt;!-- Macedonian lang code --&gt;
  5169 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
  5171 &lt;h4>Члeн 9&lt;/h4>
  5172 &lt;p>Никoj чoвeк нeмa дa бидe пoдлoжeн нa прoизвoлнo aпсeњe, притвoр или прoгoнувaњe.&lt;/p>
  5174 </pre>
  5176    <p>The Macedonian text here will be rendered using Serbian typographic
  5177     conventions, with the assumption that the font specified supports
  5178     Serbian.</p>
  5179   </div>
  5181   <p><a id=rendering-considerations></a>
  5183   <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
  5184    Resolution</h2>
  5186   <p>As described in the previous section, font features can be enabled in a
  5187    variety of ways, either via the use of ‘<a
  5188    href="#propdef-font-variant"><code
  5189    class=property>font-variant</code></a>’ or ‘<a
  5190    href="#propdef-font-feature-settings"><code
  5191    class=property>font-feature-settings</code></a>’ in a style rule or
  5192    within an <code>@font-face</code> rule. The resolution order for the union
  5193    of these settings is defined below. Features defined via CSS properties
  5194    are applied on top of layout engine default features.
  5196   <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
  5198   <p>For OpenType fonts, user agents must enable the default features defined
  5199    in the OpenType documentation for a given script and writing mode.
  5200    Required ligatures, common ligatures and contextual forms must be enabled
  5201    by default (OpenType features: <span class=tag>rlig, liga, clig,
  5202    calt</span>), along with localized forms (OpenType feature: <span
  5203    class=tag>locl</span>), and features required for proper display of
  5204    composed characters and marks (OpenType features: <span class=tag>ccmp,
  5205    mark, mkmk</span>). These features must always be enabled, even when the
  5206    value of the ‘<a href="#propdef-font-variant"><code
  5207    class=property>font-variant</code></a>’ and ‘<a
  5208    href="#propdef-font-feature-settings"><code
  5209    class=property>font-feature-settings</code></a>’ properties is ‘<a
  5210    href="#normal2"><code class=property>normal</code></a>’. Individual
  5211    features are only disabled when explicitly overridden by the author, as
  5212    when ‘<a href="#propdef-font-variant-ligatures"><code
  5213    class=property>font-variant-ligatures</code></a>’ is set to ‘<a
  5214    href="#no-common-ligatures"><code
  5215    class=property>no-common-ligatures</code></a>’. For handling complex
  5216    scripts such as <a
  5217    href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
  5218    <a
  5219    href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
  5220    or <a
  5221    href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
  5222    additional features are required. For upright text within vertical text
  5223    runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
  5224    must be enabled.
  5226   <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
  5228   <p>General and font specific font feature property settings are resolved in
  5229    the order below, in ascending precedence order. This ordering is used to
  5230    construct a combined list of font features that affect a given text run.
  5232   <ol>
  5233    <li>Font features enabled by default, including features required for a
  5234     given script.
  5236    <li>If the font is defined via an <code>@font-face</code> rule, the font
  5237     features implied by the font-variant descriptor in the
  5238     <code>@font-face</code> rule.
  5240    <li>If the font is defined via an <code>@font-face</code> rule, the font
  5241     features implied by the font-feature-settings descriptor in the
  5242     <code>@font-face</code> rule.
  5244    <li>Feature settings determined by properties other than ‘<a
  5245     href="#propdef-font-variant"><code
  5246     class=property>font-variant</code></a>’ or ‘<a
  5247     href="#propdef-font-feature-settings"><code
  5248     class=property>font-feature-settings</code></a>’. For example, setting
  5249     a non-default value for the ‘<code
  5250     class=property>letter-spacing</code>’ property disables ligatures.
  5252    <li>Font features implied by the value of the ‘<a
  5253     href="#propdef-font-variant"><code
  5254     class=property>font-variant</code></a>’ property, the related
  5255     font-variant subproperties and any other CSS property that may use
  5256     OpenType features (e.g. the ‘<a href="#propdef-font-kerning"><code
  5257     class=property>font-kerning</code></a>’ property).
  5259    <li>Font features implied by the value of ‘<a
  5260     href="#propdef-font-feature-settings"><code
  5261     class=property>font-feature-settings</code></a>’ property.
  5262   </ol>
  5264   <p>This ordering allows authors to set up a general set of defaults for
  5265    fonts within their <code>@font-face</code> rules, then override them with
  5266    property settings for specific elements. General property settings
  5267    override the settings in <code>@font-face</code> rules and low-level font
  5268    feature settings override ‘<a href="#propdef-font-variant"><code
  5269    class=property>font-variant</code></a>’ property settings.
  5271   <p>For situations where the combined list of font feature settings contains
  5272    more than one value for the same feature, the last value is used. When a
  5273    font lacks support for a given underlying font feature, text is simply
  5274    rendered as if that font feature was not enabled; font fallback does not
  5275    occur and no attempt is made to synthesize the feature except where
  5276    explicitly noted for specific properties.
  5278   <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
  5279    precedence examples</h3>
  5281   <div class=example>
  5282    <p>With the styles below, numbers are rendered proportionally when used
  5283     within a paragraph but are shown in tabular form within tables of prices:</p>
  5285    <pre>body { 
  5286   font-variant-numeric: proportional-nums; 
  5289 table.prices td {
  5290   font-variant-numeric: tabular-nums; 
  5292 </pre>
  5293   </div>
  5295   <div class=example>
  5296    <p>When the font-variant descriptor is used within an
  5297     <code>@font-face</code> rule, it only applies to the font defined by that
  5298     rule.</p>
  5300    <pre>@font-face {
  5301   font-family: MainText;
  5302   src: url(http://example.com/font.ttf);
  5303   font-variant: oldstyle-nums proportional-nums styleset(1,3);
  5306 body {
  5307   font-family: MainText, Helvetica;
  5310 table.prices td {
  5311   font-variant-numeric: tabular-nums; 
  5313 </pre>
  5315    <p>In this case, old-style numerals will be used throughout but only where
  5316     the font "MainText" is used. Just as in the previous example, tabular
  5317     values will be used in price tables since ‘<a
  5318     href="#tabular-nums"><code class=property>tabular-nums</code></a>’
  5319     appears in a general style rule and its use is mutually exclusive with
  5320     ‘<a href="#proportional-nums"><code
  5321     class=property>proportional-nums</code></a>’. Stylistic alternate sets
  5322     will only be used where MainText is used.</p>
  5323   </div>
  5325   <div class=example>
  5326    <p>The <code>@font-face</code> rule can also be used to access font
  5327     features in locally available fonts via the use of <code>local()</code>
  5328     in the ‘<a href="#descdef-src"><code class=property>src</code></a>’
  5329     descriptor of the <code>@font-face</code> definition:</p>
  5331    <pre>@font-face {
  5332   font-family: BodyText;
  5333   src: local("HiraMaruPro-W4");
  5334   font-variant: proportional-width;
  5335   font-feature-settings: "ital"; /* Latin italics within CJK text feature */
  5338 body { font-family: BodyText, serif; }
  5339 </pre>
  5341    <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
  5342     text rendering occurs, Japanese kana will be proportionally spaced and
  5343     Latin text will be italicised. Text rendered with the fallback serif font
  5344     will use default rendering properties.</p>
  5345   </div>
  5347   <div class=example>
  5348    <p>In the example below, discretionary ligatures are enabled only for a
  5349     downloadable font but are disabled within spans of class "special":</p>
  5351    <pre>@font-face {
  5352   font-family: main;
  5353   src: url(fonts/ffmeta.woff) format("woff");
  5354   font-variant: discretionary-ligatures;
  5357 body         { font-family: main, Helvetica; }
  5358 span.special { font-variant-ligatures: no-discretionary-ligatures; }
  5359 </pre>
  5361    <p>Adding an discretionary style rule with the <code>@font-face</code>
  5362     above:</p>
  5364    <pre>body         { font-family: main, Helvetica; }
  5365 span         { font-feature-settings: "dlig"; }
  5366 span.special { font-variant-ligatures: no-discretionary-ligatures; }
  5367 </pre>
  5369    <p>Within spans of class "special", discretionary ligatures <em>will</em>
  5370     be rendered. This is because both the ‘<a
  5371     href="#propdef-font-feature-settings"><code
  5372     class=property>font-feature-settings</code></a>’ and ‘<a
  5373     href="#propdef-font-variant-ligatures"><code
  5374     class=property>font-variant-ligatures</code></a>’ properties apply to
  5375     these spans. Although the ‘<code class=css>no-discretionary
  5376     ligatures</code>’ setting of ‘<a
  5377     href="#propdef-font-variant-ligatures"><code
  5378     class=property>font-variant-ligatures</code></a>’ effectively disables
  5379     the OpenType <span class=tag>dlig</span> feature, because the ‘<a
  5380     href="#propdef-font-feature-settings"><code
  5381     class=property>font-feature-settings</code></a>’ is resolved after
  5382     that, the ‘<code class=property>dlig</code>’ value reenables
  5383     discretionary ligatures.</p>
  5384   </div>
  5386   <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
  5388   <p>The contents of <code>@font-face</code> and
  5389    <code>@font-feature-values</code> rules can be accessed via the following
  5390    extensions to the CSS Object Model.
  5392   <h3 id=om-fontface><span class=secno>8.1 </span>The <a
  5393    href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
  5395   <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
  5396    <code>@font-face</code> rule.
  5398   <pre class=idl>
  5399 interface CSSFontFaceRule : CSSRule {
  5400   attribute DOMString family;
  5401   attribute DOMString src;
  5402   attribute DOMString style;
  5403   attribute DOMString weight;
  5404   attribute DOMString stretch;
  5405   attribute DOMString unicodeRange;
  5406   attribute DOMString variant;
  5407   attribute DOMString featureSettings;
  5408 }</pre>
  5410   <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
  5411    rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
  5412    defined a different variant of this rule. This definition supercedes that
  5413    one.
  5415   <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
  5416    href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
  5417    interface</h3>
  5419   <p>The <code>CSSRule</code> interface is extended as follows:
  5421   <pre class=idl>partial interface CSSRule {
  5422   const unsigned short FONT_FEATURE_VALUES_RULE = 14;
  5423 }</pre>
  5425   <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
  5426    interface represents a <code>@font-feature-values</code> rule.
  5428   <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
  5429   readonly attribute DOMString familyList;
  5430   readonly attribute DOMString valueText;
  5431 };</pre>
  5433   <dl class=idl-attributes>
  5434    <dt><var>familyList</var> of type <code>DOMString</code>, readonly
  5436    <dd>The list of one or more font families for which a given set of feature
  5437     values is defined.
  5439    <dt><var>valueText</var> of type <code>DOMString</code>, readonly
  5441    <dd>Serialized set of feature values.
  5442   </dl>
  5444   <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
  5445    properties to CSS properties</h2>
  5447   <p><em>This appendix is included as background for some of the problems and
  5448    situations that are described in other sections. It should be viewed as
  5449    informative only.</em>
  5451   <p>Font properties in CSS are designed to be independent of the underlying
  5452    font formats used; they can be used to specify bitmap fonts, Type1 fonts,
  5453    SVG fonts in addition to the common TrueType and OpenType fonts. But there
  5454    are facets of the TrueType and OpenType formats that often cause confusion
  5455    for authors and present challenges to implementers on different platforms.
  5457   <p>Originally developed at Apple, TrueType was designed as an outline font
  5458    format for both screen and print. Microsoft joined Apple in developing the
  5459    TrueType format and both platforms have supported TrueType fonts since
  5460    then. Font data in the TrueType format consists of a set of tables
  5461    distinguished with common four-letter tag names, each containing a
  5462    specific type of data. For example, naming information, including
  5463    copyright and license information, is stored in the ‘<code
  5464    class=property>name</code>’ table. The <a
  5465    href="#character-map"><em>character map</em></a> (‘<code
  5466    class=property>cmap</code>’) table contains a mapping of character
  5467    encodings to glyphs. Apple later added additional tables for supporting
  5468    enhanced typographic functionality; these are now called Apple Advanced
  5469    Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
  5470    tables for advanced typography and called their format OpenType <a
  5471    href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
  5473   <p>In many cases the font data used under Microsoft Windows or Linux is
  5474    slightly different from the data used under Apple's Mac OS X because the
  5475    TrueType format allowed for explicit variation across platforms. This
  5476    includes font metrics, names and <a href="#character-map"><em>character
  5477    map</em></a> data.
  5479   <p>Specifically, font family name data is handled differently across
  5480    platforms. For TrueType and OpenType fonts these names are contained in
  5481    the ‘<code class=property>name</code>’ table, in name records with
  5482    name ID 1. Mulitple names can be stored for different locales but
  5483    Microsoft recommends fonts always include at least a US English version of
  5484    the name. On Windows, Microsoft made the decision for backwards
  5485    compatibility to limit this family name to a maximum of four faces; for
  5486    larger groupings the "preferred family" (name ID 16) or "WWS family" (name
  5487    ID 21) can be used. Other platforms such as OSX don't have this
  5488    limitation, the family name is used to define all possible groupings.
  5490   <p>Other name table data provides names used to uniquely identify a
  5491    specific face within a family. The full font name (name ID 4) and the
  5492    Postscript name (name ID 6) describe a single face uniquely. The bold face
  5493    of the Gill Sans family has a fullname of "Gill Sans Bold" and a
  5494    Postscript name of "GillSans-Bold". There can be multiple localized
  5495    versions of the fullname for a given face but the Postscript name is
  5496    always a unique name made from a limited set of ASCII characters.
  5498   <p>On various platforms, different names are used to search for a font. For
  5499    example, with the Windows GDI CreateIndirectFont API, either a family or
  5500    fullname can be used to lookup a face while on Mac OS X the
  5501    CTFontCreateWithName API call is used to lookup a given face using the
  5502    fullname and Postscript name. Under Linux, the fontconfig API allows fonts
  5503    to be searched using any of these names. In situations where platform
  5504    API's automatically substitute other font choices, it may be necessary to
  5505    verify a returned font matches a given name.
  5507   <p>The weight of a given face can be determined via the usWeightClass field
  5508    of the OS/2 table or inferred from the style name (name ID 2). Likewise,
  5509    the width can be determined via the usWidthClass of the OS/2 table or
  5510    inferred from the style name. For historical reasons related to synthetic
  5511    bolding at weights 200 or lower with the Windows GDI API, font designers
  5512    have sometimes skewed values in the OS/2 table to avoid these weights.
  5514   <p>Rendering complex scripts that use contextual shaping such as Thai,
  5515    Arabic and Devanagari requires features present only in OpenType or AAT
  5516    fonts. Currently, complex script rendering is supported on Windows and
  5517    Linux using OpenType font features while both OpenType and AAT font
  5518    features are used under Mac OS X.
  5520   <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
  5522   <h3 class=no-num id=recent-changes> Changes from the <a
  5523    href="http://www.w3.org/TR/2013/WD-css3-fonts-20130212/">February 2013
  5524    CSS3 Fonts Working Draft</a></h3>
  5526   <p>Major changes include:
  5528   <ul>
  5529    <li>Moved font load events into a separate <a
  5530     href="http://dev.w3.org/csswg/css3-font-load-events/">spec</a>
  5532    <li>Tightened error handling rules for <code>@font-feature-values</code>
  5533     rules
  5535    <li>Added grammar productions for <code>@font-face</code> and
  5536     <code>@font-feature-values</code> rules
  5538    <li>Tightened definition of synthetic oblique
  5540    <li>Revised definition of ‘<a href="#descdef-unicode-range"><code
  5541     class=property>unicode-range</code></a>’ descriptor
  5542   </ul>
  5544   <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
  5546   <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
  5547    their help and feedback. John Hudson was kind enough to take the time to
  5548    explain the subtleties of OpenType language tags and provided the example
  5549    of character variant usage for displaying text on Byzantine seals. Ken
  5550    Lunde and Eric Muller provided valuable feedback on CJK OpenType features
  5551    and Unicode variation selectors. The idea for supporting font features by
  5552    using font-variant subproperties originated with Håkon Wium Lie, Adam
  5553    Twardoch and Tal Leming. Elika Etemad supplied some of the initial design
  5554    ideas for the <code>@font-feature-values</code> rule. Thanks also to House
  5555    Industries for allowing the use of Ed Interlock in the discretionary
  5556    ligatures example.
  5558   <p>A special thanks to Robert Bringhurst for the sublime mind expansion
  5559    that is <em>The Elements of Typographic Style</em>.
  5561   <h2 class=no-num id=conformance> Conformance</h2>
  5563   <h3 class=no-num id=conventions> Document Conventions</h3>
  5565   <p>Conformance requirements are expressed with a combination of descriptive
  5566    assertions and RFC 2119 terminology. The key words “MUST”, “MUST
  5567    NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
  5568    “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
  5569    normative parts of this document are to be interpreted as described in RFC
  5570    2119. However, for readability, these words do not appear in all uppercase
  5571    letters in this specification.
  5573   <p>All of the text of this specification is normative except sections
  5574    explicitly marked as non-normative, examples, and notes. <a
  5575    href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
  5577   <p>Examples in this specification are introduced with the words “for
  5578    example” or are set apart from the normative text with
  5579    <code>class="example"</code>, like this:
  5581   <div class=example>
  5582    <p>This is an example of an informative example.
  5583   </div>
  5585   <p>Informative notes begin with the word “Note” and are set apart from
  5586    the normative text with <code>class="note"</code>, like this:
  5588   <p class=note>Note, this is an informative note.
  5590   <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
  5592   <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
  5593    classes:
  5595   <dl>
  5596    <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
  5597     sheet</dfn>
  5599    <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
  5600     style sheet</a>.
  5602    <dt><dfn id=renderer>renderer</dfn>
  5604    <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
  5605     that interprets the semantics of a style sheet and renders documents that
  5606     use them.
  5608    <dt><dfn id=authoring-tool>authoring tool</dfn>
  5610    <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
  5611     that writes a style sheet.
  5612   </dl>
  5614   <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
  5615    declarations that use properties defined in this module have values that
  5616    are valid according to the generic CSS grammar and the individual grammars
  5617    of each property as given in this module.
  5619   <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
  5620    interpreting the style sheet as defined by the appropriate specifications,
  5621    it supports all the features defined by CSS Fonts Level 3 Module by
  5622    parsing them correctly and rendering the document accordingly. However,
  5623    the inability of a UA to correctly render a document due to limitations of
  5624    the device does not make the UA non-conformant. (For example, a UA is not
  5625    required to render color on a monochrome monitor.)
  5627   <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
  5628    style sheets that are syntactically correct according to the generic CSS
  5629    grammar and the individual grammars of each feature in this module, and
  5630    meet all other conformance requirements of style sheets as described in
  5631    this module.
  5633   <h3 class=no-num id=partial> Partial Implementations</h3>
  5635   <p>So that authors can exploit the forward-compatible parsing rules to
  5636    assign fallback values, CSS renderers <strong>must</strong> treat as
  5637    invalid (and <a
  5638    href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
  5639    appropriate</a>) any at-rules, properties, property values, keywords, and
  5640    other syntactic constructs for which they have no usable level of support.
  5641    In particular, user agents <strong>must not</strong> selectively ignore
  5642    unsupported component values and honor supported values in a single
  5643    multi-value property declaration: if any value is considered invalid (as
  5644    unsupported values must be), CSS requires that the entire declaration be
  5645    ignored.
  5647   <h3 class=no-num id=experimental> Experimental Implementations</h3>
  5649   <p>To avoid clashes with future CSS features, the CSS2.1 specification
  5650    reserves a <a
  5651    href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
  5652    syntax</a> for proprietary and experimental extensions to CSS.
  5654   <p>Prior to a specification reaching the Candidate Recommendation stage in
  5655    the W3C process, all implementations of a CSS feature are considered
  5656    experimental. The CSS Working Group recommends that implementations use a
  5657    vendor-prefixed syntax for such features, including those in W3C Working
  5658    Drafts. This avoids incompatibilities with future changes in the draft.
  5660   <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
  5662   <p>Once a specification reaches the Candidate Recommendation stage,
  5663    non-experimental implementations are possible, and implementors should
  5664    release an unprefixed implementation of any CR-level feature they can
  5665    demonstrate to be correctly implemented according to spec.
  5667   <p>To establish and maintain the interoperability of CSS across
  5668    implementations, the CSS Working Group requests that non-experimental CSS
  5669    renderers submit an implementation report (and, if necessary, the
  5670    testcases used for that implementation report) to the W3C before releasing
  5671    an unprefixed implementation of any CSS features. Testcases submitted to
  5672    W3C are subject to review and correction by the CSS Working Group.
  5674   <p>Further information on submitting testcases and implementation reports
  5675    can be found from on the CSS Working Group's website at <a
  5676    href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
  5677    Questions should be directed to the <a
  5678    href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
  5679    mailing list.
  5681   <h2 class=no-num id=references>References</h2>
  5683   <h3 class=no-num id=normative-references>Normative References</h3>
  5684   <!--begin-normative-->
  5685   <!-- Sorted by label -->
  5687   <dl class=bibliography>
  5688    <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
  5689     <!---->
  5691    <dt id=CHARMOD>[CHARMOD]
  5693    <dd>Martin J. Dürst; et al. <a
  5694     href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
  5695     Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
  5696     2005. W3C Recommendation. URL: <a
  5697     href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
  5698     </dd>
  5699    <!---->
  5701    <dt id=CORS>[CORS]
  5703    <dd>Anne van Kesteren. <a
  5704     href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
  5705     Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
  5706     Recommendation. (Work in progress.) URL: <a
  5707     href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
  5708     </dd>
  5709    <!---->
  5711    <dt id=CSS21>[CSS21]
  5713    <dd>Bert Bos; et al. <a
  5714     href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
  5715     Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
  5716     2011. W3C Recommendation. URL: <a
  5717     href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
  5718     </dd>
  5719    <!---->
  5721    <dt id=CSS3VAL>[CSS3VAL]
  5723    <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
  5724     href="http://www.w3.org/TR/2012/CR-css3-values-20120828/"><cite>CSS
  5725     Values and Units Module Level 3.</cite></a> 28 August 2012. W3C Candidate
  5726     Recommendation. (Work in progress.) URL: <a
  5727     href="http://www.w3.org/TR/2012/CR-css3-values-20120828/">http://www.w3.org/TR/2012/CR-css3-values-20120828/</a>
  5728     </dd>
  5729    <!---->
  5731    <dt id=HTML5>[HTML5]
  5733    <dd>Ian Hickson. <a
  5734     href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
  5735     17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
  5736     <a
  5737     href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
  5738     </dd>
  5739    <!---->
  5741    <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
  5743    <dd><a
  5744     href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009(E).zip"><cite>Information
  5745     technology — Coding of audio-visual objects — Part 22: Open Font
  5746     Format.</cite></a> International Organization for Standardization.
  5747     ISO/IEC 14496-22:2009. URL: <a
  5748     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>
  5749     </dd>
  5750    <!---->
  5752    <dt id=OPENTYPE>[OPENTYPE]
  5754    <dd><a
  5755     href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
  5756     specification.</cite></a> Microsoft. URL: <a
  5757     href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
  5758     </dd>
  5759    <!---->
  5761    <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
  5763    <dd><a
  5764     href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
  5765     feature registry.</cite></a> Microsoft. URL: <a
  5766     href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
  5767     </dd>
  5768    <!---->
  5770    <dt id=RFC2119>[RFC2119]
  5772    <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
  5773     words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
  5774     RFC 2119. URL: <a
  5775     href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
  5776     </dd>
  5777    <!---->
  5779    <dt id=UAX15>[UAX15]
  5781    <dd>Mark Davis; Ken Whistler. <a
  5782     href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
  5783     Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
  5784     href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
  5785     </dd>
  5786    <!---->
  5788    <dt id=UAX29>[UAX29]
  5790    <dd>Mark Davis. <a
  5791     href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
  5792     Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
  5793     URL: <a
  5794     href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
  5795     </dd>
  5796    <!---->
  5798    <dt id=UNICODE6>[UNICODE6]
  5800    <dd>The Unicode Consortium. <a
  5801     href="http://www.unicode.org/versions/Unicode6.2.0/"><cite>The Unicode
  5802     Standard, Version 6.2.0.</cite></a> Defined by: The Unicode Standard,
  5803     Version 6.2.0 URL: <a
  5804     href="http://www.unicode.org/versions/Unicode6.2.0/">http://www.unicode.org/versions/Unicode6.2.0/</a>
  5805     </dd>
  5806    <!---->
  5807   </dl>
  5808   <!--end-normative-->
  5809   <!--{{!CSS21}}-->
  5810   <!--{{!CSS3VAL}}-->
  5811   <!--{{!OPENTYPE}}-->
  5812   <!--{{!OPENTYPE-FEATURES}}-->
  5813   <!--{{!OPEN-FONT-FORMAT}}-->
  5814   <!--{{!UNICODE6}}-->
  5815   <!--{{!UAX15}}-->
  5816   <!--{{!UAX29}}-->
  5817   <!--{{!CORS}}-->
  5818   <!--{{!HTML5}}-->
  5819   <!--{{!CHARMOD}}-->
  5821   <h3 class=no-num id=other-references>Other References</h3>
  5822   <!--begin-informative-->
  5823   <!-- Sorted by label -->
  5825   <dl class=bibliography>
  5826    <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
  5827     <!---->
  5829    <dt id=AAT-FEATURES>[AAT-FEATURES]
  5831    <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
  5832     Advanced Typography font feature registry.</cite></a> Apple. URL: <a
  5833     href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
  5834     </dd>
  5835    <!---->
  5837    <dt id=ARABIC-TYPO>[ARABIC-TYPO]
  5839    <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
  5840     Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
  5841    <!---->
  5843    <dt id=CHARMOD-NORM>[CHARMOD-NORM]
  5845    <dd>François Yergeau; et al. <a
  5846     href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
  5847     Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
  5848     W3C Working Draft. (Work in progress.) URL: <a
  5849     href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
  5850     </dd>
  5851    <!---->
  5853    <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
  5855    <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
  5856     O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
  5857    <!---->
  5859    <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
  5861    <dd>L. David Baron. <a
  5862     href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/"><cite>CSS
  5863     Conditional Rules Module Level 3.</cite></a> 13 December 2012. W3C
  5864     Working Draft. (Work in progress.) URL: <a
  5865     href="http://www.w3.org/TR/2012/WD-css3-conditional-20121213/">http://www.w3.org/TR/2012/WD-css3-conditional-20121213/</a>
  5866     </dd>
  5867    <!---->
  5869    <dt id=CSS3TEXT>[CSS3TEXT]
  5871    <dd>Elika J. Etemad; Koji Ishii. <a
  5872     href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
  5873     Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
  5874     progress.) URL: <a
  5875     href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
  5876     </dd>
  5877    <!---->
  5879    <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
  5881    <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
  5882     and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
  5883     ISBN 0-201-17633-5.</dd>
  5884    <!---->
  5886    <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
  5888    <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
  5889     href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
  5890     Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
  5891     2000. W3C Recommendation. URL: <a
  5892     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>
  5893     </dd>
  5894    <!---->
  5896    <dt id=ELEMTYPO>[ELEMTYPO]
  5898    <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
  5899     4.</cite> Hartley &amp; Marks. 2013. ISBN 0-88179-212-8.</dd>
  5900    <!---->
  5902    <dt id=LANGCULTTYPE>[LANGCULTTYPE]
  5904    <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
  5905     ISBN 1-932026-01-0.</dd>
  5906    <!---->
  5908    <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
  5910    <dd><a
  5911     href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
  5912     User Guide.</cite></a> FontShop International. URL: <a
  5913     href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
  5914     </dd>
  5915    <!---->
  5917    <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
  5919    <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
  5920     Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
  5921     href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
  5922    <!---->
  5924    <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
  5926    <dd>John Hudson. <a
  5927     href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
  5928     Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
  5929     href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
  5930     </dd>
  5931    <!---->
  5932   </dl>
  5933   <!--end-informative-->
  5934   <!--{{ARABIC-TYPO}}-->
  5935   <!--{{CJKV-INFO-PROCESSING}}-->
  5936   <!--{{DIGITAL-TYPOGRAPHY}}-->
  5937   <!--{{DOM-LEVEL-2-STYLE}}-->
  5938   <!--{{ELEMTYPO}}-->
  5939   <!--{{LANGCULTTYPE}}-->
  5940   <!--{{OPENTYPE-FONT-GUIDE}}-->
  5941   <!--{{RASTER-TRAGEDY}}-->
  5942   <!--{{WINDOWS-GLYPH-PROC}}-->
  5943   <!--{{CHARMOD-NORM}}-->
  5944   <!--{{AAT-FEATURES}}-->
  5945   <!--{{CSS3-CONDITIONAL}}-->
  5946   <!--{{CSS3TEXT}}-->
  5948   <h2 class=no-num id=index>Index</h2>
  5949   <!--begin-index-->
  5951   <ul class=indexlist>
  5952    <li><var>&lt;absolute-size&gt;</var>, <a href="#absolute-size-value"
  5953     title="&lt;absolute-size&gt;"><strong>3.5</strong></a>
  5955    <li><var>&lt;common-lig-values&gt;</var>, <a href="#common-lig-values"
  5956     title="&lt;common-lig-values&gt;"><strong>6.4</strong></a>
  5958    <li><var>&lt;contextual-alt-values&gt;</var>, <a
  5959     href="#contextual-alt-values"
  5960     title="&lt;contextual-alt-values&gt;"><strong>6.4</strong></a>
  5962    <li><var>&lt;discretionary-lig-values&gt;</var>, <a
  5963     href="#discretionary-lig-values"
  5964     title="&lt;discretionary-lig-values&gt;"><strong>6.4</strong></a>
  5966    <li><var>&lt;east-asian-variant-values&gt;</var>, <a
  5967     href="#east-asian-variant-values"
  5968     title="&lt;east-asian-variant-values&gt;"><strong>6.10</strong></a>
  5970    <li><var>&lt;east-asian-width-values&gt;</var>, <a
  5971     href="#east-asian-width-values"
  5972     title="&lt;east-asian-width-values&gt;"><strong>6.10</strong></a>
  5974    <li><var>&lt;family-name&gt;</var>, <a href="#family-name-value"
  5975     title="&lt;family-name&gt;"><strong>3.1</strong></a>
  5977    <li><var>&lt;feature-tag-value&gt;</var>, <a href="#feature-tag-value"
  5978     title="&lt;feature-tag-value&gt;"><strong>6.12</strong></a>
  5980    <li><var>&lt;font-face-name&gt;</var>, <a href="#font-face-name-value"
  5981     title="&lt;font-face-name&gt;"><strong>4.3</strong></a>
  5983    <li><var>&lt;font-variant-css21&gt;</var>, <a
  5984     href="#font-variant-css21-values"
  5985     title="&lt;font-variant-css21&gt;"><strong>3.7</strong></a>
  5987    <li><var>&lt;generic-family&gt;</var>, <a href="#generic-family-value"
  5988     title="&lt;generic-family&gt;"><strong>3.1</strong></a>
  5990    <li><var>&lt;historical-lig-values&gt;</var>, <a
  5991     href="#historical-lig-values"
  5992     title="&lt;historical-lig-values&gt;"><strong>6.4</strong></a>
  5994    <li><var>&lt;length&gt;</var>, <a href="#length-size-value"
  5995     title="&lt;length&gt;"><strong>3.5</strong></a>
  5997    <li><var>&lt;number&gt;</var>, <a href="#aspect-ratio-value"
  5998     title="&lt;number&gt;"><strong>3.6</strong></a>
  6000    <li><var>&lt;numeric-figure-values&gt;</var>, <a
  6001     href="#numeric-figure-values"
  6002     title="&lt;numeric-figure-values&gt;"><strong>6.7</strong></a>
  6004    <li><var>&lt;numeric-fraction-values&gt;</var>, <a
  6005     href="#numeric-fraction-values"
  6006     title="&lt;numeric-fraction-values&gt;"><strong>6.7</strong></a>
  6008    <li><var>&lt;numeric-spacing-values&gt;</var>, <a
  6009     href="#numeric-spacing-values"
  6010     title="&lt;numeric-spacing-values&gt;"><strong>6.7</strong></a>
  6012    <li><var>&lt;percentage&gt;</var>, <a href="#percentage-size-value"
  6013     title="&lt;percentage&gt;"><strong>3.5</strong></a>
  6015    <li><var>&lt;relative-size&gt;</var>, <a href="#relative-size-value"
  6016     title="&lt;relative-size&gt;"><strong>3.5</strong></a>
  6018    <li><var>&lt;urange&gt;</var>, <a href="#urange-value"
  6019     title="&lt;urange&gt;"><strong>4.5</strong></a>
  6021    <li>@font-face, <a href="#font-face" title="@font-face">4.1</a>, <a
  6022     href="#font-face0" title="@font-face">4.3</a>
  6024    <li>all-petite-caps, <a href="#all-petite-caps"
  6025     title=all-petite-caps><strong>6.6</strong></a>
  6027    <li>all-small-caps, <a href="#all-small-caps"
  6028     title=all-small-caps><strong>6.6</strong></a>
  6030    <li>annotation, <a href="#annotation"
  6031     title=annotation><strong>6.8</strong></a>
  6033    <li>aspect value, <a href="#aspect-value0" title="aspect
  6034     value"><strong>3.6</strong></a>
  6036    <li>authoring tool, <a href="#authoring-tool" title="authoring
  6037     tool"><strong>#</strong></a>
  6039    <li>character map, <a href="#character-map" title="character
  6040     map"><strong>5.2</strong></a>
  6042    <li>character-variant, <a href="#character-variant"
  6043     title=character-variant><strong>6.8</strong></a>
  6045    <li>common-ligatures, <a href="#common-ligatures"
  6046     title=common-ligatures><strong>6.4</strong></a>
  6048    <li>contextual, <a href="#contextual"
  6049     title=contextual><strong>6.4</strong></a>
  6051    <li>CSSFontFaceRule, <a href="#cssfontfacerule"
  6052     title=CSSFontFaceRule><strong>8.1</strong></a>
  6054    <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
  6055     title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
  6057    <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
  6058     of"><strong>#</strong></a>
  6060    <li>default face, <a href="#default-face" title="default
  6061     face"><strong>5.2</strong></a>
  6063    <li>descriptor_declaration, <a href="#descriptordeclaration"
  6064     title="descriptor_declaration"><strong>4.1</strong></a>
  6066    <li>diagonal-fractions, <a href="#diagonal-fractions"
  6067     title=diagonal-fractions><strong>6.7</strong></a>
  6069    <li>discretionary-ligatures, <a href="#discretionary-ligatures"
  6070     title=discretionary-ligatures><strong>6.4</strong></a>
  6072    <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
  6073     of"><strong>#</strong></a>
  6075    <li>feature_type, <a href="#featuretype"
  6076     title="feature_type"><strong>6.9</strong></a>
  6078    <li>feature_value_block, <a href="#featurevalueblock"
  6079     title="feature_value_block"><strong>6.9</strong></a>
  6081    <li>feature_value_definition, <a href="#featurevaluedefinition"
  6082     title="feature_value_definition"><strong>6.9</strong></a>
  6084    <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
  6086    <li>font-family, <a href="#descdef-font-family"
  6087     title=font-family><strong>4.2</strong></a>, <a
  6088     href="#propdef-font-family" title=font-family><strong>3.1</strong></a>
  6090    <li>font-feature-settings, <a href="#propdef-font-feature-settings"
  6091     title=font-feature-settings><strong>6.12</strong></a>
  6093    <li>font-feature-settings (descriptor), <a
  6094     href="#descdef-font-feature-settings" title="font-feature-settings
  6095     (descriptor)"><strong>4.7</strong></a>
  6097    <li>font-kerning, <a href="#propdef-font-kerning"
  6098     title=font-kerning><strong>6.3</strong></a>
  6100    <li>font-language-override, <a href="#propdef-font-language-override"
  6101     title=font-language-override><strong>6.13</strong></a>
  6103    <li>font-size, <a href="#propdef-font-size"
  6104     title=font-size><strong>3.5</strong></a>
  6106    <li>font-size-adjust, <a href="#propdef-font-size-adjust"
  6107     title=font-size-adjust><strong>3.6</strong></a>
  6109    <li>font-stretch, <a href="#propdef-font-stretch"
  6110     title=font-stretch><strong>3.3</strong></a>
  6112    <li>font-stretch (descriptor), <a href="#descdef-font-stretch"
  6113     title="font-stretch (descriptor)"><strong>4.4</strong></a>
  6115    <li>font-style, <a href="#propdef-font-style"
  6116     title=font-style><strong>3.4</strong></a>
  6118    <li>font-style (descriptor), <a href="#descdef-font-style"
  6119     title="font-style (descriptor)"><strong>4.4</strong></a>
  6121    <li>font-synthesis, <a href="#propdef-font-synthesis"
  6122     title=font-synthesis><strong>3.8</strong></a>
  6124    <li>font-variant, <a href="#propdef-font-variant"
  6125     title=font-variant><strong>6.11</strong></a>
  6127    <li>font-variant (descriptor), <a href="#descdef-font-variant"
  6128     title="font-variant (descriptor)"><strong>4.7</strong></a>
  6130    <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
  6131     title=font-variant-alternates><strong>6.8</strong></a>
  6133    <li>font-variant-caps, <a href="#propdef-font-variant-caps"
  6134     title=font-variant-caps><strong>6.6</strong></a>
  6136    <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
  6137     title=font-variant-east-asian><strong>6.10</strong></a>
  6139    <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
  6140     title=font-variant-ligatures><strong>6.4</strong></a>
  6142    <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
  6143     title=font-variant-numeric><strong>6.7</strong></a>
  6145    <li>font-variant-position, <a href="#propdef-font-variant-position"
  6146     title=font-variant-position><strong>6.5</strong></a>
  6148    <li>font-weight, <a href="#propdef-font-weight"
  6149     title=font-weight><strong>3.2</strong></a>
  6151    <li>font-weight (descriptor), <a href="#descdef-font-weight"
  6152     title="font-weight (descriptor)"><strong>4.4</strong></a>
  6154    <li>font_face_rule, <a href="#fontfacerule"
  6155     title="font_face_rule"><strong>4.1</strong></a>
  6157    <li>FONT_FACE_SYM, <a href="#fontfacesym"
  6158     title="FONT_FACE_SYM"><strong>4.1</strong></a>
  6160    <li>font_family_name, <a href="#fontfamilyname"
  6161     title="font_family_name"><strong>6.9</strong></a>
  6163    <li>font_family_name_list, <a href="#fontfamilynamelist"
  6164     title="font_family_name_list"><strong>6.9</strong></a>
  6166    <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
  6167     title="font_feature_values_rule"><strong>6.9</strong></a>
  6169    <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
  6170     title="FONT_FEATURE_VALUES_SYM"><strong>6.9</strong></a>
  6172    <li>full-width, <a href="#full-width"
  6173     title=full-width><strong>6.10</strong></a>
  6175    <li>historical-forms, <a href="#historical-forms"
  6176     title=historical-forms><strong>6.8</strong></a>
  6178    <li>historical-ligatures, <a href="#historical-ligatures"
  6179     title=historical-ligatures><strong>6.4</strong></a>
  6181    <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
  6183    <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
  6185    <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
  6187    <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
  6189    <li>lining-nums, <a href="#lining-nums"
  6190     title=lining-nums><strong>6.7</strong></a>
  6192    <li>monospace, definition of, <a href="#monospace0" title="monospace,
  6193     definition of"><strong>#</strong></a>
  6195    <li>no-common-ligatures, <a href="#no-common-ligatures"
  6196     title=no-common-ligatures><strong>6.4</strong></a>
  6198    <li>no-contextual, <a href="#no-contextual"
  6199     title=no-contextual><strong>6.4</strong></a>
  6201    <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
  6202     title=no-discretionary-ligatures><strong>6.4</strong></a>
  6204    <li>no-historical-ligatures, <a href="#no-historical-ligatures"
  6205     title=no-historical-ligatures><strong>6.4</strong></a>
  6207    <li>normal, <a href="#normal" title=normal><strong>6.6</strong></a>, <a
  6208     href="#normal0" title=normal><strong>6.7</strong></a>, <a href="#normal1"
  6209     title=normal><strong>6.8</strong></a>, <a href="#normal2"
  6210     title=normal><strong>6.10</strong></a>
  6212    <li>oldstyle-nums, <a href="#oldstyle-nums"
  6213     title=oldstyle-nums><strong>6.7</strong></a>
  6215    <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
  6217    <li>ornaments, <a href="#ornaments"
  6218     title=ornaments><strong>6.8</strong></a>
  6220    <li>petite-caps, <a href="#petite-caps"
  6221     title=petite-caps><strong>6.6</strong></a>
  6223    <li>proportional-nums, <a href="#proportional-nums"
  6224     title=proportional-nums><strong>6.7</strong></a>
  6226    <li>proportional-width, <a href="#proportional-width"
  6227     title=proportional-width><strong>6.10</strong></a>
  6229    <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
  6231    <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
  6233    <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
  6234     definition of"><strong>#</strong></a>
  6236    <li>serif, definition of, <a href="#serif0" title="serif, definition
  6237     of"><strong>#</strong></a>
  6239    <li>simplified, <a href="#simplified"
  6240     title=simplified><strong>6.10</strong></a>
  6242    <li>slashed-zero, <a href="#slashed-zero"
  6243     title=slashed-zero><strong>6.7</strong></a>
  6245    <li>small-caps, <a href="#small-caps"
  6246     title=small-caps><strong>6.6</strong></a>
  6248    <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
  6250    <li>stacked-fractions, <a href="#stacked-fractions"
  6251     title=stacked-fractions><strong>6.7</strong></a>
  6253    <li>style sheet
  6254     <ul>
  6255      <li>as conformance class, <a href="#style-sheet" title="style sheet, as
  6256       conformance class"><strong>#</strong></a>
  6257     </ul>
  6259    <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
  6261    <li>stylistic, <a href="#stylistic"
  6262     title=stylistic><strong>6.8</strong></a>
  6264    <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
  6266    <li>tabular-nums, <a href="#tabular-nums"
  6267     title=tabular-nums><strong>6.7</strong></a>
  6269    <li>titling-caps, <a href="#titling-caps"
  6270     title=titling-caps><strong>6.6</strong></a>
  6272    <li>traditional, <a href="#traditional"
  6273     title=traditional><strong>6.10</strong></a>
  6275    <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
  6277    <li>unicode-range, <a href="#descdef-unicode-range"
  6278     title=unicode-range><strong>4.5</strong></a>
  6280    <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
  6282    <li>width, <a href="#width" title=width><strong>2</strong></a>
  6283   </ul>
  6284   <!--end-index-->
  6286   <h2 class=no-num id=property-index>Property index</h2>
  6287   <!--begin-properties-->
  6289   <table class=proptable>
  6290    <thead>
  6291     <tr>
  6292      <th>Property
  6294      <th>Values
  6296      <th>Initial
  6298      <th>Applies to
  6300      <th>Inh.
  6302      <th>Percentages
  6304      <th>Media
  6306    <tbody>
  6307     <tr>
  6308      <th><a class=property href="#propdef-font">font</a>
  6310      <td>[ [ &lt;‘font-style’&gt; || &lt;font-variant-css21&gt; ||
  6311       &lt;‘font-weight’&gt; || &lt;‘font-stretch’ ]?
  6312       &lt;‘font-size’&gt; [ / &lt;‘line-height’&gt; ]?
  6313       &lt;‘font-family’&gt; ] | caption | icon | menu | message-box |
  6314       small-caption | status-bar
  6316      <td>see individual properties
  6318      <td>all elements
  6320      <td>yes
  6322      <td>see individual properties
  6324      <td>visual
  6326     <tr>
  6327      <th><a class=property href="#descdef-font-family">font-family</a>
  6329      <td>[ &lt;family-name&gt; | &lt;generic-family&gt; ] #
  6331      <td>depends on user agent
  6333      <td>all elements
  6335      <td>yes
  6337      <td>N/A
  6339      <td>visual
  6341     <tr>
  6342      <th><a class=property
  6343       href="#propdef-font-feature-settings">font-feature-settings</a>
  6345      <td>normal | &lt;feature-tag-value&gt; #
  6347      <td>normal
  6349      <td>all elements
  6351      <td>yes
  6353      <td>N/A
  6355      <td>visual
  6357     <tr>
  6358      <th><a class=property href="#propdef-font-kerning">font-kerning</a>
  6360      <td>auto | normal | none
  6362      <td>auto
  6364      <td>all elements
  6366      <td>yes
  6368      <td>N/A
  6370      <td>visual
  6372     <tr>
  6373      <th><a class=property
  6374       href="#propdef-font-language-override">font-language-override</a>
  6376      <td>normal | &lt;string&gt;
  6378      <td>normal
  6380      <td>all elements
  6382      <td>yes
  6384      <td>N/A
  6386      <td>visual
  6388     <tr>
  6389      <th><a class=property href="#propdef-font-size">font-size</a>
  6391      <td>&lt;absolute-size&gt; | &lt;relative-size&gt; | &lt;length&gt; |
  6392       &lt;percentage&gt;
  6394      <td>medium
  6396      <td>all elements
  6398      <td>yes
  6400      <td>refer to parent element's font size
  6402      <td>visual
  6404     <tr>
  6405      <th><a class=property
  6406       href="#propdef-font-size-adjust">font-size-adjust</a>
  6408      <td>none | auto | &lt;number&gt;
  6410      <td>none
  6412      <td>all elements
  6414      <td>yes
  6416      <td>N/A
  6418      <td>visual
  6420     <tr>
  6421      <th><a class=property href="#propdef-font-stretch">font-stretch</a>
  6423      <td>normal | ultra-condensed | extra-condensed | condensed |
  6424       semi-condensed | semi-expanded | expanded | extra-expanded |
  6425       ultra-expanded
  6427      <td>normal
  6429      <td>all elements
  6431      <td>yes
  6433      <td>N/A
  6435      <td>visual
  6437     <tr>
  6438      <th><a class=property href="#propdef-font-style">font-style</a>
  6440      <td>normal | italic | oblique
  6442      <td>normal
  6444      <td>all elements
  6446      <td>yes
  6448      <td>N/A
  6450      <td>visual
  6452     <tr>
  6453      <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
  6455      <td>none | [ weight || style ]
  6457      <td>weight style
  6459      <td>all elements
  6461      <td>yes
  6463      <td>N/A
  6465      <td>visual
  6467     <tr>
  6468      <th><a class=property href="#propdef-font-variant">font-variant</a>
  6470      <td>normal | none | [ &lt;common-lig-values&gt; ||
  6471       &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
  6472       &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
  6473       || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
  6474       character-variant(&lt;feature-value-name&gt; #) ||
  6475       swash(&lt;feature-value-name&gt;) ||
  6476       ornaments(&lt;feature-value-name&gt;) ||
  6477       annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
  6478       | petite-caps | all-petite-caps | unicase | titling-caps ] ||
  6479       &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
  6480       &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
  6481       &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
  6482       ruby ]
  6484      <td>normal
  6486      <td>all elements
  6488      <td>yes
  6490      <td>see individual properties
  6492      <td>visual
  6494     <tr>
  6495      <th><a class=property
  6496       href="#propdef-font-variant-alternates">font-variant-alternates</a>
  6498      <td>normal | [ stylistic(&lt;feature-value-name&gt;) || historical-forms
  6499       || styleset(&lt;feature-value-name&gt; #) ||
  6500       character-variant(&lt;feature-value-name&gt; #) ||
  6501       swash(&lt;feature-value-name&gt;) ||
  6502       ornaments(&lt;feature-value-name&gt;) ||
  6503       annotation(&lt;feature-value-name&gt;) ]
  6505      <td>normal
  6507      <td>all elements
  6509      <td>yes
  6511      <td>N/A
  6513      <td>visual
  6515     <tr>
  6516      <th><a class=property
  6517       href="#propdef-font-variant-caps">font-variant-caps</a>
  6519      <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
  6520       | unicase | titling-caps
  6522      <td>normal
  6524      <td>all elements
  6526      <td>yes
  6528      <td>N/A
  6530      <td>visual
  6532     <tr>
  6533      <th><a class=property
  6534       href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
  6536      <td>normal | [ &lt;east-asian-variant-values&gt; ||
  6537       &lt;east-asian-width-values&gt; || ruby ]
  6539      <td>normal
  6541      <td>all elements
  6543      <td>yes
  6545      <td>N/A
  6547      <td>visual
  6549     <tr>
  6550      <th><a class=property
  6551       href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
  6553      <td>normal | none | [ &lt;common-lig-values&gt; ||
  6554       &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
  6555       &lt;contextual-alt-values&gt; ]
  6557      <td>normal
  6559      <td>all elements
  6561      <td>yes
  6563      <td>N/A
  6565      <td>visual
  6567     <tr>
  6568      <th><a class=property
  6569       href="#propdef-font-variant-numeric">font-variant-numeric</a>
  6571      <td>normal | [ &lt;numeric-figure-values&gt; ||
  6572       &lt;numeric-spacing-values&gt; || &lt;numeric-fraction-values&gt; ||
  6573       ordinal || slashed-zero ]
  6575      <td>normal
  6577      <td>all elements
  6579      <td>yes
  6581      <td>N/A
  6583      <td>visual
  6585     <tr>
  6586      <th><a class=property
  6587       href="#propdef-font-variant-position">font-variant-position</a>
  6589      <td>normal | sub | super
  6591      <td>normal
  6593      <td>all elements
  6595      <td>yes
  6597      <td>N/A
  6599      <td>visual
  6601     <tr>
  6602      <th><a class=property href="#propdef-font-weight">font-weight</a>
  6604      <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
  6605       | 700 | 800 | 900
  6607      <td>normal
  6609      <td>all elements
  6611      <td>yes
  6613      <td>N/A
  6615      <td>visual
  6616   </table>
  6617   <!--end-properties-->
  6618   <!--begin-descriptors-->
  6620   <table class=proptable>
  6621    <thead>
  6622     <tr>
  6623      <th>Descriptor
  6625      <th>Value
  6627      <th>Initial
  6629      <th>Percentages
  6631      <th>Media
  6633    <tbody>
  6634     <tr>
  6635      <th><a class=property href="#descdef-font-family">font-family</a>
  6637      <td>&lt;family-name&gt;
  6639      <td>N/A
  6641     <tr>
  6642      <th><a class=property
  6643       href="#propdef-font-feature-settings">font-feature-settings</a>
  6645      <td>normal | &lt;feature-tag-value&gt; #
  6647      <td>normal
  6649     <tr>
  6650      <th><a class=property href="#propdef-font-stretch">font-stretch</a>
  6652      <td>normal | ultra-condensed | extra-condensed | condensed |
  6653       semi-condensed | semi-expanded | expanded | extra-expanded |
  6654       ultra-expanded
  6656      <td>normal
  6658     <tr>
  6659      <th><a class=property href="#propdef-font-style">font-style</a>
  6661      <td>normal | italic | oblique
  6663      <td>normal
  6665     <tr>
  6666      <th><a class=property href="#propdef-font-variant">font-variant</a>
  6668      <td>normal | none | [ &lt;common-lig-values&gt; ||
  6669       &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
  6670       &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
  6671       || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
  6672       character-variant(&lt;feature-value-name&gt; #) ||
  6673       swash(&lt;feature-value-name&gt;) ||
  6674       ornaments(&lt;feature-value-name&gt;) ||
  6675       annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
  6676       | petite-caps | all-petite-caps | unicase | titling-caps ] ||
  6677       &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
  6678       &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
  6679       &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
  6680       ruby ]
  6682      <td>normal
  6684     <tr>
  6685      <th><a class=property href="#propdef-font-weight">font-weight</a>
  6687      <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
  6689      <td>normal
  6691     <tr>
  6692      <th><a class=property href="#descdef-src">src</a>
  6694      <td>[ &lt;url> [format(&lt;string> #)]? | &lt;font-face-name&gt; ] #
  6696      <td>N/A
  6698     <tr>
  6699      <th><a class=property href="#descdef-unicode-range">unicode-range</a>
  6701      <td>&lt;urange&gt; #
  6703      <td>U+0-10FFFF
  6704   </table>
  6705   <!--end-descriptors-->
  6706   <script type="text/javascript">
  6707 window.onload = function () {
  6708   if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
  6709   var i, hiresElements = document.getElementsByClassName("hires");
  6710   for (i = 0; i < hiresElements.length; i++) {
  6711     var h = hiresElements[i];
  6712     if (h.tagName != "IMG") continue;
  6713     var src = h.getAttribute("src");
  6714     var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
  6715     h.src = src2x;
  6718 </script>
  6719 </html>
  6720 <!-- Keep this comment at the end of the file
  6721 Local variables:
  6722 mode: sgml
  6723 sgml-declaration:"~/SGML/HTML4.decl"
  6724 sgml-default-doctype-name:"html"
  6725 sgml-minimize-attributes:t
  6726 sgml-nofill-elements:("pre" "style" "br")
  6727 sgml-live-element-indicator:t
  6728 sgml-omittag:nil
  6729 sgml-shorttag:nil
  6730 sgml-namecase-general:t
  6731 sgml-general-insert-case:lower
  6732 sgml-always-quote-attributes:t
  6733 sgml-indent-step:nil
  6734 sgml-indent-data:t
  6735 sgml-parent-document:nil
  6736 sgml-exposed-tags:nil
  6737 sgml-local-catalogs:nil
  6738 sgml-local-ecat-files:nil
  6739 End:
  6740 -->
  6741 <!-- 
  6743 to do:
  6745 - wording of OpenType family name handling
  6746 - handling combining sequences in the font matching algorithm
  6747 - fix-up fi ligature example
  6749 -->

mercurial