css-fonts/Fonts.html

Tue, 17 Sep 2013 15:52:29 +0900

author
John Daggett <jdaggett@mozilla.com>
date
Tue, 17 Sep 2013 15:52:29 +0900
changeset 9209
0fd8e74f0ab3
parent 9208
7d9c2fad8498
child 10069
538559084d14
permissions
-rw-r--r--

[css3-fonts] fix up redirected links

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
     2 "http://www.w3.org/TR/html4/strict.dtd">
     4 <html lang=en>
     5  <head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
     7   <title>CSS Fonts Module Level 3</title>
     8   <!--
     9       FIXME when publishing: copy the current default.css and link to
    10       "default.css" rather than "../default.css"
    11    -->
    12   <link href="../default.css" rel=stylesheet type="text/css">
    13   <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
    14   <!-- I'm just experimenting here, don't get your bee in a bonnet -->
    15   <script src="http://use.typekit.com/xon2bky.js"
    16   type="text/javascript"></script>
    17   <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
    19   <style type="text/css">
    21   body, th, td, h1, h2, h3, h4, h5, h6 {
    22     font-family: "myriad-pro", sans-serif !important;
    23   }
    25   body {
    26     padding: 2em 70px 2em 70px;
    27   }
    29   p + p, p.mtb {
    30     margin-top: 0.8em;
    31     text-indent: 0px;
    32   }
    34   #bolderlighter {
    35     width: 40%;
    36   }
    38   #bolderlighter th {
    39     text-align: center;
    40   }
    42   #fontformats td, #eventhandlers td, #fontformats th, #eventhandlers th {
    43     padding-right: 2em;
    44     text-align: left;
    45   }
    47   dd {
    48     margin-bottom: 1em;
    49   }
    51   #authors dd {
    52     margin-bottom: 0;
    53   }
    55   #fontstylematchingalg {
    56     list-style-type: lower-alpha;
    57   }
    59   #fontmatchingalg ul, #fontmatchingalg ol {
    60     margin-top: 0.8em;
    61   }
    63   #fontmatchingalg li + li {
    64     margin-top: 0.8em;
    65   }
    67   div.example {
    68     padding: 1em;
    69     margin-top: 1em;
    70   }
    72   div.example + div.example {
    73     margin-top: 2em;
    74   }
    76   div.figure {
    77     page-break-inside: avoid;
    78   }
    80   pre.prod { white-space: pre-wrap; margin: 1em 0 1em 2em }
    82   div.featex {
    83     width: 700px;
    84   }
    86   div.featex img {
    87     margin: auto;
    88     display: block;
    89   }
    91   span.tag {
    92     font-family: monospace;
    93     font-size: 120%;
    94   }
    96   ol ol {
    97     list-style-type: lower-alpha;
    98   }
   100   .idl-code {
   101     font-weight: bold;
   102     color: #c50;
   103   }
   104   </style>
   105   <link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
   106   type="text/css">
   107   <script defer=defer
   108   src="http://test.csswg.org/harness/annotate.js#CSS3-FONTS_DEV"
   109   type="text/javascript"></script>
   111  <body>
   112   <div class=head> <!--begin-logo-->
   113    <p><a href="http://www.w3.org/"><img alt=W3C height=48
   114     src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
   116    <h1>CSS Fonts Module Level 3</h1>
   118    <h2 class="no-num no-toc" id=editors-draft-17-september-2013>Editor's
   119     Draft 17 September 2013</h2>
   121    <dl id=authors>
   122     <dt>This version:
   124     <dd><a
   125      href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
   126      <!-- <dd><a href="http://www.w3.org/TR/2013/ED-css-fonts-3-20130917/">http://www.w3.org/TR/2013/ED-css-fonts-3-20130917/</a>  -->
   129     <dt>Latest version:
   131     <dd><a
   132      href="http://www.w3.org/TR/css-fonts-3/">http://www.w3.org/TR/css-fonts-3/</a>
   134     <dt>Latest editor's draft:
   136     <dd><a
   137      href="http://dev.w3.org/csswg/css-fonts/">http://dev.w3.org/csswg/css-fonts/</a>
   138      (<a
   139      href="https://dvcs.w3.org/hg/csswg/log/tip/css-fonts/Fonts.html">change
   140      log</a>)
   142     <dt>Previous version:
   144     <dd><a
   145      href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/</a>
   147     <dt>Issues List:
   149     <dd><a href="http://www.w3.org/Style/CSS/Tracker/products/18">CSS3 Fonts
   150      issues in Tracker</a>
   152     <dd><a
   153      href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&amp;product=CSS&amp;component=Fonts&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED">CSS3
   154      Fonts issues in Bugzilla</a>
   156     <dt>Discussion:
   158     <dd><a
   159      href="mailto:www-style@w3.org?subject=%5Bcss-fonts%5D%20feedback">www-style@w3.org</a>
   160      with subject line “<kbd>[css-fonts] <var>… message topic
   161      …</var></kbd>” (<a
   162      href="http://lists.w3.org/Archives/Public/www-style/"
   163      rel=discussion>archives</a>)
   165     <dt>Test Suite:
   167     <dd><a
   168      href="http://test.csswg.org/suites/css3-fonts/nightly-unstable/">http://test.csswg.org/suites/css3-fonts/nightly-unstable/</a>
   171     <dt>Editor:
   173     <dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
   174    </dl>
   175    <!--begin-copyright-->
   176    <p class=copyright><a
   177     href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
   178     rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
   179     title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
   180     href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
   181     Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr
   182     title="European Research Consortium for Informatics and
   183     Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>,
   184     <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
   185     <a
   186     href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
   187     <a
   188     href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
   189     and <a
   190     href="http://www.w3.org/Consortium/Legal/copyright-documents">document
   191     use</a> rules apply.</p>
   192    <!--end-copyright-->
   193    <hr title="Separator for header">
   194   </div>
   196   <h2 class="no-num no-toc" id=abstract>Abstract</h2>
   198   <p>This CSS3 module describes how font properties are specified and how
   199    font resources are loaded dynamically. The contents of this specification
   200    are a consolidation of content previously divided into <a
   201    href="http://www.w3.org/TR/2002/WD-css3-fonts-20020802/">CSS3 Fonts</a>
   202    and <a href="http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/">CSS3
   203    Web Fonts</a> modules. The description of font load events was moved into
   204    the <a href="http://dev.w3.org/csswg/css-font-load-events/">CSS3 Font Load
   205    Events</a> module.
   207   <h2 class="no-num no-toc" id=status>Status of this document</h2>
   208   <!--begin-status-->
   210   <p>This is a public copy of the editors' draft. It is provided for
   211    discussion only and may change at any moment. Its publication here does
   212    not imply endorsement of its contents by W3C. Don't cite this document
   213    other than as work in progress.
   215   <p>The (<a
   216    href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
   217    mailing list <a
   218    href="mailto:www-style@w3.org?Subject=%5Bcss3-fonts%5D%20PUT%20SUBJECT%20HERE">
   219    www-style@w3.org</a> (see <a
   220    href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
   221    discussion of this specification. When sending e-mail, please put the text
   222    “css3-fonts” in the subject, preferably like this:
   223    “[<!---->css3-fonts<!---->] <em>…summary of comment…</em>”
   225   <p>This document was produced by the <a
   226    href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
   227    the <a href="http://www.w3.org/Style/">Style Activity</a>).
   229   <p>This document was produced by a group operating under the <a
   230    href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
   231    2004 W3C Patent Policy</a>. W3C maintains a <a
   232    href="http://www.w3.org/2004/01/pp-impl/32061/status"
   233    rel=disclosure>public list of any patent disclosures</a> made in
   234    connection with the deliverables of the group; that page also includes
   235    instructions for disclosing a patent. An individual who has actual
   236    knowledge of a patent which the individual believes contains <a
   237    href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
   238    Claim(s)</a> must disclose the information in accordance with <a
   239    href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   240    6 of the W3C Patent Policy</a>.</p>
   241   <!--end-status-->
   243   <h3 class="no-num no-toc" id=atrisk>Features at risk</h3>
   245   <p>The following features are at risk and may be removed when exiting CR:
   247   <ul>
   248    <li>fallback handling for text decoration in superscript/subscript variant
   249     glyphs (‘<a href="#propdef-font-variant-position"><code
   250     class=property>font-variant-position</code></a>’)
   252    <li>‘<a href="#propdef-font-language-override"><code
   253     class=property>font-language-override</code></a>’ property
   254   </ul>
   255   <!--
   256 <p>This draft is a <strong>Last Call Working Draft</strong>.
   257 Please send comments to the 
   258 <a href="http://lists.w3.org/Archives/Public/www-style/">www-style mailing list</a>
   259 as described above.  The <strong>deadline for comments</strong> 
   260 is six weeks after the date of publication in the header, 22 August 2013.</p>
   261 -->
   263   <h2 class="no-num no-toc" id=contents>Table of contents</h2>
   264   <!--begin-toc-->
   266   <ul class=toc>
   267    <li><a href="#introduction"><span class=secno>1 </span>Introduction</a>
   269    <li><a href="#typography-background"><span class=secno>2 </span>Typography
   270     Background</a>
   272    <li><a href="#basic-font-props"><span class=secno>3 </span>Basic Font
   273     Properties</a>
   274     <ul class=toc>
   275      <li><a href="#font-family-prop"><span class=secno>3.1 </span>Font
   276       family: the font-family property</a>
   277       <ul class=toc>
   278        <li><a href="#generic-font-families"><span class=secno>3.1.1
   279         </span>Generic font families</a>
   280       </ul>
   282      <li><a href="#font-weight-prop"><span class=secno>3.2 </span>Font
   283       weight: the font-weight property</a>
   285      <li><a href="#font-stretch-prop"><span class=secno>3.3 </span>Font
   286       width: the font-stretch property</a>
   288      <li><a href="#font-style-prop"><span class=secno>3.4 </span>Font style:
   289       the font-style property</a>
   291      <li><a href="#font-size-prop"><span class=secno>3.5 </span>Font size:
   292       the font-size property</a>
   294      <li><a href="#font-size-adjust-prop"><span class=secno>3.6
   295       </span>Relative sizing: the font-size-adjust property</a>
   297      <li><a href="#font-prop"><span class=secno>3.7 </span>Shorthand font
   298       property: the font property</a>
   300      <li><a href="#font-synthesis-prop"><span class=secno>3.8
   301       </span>Controlling synthetic faces: the font-synthesis property</a>
   302     </ul>
   304    <li><a href="#font-resources"><span class=secno>4 </span>Font
   305     Resources</a>
   306     <ul class=toc>
   307      <li><a href="#font-face-rule"><span class=secno>4.1 </span>The
   308       <code>@font-face</code> rule</a>
   310      <li><a href="#font-family-desc"><span class=secno>4.2 </span>Font
   311       family: the font-family descriptor</a>
   313      <li><a href="#src-desc"><span class=secno>4.3 </span>Font reference: the
   314       src descriptor</a>
   316      <li><a href="#font-prop-desc"><span class=secno>4.4 </span>Font property
   317       descriptors: the font-style, font-weight, font-stretch descriptors</a>
   319      <li><a href="#unicode-range-desc"><span class=secno>4.5 </span>Character
   320       range: the unicode-range descriptor</a>
   322      <li><a href="#composite-fonts"><span class=secno>4.6 </span>Using
   323       character ranges to define composite fonts</a>
   325      <li><a href="#font-rend-desc"><span class=secno>4.7 </span>Font
   326       features: the font-variant and font-feature-settings descriptors</a>
   328      <li><a href="#font-face-loading"><span class=secno>4.8 </span>Font
   329       loading guidelines</a>
   331      <li><a href="#font-fetching-requirements"><span class=secno>4.9
   332       </span>Font fetching requirements</a>
   333     </ul>
   335    <li><a href="#font-matching-algorithm"><span class=secno>5 </span>Font
   336     Matching Algorithm</a>
   337     <ul class=toc>
   338      <li><a href="#font-family-casing"><span class=secno>5.1 </span>Case
   339       sensitivity of font family names</a>
   341      <li><a href="#font-style-matching"><span class=secno>5.2 </span>Matching
   342       font styles</a>
   344      <li><a href="#cluster-matching"><span class=secno>5.3 </span>Cluster
   345       matching</a>
   347      <li><a href="#char-handling-issues"><span class=secno>5.4
   348       </span>Character handling issues</a>
   350      <li><a href="#font-matching-changes"><span class=secno>5.5 </span>Font
   351       matching changes since CSS 2.1</a>
   353      <li><a href="#font-matching-examples"><span class=secno>5.6 </span>Font
   354       matching examples</a>
   355     </ul>
   357    <li><a href="#font-rend-props"><span class=secno>6 </span>Font Feature
   358     Properties</a>
   359     <ul class=toc>
   360      <li><a href="#glyph-selection-positioning"><span class=secno>6.1
   361       </span>Glyph selection and positioning</a>
   363      <li><a href="#language-specific-support"><span class=secno>6.2
   364       </span>Language-specific display</a>
   366      <li><a href="#font-kerning-prop"><span class=secno>6.3 </span>Kerning:
   367       the font-kerning property</a>
   369      <li><a href="#font-variant-ligatures-prop"><span class=secno>6.4
   370       </span>Ligatures: the font-variant-ligatures property</a>
   372      <li><a href="#font-variant-position-prop"><span class=secno>6.5
   373       </span>Subscript and superscript forms: the font-variant-position
   374       property</a>
   376      <li><a href="#font-variant-caps-prop"><span class=secno>6.6
   377       </span>Capitalization: the font-variant-caps property</a>
   379      <li><a href="#font-variant-numeric-prop"><span class=secno>6.7
   380       </span>Numerical formatting: the font-variant-numeric property</a>
   382      <li><a href="#font-variant-alternates-prop"><span class=secno>6.8
   383       </span>Alternates and swashes: the font-variant-alternates property</a>
   386      <li><a href="#font-feature-values"><span class=secno>6.9 </span>Defining
   387       font specific alternates: the <code>@font-feature-values</code>
   388       rule</a>
   389       <ul class=toc>
   390        <li><a href="#basic-syntax"><span class=secno>6.9.1 </span>Basic
   391         syntax</a>
   393        <li><a href="#multi-valued-feature-value-definitions"><span
   394         class=secno>6.9.2 </span>Multi-valued feature value definitions</a>
   395       </ul>
   397      <li><a href="#font-variant-east-asian-prop"><span class=secno>6.10
   398       </span>East Asian text rendering: the font-variant-east-asian
   399       property</a>
   401      <li><a href="#font-variant-prop"><span class=secno>6.11 </span>Overall
   402       shorthand for font rendering: the font-variant property</a>
   404      <li><a href="#font-feature-settings-prop"><span class=secno>6.12
   405       </span>Low-level font feature settings control: the
   406       font-feature-settings property</a>
   408      <li><a href="#font-language-override-prop"><span class=secno>6.13
   409       </span>Font language override: the font-language-override property</a>
   410     </ul>
   412    <li><a href="#font-feature-resolution"><span class=secno>7 </span>Font
   413     Feature Resolution </a>
   414     <ul class=toc>
   415      <li><a href="#default-features"><span class=secno>7.1 </span>Default
   416       features</a>
   418      <li><a href="#feature-precedence"><span class=secno>7.2 </span>Feature
   419       precedence</a>
   421      <li><a href="#feature-precedence-examples"><span class=secno>7.3
   422       </span>Feature precedence examples</a>
   423     </ul>
   425    <li><a href="#object-model"><span class=secno>8 </span>Object Model</a>
   426     <ul class=toc>
   427      <li><a href="#om-fontface"><span class=secno>8.1 </span>The
   428       <code>CSSFontFaceRule</code> interface</a>
   430      <li><a href="#om-fontfeaturevalues"><span class=secno>8.2 </span>The
   431       <code>CSSFontFeatureValuesRule</code> interface</a>
   432     </ul>
   434    <li class=no-num><a href="#platform-props-to-css">Appendix A: Mapping
   435     platform font properties to CSS properties</a>
   437    <li class=no-num><a href="#ch-ch-ch-changes">Changes</a>
   438     <ul class=toc>
   439      <li class=no-num><a href="#recent-changes"> Changes from the July 2013
   440       CSS3 Fonts Last Call Working Draft</a>
   441     </ul>
   443    <li class=no-num><a href="#acknowledgments">Acknowledgments</a>
   445    <li class=no-num><a href="#conformance"> Conformance</a>
   446     <ul class=toc>
   447      <li class=no-num><a href="#conventions"> Document Conventions</a>
   449      <li class=no-num><a href="#conformance-classes"> Conformance Classes</a>
   452      <li class=no-num><a href="#partial"> Partial Implementations</a>
   454      <li class=no-num><a href="#experimental"> Experimental
   455       Implementations</a>
   457      <li class=no-num><a href="#testing"> Non-Experimental
   458       Implementations</a>
   459     </ul>
   461    <li class=no-num><a href="#references">References</a>
   462     <ul class=toc>
   463      <li class=no-num><a href="#normative-references">Normative
   464       References</a>
   466      <li class=no-num><a href="#other-references">Other References</a>
   467     </ul>
   469    <li class=no-num><a href="#index">Index</a>
   471    <li class=no-num><a href="#property-index">Property index</a>
   472   </ul>
   473   <!--end-toc-->
   475   <h2 id=introduction><span class=secno>1 </span>Introduction</h2>
   477   <p>A font provides a resource containing the visual representation of
   478    characters. At the simplest level it contains information that maps
   479    character codes to shapes (called glyphs) that represent these characters.
   480    Fonts sharing a common design style are commonly grouped into font
   481    families classified by a set of standard font properties. Within a family,
   482    the shape displayed for a given character can vary by stroke weight, slant
   483    or relative width, among others. An individual font face is described by a
   484    unique combination of these properties. For a given range of text, CSS
   485    font properties are used to select a font family and a specific font face
   486    within that family to be used when rendering that text. As a simple
   487    example, to use the bold form of Helvetica one could use:
   489   <pre>body {
   490     font-family: Helvetica;
   491     font-weight: bold;
   492 }</pre>
   494   <p>Font resources may be installed locally on the system on which a user
   495    agent is running or downloadable. For local font resources descriptive
   496    information can be obtained directly from the font resource. For
   497    downloadable font resources (sometimes referred to as web fonts), the
   498    descriptive information is included with the reference to the font
   499    resource.
   501   <p>Families of fonts typically don't contain a single face for each
   502    possible variation of font properties. The CSS font selection mechanism
   503    describes how to match a given set of CSS font properties to a single font
   504    face.
   506   <h2 id=typography-background><span class=secno>2 </span>Typography
   507    Background</h2>
   509   <p><em>This section is non-normative.</em>
   511   <p> Typographic traditions vary across the globe, so there is no unique way
   512    to classify all fonts across languages and cultures. For even common Latin
   513    letters, wide variations are possible:
   515   <div class=figure><img alt="variations in glyphs for a single character"
   516    src=aaaaaa.png>
   517    <p class=caption>One character, many glyph variations
   518   </div>
   520   <p>Differences in the anatomy of letterforms is one way to distinguish
   521    fonts. For Latin fonts, flourishes at the ends of a character's main
   522    strokes, or serifs, can distinguish a font from those without. Similar
   523    comparisons exist in non-Latin fonts between fonts with tapered strokes
   524    and those using primarily uniform strokes:
   526   <div class=figure><img alt="serif vs. non-serifs" src=serifvssansserif.png>
   527    <p class=caption>Letterforms with and without serifs
   528   </div>
   530   <div class=figure><img alt="serif vs. non-serifs for japanese"
   531    src=minchovsgothic.png>
   532    <p class=caption>Similar groupings for Japanese typefaces
   533   </div>
   535   <p>Fonts contain letterforms and the data needed to map characters to these
   536    letterforms. Often this may be a simple one-to-one mapping, but more
   537    complex mappings are also possible. The use of combining diacritic marks
   538    creates many variations for an underlying letterform:
   540   <div class=figure><img alt="diacritic marks" src=aaaaaa-diacritics.png>
   541    <p class=caption>Variations with diacritic marks
   542   </div>
   544   <p>A sequence of characters can be represented by a single glyph known as a
   545    ligature:
   547   <div class=figure><img alt="example of a fi ligature"
   548    src=final-ligature.png>
   549    <p class=caption>Ligature example
   550   </div>
   552   <p>Visual transformations based on textual context are often stylistic
   553    option in European languages. They are required to correctly render
   554    languages like Arabic, the lam and alef characters below <em>must</em> be
   555    combined when they exist in sequence:
   557   <div class=figure><img alt="lam alef ligature" src=lamaleflig.png>
   558    <p class=caption>Required Arabic ligature
   559   </div>
   561   <p>The relative complexity of these shaping transformations requires
   562    additional data within the font.
   564   <p>Sets of font faces with various stylistic variations are often grouped
   565    together into font families. In the simplest case a regular face is
   566    supplemented with bold and italic faces, but much more extensive groupings
   567    are possible. Variations in the thickness of letterform strokes, the <dfn
   568    id=weight>weight</dfn>, and the overall proportions of the letterform, the
   569    <dfn id=width>width</dfn>, are most common. In the example below, each
   570    letter uses a different font face within the Univers font family. The
   571    width used increases from top to bottom and the weight increases from left
   572    to right:
   574   <div class=figure><img alt="various width and weight variations within a
   575    single family" src=weightwidthvariations.png>
   576    <p class=caption>Weight and width variations within a single font family
   577   </div>
   579   <p>Creating fonts that support multiple scripts is a difficult task;
   580    designers need to understand the cultural traditions surrounding the use
   581    of type in different scripts and come up with letterforms that somehow
   582    share a common theme. Many languages often share a common script and each
   583    of these languages may have noticeable stylistic differences. For example,
   584    the Arabic script, when used for Persian and Urdu, exhibits significant
   585    and systematic differences in letterforms, as does Cyrillic when used with
   586    languages such as Serbian and Russian.
   588   <p>The <a href="#character-map"><em>character map</em></a> of a font
   589    defines the mapping of characters to glyphs for that font. If a document
   590    contains characters not supported by the <a href="#character-map"><em
   591    title="character map">character maps</em></a> of the fonts contained in a
   592    font family list, a user agent may use a <a
   593    href="#system-font-fallback"><em>system font fallback</em></a> procedure
   594    to locate an appropriate font that does. If no appropriate font can be
   595    found, some form of "missing glyph" character will be rendered by the user
   596    agent. System fallback can occur when the specified list of font families
   597    does not include a font that supports a given character.
   599   <p>Although the <a href="#character-map"><em>character map</em></a> of a
   600    font maps a given character to a glyph for that character, modern font
   601    technologies such as OpenType and AAT (Apple Advanced Typography) provide
   602    ways of mapping a character to different glyphs based upon feature
   603    settings. Fonts in these formats allow these features to be embedded in
   604    the font itself and controlled by applications. Common typographic
   605    features which can be specified this way include ligatures, swashes,
   606    contextual alternates, proportional and tabular figures, and automatic
   607    fractions, to list just a few. For a visual overview of OpenType features,
   608    see the <a href="#OPENTYPE-FONT-GUIDE"
   609    rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
   611   <h2 id=basic-font-props><span class=secno>3 </span>Basic Font Properties</h2>
   613   <p>The particular font face used to render a character is determined by the
   614    font family and other font properties that apply to a given element. This
   615    structure allows settings to be varied independent of each other.</p>
   616   <!-- prop: font-family -->
   618   <h3 id=font-family-prop><span class=secno>3.1 </span>Font family: the <a
   619    href="#propdef-font-family">font-family</a> property</h3>
   621   <table class=propdef id=namefont-familyvalue-ltfamily-namegt-ltg>
   622    <tbody>
   623     <tr>
   624      <td>Name:
   626      <td><dfn id=propdef-font-family
   627       title="font-family!!property">font-family</dfn>
   629     <tr>
   630      <td>Value:
   632      <td>[ <a href="#family-name-value"><var>&lt;family-name&gt;</var></a> |
   633       <a href="#generic-family-value"><var>&lt;generic-family&gt;</var></a> ]
   634       #
   636     <tr>
   637      <td>Initial:
   639      <td>depends on user agent
   641     <tr>
   642      <td>Applies to:
   644      <td>all elements
   646     <tr>
   647      <td>Inherited:
   649      <td>yes
   651     <tr>
   652      <td>Percentages:
   654      <td>N/A
   656     <tr>
   657      <td>Media:
   659      <td>visual
   661     <tr>
   662      <td>Computed value:
   664      <td>as specified
   666     <tr>
   667      <td>Animatable:
   669      <td>no
   670   </table>
   672   <p>This property specifies a prioritized list of font family names or
   673    generic family names. A font family defines a set of faces that vary in
   674    weight, width or slope. CSS uses the combination of a family name with
   675    other style attributes to select an individual face. Using this selection
   676    mechanism, rather than selecting a face via the style name as is often
   677    done in design applications, allows some degree of regularity in textual
   678    display when fallback occurs.
   680   <p class=note>Designers should note that the CSS definition of font
   681    attributes used for selection are explicitly not intended to define a font
   682    taxonomy. A type designer's idea of a family may often extend to a set of
   683    faces that vary along axes other than just the standard axes of weight,
   684    width and slope. A family may extend to include both a set of serif faces
   685    and a set of sans-serif faces or vary along axes that are unique to that
   686    family. The CSS font selection mechanism merely provides a way to
   687    determine the “closest” substitute when substitution is necessary.
   689   <p>Unlike other CSS properties, component values are a comma-separated list
   690    indicating alternatives. A user agent iterates through the list of family
   691    names until it matches an available font that contains a glyph for the
   692    character to be rendered. This allows for differences in available fonts
   693    across platforms and for differences in the range of characters supported
   694    by individual fonts.
   696   <p>A font family name only specifies a name given to a set of font faces,
   697    it does not specify an individual face. For example, given the
   698    availability of the fonts below, Futura would match but Futura Medium
   699    would not:
   701   <div class=figure><img alt="family and face names"
   702    src=familyvsfacename.png>
   703    <p class=caption>Family and individual face names
   704   </div>
   706   <p>Consider the example below:
   708   <div class=example>
   709    <pre>body {
   710     font-family: Helvetica, Verdana, sans-serif;
   711 }</pre>
   713    <p>If Helvetica is available it will be used when rendering. If neither
   714     Helvetica nor Verdana is present, then the user-agent-defined sans serif
   715     font will be used.</p>
   716   </div>
   718   <p>There are two types of font family names:
   720   <dl>
   721    <dt><dfn id=family-name-value><var>&lt;family-name&gt;</var></dfn>
   723    <dd>The name of a font family of choice such as Helvetica or Verdana in
   724     the previous example.
   726    <dt><dfn id=generic-family-value><var>&lt;generic-family&gt;</var></dfn>
   728    <dd> The following generic family keywords are defined: ‘<a
   729     href="#serif"><code class=property>serif</code></a>’, ‘<a
   730     href="#sans-serif"><code class=property>sans-serif</code></a>’, ‘<a
   731     href="#cursive"><code class=property>cursive</code></a>’, ‘<a
   732     href="#fantasy"><code class=property>fantasy</code></a>’, and ‘<a
   733     href="#monospace"><code class=property>monospace</code></a>’. These
   734     keywords can be used as a general fallback mechanism when an author's
   735     desired font choices are not available. As keywords, they must not be
   736     quoted. Authors are encouraged to append a generic font family as a last
   737     alternative for improved robustness.
   738   </dl>
   740   <p>Font family names other than generic families must either be given
   741    quoted as <a
   742    href="http://www.w3.org/TR/CSS21/syndata.html#strings">strings,</a> or
   743    unquoted as a sequence of one or more <a
   744    href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers.</a>
   745    This means most punctuation characters and digits at the start of each
   746    token must be escaped in unquoted font family names.
   748   <p>To illustrate this, the following declarations are invalid:
   750   <pre>
   751 font-family: Red/Black, sans-serif;
   752 font-family: "Lucida" Grande, sans-serif;
   753 font-family: Ahem!, sans-serif;
   754 font-family: test@foo, sans-serif;
   755 font-family: #POUND, sans-serif;
   756 font-family: Hawaii 5-0, sans-serif;
   757 </pre>
   759   <p>If a sequence of identifiers is given as a font family name, the
   760    computed value is the name converted to a string by joining all the
   761    identifiers in the sequence by single spaces.
   763   <p>To avoid mistakes in escaping, it is recommended to quote font family
   764    names that contain white space, digits, or punctuation characters other
   765    than hyphens:
   767   <pre>
   768 body { font-family: "New Century Schoolbook", serif }
   770 &lt;BODY STYLE="font-family: '21st Century', fantasy">
   771 </pre>
   773   <p>Font family <em>names</em> that happen to be the same as a keyword value
   774    (‘<code class=property>inherit</code>’, ‘<a href="#serif"><code
   775    class=property>serif</code></a>’, ‘<a href="#sans-serif"><code
   776    class=property>sans-serif</code></a>’, ‘<a href="#monospace"><code
   777    class=property>monospace</code></a>’, ‘<a href="#fantasy"><code
   778    class=property>fantasy</code></a>’, and ‘<a href="#cursive"><code
   779    class=property>cursive</code></a>’) must be quoted to prevent confusion
   780    with the keywords with the same names. The keywords ‘<code
   781    class=property>initial</code>’ and ‘<code
   782    class=property>default</code>’ are reserved for future use and must also
   783    be quoted when used as font names. UAs must not consider these keywords as
   784    matching the <a
   785    href="#family-name-value"><var>&lt;family-name&gt;</var></a> type.
   787   <p>The precise way a set of fonts are grouped into font families varies
   788    depending upon the platform font management API's. The Windows GDI API
   789    only allows four faces to be grouped into a family while the DirectWrite
   790    API and API's on OSX and other platforms support font families with a
   791    variety of weights, widths and slopes (see <a
   792    href="#platform-props-to-css">Appendix A</a> for more details).
   794   <p>Some font formats allow fonts to carry multiple localizations of the
   795    family name. User agents must recognize and correctly match all of these
   796    names independent of the underlying platform localization, system API used
   797    or document encoding:
   799   <div class=figure><img alt="examples of localized family names"
   800    src=localizedfamilynames.png>
   801    <p class=caption>Localized family names
   802   </div>
   804   <p>The details of localized font family name matching and the corresponding
   805    issues of case sensitivity are described below in the <a
   806    href="#font-family-casing">font matching</a> section.
   808   <h4 id=generic-font-families><span class=secno>3.1.1 </span>Generic font
   809    families</h4>
   811   <p>All five generic font families are defined to exist in all CSS
   812    implementations (they need not necessarily map to five distinct actual
   813    fonts). User agents should provide reasonable default choices for the
   814    generic font families, which express the characteristics of each family as
   815    well as possible within the limits allowed by the underlying technology.
   816    User agents are encouraged to allow users to select alternative choices
   817    for the generic fonts.
   819   <h5 class="no-num no-toc"> <span class=index-def id=serif0 title="serif,
   820    definition of"><a name=serif-def><dfn id=serif>serif</dfn></a></span></h5>
   822   <p>Serif fonts represent the formal text style for a script. This often
   823    means but is not limited to glyphs that have finishing strokes, flared or
   824    tapering ends, or have actual serifed endings (including slab serifs).
   825    Serif fonts are typically proportionately-spaced. They often display a
   826    greater variation between thick and thin strokes than fonts from the ‘<a
   827    href="#sans-serif"><code class=property>sans-serif</code></a>’ generic
   828    font family. CSS uses the term ‘<a href="#serif"><code
   829    class=property>serif</code></a>’ to apply to a font for any script,
   830    although other names may be more familiar for particular scripts, such as
   831    Mincho (Japanese), Sung, Song or Kai (Chinese), Batang (Korean). For
   832    Arabic, the Naskh style would correspond to ‘<a href="#serif"><code
   833    class=property>serif</code></a>’ more due to its typographic role rather
   834    than its actual design style. Any font that is so described may be used to
   835    represent the generic ‘<a href="#serif"><code
   836    class=property>serif</code></a>’ family.
   838   <div class=figure><img alt="sample serif fonts" src=serifexamples.png>
   839    <p class=caption>Sample serif fonts
   840   </div>
   842   <h5 class="no-num no-toc"> <span class=index-def id=sans-serif0
   843    title="sans-serif, definition of"> <a name=sans-serif-def><dfn
   844    id=sans-serif>sans-serif</dfn></a></span></h5>
   846   <p>Glyphs in sans-serif fonts, as the term is used in CSS, are generally
   847    low contrast (vertical and horizontal stems have the close to the same
   848    thickness) and have stroke endings that are plain -- without any flaring,
   849    cross stroke, or other ornamentation. Sans-serif fonts are typically
   850    proportionately-spaced. They often have little variation between thick and
   851    thin strokes, compared to fonts from the ‘<a href="#serif"><code
   852    class=property>serif</code></a>’ family. CSS uses the term ‘<a
   853    href="#sans-serif"><code class=property>sans-serif</code></a>’ to apply
   854    to a font for any script, although other names may be more familiar for
   855    particular scripts, such as Gothic (Japanese), Hei (Chinese), or Gulim
   856    (Korean). Any font that is so described may be used to represent the
   857    generic ‘<a href="#sans-serif"><code
   858    class=property>sans-serif</code></a>’ family.
   860   <div class=figure><img alt="sample sans-serif fonts"
   861    src=sansserifexamples.png>
   862    <p class=caption>Sample sans-serif fonts
   863   </div>
   865   <h5 class="no-num no-toc"> <span class=index-def id=cursive0
   866    title="cursive, definition of"> <a name=cursive-def><dfn
   867    id=cursive>cursive</dfn></a></span></h5>
   869   <p>Glyphs in cursive fonts generally use a more informal script style, and
   870    the result looks more like handwritten pen or brush writing than printed
   871    letterwork. CSS uses the term ‘<a href="#cursive"><code
   872    class=property>cursive</code></a>’ to apply to a font for any script,
   873    although other names such as Chancery, Brush, Swing and Script are also
   874    used in font names.
   876   <div class=figure><img alt="sample cursive fonts" src=cursiveexamples.png>
   877    <p class=caption>Sample cursive fonts
   878   </div>
   880   <h5 class="no-num no-toc"> <span class=index-def id=fantasy0
   881    title="fantasy, definition of"> <a name=fantasy-def><dfn
   882    id=fantasy>fantasy</dfn></a></span></h5>
   884   <p>Fantasy fonts are primarily decorative or expressive fonts that contain
   885    decorative or expressive representations of characters. These do not
   886    include Pi or Picture fonts which do not represent actual characters.
   888   <div class=figure><img alt="sample fantasy fonts" src=fantasyexamples.png>
   889    <p class=caption>Sample fantasy fonts
   890   </div>
   892   <h5 class="no-num no-toc"> <span class=index-def id=monospace0
   893    title="monospace, definition of"> <a name=monospace-def><dfn
   894    id=monospace>monospace</dfn></a></span></h5>
   896   <p>The sole criterion of a monospace font is that all glyphs have the same
   897    fixed width. This is often used to render samples of computer code.
   899   <div class=figure><img alt="sample monospace fonts"
   900    src=monospaceexamples.png>
   901    <p class=caption>Sample monospace fonts
   902   </div>
   903   <!-- prop: font-weight -->
   905   <h3 id=font-weight-prop><span class=secno>3.2 </span>Font weight: the <a
   906    href="#propdef-font-weight">font-weight</a> property</h3>
   908   <table class=propdef id=namefont-weightvaluenormal-bold-bolder-l>
   909    <tbody>
   910     <tr>
   911      <td>Name:
   913      <td><dfn id=propdef-font-weight
   914       title="font-weight!!property">font-weight</dfn>
   916     <tr>
   917      <td>Value:
   919      <td><a href="#font-weight-normal-value"
   920       title="normal!!font-weight">normal</a> | <a href="#bold">bold</a> | <a
   921       href="#bolder">bolder</a> | <a href="#lighter">lighter</a> | <a
   922       href="#font-weight-numeric-values" title="100...900 weight
   923       values">100</a> | <a href="#font-weight-numeric-values"
   924       title="100...900 weight values">200</a> | <a
   925       href="#font-weight-numeric-values" title="100...900 weight
   926       values">300</a> | <a href="#font-weight-numeric-values"
   927       title="100...900 weight values">400</a> | <a
   928       href="#font-weight-numeric-values" title="100...900 weight
   929       values">500</a> | <a href="#font-weight-numeric-values"
   930       title="100...900 weight values">600</a> | <a
   931       href="#font-weight-numeric-values" title="100...900 weight
   932       values">700</a> | <a href="#font-weight-numeric-values"
   933       title="100...900 weight values">800</a> | <a
   934       href="#font-weight-numeric-values" title="100...900 weight
   935       values">900</a>
   937     <tr>
   938      <td>Initial:
   940      <td>normal
   942     <tr>
   943      <td>Applies to:
   945      <td>all elements
   947     <tr>
   948      <td>Inherited:
   950      <td>yes
   952     <tr>
   953      <td>Percentages:
   955      <td>N/A
   957     <tr>
   958      <td>Media:
   960      <td>visual
   962     <tr>
   963      <td>Computed value:
   965      <td>numeric weight value (see description)
   967     <tr>
   968      <td>Animatable:
   970      <td>as <a
   971       href="http://dev.w3.org/csswg/css-transitions/#animtype-font-weight">font
   972       weight</a>
   973   </table>
   975   <p>The <a href="#propdef-font-weight"
   976    title="font-weight!!property">‘<code
   977    class=property>font-weight</code>’</a> property specifies the weight of
   978    glyphs in the font, their degree of blackness or stroke thickness.
   980   <p>Values have the following meanings:
   982   <dl>
   983    <dt><dfn id=font-weight-numeric-values title="100...900 weight values">100
   984     to 900</dfn>
   986    <dd>These values form an ordered sequence, where each number indicates a
   987     weight that is at least as dark as its predecessor. These roughly
   988     correspond to the commonly used weight names below:
   989   </dl>
   991   <ul>
   992    <li>100 - Thin
   994    <li>200 - Extra Light (Ultra Light)
   996    <li>300 - Light
   998    <li>400 - Normal
  1000    <li>500 - Medium
  1002    <li>600 - Semi Bold (Demi Bold)
  1004    <li>700 - Bold
  1006    <li>800 - Extra Bold (Ultra Bold)
  1008    <li>900 - Black (Heavy)
  1009   </ul>
  1011   <dl>
  1012    <dt><dfn id=font-weight-normal-value
  1013     title="normal!!font-weight">normal</dfn>
  1015    <dd>Same as ‘<code class=css>400</code>’.
  1017    <dt><dfn id=bold>bold</dfn>
  1019    <dd>Same as ‘<code class=css>700</code>’.
  1021    <dt><dfn id=bolder>bolder</dfn>
  1023    <dd>Specifies a bolder weight than the inherited value.
  1025    <dt><dfn id=lighter>lighter</dfn>
  1027    <dd>Specifies a lighter weight than the inherited value.
  1028   </dl>
  1030   <p>Font formats that use a scale other than a nine-step scale should map
  1031    their scale onto the CSS scale so that 400 roughly corresponds with a face
  1032    that would be labeled as Regular, Book, Roman and 700 roughly matches a
  1033    face that would be labeled as Bold. Or weights may be inferred from the
  1034    style names, ones that correspond roughly with the scale above. The scale
  1035    is relative, so a face with a larger weight value must never appear
  1036    lighter. If style names are used to infer weights, care should be taken to
  1037    handle variations in style names across locales.
  1039   <p>Quite often there are only a few weights available for a particular font
  1040    family. When a weight is specified for which no face exists, a face with a
  1041    nearby weight is used. In general, bold weights map to faces with heavier
  1042    weights and light weights map to faces with lighter weights (see the <a
  1043    href="#font-matching-algorithm">font matching section below</a> for a
  1044    precise definition). The examples here illustrate which face is used for
  1045    different weights, grey indicates a face for that weight does not exist so
  1046    a face with a nearby weight is used:
  1048   <div class=figure><img alt="weight mappings for a family with 400, 700 and
  1049    900 weights" src=optimaweights.png>
  1050    <p class=caption>Weight mappings for a font family with 400, 700 and 900
  1051     weight faces
  1052   </div>
  1054   <div class=figure><img alt="weight mappings for a family with 300, 600
  1055    weights" src=hiraginoweights.png>
  1056    <p class=caption>Weight mappings for a font family with 300 and 600 weight
  1057     faces
  1058   </div>
  1060   <p>Although the practice is not well-loved by typographers, bold faces are
  1061    often synthesized by user agents for faces that lack actual bold faces.
  1062    For the purposes of style matching, these faces must be treated as if they
  1063    exist within the family. Authors can explicitly avoid this behavior by
  1064    using the ‘<a href="#propdef-font-synthesis"><code
  1065    class=property>font-synthesis</code></a>’ property.
  1067   <p>Specified values of ‘<a href="#bolder"><code
  1068    class=property>bolder</code></a>’ and ‘<a href="#lighter"><code
  1069    class=property>lighter</code></a>’ indicate weights relative to the
  1070    weight of the parent element. The computed weight is calculated based on
  1071    the inherited <a href="#propdef-font-weight"
  1072    title="font-weight!!property">‘<code
  1073    class=property>font-weight</code>’</a> value using the chart below.
  1075   <table class=data id=bolderlighter summary="Bolder/lighter mappings">
  1076    <thead>
  1077     <tr>
  1078      <th>Inherited value
  1080      <th>bolder
  1082      <th>lighter
  1084    <tbody>
  1085     <tr>
  1086      <th>100
  1088      <td>400
  1090      <td>100
  1092     <tr>
  1093      <th>200
  1095      <td>400
  1097      <td>100
  1099     <tr>
  1100      <th>300
  1102      <td>400
  1104      <td>100
  1106     <tr>
  1107      <th>400
  1109      <td>700
  1111      <td>100
  1113     <tr>
  1114      <th>500
  1116      <td>700
  1118      <td>100
  1120     <tr>
  1121      <th>600
  1123      <td>900
  1125      <td>400
  1127     <tr>
  1128      <th>700
  1130      <td>900
  1132      <td>400
  1134     <tr>
  1135      <th>800
  1137      <td>900
  1139      <td>700
  1141     <tr>
  1142      <th>900
  1144      <td>900
  1146      <td>700
  1147   </table>
  1149   <p>The table above is equivalent to selecting the next relative bolder or
  1150    lighter face, given a font family containing normal and bold faces along
  1151    with a thin and a heavy face. Authors who desire finer control over the
  1152    exact weight values used for a given element may use numerical values
  1153    instead of relative weights.</p>
  1154   <!-- prop: font-stretch -->
  1156   <h3 id=font-stretch-prop><span class=secno>3.3 </span>Font width: the <a
  1157    href="#propdef-font-stretch">font-stretch</a> property</h3>
  1159   <table class=propdef id=namefont-stretchvalue-normal-ultra-conde>
  1160    <tbody>
  1161     <tr>
  1162      <td>Name:
  1164      <td><dfn id=propdef-font-stretch
  1165       title="font-stretch!!property">font-stretch</dfn>
  1167     <tr>
  1168      <td>Value:
  1170      <td> <a href="#font-stretch-normal-value"
  1171       title="normal!!font-stretch">normal</a> | <a
  1172       href="#ultra-condensed">ultra-condensed</a> | <a
  1173       href="#extra-condensed">extra-condensed</a> | <a
  1174       href="#condensed">condensed</a> | <a
  1175       href="#semi-condensed-">semi-condensed</a> | <a
  1176       href="#semi-expanded">semi-expanded</a> | <a
  1177       href="#expanded">expanded</a> | <a
  1178       href="#extra-expanded">extra-expanded</a> | <a
  1179       href="#ultra-expanded">ultra-expanded</a>
  1181     <tr>
  1182      <td>Initial:
  1184      <td>normal
  1186     <tr>
  1187      <td>Applies to:
  1189      <td>all elements
  1191     <tr>
  1192      <td>Inherited:
  1194      <td>yes
  1196     <tr>
  1197      <td>Percentages:
  1199      <td>N/A
  1201     <tr>
  1202      <td>Media:
  1204      <td>visual
  1206     <tr>
  1207      <td>Computed value:
  1209      <td>as specified
  1211     <tr>
  1212      <td>Animatable:
  1214      <td>as <a href="#font-stretch-animation">font stretch</a>
  1215   </table>
  1217   <p>The <a href="#propdef-font-stretch"
  1218    title="font-stretch!!property">‘<code
  1219    class=property>font-stretch</code>’</a> property selects a normal,
  1220    condensed, or expanded face from a font family. Absolute keyword values
  1221    have the following ordering, from narrowest to widest:
  1223   <ul>
  1224    <li><dfn id=ultra-condensed>ultra-condensed</dfn>
  1226    <li><dfn id=extra-condensed>extra-condensed</dfn>
  1228    <li><dfn id=condensed>condensed</dfn>
  1230    <li><dfn id=semi-condensed->semi-condensed </dfn>
  1232    <li><dfn id=font-stretch-normal-value
  1233     title="normal!!font-stretch">normal</dfn>
  1235    <li><dfn id=semi-expanded>semi-expanded</dfn>
  1237    <li><dfn id=expanded>expanded</dfn>
  1239    <li><dfn id=extra-expanded>extra-expanded</dfn>
  1241    <li><dfn id=ultra-expanded>ultra-expanded</dfn>
  1242   </ul>
  1244   <p>When a face does not exist for a given width, normal or condensed values
  1245    map to a narrower face, otherwise a wider face. Conversely, expanded
  1246    values map to a wider face, otherwise a narrower face. The figure below
  1247    shows how the nine font-stretch property settings affect font selection
  1248    for font family containing a variety of widths, grey indicates a width for
  1249    which no face exists and a different width is substituted:
  1251   <div class=figure><img alt="width mappings for a family with condensed,
  1252    normal and expanded faces" src=universwidths.png>
  1253    <p class=caption>Width mappings for a font family with condensed, normal
  1254     and expanded width faces
  1255   </div>
  1257   <p id=font-stretch-animation>Animation of font stretch: Font stretch is
  1258    interpolated in discrete steps. The interpolation happens as though the
  1259    ordered values are equally spaced real numbers. The interpolation result
  1260    is rounded to the nearest value, with values exactly halfway between two
  1261    values rounded towards the later value in the list above.</p>
  1262   <!-- prop: font-style -->
  1264   <h3 id=font-style-prop><span class=secno>3.4 </span>Font style: the <a
  1265    href="#propdef-font-style">font-style</a> property</h3>
  1267   <table class=propdef id=namefont-stylevaluenormal-italic-oblique>
  1268    <tbody>
  1269     <tr>
  1270      <td>Name:
  1272      <td><dfn id=propdef-font-style
  1273       title="font-style!!property">font-style</dfn>
  1275     <tr>
  1276      <td>Value:
  1278      <td><a href="#font-style-normal-value"
  1279       title="normal!!font-style">normal</a> | <a href="#italic">italic</a> |
  1280       <a href="#oblique">oblique</a>
  1282     <tr>
  1283      <td>Initial:
  1285      <td>normal
  1287     <tr>
  1288      <td>Applies to:
  1290      <td>all elements
  1292     <tr>
  1293      <td>Inherited:
  1295      <td>yes
  1297     <tr>
  1298      <td>Percentages:
  1300      <td>N/A
  1302     <tr>
  1303      <td>Media:
  1305      <td>visual
  1307     <tr>
  1308      <td>Computed value:
  1310      <td>as specified
  1312     <tr>
  1313      <td>Animatable:
  1315      <td>no
  1316   </table>
  1318   <p>The <a href="#propdef-font-style" title="font-style!!property">‘<code
  1319    class=property>font-style</code>’</a> property allows italic or oblique
  1320    faces to be selected. Italic forms are generally cursive in nature while
  1321    oblique faces are typically sloped versions of the regular face. Oblique
  1322    faces can be simulated by artificially sloping the glyphs of the regular
  1323    face. Compare the artificially sloped renderings of Palatino ‘<code
  1324    class=property>a</code>’ and Baskerville ‘<code
  1325    class=property>N</code>’ in grey with the actual italic versions:
  1327   <div class=figure><img alt="artificial sloping vs. real italics"
  1328    src=realvsfakeitalics.png>
  1329    <p class=caption>Artificial sloping versus real italics
  1330   </div>
  1332   <p>Values have the following meanings:
  1334   <dl>
  1335    <dt><dfn id=font-style-normal-value
  1336     title="normal!!font-style">normal</dfn>
  1338    <dd>selects a face that is classified as a normal face, one that is
  1339     neither italic or obliqued
  1341    <dt><dfn id=italic>italic</dfn>
  1343    <dd>selects a font that is labeled as an italic face, or an oblique face
  1344     if one is not
  1346    <dt><dfn id=oblique>oblique</dfn>
  1348    <dd>selects a font that is labeled as an oblique face, or an italic face
  1349     if one is not
  1350   </dl>
  1352   <p>If no italic or oblique face is available, oblique faces can be
  1353    synthesized by rendering non-obliqued faces with an artificial obliquing
  1354    operation. The use of these artificially obliqued faces can be disabled
  1355    using the ‘<a href="#propdef-font-synthesis"><code
  1356    class=property>font-synthesis</code></a>’ property. The details of the
  1357    obliquing operation are not explicitly defined.
  1359   <p class=note>Authors should also be aware that synthesized approaches may
  1360    not be suitable for scripts like Cyrillic, where italic forms are very
  1361    different in shape. It is always better to use an actual italic font
  1362    rather than rely on a synthetic version.</p>
  1363   <!-- resolution on the "undefined" nature of synthetics: http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
  1365   <p>Many scripts lack the tradition of mixing a cursive form within text
  1366    rendered with a normal face. Chinese, Japanese and Korean fonts almost
  1367    always lack italic or oblique faces. Fonts that support a mixture of
  1368    scripts will sometimes omit specific scripts such as Arabic from the set
  1369    of glyphs supported in the italic face. User agents should be careful
  1370    about making <a href="#character-map"><em>character map</em></a>
  1371    assumptions across faces when implementing support for <a
  1372    href="#system-font-fallback"><em>system font fallback</em></a>.</p>
  1373   <!-- prop: font-size -->
  1375   <h3 id=font-size-prop><span class=secno>3.5 </span>Font size: the <a
  1376    href="#propdef-font-size">font-size</a> property</h3>
  1378   <table class=propdef id=namefont-sizevalueltabsolute-sizegt-ltre>
  1379    <tbody>
  1380     <tr>
  1381      <td>Name:
  1383      <td><dfn id=propdef-font-size>font-size</dfn>
  1385     <tr>
  1386      <td>Value:
  1388      <td><a href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a>
  1389       | <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a> |
  1390       <a href="#length-size-value"><var>&lt;length&gt;</var></a> | <a
  1391       href="#percentage-size-value"><var>&lt;percentage&gt;</var></a>
  1393     <tr>
  1394      <td>Initial:
  1396      <td>medium
  1398     <tr>
  1399      <td>Applies to:
  1401      <td>all elements
  1403     <tr>
  1404      <td>Inherited:
  1406      <td>yes
  1408     <tr>
  1409      <td>Percentages:
  1411      <td>refer to parent element's font size
  1413     <tr>
  1414      <td>Media:
  1416      <td>visual
  1418     <tr>
  1419      <td>Computed value:
  1421      <td>absolute length
  1423     <tr>
  1424      <td>Animatable:
  1426      <td>as <a
  1427       href="http://dev.w3.org/csswg/css-transitions/#animtype-length">length</a>
  1428   </table>
  1430   <p>This property indicates the desired height of glyphs from the font. For
  1431    scalable fonts, the font-size is a scale factor applied to the EM unit of
  1432    the font. (Note that certain glyphs may bleed outside their EM box.) For
  1433    non-scalable fonts, the font-size is converted into absolute units and
  1434    matched against the declared font-size of the font, using the same
  1435    absolute coordinate space for both of the matched values. Values have the
  1436    following meanings:
  1438   <dl>
  1439    <dt><dfn id=absolute-size-value><var>&lt;absolute-size&gt;</var></dfn>
  1441    <dd> An <a
  1442     href="#absolute-size-value"><var>&lt;absolute-size&gt;</var></a> keyword
  1443     refers to an entry in a table of font sizes computed and kept by the user
  1444     agent. Possible values are:
  1445     <p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
  1447    <dt><dfn id=relative-size-value><var>&lt;relative-size&gt;</var></dfn>
  1449    <dd> A <a href="#relative-size-value"><var>&lt;relative-size&gt;</var></a>
  1450     keyword is interpreted relative to the table of font sizes and the
  1451     computed ‘<a href="#propdef-font-size"><code
  1452     class=property>font-size</code></a>’ of the parent element. Possible
  1453     values are:
  1454     <p> [ larger | smaller ]
  1456     <p> For example, if the parent element has a font size of ‘<code
  1457      class=property>medium</code>’, a value of ‘<code
  1458      class=property>larger</code>’ will make the font size of the current
  1459      element be ‘<code class=property>large</code>’. If the parent
  1460      element's size is not close to a table entry, the user agent is free to
  1461      interpolate between table entries or round off to the closest one. The
  1462      user agent may have to extrapolate table values if the numerical value
  1463      goes beyond the keywords.
  1465    <dt><dfn id=length-size-value><var>&lt;length&gt;</var></dfn>
  1467    <dd>A length value specifies an absolute font size (independent of the
  1468     user agent's font table). Negative lengths are illegal.
  1470    <dt><dfn id=percentage-size-value><var>&lt;percentage&gt;</var></dfn>
  1472    <dd>A percentage value specifies an absolute font size relative to the
  1473     parent element's font size. Use of percentage values, or values in
  1474     ‘<code class=property>em</code>’s, leads to more robust and
  1475     cascadable style sheets.
  1476   </dl>
  1478   <p>The following table provides user agent guidelines for the absolute-size
  1479    scaling factor and their mapping to HTML heading and absolute font-sizes.
  1480    The ‘<code class=property>medium</code>’ value is used as the
  1481    reference middle value. The user agent may fine-tune these values for
  1482    different fonts or different types of display devices.
  1484   <table class=data>
  1485    <thead>
  1486     <tr>
  1487      <th>CSS absolute-size values
  1489      <th>xx-small
  1491      <th>x-small
  1493      <th>small
  1495      <th>medium
  1497      <th>large
  1499      <th>x-large
  1501      <th>xx-large
  1503      <th> 
  1505    <tbody>
  1506     <tr>
  1507      <th>scaling factor
  1509      <td>3/5
  1511      <td>3/4
  1513      <td>8/9
  1515      <td>1
  1517      <td>6/5
  1519      <td>3/2
  1521      <td>2/1
  1523      <td>3/1
  1525     <tr>
  1526      <th>HTML headings
  1528      <td>h6
  1530      <td> 
  1532      <td>h5
  1534      <td>h4
  1536      <td>h3
  1538      <td>h2
  1540      <td>h1
  1542      <td> 
  1544     <tr>
  1545      <th>HTML font sizes
  1547      <td>1
  1549      <td> 
  1551      <td>2
  1553      <td>3
  1555      <td>4
  1557      <td>5
  1559      <td>6
  1561      <td>7
  1562   </table>
  1564   <p class=note><em><strong>Note 1.</strong> To preserve readability, an UA
  1565    applying these guidelines should nevertheless avoid creating font-size
  1566    resulting in less than 9 device pixels per EM unit on a computer
  1567    display.</em>
  1569   <p class=note><em><strong>Note 2.</strong> In CSS1, the suggested scaling
  1570    factor between adjacent indexes was 1.5 which user experience proved to be
  1571    too large. In CSS2, the suggested scaling factor for computer screen
  1572    between adjacent indexes was 1.2 which still created issues for the small
  1573    sizes. The new scaling factor varies between each index to provide a
  1574    better readability.</em>
  1576   <p>The actual value of this property may differ from the computed value due
  1577    a numerical value on ‘<a href="#propdef-font-size-adjust"><code
  1578    class=property>font-size-adjust</code></a>’ and the unavailability of
  1579    certain font sizes.
  1581   <p>Child elements inherit the computed <a class=noxref
  1582    href="#font-size-prop"> <span class=property>‘<code
  1583    class=property>font-size</code>’</span></a> value (otherwise, the effect
  1584    of <a class=noxref href="#font-size-adjust-prop"><span
  1585    class=property>‘<code
  1586    class=property>font-size-adjust</code>’</span></a> would compound).
  1588   <div class=example>
  1589    <p style="display:none">Example(s):</p>
  1591    <pre>p { font-size: 12pt; }
  1592 blockquote { font-size: larger }
  1593 em { font-size: 150% }
  1594 em { font-size: 1.5em }
  1595 </pre>
  1596   </div>
  1597   <!-- prop: font-size-adjust -->
  1599   <h3 id=font-size-adjust-prop><span class=secno>3.6 </span>Relative sizing:
  1600    the <a href="#propdef-font-size-adjust">font-size-adjust</a> property</h3>
  1602   <table class=propdef id=namefont-size-adjustvaluenone-ltnumbergt>
  1603    <tbody>
  1604     <tr>
  1605      <td>Name:
  1607      <td><dfn id=propdef-font-size-adjust>font-size-adjust</dfn>
  1609     <tr>
  1610      <td>Value:
  1612      <td><a href="#font-size-adjust-none-value"
  1613       title="none!!font-size-adjust">none</a> | <a
  1614       href="#aspect-ratio-value"><var>&lt;number&gt;</var></a>
  1616     <tr>
  1617      <td>Initial:
  1619      <td>none
  1621     <tr>
  1622      <td>Applies to:
  1624      <td>all elements
  1626     <tr>
  1627      <td>Inherited:
  1629      <td>yes
  1631     <tr>
  1632      <td>Percentages:
  1634      <td>N/A
  1636     <tr>
  1637      <td>Media:
  1639      <td>visual
  1641     <tr>
  1642      <td>Computed value:
  1644      <td>as specified
  1646     <tr>
  1647      <td>Animatable:
  1649      <td>as <a
  1650       href="http://dev.w3.org/csswg/css-transitions/#animtype-number">number</a>
  1651   </table>
  1653   <p>For any given font size, the apparent size and legibility of text varies
  1654    across fonts. For scripts such as Latin or Cyrillic that distinguish
  1655    between upper and lowercase letters, the relative height of lowercase
  1656    letters compared to their uppercase counterparts is a determining factor
  1657    of legibility. This is commonly referred to as the <a class=index-def
  1658    href="#aspect-value" id=aspect-value0 title="aspect value"><dfn
  1659    id=aspect-value>aspect value</dfn></a>. Precisely defined, it is equal to
  1660    the x-height of a font divided by the font size.
  1662   <p>In situations where font fallback occurs, fallback fonts may not share
  1663    the same aspect value as the desired font family and will thus appear less
  1664    readable. The ‘<a href="#propdef-font-size-adjust"><code
  1665    class=property>font-size-adjust</code></a>’ property is a way to
  1666    preserve the readability of text when font fallback occurs. It does this
  1667    by adjusting the font-size so that the x-height is the same regardless of
  1668    the font used.
  1670   <div class=example>
  1671    <p>The style defined below defines Verdana as the desired font family, but
  1672     if Verdana is not available Futura or Times will be used.</p>
  1674    <pre>p {
  1675     font-family: Verdana, Futura, Times;
  1678 &lt;p>Lorem ipsum dolor sit amet, ...&lt;/p>
  1679 </pre>
  1681    <p>Verdana has a relatively high aspect value, lowercase letters are
  1682     relatively tall compared to uppercase letters, so at small sizes text
  1683     appears legible. Times has a lower aspect value and so if fallback
  1684     occurs, the text will be less legible at small sizes than Verdana.</p>
  1685   </div>
  1687   <p>How text rendered in each of these fonts compares is shown below, the
  1688    columns show text rendered in Verdana, Futura and Times. The same
  1689    font-size value is used across cells within each row and red lines are
  1690    included to show the differences in x-height. In the upper half each row
  1691    is rendered in the same font-size value. The same is true for the lower
  1692    half but in this half the ‘<a href="#propdef-font-size-adjust"><code
  1693    class=property>font-size-adjust</code></a>’ property is also set so that
  1694    the actual font size is adjusted to preserve the x-height across each row.
  1695    Note how small text remains relatively legible across each row in the
  1696    lower half.
  1698   <div class=figure><img alt="text with and without 'font-size-adjust'"
  1699    src=fontsizeadjust.png>
  1700    <p class=caption>Text with and without the use of ‘<a
  1701     href="#propdef-font-size-adjust"><code
  1702     class=property>font-size-adjust</code></a>’
  1703   </div>
  1705   <p>This property allows authors to specify an <a
  1706    href="#aspect-value"><i>aspect value</i></a> for an element that will
  1707    effectively preserve the x-height of the first choice font, whether it is
  1708    substituted or not. Values have the following meanings:
  1710   <dl>
  1711    <dt><dfn id=font-size-adjust-none-value
  1712     title="none!!font-size-adjust">none</dfn>
  1714    <dd>Do not preserve the font's x-height.
  1716    <dt><dfn id=aspect-ratio-value><var>&lt;number&gt;</var></dfn>
  1718    <dd>Specifies the <a href="#aspect-value"><i>aspect value</i></a> used in
  1719     the calculation below to calculate the adjusted font size:
  1720     <pre>c  =  ( a / a' ) s
  1721 </pre>
  1723     <p>where:</p>
  1725     <pre>s  =  font-size value
  1726 a  =  <a href="#aspect-value"><i>aspect value</i></a> as specified by the 'font-size-adjust' property
  1727 a' =  <a href="#aspect-value"><i>aspect value</i></a> of actual font
  1728 c  =  adjusted font-size to use
  1729 </pre>
  1731     <p>This value applies to any font that is selected but in typical usage
  1732      it should be based on the <a href="#aspect-value"><i>aspect
  1733      value</i></a> of the first font in the font-family list. If this is
  1734      specified accurately, the <tt>(a/a')</tt> term in the formula above is
  1735      effectively 1 for the first font and no adjustment occurs. If the value
  1736      is specified inaccurately, text rendered using the first font in the
  1737      family list will display differently in older user agents that don't
  1738      support ‘<a href="#propdef-font-size-adjust"><code
  1739      class=property>font-size-adjust</code></a>’.</p>
  1740   </dl>
  1742   <p>The value of ‘<a href="#propdef-font-size-adjust"><code
  1743    class=property>font-size-adjust</code></a>’ affects the used value of
  1744    ‘<a href="#propdef-font-size"><code
  1745    class=property>font-size</code></a>’ but does not affect the computed
  1746    value. It affects the size of relative units that are based on font
  1747    metrics of the <a href="#first-available-font"><i>first available
  1748    font</i></a> such as <code>ex</code> and <code>ch</code> but does not
  1749    affect the size of <code>em</code> units. Since numeric values of <a
  1750    href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
  1751    class=property>line-height</code>’</a> refer to the computed size of
  1752    ‘<a href="#propdef-font-size"><code
  1753    class=property>font-size</code></a>’, ‘<a
  1754    href="#propdef-font-size-adjust"><code
  1755    class=property>font-size-adjust</code></a>’ does not affect the used
  1756    value of <a
  1757    href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
  1758    class=property>line-height</code>’</a>.
  1760   <p class=note>In CSS, authors often specify <a
  1761    href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
  1762    class=property>line-height</code>’</a> as a multiple of the ‘<a
  1763    href="#propdef-font-size"><code class=property>font-size</code></a>’.
  1764    Since the ‘<a href="#propdef-font-size-adjust"><code
  1765    class=property>font-size-adjust</code></a>’ property affects the used
  1766    value of ‘<a href="#propdef-font-size"><code
  1767    class=property>font-size</code></a>’, authors should take care setting
  1768    the line height when ‘<a href="#propdef-font-size-adjust"><code
  1769    class=property>font-size-adjust</code></a>’ is used. Setting the line
  1770    height too tightly can result in overlapping lines of text in this
  1771    situation.
  1773   <p>Authors can calculate the <a href="#aspect-value"><i>aspect
  1774    value</i></a> for a given font by comparing spans with the same content
  1775    but different ‘<a href="#propdef-font-size-adjust"><code
  1776    class=property>font-size-adjust</code></a>’ properties. If the same
  1777    font-size is used, the spans will match when the ‘<a
  1778    href="#propdef-font-size-adjust"><code
  1779    class=property>font-size-adjust</code></a>’ value is accurate for the
  1780    given font.
  1782   <div class=example>
  1783    <p>Two spans with borders are used to determine the <a
  1784     href="#aspect-value"><i>aspect value</i></a> of a font. The ‘<a
  1785     href="#propdef-font-size"><code class=property>font-size</code></a>’ is
  1786     the same for both spans but the ‘<a
  1787     href="#propdef-font-size-adjust"><code
  1788     class=property>font-size-adjust</code></a>’ property is specified only
  1789     for the right span. Starting with a value of 0.5, the aspect value can be
  1790     adjusted until the borders around the two letters line up.</p>
  1792    <pre>p {
  1793     font-family: Futura;
  1794     font-size: 500px;
  1797 span {
  1798     border: solid 1px red;
  1801 .adjust {
  1802     font-size-adjust: 0.5;
  1805 &lt;p>&lt;span>b&lt;/span>&lt;span class="adjust">b&lt;/span>&lt;/p>
  1806 </pre>
  1808    <div class=figure><img alt="Futura with an <i>aspect value</i> of 0.5"
  1809     src=beforefontsizeadjust.png>
  1810     <p class=caption>Futura with an <a href="#aspect-value"><i>aspect
  1811      value</i></a> of 0.5
  1812    </div>
  1814    <p>The box on the right is a bit bigger than the one on the left, so the
  1815     <a href="#aspect-value"><i>aspect value</i></a> of this font is something
  1816     less than 0.5. Adjust the value until the boxes align.</p>
  1817   </div>
  1818   <!-- prop: font -->
  1820   <h3 id=font-prop><span class=secno>3.7 </span>Shorthand font property: the
  1821    <a href="#propdef-font">font</a> property</h3>
  1823   <table class=propdef id=namefontvalue-ltlsquofont-stylersquogt-l>
  1824    <tbody>
  1825     <tr>
  1826      <td>Name:
  1828      <td><dfn id=propdef-font>font</dfn>
  1830     <tr>
  1831      <td>Value:
  1833      <td>[ [ <var>&lt;<a href="#propdef-font-style"
  1834       title="font-style!!property">‘<code
  1835       class=property>font-style</code>’</a>&gt;</var> || <a
  1836       href="#font-variant-css21-values"><var>&lt;font-variant-css21&gt;</var></a>
  1837       || <var>&lt;<a href="#propdef-font-weight"
  1838       title="font-weight!!property">‘<code
  1839       class=property>font-weight</code>’</a>&gt;</var> || <var>&lt;<a
  1840       href="#propdef-font-stretch" title="font-stretch!!property">‘<code
  1841       class=property>font-stretch</code>’</a></var> ]? <var>&lt;‘<a
  1842       href="#propdef-font-size"><code
  1843       class=property>font-size</code></a>’&gt;</var> [ / <var>&lt;‘<code
  1844       class=property>line-height</code>’&gt;</var> ]? <var>&lt;<a
  1845       href="#propdef-font-family" title="font-family!!property">‘<code
  1846       class=property>font-family</code>’</a>&gt;</var> ] | caption | icon |
  1847       menu | message-box | small-caption | status-bar
  1849     <tr>
  1850      <td>Initial:
  1852      <td>see individual properties
  1854     <tr>
  1855      <td>Applies to:
  1857      <td>all elements
  1859     <tr>
  1860      <td>Inherited:
  1862      <td>yes
  1864     <tr>
  1865      <td>Percentages:
  1867      <td>see individual properties
  1869     <tr>
  1870      <td>Media:
  1872      <td>visual
  1874     <tr>
  1875      <td>Computed value:
  1877      <td>see individual properties
  1879     <tr>
  1880      <td>Animatable:
  1882      <td>see individual properties
  1883   </table>
  1885   <p>The <span class=property>‘<a href="#propdef-font"><code
  1886    class=property>font</code></a>’</span> property is, except as described
  1887    below, a shorthand property for setting <a href="#propdef-font-style"
  1888    title="font-style!!property">‘<code
  1889    class=property>font-style</code>’</a>, <a href="#propdef-font-variant"
  1890    title="font-variant!!property">‘<code
  1891    class=property>font-variant</code>’</a>, <a href="#propdef-font-weight"
  1892    title="font-weight!!property">‘<code
  1893    class=property>font-weight</code>’</a>, <a href="#propdef-font-stretch"
  1894    title="font-stretch!!property">‘<code
  1895    class=property>font-stretch</code>’</a>, <span class=property>‘<a
  1896    href="#propdef-font-size"><code
  1897    class=property>font-size</code></a>’</span>, <a class=property
  1898    href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
  1899    class=property>line-height</code>’</a>, <a href="#propdef-font-family"
  1900    title="font-family!!property">‘<code
  1901    class=property>font-family</code>’</a> at the same place in the
  1902    stylesheet. Values for the <a href="#propdef-font-variant"
  1903    title="font-variant!!property">‘<code
  1904    class=property>font-variant</code>’</a> property may also be included
  1905    but only those supported in CSS 2.1, none of the <a
  1906    href="#propdef-font-variant" title="font-variant!!property">‘<code
  1907    class=property>font-variant</code>’</a> values added in this
  1908    specification can be used in the <span class=property>‘<a
  1909    href="#propdef-font"><code class=property>font</code></a>’</span>
  1910    shorthand:
  1912   <pre
  1913    class=prod><dfn id=font-variant-css21-values><var>&lt;font-variant-css21&gt;</var></dfn> = [normal | small-caps]</pre>
  1915   <p>The syntax of this property is based on a traditional typographical
  1916    shorthand notation to set multiple properties related to fonts.
  1918   <p>All subproperties of the ‘<a href="#propdef-font"><code
  1919    class=property>font</code></a>’ property are first reset to their
  1920    initial values, including those listed above plus <span
  1921    class=property>‘<a href="#propdef-font-size-adjust"><code
  1922    class=property>font-size-adjust</code></a>’</span>, <span
  1923    class=property>‘<a href="#propdef-font-kerning"><code
  1924    class=property>font-kerning</code></a>’</span>, subproperties of <a
  1925    href="#propdef-font-variant" title="font-variant!!property">‘<code
  1926    class=property>font-variant</code>’</a> and and <span>‘<a
  1927    href="#propdef-font-language-override"><code
  1928    class=property>font-language-override</code></a>’</span>. Then, those
  1929    properties that are given explicit values in the <span
  1930    class=property>‘<a href="#propdef-font"><code
  1931    class=property>font</code></a>’</span> shorthand are set to those
  1932    values. For a definition of allowed and initial values, see the previously
  1933    defined properties. For reasons of backwards compatibility, it is not
  1934    possible to set <span class=property>‘<a
  1935    href="#propdef-font-size-adjust"><code
  1936    class=property>font-size-adjust</code></a>’</span> to anything other
  1937    than its initial value using the <span class=property>‘<a
  1938    href="#propdef-font"><code class=property>font</code></a>’</span>
  1939    shorthand property; instead, use the individual property.
  1941   <div class=example>
  1942    <p style="display:none">Example(s):</p>
  1944    <pre>p { font: 12pt/14pt sans-serif }
  1945 p { font: 80% sans-serif }
  1946 p { font: x-large/110% &quot;new century schoolbook&quot;, serif }
  1947 p { font: bold italic large Palatino, serif }
  1948 p { font: normal small-caps 120%/120% fantasy }
  1949 p { font: condensed oblique 12pt &quot;Helvetica Neue&quot;, serif; }
  1950 </pre>
  1952    <p> In the second rule, the font size percentage value (‘<code
  1953     class=css>80%</code>’) refers to the computed ‘<a
  1954     href="#propdef-font-size"><code class=property>font-size</code></a>’ of
  1955     the parent element. In the third rule, the line height percentage
  1956     (‘<code class=css>110%</code>’) refers to the font size of the
  1957     element itself.
  1959    <p>The first three rules do not specify the <a
  1960     href="#propdef-font-variant" title="font-variant!!property">‘<code
  1961     class=property>font-variant</code>’</a> and <a
  1962     href="#propdef-font-weight" title="font-weight!!property">‘<code
  1963     class=property>font-weight</code>’</a> explicitly, so these properties
  1964     receive their initial values (<span title="normal value">‘<code
  1965     class=property>normal</code>’</span>). Notice that the font family name
  1966     "new century schoolbook", which contains spaces, is enclosed in quotes.
  1967     The fourth rule sets the <a href="#propdef-font-weight"
  1968     title="font-weight!!property">‘<code
  1969     class=property>font-weight</code>’</a> to ‘<a href="#bold"><code
  1970     class=property>bold</code></a>’, the <a href="#propdef-font-style"
  1971     title="font-style!!property">‘<code
  1972     class=property>font-style</code>’</a> to ‘<a href="#italic"><code
  1973     class=property>italic</code></a>’, and implicitly sets <a
  1974     href="#propdef-font-variant" title="font-variant!!property">‘<code
  1975     class=property>font-variant</code>’</a> to <a
  1976     href="#font-variant-normal-value" title="normal!!font-variant">‘<code
  1977     class=property>normal</code>’</a>.
  1979    <p> The fifth rule sets the <a href="#propdef-font-variant"
  1980     title="font-variant!!property">‘<code
  1981     class=property>font-variant</code>’</a> (‘<a href="#small-caps"><code
  1982     class=property>small-caps</code></a>’), the <span class=property>‘<a
  1983     href="#propdef-font-size"><code
  1984     class=property>font-size</code></a>’</span> (120% of the parent's font
  1985     size), the <a class=property
  1986     href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
  1987     class=property>line-height</code>’</a> (120% of the font size) and the
  1988     <a href="#propdef-font-family" title="font-family!!property">‘<code
  1989     class=property>font-family</code>’</a> (‘<a href="#fantasy"><code
  1990     class=property>fantasy</code></a>’). It follows that the keyword <span
  1991     title="normal value">‘<code class=property>normal</code>’</span>
  1992     applies to the two remaining properties: <a href="#propdef-font-style"
  1993     title="font-style!!property">‘<code
  1994     class=property>font-style</code>’</a> and <a
  1995     href="#propdef-font-weight" title="font-weight!!property">‘<code
  1996     class=property>font-weight</code>’</a>.
  1998    <p>The sixth rule sets the <a href="#propdef-font-style"
  1999     title="font-style!!property">‘<code
  2000     class=property>font-style</code>’</a>, <a href="#propdef-font-stretch"
  2001     title="font-stretch!!property">‘<code
  2002     class=property>font-stretch</code>’</a>, <span class=property>‘<a
  2003     href="#propdef-font-size"><code
  2004     class=property>font-size</code></a>’</span>, and <a
  2005     href="#propdef-font-family" title="font-family!!property">‘<code
  2006     class=property>font-family</code>’</a>, the other font properties being
  2007     set to their initial values.
  2008   </div>
  2010   <p>Since the <a href="#propdef-font-stretch"
  2011    title="font-stretch!!property">‘<code
  2012    class=property>font-stretch</code>’</a> property was not defined in CSS
  2013    2.1, when using <a href="#propdef-font-stretch"
  2014    title="font-stretch!!property">‘<code
  2015    class=property>font-stretch</code>’</a> values within ‘<a
  2016    href="#propdef-font"><code class=property>font</code></a>’ rules,
  2017    authors should include a extra version compatible with older user agents:
  2019   <pre>p {
  2020   font: 80% sans-serif;   /* for older user agents */
  2021   font: condensed 80% sans-serif;
  2022 }</pre>
  2024   <p>The following values refer to system fonts:
  2026   <dl>
  2027    <dt><strong>caption</strong>
  2029    <dd>The font used for captioned controls (e.g., buttons, drop-downs,
  2030     etc.).
  2032    <dt><strong>icon</strong>
  2034    <dd>The font used to label icons.
  2036    <dt><strong>menu</strong>
  2038    <dd>The font used in menus (e.g., dropdown menus and menu lists).
  2040    <dt><strong>message-box</strong>
  2042    <dd>The font used in dialog boxes.
  2044    <dt><strong>small-caption</strong>
  2046    <dd>The font used for labeling small controls.
  2048    <dt><strong>status-bar</strong>
  2050    <dd>The font used in window status bars.
  2051   </dl>
  2053   <p>System fonts may only be set as a whole; that is, the font family, size,
  2054    weight, style, etc. are all set at the same time. These values may then be
  2055    altered individually if desired. If no font with the indicated
  2056    characteristics exists on a given platform, the user agent should either
  2057    intelligently substitute (e.g., a smaller version of the ‘<code
  2058    class=property>caption</code>’ font might be used for the ‘<code
  2059    class=property>small-caption</code>’ font), or substitute a user agent
  2060    default font. As for regular fonts, if, for a system font, any of the
  2061    individual properties are not part of the operating system's available
  2062    user preferences, those properties should be set to their initial values.
  2064   <p>That is why this property is "almost" a shorthand property: system fonts
  2065    can only be specified with this property, not with <a
  2066    href="#propdef-font-family" title="font-family!!property">‘<code
  2067    class=property>font-family</code>’</a> itself, so <span
  2068    class=property>‘<a href="#propdef-font"><code
  2069    class=property>font</code></a>’</span> allows authors to do more than
  2070    the sum of its subproperties. However, the individual properties such as
  2071    <a href="#propdef-font-weight" title="font-weight!!property">‘<code
  2072    class=property>font-weight</code>’</a> are still given values taken from
  2073    the system font, which can be independently varied.
  2075   <p>Note that the keywords used for the system fonts listed above are only
  2076    treated as keywords when they occur in the initial position, in other
  2077    positions the same string is treated as part of the font family name:
  2079   <pre>  font: menu;        /* use the font settings for system menus */
  2080   font: large menu;  /* use a font family named "menu" */</pre>
  2082   <div class=example>
  2083    <p style="display:none">Example(s):</p>
  2085    <pre>button { font: 300 italic 1.3em/1.7em &quot;FB Armada&quot;, sans-serif }
  2086 button p { font: menu }
  2087 button p em { font-weight: bolder }
  2088 </pre>
  2090    <p>If the font used for dropdown menus on a particular system happened to
  2091     be, for example, 9-point Charcoal, with a weight of 600, then P elements
  2092     that were descendants of BUTTON would be displayed as if this rule were
  2093     in effect:
  2095    <pre>button p { font: 600 9pt Charcoal }
  2096 </pre>
  2098    <p>Because the <span class=property>‘<a href="#propdef-font"><code
  2099     class=property>font</code></a>’</span> shorthand resets to its initial
  2100     value any property not explicitly given a value, this has the same effect
  2101     as this declaration:
  2103    <pre>button p {
  2104   font-style: normal;
  2105   font-variant: normal;
  2106   font-weight: 600;
  2107   font-size: 9pt;
  2108   line-height: normal;
  2109   font-family: Charcoal
  2111 </pre>
  2112   </div>
  2113   <!-- prop: font-synthesis -->
  2115   <h3 id=font-synthesis-prop><span class=secno>3.8 </span>Controlling
  2116    synthetic faces: the <a href="#propdef-font-synthesis">font-synthesis</a>
  2117    property</h3>
  2119   <table class=propdef id=namefont-synthesisvaluenone-weight-style>
  2120    <tbody>
  2121     <tr>
  2122      <td>Name:
  2124      <td><dfn id=propdef-font-synthesis>font-synthesis</dfn>
  2126     <tr>
  2127      <td>Value:
  2129      <td>none | [ weight || style ]
  2131     <tr>
  2132      <td>Initial:
  2134      <td>weight style
  2136     <tr>
  2137      <td>Applies to:
  2139      <td>all elements
  2141     <tr>
  2142      <td>Inherited:
  2144      <td>yes
  2146     <tr>
  2147      <td>Percentages:
  2149      <td>N/A
  2151     <tr>
  2152      <td>Media:
  2154      <td>visual
  2156     <tr>
  2157      <td>Computed value:
  2159      <td>as specified
  2161     <tr>
  2162      <td>Animatable:
  2164      <td>no
  2165   </table>
  2167   <p>This property controls whether user agents are allowed to synthesize
  2168    bold or oblique font faces when a font family lacks bold or italic faces.
  2169    If ‘<a href="#weight"><code class=property>weight</code></a>’ is not
  2170    specified, user agents must not synthesize bold faces and if ‘<code
  2171    class=property>style</code>’ is not specified user agents must not
  2172    synthesize italic faces. A value of ‘<code class=property>none</code>’
  2173    disallows all synthetic faces.
  2175   <div class=example>
  2176    <p>The style rule below disables the use of synthetically obliqued Arabic:</p>
  2178    <pre>*:lang(ar) { font-synthesis: none; }
  2179 </pre>
  2180   </div>
  2182   <h2 id=font-resources><span class=secno>4 </span>Font Resources</h2>
  2184   <h3 id=font-face-rule><span class=secno>4.1 </span>The <dfn
  2185    id=at-font-face-rule style="font-weight: inherit; font-style:
  2186    inherit"><code>@font-face</code></dfn> rule</h3>
  2188   <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule allows
  2189    for linking to fonts that are automatically fetched and activated when
  2190    needed. This allows authors to select a font that closely matches the
  2191    design goals for a given page rather than limiting the font choice to a
  2192    set of fonts available on a given platform. A set of font descriptors
  2193    define the location of a font resource, either locally or externally,
  2194    along with the style characteristics of an individual face. Multiple <a
  2195    href="#at-font-face-rule"><code>@font-face</code></a> rules can be used to
  2196    construct font families with a variety of faces. Using CSS font matching
  2197    rules, a user agent can selectively download only those faces that are
  2198    needed for a given piece of text.
  2200   <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule
  2201    consists of the <a href="#at-font-face-rule"><code>@font-face</code></a>
  2202    at-keyword followed by a block of descriptor declarations. In terms of the
  2203    grammar, this specification defines the following productions:
  2205   <pre><dfn id=fontfacerule>font_face_rule</dfn>
  2206   : <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>*
  2209 <dfn id=descriptordeclaration>descriptor_declaration</dfn>
  2210   : <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>
  2211   ;</pre>
  2213   <p>The following new definitions are introduced:
  2215   <pre>-    -|\\0{0,4}2d(\r\n|[ \t\r\n\f])?
  2216 F    f|\\0{0,4}(46|66)(\r\n|[ \t\r\n\f])?</pre>
  2218   <p>The following new token is introduced:
  2220   <pre>@{F}{O}{N}{T}{-}{F}{A}{C}{E} {return <dfn id=fontfacesym>FONT_FACE_SYM</dfn>;}</pre>
  2222   <p>Each <a href="#at-font-face-rule"><code>@font-face</code></a> rule
  2223    specifies a value for every font descriptor, either implicitly or
  2224    explicitly. Those not given explicit values in the rule take the initial
  2225    value listed with each descriptor in this specification. These descriptors
  2226    apply solely within the context of the <a
  2227    href="#at-font-face-rule"><code>@font-face</code></a> rule in which they
  2228    are defined, and do not apply to document language elements. There is no
  2229    notion of which elements the descriptors apply to or whether the values
  2230    are inherited by child elements. When a given descriptor occurs multiple
  2231    times in a given <a href="#at-font-face-rule"><code>@font-face</code></a>
  2232    rule, only the last descriptor declaration is used and all prior
  2233    declarations for that descriptor are ignored.
  2235   <div class=example>
  2236    <p>To use a downloadable font called Gentium:</p>
  2238    <pre>
  2239 @font-face {
  2240   font-family: Gentium;
  2241   src: url(http://example.com/fonts/Gentium.woff);
  2244 p { font-family: Gentium, serif; }
  2245 </pre>
  2247    <p>The user agent will download Gentium and use it when rendering text
  2248     within paragraph elements. If for some reason the site serving the font
  2249     is unavailable, the default serif font will be used.</p>
  2250   </div>
  2252   <p>A given set of <a href="#at-font-face-rule"><code>@font-face</code></a>
  2253    rules define a set of fonts available for use within the documents that
  2254    contain these rules. When font matching is done, fonts defined using these
  2255    rules are considered before other available fonts on a system.
  2257   <p>Downloaded fonts are only available to documents that reference them.
  2258    The process of activating these fonts must not make them available to
  2259    other applications or to documents that don't directly link to the same
  2260    font. User agent implementers might consider it convenient to use
  2261    downloaded fonts when rendering characters in other documents for which no
  2262    other available font exists as part of the <a
  2263    href="#system-font-fallback"><em>system font fallback</em></a> procedure.
  2264    However, this would cause a security leak since the contents of one page
  2265    would be able to affect other pages, something an attacker could use as an
  2266    attack vector. These restrictions do not affect caching behavior, fonts
  2267    are cached the same way other web resources are cached.
  2269   <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
  2270    properties in a declaration block, declarations of any descriptors that
  2271    are not supported by the user agent must be ignored. <a
  2272    href="#at-font-face-rule"><code>@font-face</code></a> rules require a
  2273    font-family and src descriptor; if either of these are missing, the <a
  2274    href="#at-font-face-rule"><code>@font-face</code></a> rule is invalid and
  2275    must be ignored entirely.
  2277   <p>In cases where user agents have limited platform resources or implement
  2278    the ability to disable downloadable font resources, <a
  2279    href="#at-font-face-rule"><code>@font-face</code></a> rules must simply be
  2280    ignored; the behavior of individual descriptors as defined in this
  2281    specification should not be altered.
  2283   <h3 id=font-family-desc><span class=secno>4.2 </span>Font family: the <a
  2284    href="#descdef-font-family">font-family</a> descriptor</h3>
  2286   <table class=descdef>
  2287    <tbody>
  2288     <tr>
  2289      <td>Name:
  2291      <td><dfn id=descdef-font-family
  2292       title="font-family!!descriptor">font-family</dfn>
  2294     <tr>
  2295      <td>Value:
  2297      <td><a href="#family-name-value"><var>&lt;family-name&gt;</var></a>
  2299     <tr>
  2300      <td><em>Initial:</em>
  2302      <td>N/A
  2303   </table>
  2305   <p>This descriptor defines the font family name that will be used in all
  2306    CSS font family name matching. It is required for the <a
  2307    href="#at-font-face-rule"><code>@font-face</code></a> rule to be valid. It
  2308    overrides the font family names contained in the underlying font data. If
  2309    the font family name is the same as a font family available in a given
  2310    user's environment, it effectively hides the underlying font for documents
  2311    that use the stylesheet. This permits a web author to freely choose
  2312    font-family names without worrying about conflicts with font family names
  2313    present in a given user's environment. Likewise, platform substitutions
  2314    for a given font family name must not be used.
  2316   <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
  2317    href="#descdef-src">src</a> descriptor</h3>
  2319   <table class=descdef>
  2320    <tbody>
  2321     <tr>
  2322      <td>Name:
  2324      <td><dfn id=descdef-src>src</dfn>
  2326     <tr>
  2327      <td>Value:
  2329      <td>[ &lt;url> [format(&lt;string> #)]? | <a
  2330       href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> ] #
  2332     <tr>
  2333      <td><em>Initial:</em>
  2335      <td>N/A
  2336   </table>
  2338   <p>This descriptor specifies the resource containing font data. It is
  2339    required for the <a href="#at-font-face-rule"><code>@font-face</code></a>
  2340    rule to be valid. Its value is a prioritized, comma-separated list of
  2341    external references or locally-installed font face names. When a font is
  2342    needed the user agent iterates over the set of references listed, using
  2343    the first one it can successfully activate. Fonts containing invalid data
  2344    or local font faces that are not found are ignored and the user agent
  2345    loads the next font in the list.
  2347   <p>As with other URLs in CSS, the URL may be relative, in which case it is
  2348    resolved relative to the location of the style sheet containing the <a
  2349    href="#at-font-face-rule"><code>@font-face</code></a> rule. In the case of
  2350    SVG fonts, the URL points to an element within a document containing SVG
  2351    font definitions. If the element reference is omitted, a reference to the
  2352    first defined font is implied. Similarly, font container formats that can
  2353    contain more than one font must load one and only one of the fonts for a
  2354    given <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
  2355    Fragment identifiers are used to indicate which font to load. If a
  2356    container format lacks a defined fragment identifier scheme,
  2357    implementations should use a simple 1-based indexing scheme (e.g.
  2358    "font-collection#1" for the first font, "font-collection#2" for the second
  2359    font).
  2361   <pre>
  2362 src: url(fonts/simple.woff);   /* load simple.woff relative to stylesheet location */
  2363 src: url(/fonts/simple.woff);  /* load simple.woff from absolute location */
  2364 src: url(fonts.svg#simple);    /* load SVG font with id 'simple' */
  2365 </pre>
  2367   <p>External references consist of a URL, followed by an optional hint
  2368    describing the format of the font resource referenced by that URL. The
  2369    format hint contains a comma-separated list of format strings that denote
  2370    well-known font formats. Conformant user agents must skip downloading a
  2371    font resource if the format hints indicate only unsupported or unknown
  2372    font formats. If no format hints are supplied, the user agent should
  2373    download the font resource.
  2375   <pre>
  2376 /* load WOFF font if possible, otherwise use OpenType font */
  2377 @font-face {
  2378   font-family: bodytext;
  2379   src: url(ideal-sans-serif.woff) format("woff"),
  2380        url(basic-sans-serif.ttf) format("opentype");
  2382 </pre>
  2384   <p>Format strings defined by this specification:
  2386   <table class=data id=fontformats>
  2387    <thead>
  2388     <tr>
  2389      <th>String
  2391      <th>Font Format
  2393      <th>Common extensions
  2395    <tbody>
  2396     <tr>
  2397      <th>"woff"
  2399      <td><a href="http://www.w3.org/TR/WOFF/">WOFF (Web Open Font Format)</a>
  2401      <td>.woff
  2403     <tr>
  2404      <th>"truetype"
  2406      <td><a
  2407       href="http://www.microsoft.com/typography/otspec/default.htm">TrueType</a>
  2409      <td>.ttf
  2411     <tr>
  2412      <th>"opentype"
  2414      <td><a
  2415       href="http://www.microsoft.com/typography/otspec/default.htm">OpenType</a>
  2417      <td>.ttf, .otf
  2419     <tr>
  2420      <th>"embedded-opentype"
  2422      <td><a
  2423       href="http://www.w3.org/Submission/2008/SUBM-EOT-20080305/">Embedded
  2424       OpenType</a>
  2426      <td>.eot
  2428     <tr>
  2429      <th>"svg"
  2431      <td><a href="http://www.w3.org/TR/SVG/fonts.html">SVG Font</a>
  2433      <td>.svg, .svgz
  2434   </table>
  2436   <p>Given the overlap in common usage between TrueType and OpenType, the
  2437    format hints "truetype" and "opentype" must be considered as synonymous; a
  2438    format hint of "opentype" does not imply that the font contains Postscript
  2439    CFF style glyph data or that it contains OpenType layout information (see
  2440    <a href="#platform-props-to-css">Appendix A</a> for more background on
  2441    this).
  2443   <p>When authors would prefer to use a locally available copy of a given
  2444    font and download it if it's not, <code>local()</code> can be used. The
  2445    locally-installed <dfn
  2446    id=font-face-name-value><var>&lt;font-face-name&gt;</var></dfn> argument
  2447    to <code>local()</code> is a format-specific string that uniquely
  2448    identifies a single font face within a larger family. The syntax for a <a
  2449    href="#font-face-name-value"><var>&lt;font-face-name&gt;</var></a> is a
  2450    unique font face name enclosed by "local(" and ")". The name can
  2451    optionally be enclosed in quotes. If unquoted, the unquoted font family
  2452    name processing conventions apply; the name must be a sequence of
  2453    identifiers separated by whitespace which is converted to a string by
  2454    joining the identifiers together separated by a single space.
  2456   <pre>
  2457 /* regular face of Gentium */
  2458 @font-face {
  2459   font-family: MyGentium;
  2460   src: local(Gentium),    /* use locally available Gentium */
  2461        url(Gentium.woff); /* otherwise, download it */
  2463 </pre>
  2465   <p>For OpenType and TrueType fonts, this string is used to match only the
  2466    Postscript name or the full font name in the name table of locally
  2467    available fonts. Which type of name is used varies by platform and font,
  2468    so authors should include both of these names to assure proper matching
  2469    across platforms. Platform substitutions for a given font name must not be
  2470    used.
  2472   <pre>
  2473 /* bold face of Gentium */
  2474 @font-face {
  2475   font-family: MyGentium;
  2476   src: local(Gentium Bold),    /* full font name */
  2477        local(Gentium-Bold),    /* Postscript name */
  2478        url(GentiumBold.woff);  /* otherwise, download it */
  2479   font-weight: bold;
  2481 </pre>
  2483   <p>Just as a <a href="#at-font-face-rule"><code>@font-face</code></a> rule
  2484    specifies the characteristics of a single font within a family, the unique
  2485    name used with <code>local()</code> specifies a single font, not an entire
  2486    font family. Defined in terms of OpenType font data, the Postscript name
  2487    is found in the font's <a
  2488    href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
  2489    in the name record with nameID = 6 (see <a href="#OPENTYPE"
  2490    rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
  2491    Postscript name is the commonly used key for all fonts on OSX and for
  2492    Postscript CFF fonts under Windows. The full font name (nameID = 4) is
  2493    used as a unique key for fonts with TrueType glyphs on Windows.
  2495   <p>For OpenType fonts with multiple localizations of the full font name,
  2496    the US English version is used (language ID = 0x409 for Windows and
  2497    language ID = 0 for Macintosh) or the first localization when a US English
  2498    full font name is not available (the OpenType specification recommends
  2499    that <a href="http://www.microsoft.com/typography/otspec/recom.htm">all
  2500    fonts minimally include US English names</a>). User agents that also match
  2501    other full font names, e.g. matching the Dutch name when the current
  2502    system locale is set to Dutch, are considered non-conformant. This is done
  2503    not to prefer English but to avoid matching inconsistencies across font
  2504    versions and OS localizations, since font style names (e.g. "Bold") are
  2505    frequently localized into many languages and the set of localizations
  2506    available varies widely across platform and font version. User agents that
  2507    match a concatenation of family name (nameID = 1) with style name (nameID
  2508    = 2) are considered non-conformant.
  2510   <p>This also allows for referencing faces that belong to larger families
  2511    that cannot otherwise be referenced.
  2513   <div class=example>
  2514    <p>Use a local font or reference an SVG font in another document:</p>
  2516    <pre>
  2517 @font-face {
  2518   font-family: Headline;
  2519   src: local(Futura-Medium),
  2520        url(fonts.svg#MyGeometricModern) format("svg");
  2522 </pre>
  2524    <p>Create an alias for local Japanese fonts on different platforms:</p>
  2526    <pre>
  2527 @font-face {
  2528   font-family: jpgothic;
  2529   src: local(HiraKakuPro-W3), local(Meiryo), local(IPAPGothic);
  2531 </pre>
  2533    <p>Reference a font face that cannot be matched within a larger family:</p>
  2535    <pre>
  2536 @font-face {
  2537   font-family: Hoefler Text Ornaments;
  2538   /* has the same font properties as Hoefler Text Regular */
  2539   src: local(HoeflerText-Ornaments);
  2541 </pre>
  2543    <p>Since localized fullnames never match, a document with the header style
  2544     rules below would always render using the default serif font, regardless
  2545     whether a particular system locale parameter is set to Finnish or not:</p>
  2547    <pre>
  2548 @font-face {
  2549   font-family: SectionHeader;
  2550   src: local("Arial Lihavoitu");  /* Finnish fullname for Arial Bold, should fail */
  2551   font-weight: bold;
  2554 h2 { font-family: SectionHeader, serif; }
  2555 </pre>
  2557    <p>A conformant user agent would never load the font ‘<code
  2558     class=css>gentium.eot</code>’ in the example below, since it is
  2559     included in the first definition of the ‘<a href="#descdef-src"><code
  2560     class=property>src</code></a>’ descriptor which is overridden by the
  2561     second definition in the same <a
  2562     href="#at-font-face-rule"><code>@font-face</code></a> rule:</p>
  2564    <pre>
  2565 @font-face {
  2566   font-family: MainText;
  2567   src: url(gentium.eot);                     /* for use with older user agents */
  2568   src: local("Gentium"), url(gentium.woff);  /* Overrides src definition */
  2570 </pre>
  2571   </div>
  2573   <h3 id=font-prop-desc><span class=secno>4.4 </span>Font property
  2574    descriptors: the <a href="#descdef-font-style">font-style</a>, <a
  2575    href="#descdef-font-weight">font-weight</a>, <a
  2576    href="#descdef-font-stretch">font-stretch</a> descriptors</h3>
  2578   <table class=descdef>
  2579    <tbody>
  2580     <tr>
  2581      <td>Name:
  2583      <td><dfn id=descdef-font-style
  2584       title="font-style!!descriptor">font-style</dfn>
  2586     <tr>
  2587      <td>Value:
  2589      <td>normal | italic | oblique
  2591     <tr>
  2592      <td><em>Initial:</em>
  2594      <td>normal
  2595   </table>
  2597   <table class=descdef>
  2598    <tbody>
  2599     <tr>
  2600      <td>Name:
  2602      <td><dfn id=descdef-font-weight
  2603       title="font-weight!!descriptor">font-weight</dfn>
  2605     <tr>
  2606      <td>Value:
  2608      <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
  2610     <tr>
  2611      <td><em>Initial:</em>
  2613      <td>normal
  2614   </table>
  2616   <table class=descdef>
  2617    <tbody>
  2618     <tr>
  2619      <td>Name:
  2621      <td><dfn id=descdef-font-stretch
  2622       title="font-stretch!!descriptor">font-stretch</dfn>
  2624     <tr>
  2625      <td>Value:
  2627      <td>normal | ultra-condensed | extra-condensed | condensed |
  2628       semi-condensed | semi-expanded | expanded | extra-expanded |
  2629       ultra-expanded
  2631     <tr>
  2632      <td><em>Initial:</em>
  2634      <td>normal
  2635   </table>
  2637   <p>These descriptors define the characteristics of a font face and are used
  2638    in the process of matching styles to specific faces. For a font family
  2639    defined with several <a
  2640    href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
  2641    can either download all faces in the family or use these descriptors to
  2642    selectively download font faces that match actual styles used in document.
  2643    The values for these descriptors are the same as those for the
  2644    corresponding font properties except that relative keywords are not
  2645    allowed, ‘<a href="#bolder"><code class=property>bolder</code></a>’
  2646    and ‘<a href="#lighter"><code class=property>lighter</code></a>’. If
  2647    these descriptors are omitted, initial values are assumed.
  2649   <p>The value for these font face style attributes is used in place of the
  2650    style implied by the underlying font data. This allows authors to combine
  2651    faces in flexible combinations, even in situations where the original font
  2652    data was arranged differently. User agents that implement synthetic
  2653    bolding and obliquing must only apply synthetic styling in cases where the
  2654    font descriptors imply this is needed, rather than based on the style
  2655    attributes implied by the font data.
  2657   <h3 id=unicode-range-desc><span class=secno>4.5 </span>Character range: the
  2658    <a href="#descdef-unicode-range">unicode-range</a> descriptor</h3>
  2660   <table class=descdef>
  2661    <tbody>
  2662     <tr>
  2663      <td>Name:
  2665      <td><dfn id=descdef-unicode-range>unicode-range</dfn>
  2667     <tr>
  2668      <td>Value:
  2670      <td><a href="#urange-value"><var>&lt;urange&gt;</var></a> #
  2672     <tr>
  2673      <td><em>Initial:</em>
  2675      <td>U+0-10FFFF
  2676   </table>
  2678   <p>This descriptor defines the set of Unicode codepoints that may be
  2679    supported by the font face for which it is declared. The descriptor value
  2680    is a comma-delimited list of Unicode range (<a
  2681    href="#urange-value"><var>&lt;urange&gt;</var></a>) values. The union of
  2682    these ranges defines the set of codepoints that serves as a hint for user
  2683    agents when deciding whether or not to download a font resource for a
  2684    given text run.
  2686   <p>Each <dfn id=urange-value><var>&lt;urange&gt;</var></dfn> value is a <a
  2687    href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
  2688    title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token made up of a
  2689    "U+" or "u+" prefix followed by a codepoint range in one of the three
  2690    forms listed below. Ranges that do not fit one of the these forms are
  2691    invalid and cause the declaration to be ignored.
  2693   <dl>
  2694    <dt>single codepoint (e.g. U+416)
  2696    <dd>a Unicode codepoint, represented as one to six hexadecimal digits
  2698    <dt>interval range (e.g. U+400-4ff)
  2700    <dd>represented as two hyphen-separated Unicode codepoints indicating the
  2701     inclusive start and end codepoints of a range
  2703    <dt>wildcard range (e.g. U+4??)
  2705    <dd>defined by the set of codepoints implied when trailing ‘<code
  2706     class=css>?</code>’ characters signify any hexadeximal digit
  2707   </dl>
  2709   <p>Individual codepoints are written using hexadecimal values that
  2710    correspond to <a href="http://www.unicode.org/charts/">Unicode character
  2711    codepoints</a>. Unicode codepoint values must be between 0 and 10FFFF
  2712    inclusive. Digit values of codepoints are ASCII case-insensitive. For
  2713    interval ranges, the start and end codepoints must be within the range
  2714    noted above and the end codepoint must be greater than or equal to the
  2715    start codepoint.
  2717   <p>Wildcard ranges specified with ‘?’ that lack an initial digit (e.g.
  2718    "U+???") are valid and equivalent to a wildcard range with an initial zero
  2719    digit (e.g. "U+0???" = "U+0000-0FFF"). Wildcard ranges that extend beyond
  2720    the range of Unicode codepoints are invalid. Because of this, the maximum
  2721    number of trailing ‘<code class=css>?</code>’ wildcard characters is
  2722    five, even though the <a
  2723    href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><code
  2724    title="UNICODE-RANGE token">UNICODE-RANGE</code></a> token accepts six.
  2726   <p>Within the comma-delimited list of Unicode ranges in a ‘<a
  2727    href="#descdef-unicode-range"><code
  2728    class=property>unicode-range</code></a>’ descriptor declaration, ranges
  2729    may overlap. The union of these ranges defines the set of codepoints for
  2730    which the corresponding font may be used. User agents must not download or
  2731    use the font for codepoints outside this set. User agents may normalize
  2732    the list of ranges into a list that is different but represents the same
  2733    set of codepoints.
  2735   <p>The associated font might not contain glyphs for the entire set of
  2736    codepoints defined by the ‘<a href="#descdef-unicode-range"><code
  2737    class=property>unicode-range</code></a>’ descriptor. When the font is
  2738    used, the <dfn id=effective-character-map>effective character map</dfn> is
  2739    the intersection of the codepoints defined by ‘<a
  2740    href="#descdef-unicode-range"><code
  2741    class=property>unicode-range</code></a>’ with the font's <a
  2742    href="#character-map"><em>character map</em></a>. This allows authors to
  2743    define supported ranges in terms of broad ranges without worrying about
  2744    the precise codepoint ranges supported by the underlying font.
  2746   <h3 id=composite-fonts><span class=secno>4.6 </span>Using character ranges
  2747    to define composite fonts</h3>
  2749   <p>Multiple <a href="#at-font-face-rule"><code>@font-face</code></a> rules
  2750    with different unicode ranges for the same family and style descriptor
  2751    values can be used to create composite fonts that mix the glyphs from
  2752    different fonts for different scripts. This can be used to combine fonts
  2753    that only contain glyphs for a single script (e.g. Latin, Greek, Cyrillic)
  2754    or it can be used by authors as a way of segmenting a font into fonts for
  2755    commonly used characters and less frequently used characters. Since the
  2756    user agent will only pull down the fonts it needs this helps reduce page
  2757    bandwidth.
  2759   <p>If the unicode ranges overlap for a set of <a
  2760    href="#at-font-face-rule"><code>@font-face</code></a> rules with the same
  2761    family and style descriptor values, the rules are ordered in the reverse
  2762    order they were defined; the last rule defined is the first to be checked
  2763    for a given character.
  2765   <p>Example ranges for specific languages or characters:
  2767   <dl>
  2768    <dt>unicode-range: U+A5;
  2770    <dd>a single code point, the yen/yuan symbol
  2772    <dt>unicode-range: U+0-7F;
  2774    <dd>code range for basic ASCII characters
  2776    <dt>unicode-range: U+590-5ff;
  2778    <dd>code range for Hebrew characters
  2780    <dt>unicode-range: U+A5, U+4E00-9FFF, U+30??, U+FF00-FF9F;
  2782    <dd>code range for Japanese kanji, hiragana and katakana characters plus
  2783     yen/yuan symbol
  2784   </dl>
  2786   <div class=example>
  2787    <p>The BBC provides news services in a wide variety of languages, many
  2788     that are not well supported across all platforms. Using an <a
  2789     href="#at-font-face-rule"><code>@font-face</code></a> rule, the BBC could
  2790     provide a font for any of these languages, as it already does via a
  2791     manual font download.</p>
  2793    <pre>
  2794 @font-face {
  2795   font-family: BBCBengali;
  2796   src: url(fonts/BBCBengali.woff) format("woff");
  2797   unicode-range: U+00-FF, U+980-9FF;
  2799 </pre>
  2800   </div>
  2802   <div class=example>
  2803    <p>Technical documents often require a wide range of symbols. The STIX
  2804     Fonts project is one project aimed at providing fonts to support a wide
  2805     range of technical typesetting in a standardized way. The example below
  2806     shows the use of a font that provides glyphs for many of the mathematical
  2807     and technical symbol ranges within Unicode:</p>
  2809    <pre>
  2810 @font-face {
  2811   font-family: STIXGeneral;
  2812   src: local(STIXGeneral), url(/stixfonts/STIXGeneral.otf);
  2813   unicode-range: U+000-49F, U+2000-27FF, U+2900-2BFF, U+1D400-1D7FF;
  2815 </pre>
  2816   </div>
  2818   <div class=example>
  2819    <p>This example shows how an author can override the glyphs used for Latin
  2820     characters in a Japanese font with glyphs from a different font. The
  2821     first rule specifies no range so it defaults to the entire range. The
  2822     range specified in the second rule overlaps but takes precedence because
  2823     it is defined later.</p>
  2825    <pre>
  2826 @font-face {
  2827   font-family: JapaneseWithGentium;
  2828   src: local(MSMincho);
  2829   /* no range specified, defaults to entire range */
  2832 @font-face {
  2833   font-family: JapaneseWithGentium;
  2834   src: url(../fonts/Gentium.woff);
  2835   unicode-range: U+0-2FF;
  2837 </pre>
  2838   </div>
  2840   <div class=example>
  2841    <p>Consider a family constructed to optimize bandwidth by separating out
  2842     Latin, Japanese and other characters into different font files:</p>
  2844    <pre>
  2845 /* fallback font - size: 4.5MB */
  2846 @font-face {
  2847   font-family: DroidSans;
  2848   src: url(DroidSansFallback.woff);
  2849   /* no range specified, defaults to entire range */
  2852 /* Japanese glyphs - size: 1.2MB */
  2853 @font-face {
  2854   font-family: DroidSans;
  2855   src: url(DroidSansJapanese.woff);
  2856   unicode-range: U+3000-9FFF, U+ff??;
  2859 /* Latin, Greek, Cyrillic along with some
  2860    punctuation and symbols - size: 190KB */
  2861 @font-face {
  2862   font-family: DroidSans;
  2863   src: url(DroidSans.woff);
  2864   unicode-range: U+000-5FF, U+1e00-1fff, U+2000-2300;
  2866 </pre>
  2868    <p>For simple Latin text, only the font for Latin characters is
  2869     downloaded:</p>
  2871    <pre>
  2872 body { font-family: DroidSans; }
  2874 &lt;p>This is that&lt;/p>
  2875 </pre>
  2877    <p>In this case the user agent first checks the unicode-range for the font
  2878     containing Latin characters (DroidSans.woff). Since all the characters
  2879     above are in the range U+0-5FF, the user agent downloads the font and
  2880     renders the text with that font.</p>
  2882    <p>Next, consider text that makes use of an arrow character (⇨):</p>
  2884    <pre>
  2885 &lt;p>This &amp;#x21e8; that&lt;p>
  2886 </pre>
  2888    <p>The user agent again first checks the unicode-range of the font
  2889     containing Latin characters. Since U+2000-2300 includes the arrow code
  2890     point (U+21E8), the user agent downloads the font. For this character
  2891     however the Latin font does not have a matching glyph, so the effective
  2892     unicode-range used for font matching excludes this code point. Next, the
  2893     user agent evaluates the Japanese font. The unicode-range for the
  2894     Japanese font, U+3000-9FFF and U+ff??, does not include U+21E8, so the
  2895     user agent does not download the Japanese font. Next the fallback font is
  2896     considered. The <a href="#at-font-face-rule"><code>@font-face</code></a>
  2897     rule for the fallback font does not define unicode-range so its value
  2898     defaults to the range of all Unicode code points. The fallback font is
  2899     downloaded and used to render the arrow character.</p>
  2900   </div>
  2902   <h3 id=font-rend-desc><span class=secno>4.7 </span>Font features: the <a
  2903    href="#descdef-font-variant">font-variant</a> and <a
  2904    href="#descdef-font-feature-settings">font-feature-settings</a>
  2905    descriptors</h3>
  2907   <table class=descdef>
  2908    <tbody>
  2909     <tr>
  2910      <td>Name:
  2912      <td><dfn id=descdef-font-variant
  2913       title="font-variant!!descriptor">font-variant</dfn>
  2915     <tr>
  2916      <td>Value:
  2918      <td><a href="#font-variant-normal-value"
  2919       title="normal!!font-variant">normal</a> | <a
  2920       href="#font-variant-none-value" title="none!!font-variant">none</a> | [
  2921       <a href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a>
  2922       || <a
  2923       href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
  2924       || <a
  2925       href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
  2926       || <a
  2927       href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
  2928       || <a href="#stylistic"><var
  2929       title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
  2930       href="#historical-forms"><var>historical-forms</var></a> || <a
  2931       href="#styleset"><var
  2932       title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
  2933       href="#character-variant"><var
  2934       title=character-variant>character-variant(&lt;feature-value-name&gt;
  2935       #)</var></a> || <a href="#swash"><var
  2936       title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
  2937       href="#ornaments"><var
  2938       title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
  2939       href="#annotation"><var
  2940       title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
  2941       <a href="#small-caps"><i>small-caps</i></a> | <a
  2942       href="#all-small-caps"><i>all-small-caps</i></a> | <a
  2943       href="#petite-caps"><i>petite-caps</i></a> | <a
  2944       href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
  2945       href="#unicase"><i>unicase</i></a> | <a
  2946       href="#titling-caps"><i>titling-caps</i></a> ] || <a
  2947       href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
  2948       || <a
  2949       href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
  2950       || <a
  2951       href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
  2952       || <a href="#ordinal"><i>ordinal</i></a> || <a
  2953       href="#slashed-zero"><i>slashed-zero</i></a> || <a
  2954       href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
  2955       || <a
  2956       href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
  2957       || <a href="#ruby"><i>ruby</i></a> ]
  2959     <tr>
  2960      <td><em>Initial:</em>
  2962      <td>normal
  2963   </table>
  2965   <table class=descdef>
  2966    <tbody>
  2967     <tr>
  2968      <td>Name:
  2970      <td><dfn id=descdef-font-feature-settings
  2971       title="font-feature-settings!!descriptor">font-feature-settings</dfn>
  2973     <tr>
  2974      <td>Value:
  2976      <td><a href="#font-feature-settings-normal-value"
  2977       title="normal!!font-feature-settings">normal</a> | <a
  2978       href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
  2980     <tr>
  2981      <td><em>Initial:</em>
  2983      <td>normal
  2984   </table>
  2986   <p>These descriptors define initial settings that apply when the font
  2987    defined by an <a href="#at-font-face-rule"><code>@font-face</code></a>
  2988    rule is rendered. They do not affect font selection. Values are identical
  2989    to those defined for the corresponding <a href="#propdef-font-variant"
  2990    title="font-variant!!property">‘<code
  2991    class=property>font-variant</code>’</a> and <a
  2992    href="#propdef-font-feature-settings"
  2993    title="font-feature-settings!!property">‘<code
  2994    class=property>font-feature-settings</code>’</a> properties defined
  2995    below except that the value ‘<code class=property>inherit</code>’ is
  2996    omitted. When multiple font feature descriptors or properties are used,
  2997    the cumulative effect on text rendering is detailed in the section <a
  2998    href="#font-feature-resolution">Font Feature Resolution</a> below. In
  2999    cases where specific values define synthesized fallback for certain <a
  3000    href="#propdef-font-variant" title="font-variant!!property">‘<code
  3001    class=property>font-variant</code>’</a> subproperties, the same
  3002    synthesized fallback applies when used within those values are used with
  3003    the <a href="#descdef-font-style" title="font-style!!descriptor">‘<code
  3004    class=property>font-variant</code>’</a> descriptor.
  3006   <h3 id=font-face-loading><span class=secno>4.8 </span>Font loading
  3007    guidelines</h3>
  3009   <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule is
  3010    designed to allow lazy loading of font resources that are only downloaded
  3011    when used within a document. A stylesheet can include <a
  3012    href="#at-font-face-rule"><code>@font-face</code></a> rules for a library
  3013    of fonts of which only a select set are used; user agents must only
  3014    download those fonts that are referred to within the style rules
  3015    applicable to a given page. User agents that download all fonts defined in
  3016    <a href="#at-font-face-rule"><code>@font-face</code></a> rules without
  3017    considering whether those fonts are in fact used within a page are
  3018    considered non-conformant. In cases where a font might be downloaded in
  3019    character fallback cases, user agents may download a font if it's
  3020    contained within the computed value of <a href="#propdef-font-family"
  3021    title="font-family!!property">‘<code
  3022    class=property>font-family</code>’</a> for a given text run.
  3024   <pre>
  3025 @font-face {
  3026   font-family: GeometricModern;
  3027   src: url(font.woff);
  3030 p {
  3031   /* font will be downloaded for pages with p elements */
  3032   font-family: GeometricModern, sans-serif;
  3035 h2 {
  3036   /* font may be downloaded for pages with h2 elements, even if Futura is available locally */
  3037   font-family: Futura, GeometricModern, sans-serif;
  3039 </pre>
  3041   <p>In cases where textual content is loaded before downloadable fonts are
  3042    available, user agents may render text as it would be rendered if
  3043    downloadable font resources are not available or they may render text
  3044    transparently with fallback fonts to avoid a flash of text using a
  3045    fallback font. In cases where the font download fails user agents must
  3046    display text, simply leaving transparent text is considered non-conformant
  3047    behavior. Authors are advised to use fallback fonts in their font lists
  3048    that closely match the metrics of the downloadable fonts to avoid large
  3049    page reflows where possible.
  3051   <p><a id=same-origin-restriction> </a><a
  3052    id=allowing-cross-origin-font-loading> </a>
  3054   <h3 id=font-fetching-requirements><span class=secno>4.9 </span>Font
  3055    fetching requirements</h3>
  3056   <!-- TPAC 2011 Resolution to require same-origin restriction for loading fonts:
  3057   http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html
  3058   http://www.w3.org/2011/10/31-webapps-minutes.html#item02
  3059 -->
  3061   <p>For font loads, user agents must use the <a
  3062    href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
  3063    CORS-enabled fetch</a> method defined by the <a href="#HTML5"
  3064    rel=biblioentry>[HTML5]<!--{{!HTML5}}--></a> specification for URL's
  3065    defined within @font-face rules. When fetching, user agents must use
  3066    "Anonymous" mode, set the referrer source to the stylesheet's URL and set
  3067    the origin to the URL of the containing document.
  3069   <p class=note>The implications of this for authors are that fonts will
  3070    typically not be loaded cross-origin unless authors specifically takes
  3071    steps to permit cross-origin loads. Sites can explicitly allow cross-site
  3072    loading of font data using the <code>Access-Control-Allow-Origin</code>
  3073    HTTP header. For other schemes, no explicit mechanism to allow
  3074    cross-origin loading, beyond what is permitted by the <a
  3075    href="http://www.w3.org/TR/html5/infrastructure.html#cors-enabled-fetch">potentially
  3076    CORS-enabled fetch</a> method, is defined or required.
  3078   <div class=example> For the examples given below, assume that a document is
  3079    located at <code>http://example.com/page.html</code> and all URL's link to
  3080    valid font resources supported by the user agent. Fonts defined with the
  3081    ‘<a href="#descdef-src"><code class=property>src</code></a>’
  3082    descriptor values below will be loaded:
  3083    <pre>/* same origin (i.e. domain, scheme, port match document) */
  3084 src: url(fonts/simple.woff);
  3086 /* data url's with no redirects are treated as same origin */
  3087 src: url("data:application/font-woff;base64,...");
  3089 /* cross origin, different domain */
  3090 /* Access-Control-Allow-Origin response header set to '*' */
  3091 src: url(http://another.example.com/fonts/simple.woff);
  3092 </pre>
  3093    Fonts defined with the ‘<a href="#descdef-src"><code
  3094    class=property>src</code></a>’ descriptor values below will fail to
  3095    load:
  3096    <pre>/* cross origin, different scheme */
  3097 /* no Access-Control-xxx headers in response */
  3098 src: url(https://example.com/fonts/simple.woff);
  3100 /* cross origin, different domain */
  3101 /* no Access-Control-xxx headers in response */
  3102 src: url(http://another.example.com/fonts/simple.woff);
  3103 </pre>
  3104   </div>
  3106   <h2 id=font-matching-algorithm><span class=secno>5 </span>Font Matching
  3107    Algorithm</h2>
  3109   <p>The algorithm below describes how fonts are associated with individual
  3110    runs of text. For each character in the run a font family is chosen and a
  3111    particular font face is selected containing a glyph for that character.
  3113   <h3 id=font-family-casing><span class=secno>5.1 </span>Case sensitivity of
  3114    font family names</h3>
  3116   <p>As part of the font matching algorithm outlined below, user agents must
  3117    match font family names used in style rules with actual font family names
  3118    contained in fonts available in a given environment or with font family
  3119    names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
  3120    rules. User agents must match these names case insensitively, using the
  3121    "Default Caseless Matching" algorithm outlined in the Unicode
  3122    specification <a href="#UNICODE"
  3123    rel=biblioentry>[UNICODE]<!--{{!UNICODE}}--></a>. This algorithm is
  3124    detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
  3125    the algorithm must be applied without normalizing the strings involved and
  3126    without applying any language-specific tailorings. The case folding method
  3127    specified by this algorithm uses the case mappings with status field
  3128    ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
  3129    in the CaseFolding.txt file of the Unicode Character Database.
  3131   <p class=note> For authors this means that font family names are matched
  3132    case insensitively, whether those names exist in a platform font or in the
  3133    <a href="#at-font-face-rule"><code>@font-face</code></a> rules contained
  3134    in a stylesheet. Authors should take care to ensure that names use a
  3135    character sequence consistent with the actual font family name,
  3136    particularly when using combining characters such as diacritical marks.
  3137    For example, a family name that contains an uppercase A (U+0041) followed
  3138    by a combining ring (U+030A) will <strong>not</strong> match a name that
  3139    looks identical but which uses the precomposed lowercase a-ring character
  3140    (U+00E5) instead of the combining sequence.
  3142   <p class=note> Implementors should take care to verify that a given
  3143    caseless string comparison implementation uses this precise algorithm and
  3144    not assume that a given platform string matching routine follows it, as
  3145    many of these have locale-specific behavior or use some level of string
  3146    normalization.
  3148   <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
  3149    styles</h3>
  3151   <p>The procedure for choosing a font for a given character in a run of text
  3152    consists of iterating over the font families named by the <a
  3153    href="#propdef-font-family" title="font-family!!property">‘<code
  3154    class=property>font-family</code>’</a> property, selecting a font face
  3155    with the appropriate style based on other font properties and then
  3156    determining whether a glyph exists for the given character. This is done
  3157    using the <dfn id=character-map>character map</dfn> of the font, data
  3158    which maps characters to the default glyph for that character. A font is
  3159    considered to <dfn id=support>support</dfn> a given character if (1) the
  3160    character is contained in the font's <a
  3161    href="#character-map"><em>character map</em></a> and (2) if required by
  3162    the containing script, shaping information is available for that
  3163    character.
  3165   <p>Some legacy fonts may include a given character in the <a
  3166    href="#character-map"><em>character map</em></a> but lack the shaping
  3167    information (e.g. <a
  3168    href="http://www.microsoft.com/typography/otspec/ttochap1.htm">OpenType
  3169    layout tables</a> or <a
  3170    href="http://scripts.sil.org/cms/scripts/page.php?site_id=projects&amp;item_id=graphite_techAbout">Graphite
  3171    tables</a>) necessary for correctly rendering text runs containing that
  3172    character.
  3174   <p>Codepoint sequences consisting of a base character followed by a
  3175    sequence of combining characters are treated slightly differently, see the
  3176    section on <a href="#cluster-matching">cluster matching</a> below.
  3178   <p>For this procedure, the <dfn id=default-face>default face</dfn> for a
  3179    given font family is defined to be the face that would be selected if all
  3180    font style properties were set to their initial value.
  3182   <ol id=fontmatchingalg>
  3183    <li>Using the computed font property values for a given element, the user
  3184     agent starts with the first family name specified by the <a
  3185     href="#propdef-font-family" title="font-family!!property">‘<code
  3186     class=property>font-family</code>’</a> property.
  3188    <li>If the family name is a generic family keyword, the user agent looks
  3189     up the appropriate font family name to be used. User agents may choose
  3190     the generic font family to use based on the language of the containing
  3191     element or the Unicode range of the character.
  3193    <li>For other family names, the user agent attempts to find the family
  3194     name among fonts defined via <a
  3195     href="#at-font-face-rule"><code>@font-face</code></a> rules and then
  3196     among available system fonts, matching names with a <a
  3197     href="#font-family-casing">case-insensitive comparison</a> as outlined in
  3198     the section above. On systems containing fonts with multiple localized
  3199     font family names, user agents must match any of these names independent
  3200     of the underlying system locale or platform API used. If the font
  3201     resources defined for a given face in an <a
  3202     href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
  3203     available or contain invalid font data, then the face should be treated
  3204     as not present in the family. If no faces are present for a family
  3205     defined via <a href="#at-font-face-rule"><code>@font-face</code></a>
  3206     rules, the family should be treated as missing; matching a platform font
  3207     with the same name must not occur in this case.
  3209    <li>If a font family match occurs, the user agent assembles the set of
  3210     font faces in that family and then narrows the set to a single face using
  3211     other font properties in the order given below. A group of faces defined
  3212     via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
  3213     identical font descriptor values but differing ‘<a
  3214     href="#descdef-unicode-range"><code
  3215     class=property>unicode-range</code></a>’ values are considered to be a
  3216     single <dfn id=composite-face>composite face</dfn> for this step:
  3217     <ol id=fontstylematchingalg>
  3218      <li><a href="#propdef-font-stretch"
  3219       title="font-stretch!!property">‘<code
  3220       class=property>font-stretch</code>’</a> is tried first. If the
  3221       matching set contains faces with width values matching the <a
  3222       href="#propdef-font-stretch" title="font-stretch!!property">‘<code
  3223       class=property>font-stretch</code>’</a> value, faces with other width
  3224       values are removed from the matching set. If there is no face that
  3225       exactly matches the width value the nearest width is used instead. If
  3226       the value of <a href="#propdef-font-stretch"
  3227       title="font-stretch!!property">‘<code
  3228       class=property>font-stretch</code>’</a> is <a
  3229       href="#font-stretch-normal-value" title="normal!!font-stretch">‘<code
  3230       class=property>normal</code>’</a> or one of the condensed values,
  3231       narrower width values are checked first, then wider values. If the
  3232       value of <a href="#propdef-font-stretch"
  3233       title="font-stretch!!property">‘<code
  3234       class=property>font-stretch</code>’</a> is one of the expanded
  3235       values, wider values are checked first, followed by narrower values.
  3236       Once the closest matching width has been determined by this process,
  3237       faces with other widths are removed from the matching set.
  3239      <li><a href="#propdef-font-style" title="font-style!!property">‘<code
  3240       class=property>font-style</code>’</a> is tried next. If the value of
  3241       <a href="#propdef-font-style" title="font-style!!property">‘<code
  3242       class=property>font-style</code>’</a> is ‘<a href="#italic"><code
  3243       class=property>italic</code></a>’, italic faces are checked first,
  3244       then oblique, then normal faces. If the value is ‘<a
  3245       href="#oblique"><code class=property>oblique</code></a>’, oblique
  3246       faces are checked first, then italic faces and then normal faces. If
  3247       the value is <a href="#font-style-normal-value"
  3248       title="normal!!font-style">‘<code
  3249       class=property>normal</code>’</a>, normal faces are checked first,
  3250       then oblique faces, then italic faces. Faces with other style values
  3251       are excluded from the matching set. User agents are permitted to
  3252       distinguish between italic and oblique faces within platform font
  3253       families but this is not required, so all italic or oblique faces may
  3254       be treated as italic faces. However, within font families defined via
  3255       <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
  3256       and oblique faces must be distinguished using the value of the <a
  3257       href="#descdef-font-style" title="font-style!!descriptor">‘<code
  3258       class=property>font-style</code>’</a> descriptor. For families that
  3259       lack any italic or oblique faces, users agents may create artificial
  3260       oblique faces, if this is permitted by the value of the ‘<a
  3261       href="#propdef-font-synthesis"><code
  3262       class=property>font-synthesis</code></a>’ property.
  3264      <li><a href="#propdef-font-weight"
  3265       title="font-weight!!property">‘<code
  3266       class=property>font-weight</code>’</a> is matched next, so it will
  3267       always reduce the matching set to a single font face. If bolder/lighter
  3268       relative weights are used, the effective weight is calculated based on
  3269       the inherited weight value, as described in the definition of the <a
  3270       href="#propdef-font-weight" title="font-weight!!property">‘<code
  3271       class=property>font-weight</code>’</a> property. Given the desired
  3272       weight and the weights of faces in the matching set after the steps
  3273       above, if the desired weight is available that face matches. Otherwise,
  3274       a weight is chosen using the rules below:
  3275       <ul>
  3276        <li>If the desired weight is less than 400, weights below the desired
  3277         weight are checked in descending order followed by weights above the
  3278         desired weight in ascending order until a match is found.
  3280        <li>If the desired weight is greater than 500, weights above the
  3281         desired weight are checked in ascending order followed by weights
  3282         below the desired weight in descending order until a match is found.
  3284        <li>If the desired weight is 400, 500 is checked first and then the
  3285         rule for desired weights less than 400 is used.
  3287        <li>If the desired weight is 500, 400 is checked first and then the
  3288         rule for desired weights less than 400 is used.
  3289       </ul>
  3291      <li><span class=property>‘<a href="#propdef-font-size"><code
  3292       class=property>font-size</code></a>’</span> must be matched within a
  3293       UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
  3294       are rounded to the nearest whole pixel, while the tolerance for
  3295       bitmapped fonts could be as large as 20%.) Further computations, e.g.,
  3296       by ‘<code class=property>em</code>’ values in other properties, are
  3297       based on the <span class=property>‘<a href="#propdef-font-size"><code
  3298       class=property>font-size</code></a>’</span> value that is used, not
  3299       the one that is specified.
  3300     </ol>
  3302    <li>
  3303     <p>If the matched face is defined via <a
  3304      href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
  3305      must use the procedure below to select a single font:
  3307     <ol>
  3308      <li>If the font resource has not been loaded and the range of characters
  3309       defined by the ‘<a href="#descdef-unicode-range"><code
  3310       class=property>unicode-range</code></a>’ descriptor value includes
  3311       the character in question, load the font.
  3313      <li>After downloading, if the <a
  3314       href="#effective-character-map"><em>effective character map</em></a>
  3315       supports the character in question, select that font.
  3316     </ol>
  3318     <p>When the matched face is a <a href="#composite-face"><em>composite
  3319      face</em></a>, user agents must use the procedure above on each of the
  3320      faces in the <a href="#composite-face"><em>composite face</em></a> in
  3321      reverse order of <a
  3322      href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
  3324     <p>While the download occurs, user agents may either wait until the font
  3325      is downloaded or render once with substituted font metrics and render
  3326      again once the font is downloaded.</p>
  3328    <li>
  3329     <p>If no matching face exists or the matched face does not contain a
  3330      glyph for the character to be rendered, the next family name is selected
  3331      and the previous three steps repeated. Glyphs from other faces in the
  3332      family are not considered. The only exception is that user agents may
  3333      optionally substitute a synthetically obliqued version of the <a
  3334      href="#default-face"><em>default face</em></a> if that face supports a
  3335      given glyph and synthesis of these faces is permitted by the value of
  3336      the ‘<a href="#propdef-font-synthesis"><code
  3337      class=property>font-synthesis</code></a>’ property. For example, a
  3338      synthetic italic version of the regular face may be used if the italic
  3339      face doesn't support glyphs for Arabic.</p>
  3340     <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
  3343    <li>If there are no more font families to be evaluated and no matching
  3344     face has been found, then the user agent performs a <dfn
  3345     id=system-font-fallback>system font fallback</dfn> procedure to find the
  3346     best match for the character to be rendered. The result of this procedure
  3347     may vary across user agents.
  3349    <li>If a particular character cannot be displayed using any font, the user
  3350     agent should indicate by some means that a character is not being
  3351     displayed, displaying either a symbolic representation of the missing
  3352     glyph (e.g. using a <a
  3353     href="http://en.wikipedia.org/wiki/Last_resort_font">Last Resort
  3354     Font</a>) or using the missing character glyph from a default font.
  3355   </ol>
  3357   <p>Optimizations of this process are allowed provided that an
  3358    implementation behaves as if the algorithm had been followed exactly.
  3359    Matching occurs in a well-defined order to ensure that the results are as
  3360    consistent as possible across user agents, given an identical set of
  3361    available fonts and rendering technology.
  3363   <p>The <dfn id=first-available-font>first available font</dfn>, used in the
  3364    definition of <a
  3365    href="http://www.w3.org/TR/css3-values/#font-relative-lengths"><em>font-relative
  3366    lengths</em></a> such as ‘<code class=property>ex</code>’ and ‘<code
  3367    class=property>ch</code>’, is defined to be the first available font
  3368    that would match any character given font families in the ‘<code
  3369    class=property>font-family</code>’ list (or a user agent's default font
  3370    if none are available).
  3372   <h3 id=cluster-matching><span class=secno>5.3 </span>Cluster matching</h3>
  3374   <p>When text contains characters such as combining marks, ideally the base
  3375    character should be rendered using the same font as the mark, this assures
  3376    proper placement of the mark. For this reason, the font matching algorithm
  3377    for clusters is more specialized than the general case of matching a
  3378    single character by itself. For sequences containing variation selectors,
  3379    which indicate the precise glyph to be used for a given character, user
  3380    agents always attempt <a href="#system-font-fallback"><em>system font
  3381    fallback</em></a> to find the appropriate glyph before using the default
  3382    glyph of the base character.
  3384   <p>A sequence of codepoints containing combining mark or other modifiers is
  3385    termed a grapheme cluster (see <a href="#CSS3TEXT"
  3386    rel=biblioentry>[CSS3TEXT]<!--{{CSS3TEXT}}--></a> for a more complete
  3387    description). For a given cluster containing a base character, <em>b</em>
  3388    and a sequence of combining characters <em>c1, c2…</em>, the entire
  3389    cluster is matched using these steps:
  3391   <ol>
  3392    <li>For each family in the font list, a face is chosen using the style
  3393     selection rules defined in the previous section.
  3394     <ol>
  3395      <li>If all characters in the sequence <em>b + c1 + c2 …</em> are
  3396       completely supported by the font, select this font for the sequence.
  3398      <li>If a sequence of multiple codepoints is canonically equivalent to a
  3399       single character and the font <a href="#support"><em
  3400       title=support>supports</em></a> that character, select this font for
  3401       the sequence and use the glyph associated with the canonically
  3402       equiavlent character for the entire cluster.
  3403     </ol>
  3405    <li>If no font was found in the font list in step 1:
  3406     <ol>
  3407      <li>If <em>c1</em> is a variation selector, system fallback must be used
  3408       to find a font that <a href="#support"><em
  3409       title=support>supports</em></a> the full sequence of <em>b + c1</em>.
  3410       If no font on the system <a href="#support"><em
  3411       title=support>supports</em></a> the full sequence, match the single
  3412       character <em>b</em> using the normal procedure for matching single
  3413       characters and ignore the variation selector. Note: a sequence with
  3414       more than one variation selector must be treated as an encoding error
  3415       and the trailing selectors must be ignored. <a href="#UNICODE"
  3416       rel=biblioentry>[UNICODE]<!--{{!UNICODE}}--></a>
  3418      <li>Otherwise, the user agent may optionally use system font fallback to
  3419       match a font that <a href="#support"><em
  3420       title=support>supports</em></a> the entire cluster.
  3421     </ol>
  3423    <li>If no font is found in step 2, use the matching sequence from step 1
  3424     to determine the longest sequence that is completely <a
  3425     href="#support"><em title=support>supported</em></a> by a font in the
  3426     font list and attempt to match the remaining combining characters
  3427     separately using the rules for single characters.
  3428   </ol>
  3430   <h3 id=char-handling-issues><span class=secno>5.4 </span>Character handling
  3431    issues</h3>
  3433   <p>CSS font matching is always performed on text runs containing Unicode
  3434    characters, so documents using legacy encodings are assumed to have been
  3435    transcoded before matching fonts. For fonts containing <a
  3436    href="#character-map"><em title="character map">character maps</em></a>
  3437    for both legacy encodings and Unicode, the contents of the legacy encoding
  3438    <a href="#character-map"><em>character map</em></a> must have no effect on
  3439    the results of the font matching process.
  3441   <p>The font matching process does not assume that text runs are in either
  3442    normalized or denormalized form (see <a href="#CHARMOD-NORM"
  3443    rel=biblioentry>[CHARMOD-NORM]<!--{{CHARMOD-NORM}}--></a> for more
  3444    details). Fonts may only support precomposed forms and not the decomposed
  3445    sequence of base character plus combining marks. Authors should always
  3446    tailor their choice of fonts to their content, including whether that
  3447    content contains normalized or denormalized character streams.
  3449   <p>If a given character is a Private-Use Area Unicode codepoint, user
  3450    agents must only match font families named in the ‘<code
  3451    class=property>font-family</code>’ list that are not generic families.
  3452    If none of the families named in the ‘<code
  3453    class=property>font-family</code>’ list contain a glyph for that
  3454    codepoint, user agents must display some form of missing glyph symbol for
  3455    that character rather than attempting <a
  3456    href="#system-font-fallback"><em>system font fallback</em></a> for that
  3457    codepoint. When matching the replacement character U+FFFD, user agents may
  3458    skip the font matching process and immediately display some form of
  3459    missing glyph symbol, they are not required to display the glyph from the
  3460    font that would be selected by the font matching process.
  3462   <p>In general, the fonts for a given family will all have the same or
  3463    similar <a href="#character-map"><em title="character map">character
  3464    maps</em></a>. The process outlined here is designed to handle even font
  3465    families containing faces with widely variant <a href="#character-map"><em
  3466    title="character map">character maps</em></a>. However, authors are
  3467    cautioned that the use of such families can lead to unexpected results.
  3469   <h3 id=font-matching-changes><span class=secno>5.5 </span>Font matching
  3470    changes since CSS 2.1</h3>
  3472   <p>The algorithm above is different from CSS 2.1 in a number of key places.
  3473    These changes were made to better reflect actual font matching behavior
  3474    across user agent implementations.
  3476   <p>Differences compared to the font matching algorithm in CSS 2.1:
  3478   <ul>
  3479    <li>The algorithm includes font-stretch matching.
  3481    <li>All possible font-style matching scenarios are delineated.
  3483    <li>Small-caps fonts are not matched as part of the font matching process,
  3484     they are now handled via font features.
  3486    <li>Unicode variation selector matching is required.
  3488    <li>Cluster sequences are matched as a unit.
  3489   </ul>
  3491   <h3 id=font-matching-examples><span class=secno>5.6 </span>Font matching
  3492    examples</h3>
  3494   <div class=example>
  3495    <p>It's useful to note that the CSS selector syntax may be used to create
  3496     language-sensitive typography. For example, some Chinese and Japanese
  3497     characters are unified to have the same Unicode code point, although the
  3498     abstract glyphs are not the same in the two languages.
  3500    <pre>*:lang(ja) { font: 900 14pt/16pt &quot;Heisei Mincho W9&quot;, serif; }
  3501 *:lang(zh-Hant-TW) { font: 800 14pt/16.5pt &quot;Li Sung&quot;, serif; }
  3502 </pre>
  3504    <p>This selects any element that has the given language — Japanese or
  3505     Traditional Chinese as used in Taiwan — and uses the appropriate font.
  3507   </div>
  3509   <h2 id=font-rend-props><span class=secno>6 </span>Font Feature Properties</h2>
  3511   <p>Modern font technologies support a variety of advanced typographic and
  3512    language-specific font features. Using these features, a single font can
  3513    provide glyphs for a wide range of ligatures, contextual and stylistic
  3514    alternates, tabular and old-style figures, small capitals, automatic
  3515    fractions, swashes, and alternates specific to a given language. To allow
  3516    authors control over these font capabilities, the ‘<code
  3517    class=property>font-variant</code>’ property has been expanded for CSS3.
  3518    It now functions as a shorthand for a set of properties that provide
  3519    control over stylistic font features.
  3521   <h3 id=glyph-selection-positioning><span class=secno>6.1 </span>Glyph
  3522    selection and positioning</h3>
  3524   <p>Simple fonts used for displaying Latin text use a very basic processing
  3525    model. Fonts contain a <a href="#character-map"><em>character map</em></a>
  3526    which maps each character to a glyph for that character. Glyphs for
  3527    subsequent characters are simply placed one after the other along a run of
  3528    text. Modern font formats such as OpenType and AAT (Apple Advanced
  3529    Typography) use a richer processing model. The glyph for a given character
  3530    can be chosen and positioned not just based on the codepoint of the
  3531    character itself, but also on adjacent characters as well as the language,
  3532    script, and features enabled for the text. Font features may be required
  3533    for specific scripts, or recommended as enabled by default or they might
  3534    be stylistic features meant to be used under author control.
  3536   <p>For a good visual overview of these features, see the <a
  3537    href="#OPENTYPE-FONT-GUIDE"
  3538    rel=biblioentry>[OPENTYPE-FONT-GUIDE]<!--{{OPENTYPE-FONT-GUIDE}}--></a>.
  3539    For a detailed description of glyph processing for OpenType fonts, see <a
  3540    href="#WINDOWS-GLYPH-PROC"
  3541    rel=biblioentry>[WINDOWS-GLYPH-PROC]<!--{{WINDOWS-GLYPH-PROC}}--></a>.
  3543   <p>Stylistic font features can be classified into two broad categories:
  3544    ones that affect the harmonization of glyph shapes with the surrounding
  3545    context, such as kerning and ligature features, and ones such as the
  3546    small-caps, subscript/superscript and alternate features that affect shape
  3547    selection.
  3549   <p>The subproperties of <a href="#propdef-font-variant"
  3550    title="font-variant!!property">‘<code
  3551    class=property>font-variant</code>’</a> listed below are used to control
  3552    these stylistic font features. They do not control features that are
  3553    required for displaying certain scripts, such as the OpenType features
  3554    used when displaying Arabic or Indic language text. They affect glyph
  3555    selection and positioning, but do not affect font selection as described
  3556    in the font matching section (except in cases required for compatibility
  3557    with CSS 2.1).
  3559   <p>To assure consistent behavior across user agents, the equivalent
  3560    OpenType property settings are listed for individual properties and are
  3561    normative. When using other font formats these should be used as a
  3562    guideline to map CSS font feature property values to specific font
  3563    features.
  3565   <h3 id=language-specific-support><span class=secno>6.2
  3566    </span>Language-specific display</h3>
  3568   <p>OpenType also supports language-specific glyph selection and
  3569    positioning, so that text can be displayed correctly in cases where the
  3570    language dictates a specific display behavior. Many languages share a
  3571    common script, but the shape of certain letters can vary across those
  3572    languages. For example, certain Cyrillic letters have different shapes in
  3573    Russian text than in Bulgarian. In Latin text, it's common to render "fi"
  3574    with an explicit fi-ligature that lacks a dot on the "i". However, in
  3575    languages such as Turkish which uses both a dotted-i and a dotless-i, it's
  3576    important to not use this ligature or use a specialized version that
  3577    contains a dot over the "i". The example below shows language-specific
  3578    variations based on stylistic traditions found in Spanish, Italian and
  3579    French orthography:
  3581   <div class=featex><img alt="language specific forms, spanish"
  3582    src=locl-1.png></div>
  3584   <div class=featex><img alt="language specific forms, italian"
  3585    src=locl-2.png></div>
  3587   <div class=featex><img alt="language specific forms, french"
  3588    src=locl-3.png></div>
  3590   <p>If the content language of the element is known according to the rules
  3591    of the <a
  3592    href="http://www.w3.org/TR/CSS21/conform.html#doclanguage">document
  3593    language</a>, user agents are required to infer the OpenType language
  3594    system from the content language and use that when selecting and
  3595    positioning glyphs using an OpenType font.
  3597   <p>For OpenType fonts, in some cases it may be necessary to explicitly
  3598    declare the OpenType language to be used, for example when displaying text
  3599    in a given language that uses the typographic conventions of another
  3600    language or when the font does not explicitly support a given language but
  3601    supports a language that shares common typographic conventions. The ‘<a
  3602    href="#propdef-font-language-override"><code
  3603    class=property>font-language-override</code></a>’ property is used for
  3604    this purpose.</p>
  3605   <!-- prop: font-kerning -->
  3607   <h3 id=font-kerning-prop><span class=secno>6.3 </span>Kerning: the <a
  3608    href="#propdef-font-kerning">font-kerning</a> property</h3>
  3610   <table class=propdef id=namefont-kerningvalueauto-normal-noneini>
  3611    <tbody>
  3612     <tr>
  3613      <td>Name:
  3615      <td><dfn id=propdef-font-kerning>font-kerning</dfn>
  3617     <tr>
  3618      <td>Value:
  3620      <td><a href="#font-kerning-auto-value"
  3621       title="auto!!font-kerning">auto</a> | <a
  3622       href="#font-kerning-normal-value"
  3623       title="normal!!font-kerning">normal</a> | <a
  3624       href="#font-kerning-none-value" title="none!!font-kerning">none</a>
  3626     <tr>
  3627      <td>Initial:
  3629      <td>auto
  3631     <tr>
  3632      <td>Applies to:
  3634      <td>all elements
  3636     <tr>
  3637      <td>Inherited:
  3639      <td>yes
  3641     <tr>
  3642      <td>Percentages:
  3644      <td>N/A
  3646     <tr>
  3647      <td>Media:
  3649      <td>visual
  3651     <tr>
  3652      <td>Computed value:
  3654      <td>as specified
  3656     <tr>
  3657      <td>Animatable:
  3659      <td>no
  3660   </table>
  3662   <p>Kerning is the contextual adjustment of inter-glyph spacing. This
  3663    property controls metric kerning, kerning that utilizes adjustment data
  3664    contained in the font.
  3666   <dl>
  3667    <dt><dfn id=font-kerning-auto-value title="auto!!font-kerning">auto</dfn>
  3669    <dd>Specifies that kerning is applied at the discretion of the user agent
  3671    <dt><dfn id=font-kerning-normal-value
  3672     title="normal!!font-kerning">normal</dfn>
  3674    <dd>Specifies that kerning is applied
  3676    <dt><dfn id=font-kerning-none-value title="none!!font-kerning">none</dfn>
  3678    <dd>Specifies that kerning is not applied
  3679   </dl>
  3681   <p>For fonts that do not include kerning data this property will have no
  3682    visible effect. When rendering with OpenType fonts, the <a
  3683    href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>
  3684    specification suggests that kerning be enabled by default. When kerning is
  3685    enabled, the OpenType <span class=tag>kern</span> feature is enabled (for
  3686    vertical text runs the <span class=tag>vkrn</span> feature is enabled
  3687    instead). User agents must also support fonts that only support kerning
  3688    via data contained in a <span class=tag>kern</span> font table, as
  3689    detailed in the OpenType specification. If the ‘<code
  3690    class=property>letter-spacing</code>’ property is defined, kerning
  3691    adjustments are considered part of the default spacing and letter spacing
  3692    adjustments are made after kerning has been applied.
  3694   <p>When set to ‘<code class=property>auto</code>’, user agents can
  3695    determine whether to apply kerning or not based on a number of factors:
  3696    text size, script, or other factors that influence text processing speed.
  3697    Authors who want proper kerning should use <a
  3698    href="#font-kerning-normal-value" title="normal!!font-kerning">‘<code
  3699    class=property>normal</code>’</a> to explicitly enable kerning.
  3700    Likewise, some authors may prefer to disable kerning in situations where
  3701    performance is more important than precise appearance. However, in
  3702    well-designed modern implementations the use of kerning generally does not
  3703    have a large impact on text rendering speed.</p>
  3704   <!-- prop: font-variant-ligatures -->
  3706   <h3 id=font-variant-ligatures-prop><span class=secno>6.4 </span>Ligatures:
  3707    the <a href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
  3708    property</h3>
  3710   <table class=propdef id=namefont-variant-ligaturesvaluenormal-no>
  3711    <tbody>
  3712     <tr>
  3713      <td>Name:
  3715      <td><dfn id=propdef-font-variant-ligatures>font-variant-ligatures</dfn>
  3717     <tr>
  3718      <td>Value:
  3720      <td><a href="#font-variant-ligatures-normal-value"
  3721       title="normal!!font-variant-ligatures">normal</a> | <a
  3722       href="#font-variant-ligatures-none-value"
  3723       title="none!!font-variant-ligatures">none</a> | [ <a
  3724       href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a> ||
  3725       <a
  3726       href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
  3727       || <a
  3728       href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
  3729       || <a
  3730       href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
  3733     <tr>
  3734      <td>Initial:
  3736      <td>normal
  3738     <tr>
  3739      <td>Applies to:
  3741      <td>all elements
  3743     <tr>
  3744      <td>Inherited:
  3746      <td>yes
  3748     <tr>
  3749      <td>Percentages:
  3751      <td>N/A
  3753     <tr>
  3754      <td>Media:
  3756      <td>visual
  3758     <tr>
  3759      <td>Computed value:
  3761      <td>as specified
  3763     <tr>
  3764      <td>Animatable:
  3766      <td>no
  3767   </table>
  3769   <p>Ligatures and contextual forms are ways of combining glyphs to produce
  3770    more harmonized forms.
  3772   <pre
  3773    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>
  3775   <pre
  3776    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>
  3778   <pre
  3779    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>
  3781   <pre
  3782    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>
  3784   <p>Individual values have the following meanings:
  3786   <dl>
  3787    <dt><dfn id=font-variant-ligatures-normal-value
  3788     title="normal!!font-variant-ligatures">normal</dfn>
  3790    <dd>A value of <a href="#font-variant-ligatures-normal-value"
  3791     title="normal!!font-variant-ligatures">‘<code
  3792     class=property>normal</code>’</a> specifies that common default
  3793     features are enabled, <a href="#font-feature-resolution">as described in
  3794     detail in the next section</a>. For OpenType fonts, common ligatures and
  3795     contextual forms are on by default, discretionary and historical
  3796     ligatures are not.
  3798    <dt><dfn id=font-variant-ligatures-none-value
  3799     title="none!!font-variant-ligatures">none</dfn>
  3801    <dd>Specifies that all types of ligatures and contextual forms covered by
  3802     this property are explicitly disabled. In situations where ligatures are
  3803     not considered necessary, this may improve the speed of text rendering.
  3805    <dt><dfn id=common-ligatures>common-ligatures</dfn>
  3807    <dd>Enables display of common ligatures (OpenType features: <span
  3808     class=tag>liga, clig</span>). For OpenType fonts, common ligatures are
  3809     enabled by default.
  3810   </dl>
  3812   <div class=featex><img alt="common ligature example" src=liga.png></div>
  3814   <dl>
  3815    <dt><dfn id=no-common-ligatures>no-common-ligatures</dfn>
  3817    <dd>Disables display of common ligatures (OpenType features: <span
  3818     class=tag>liga, clig</span>).
  3820    <dt><dfn id=discretionary-ligatures>discretionary-ligatures</dfn>
  3822    <dd>Enables display of discretionary ligatures (OpenType feature: <span
  3823     class=tag>dlig</span>). Which ligatures are discretionary or optional is
  3824     decided by the type designer, so authors will need to refer to the
  3825     documentation of a given font to understand which ligatures are
  3826     considered discretionary.
  3827   </dl>
  3829   <div class=featex><img alt="discretionary ligature example" src=dlig.png></div>
  3831   <dl>
  3832    <dt><dfn id=no-discretionary-ligatures>no-discretionary-ligatures</dfn>
  3834    <dd>Disables display of discretionary ligatures (OpenType feature: <span
  3835     class=tag>dlig</span>).
  3837    <dt><dfn id=historical-ligatures>historical-ligatures</dfn>
  3839    <dd>Enables display of historical ligatures (OpenType feature: <span
  3840     class=tag>hlig</span>).
  3841   </dl>
  3843   <div class=featex><img alt="historical ligature example" src=hlig.png></div>
  3845   <dl>
  3846    <dt><dfn id=no-historical-ligatures>no-historical-ligatures</dfn>
  3848    <dd>Disables display of historical ligatures (OpenType feature: <span
  3849     class=tag>hlig</span>).
  3851    <dt><dfn id=contextual>contextual</dfn>
  3853    <dd>Enables display of contextual alternates (OpenType feature: <span
  3854     class=tag>calt</span>). Although not strictly a ligature feature, like
  3855     ligatures this feature is commonly used to harmonize the shapes of glyphs
  3856     with the surrounding context. For OpenType fonts, this feature is on by
  3857     default.
  3858   </dl>
  3860   <div class=featex><img alt="contextual alternate example" src=calt.png></div>
  3862   <dl>
  3863    <dt><dfn id=no-contextual>no-contextual</dfn>
  3865    <dd>Disables display of contextual alternates (OpenType feature: <span
  3866     class=tag>calt</span>).
  3867   </dl>
  3869   <p>Required ligatures, needed for correctly rendering complex scripts, are
  3870    not affected by the settings above, including ‘<code
  3871    class=property>none</code>’ (OpenType feature: <span
  3872    class=tag>rlig</span>).</p>
  3873   <!-- prop: font-variant-position -->
  3875   <h3 id=font-variant-position-prop><span class=secno>6.5 </span>Subscript
  3876    and superscript forms: the <a
  3877    href="#propdef-font-variant-position">font-variant-position</a> property</h3>
  3879   <table class=propdef id=namefont-variant-positionvaluenormal-sub>
  3880    <tbody>
  3881     <tr>
  3882      <td>Name:
  3884      <td><dfn id=propdef-font-variant-position>font-variant-position</dfn>
  3886     <tr>
  3887      <td>Value:
  3889      <td><a href="#font-variant-position-normal-value"
  3890       title="normal!!font-variant-position">normal</a> | <a
  3891       href="#sub">sub</a> | <a href="#super">super</a>
  3893     <tr>
  3894      <td>Initial:
  3896      <td>normal
  3898     <tr>
  3899      <td>Applies to:
  3901      <td>all elements
  3903     <tr>
  3904      <td>Inherited:
  3906      <td>yes
  3908     <tr>
  3909      <td>Percentages:
  3911      <td>N/A
  3913     <tr>
  3914      <td>Media:
  3916      <td>visual
  3918     <tr>
  3919      <td>Computed value:
  3921      <td>as specified
  3923     <tr>
  3924      <td>Animatable:
  3926      <td>no
  3927   </table>
  3929   <p>This property is used to enable typographic subscript and superscript
  3930    glyphs. These are alternate glyphs designed within the same em-box as
  3931    default glyphs and are intended to be laid out on the same baseline as the
  3932    default glyphs, with no resizing or repositioning of the baseline. They
  3933    are explicitly designed to match the surrounding text and to be more
  3934    readable without affecting the line height.
  3936   <div class=figure><img alt="comparison between real subscript glyphs and
  3937    synthesized ones" src=realsubscripts.png>
  3938    <p class=caption>Subscript glyphs (top) vs. typical synthesized subscripts
  3939     (bottom)
  3940   </div>
  3942   <p>Individual values have the following meanings:
  3944   <dl>
  3945    <dt><dfn id=font-variant-position-normal-value
  3946     title="normal!!font-variant-position">normal</dfn>
  3948    <dd>None of the features listed below are enabled.
  3950    <dt><dfn id=sub>sub</dfn>
  3952    <dd>Enables display of subscript variants (OpenType feature: <span
  3953     class=tag>subs</span>).
  3955    <dt><dfn id=super>super</dfn>
  3957    <dd>Enables display of superscript variants (OpenType feature: <span
  3958     class=tag>sups</span>).
  3959   </dl>
  3961   <p>Because of the semantic nature of subscripts and superscripts, when the
  3962    value is either ‘<a href="#sub"><code class=property>sub</code></a>’
  3963    or ‘<a href="#super"><code class=property>super</code></a>’ for a
  3964    given contiguous run of text, if a variant glyph is not available for all
  3965    the characters in the run, simulated glyphs must be synthesized for all
  3966    characters using reduced forms of the glyphs that would be used without
  3967    this feature applied. This is done per run to avoid a mixture of variant
  3968    glyphs and synthesized ones that would not align correctly. In the case of
  3969    OpenType fonts that lack subscript or superscript glyphs for a given
  3970    character, user agents must use the appropriate subscript and superscript
  3971    metrics specified in the selected font's <a
  3972    href="http://www.microsoft.com/typography/otspec/os2.htm#subxs">OS/2
  3973    table</a> <a href="#OPENTYPE"
  3974    rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> to calculate the size
  3975    and offset of the synthesized substitutes.
  3977   <div class=figure><img alt="alternate superscripts vs. glyphs synthesized
  3978    using superscript metrics" src=superscript-alt-synth.png>
  3979    <p class=caption>Superscript alternate glyph (left), synthesized
  3980     superscript glyphs (middle), and incorrect mixture of the two (right)
  3981   </div>
  3983   <p>In situations where text decorations are only applied to runs of text
  3984    containing superscript or subscript glyphs, the synthesized glyphs must be
  3985    used to avoid problems with the placement of decorations.
  3987   <p>In the past, user agents have used font-size and vertical-align to
  3988    simulate subscripts and superscripts for the <code title="HTML sub
  3989    element">sub</code> and <code title="HTML sup element">sup</code>
  3990    elements. To allow a backwards compatible way of defining subscripts and
  3991    superscripts, it is recommended that authors use conditional rules <a
  3992    href="#CSS3-CONDITIONAL"
  3993    rel=biblioentry>[CSS3-CONDITIONAL]<!--{{CSS3-CONDITIONAL}}--></a> so that
  3994    older user agents will still render subscripts and superscripts via the
  3995    older mechanism.
  3997   <p>Authors should note that fonts typically only provide subscript and
  3998    superscript glyphs for a subset of all characters supported by the font.
  3999    For example, while subscript and superscript glyphs are often available
  4000    for Latin numbers, glyphs for punctuation and letter characters are less
  4001    frequently provided. The synthetic fallback rules defined for this
  4002    property assure that subscripts and superscripts will always appear but
  4003    the appearance may not match author expectations if the font used does not
  4004    provide the appropriate alternate glyph for all characters contained in a
  4005    subscript or superscript.
  4007   <p>This property is not cumulative. Applying it to elements within a
  4008    subscript or superscript won't nest the placement of a subscript or
  4009    superscript glyph. Images contained within text runs where the value of
  4010    this property is ‘<a href="#sub"><code class=property>sub</code></a>’
  4011    or ‘<a href="#super"><code class=property>super</code></a>’ will be
  4012    drawn just as they would if the value was <a
  4013    href="#font-variant-position-normal-value"
  4014    title="normal!!font-variant-position">‘<code
  4015    class=property>normal</code>’</a>.</p>
  4016   <!-- due to lack of consensus, couldn't resolve on exact positioning of text decorations:
  4017 http://www.w3.org/2013/06/06-css-minutes.html#item03 -->
  4019   <p>Because of these limitations, ‘<a
  4020    href="#propdef-font-variant-position"><code
  4021    class=property>font-variant-position</code></a>’ is not recommended for
  4022    use in user agent stylesheets. Authors should use it in cases where
  4023    subscripts or superscripts will only contain the narrow range of
  4024    characters supported by the fonts specified.
  4026   <p class=note>The variant glyphs use the same baseline as the default
  4027    glyphs would use. There is no shift in the placement along the baseline,
  4028    so the use of variant glyphs doesn't affect the height of the inline box
  4029    or alter the height of the linebox. This makes superscript and subscript
  4030    variants ideal for situations where it's important that leading remain
  4031    constant, such as in multi-column layout.
  4033   <div class=example>
  4034    <p>A typical user agent default style for the <a class=tag
  4035     href="#sub">sub</a> element:</p>
  4037    <pre>sub {
  4038   vertical-align: sub;
  4039   font-size: smaller;
  4040   line-height: normal;
  4042 </pre>
  4044    <p>Using font-variant-position to specify typographic subscripts in a way
  4045     that will still show subscripts in older user agents:</p>
  4047    <pre>@supports ( font-variant-position: sub ) {
  4049   sub {
  4050     vertical-align: baseline;
  4051     font-size: 100%;
  4052     line-height: inherit;
  4053     font-variant-position: sub;
  4057 </pre>
  4059    <p>User agents that support the ‘<a
  4060     href="#propdef-font-variant-position"><code
  4061     class=property>font-variant-position</code></a>’ property will select a
  4062     subscript variant glyph and render this without adjusting the baseline or
  4063     font-size. Older user agents will ignore the ‘<a
  4064     href="#propdef-font-variant-position"><code
  4065     class=property>font-variant-position</code></a>’ property definition
  4066     and use the standard defaults for subscripts.</p>
  4067   </div>
  4068   <!-- prop: font-variant-caps -->
  4070   <h3 id=font-variant-caps-prop><span class=secno>6.6 </span>Capitalization:
  4071    the <a href="#propdef-font-variant-caps">font-variant-caps</a> property</h3>
  4073   <table class=propdef id=namefont-variant-capsvaluenormal-small-c>
  4074    <tbody>
  4075     <tr>
  4076      <td>Name:
  4078      <td><dfn id=propdef-font-variant-caps>font-variant-caps</dfn>
  4080     <tr>
  4081      <td>Value:
  4083      <td><a href="#font-variant-caps-normal-value"
  4084       title="normal!!font-variant-caps">normal</a> | <a
  4085       href="#small-caps">small-caps</a> | <a
  4086       href="#all-small-caps">all-small-caps</a> | <a
  4087       href="#petite-caps">petite-caps</a> | <a
  4088       href="#all-petite-caps">all-petite-caps</a> | <a
  4089       href="#unicase">unicase</a> | <a href="#titling-caps">titling-caps</a>
  4091     <tr>
  4092      <td>Initial:
  4094      <td>normal
  4096     <tr>
  4097      <td>Applies to:
  4099      <td>all elements
  4101     <tr>
  4102      <td>Inherited:
  4104      <td>yes
  4106     <tr>
  4107      <td>Percentages:
  4109      <td>N/A
  4111     <tr>
  4112      <td>Media:
  4114      <td>visual
  4116     <tr>
  4117      <td>Computed value:
  4119      <td>as specified
  4121     <tr>
  4122      <td>Animatable:
  4124      <td>no
  4125   </table>
  4127   <p>This property allows the selection of alternate glyphs used for small or
  4128    petite capitals or for titling. These glyphs are specifically designed to
  4129    blend well with the surrounding normal glyphs, to maintain the weight and
  4130    readability which suffers when text is simply resized to fit this purpose.
  4132   <p>Individual values have the following meanings:
  4134   <dl>
  4135    <dt><dfn id=font-variant-caps-normal-value
  4136     title="normal!!font-variant-caps">normal</dfn>
  4138    <dd>None of the features listed below are enabled.
  4140    <dt><dfn id=small-caps>small-caps</dfn>
  4142    <dd>Enables display of small capitals (OpenType feature: <span
  4143     class=tag>smcp</span>). Small-caps glyphs typically use the form of
  4144     uppercase letters but are reduced to the size of lowercase letters.
  4145   </dl>
  4147   <div class=featex><img alt="small-caps example" src=smcp.png></div>
  4149   <dl>
  4150    <dt><dfn id=all-small-caps>all-small-caps</dfn>
  4152    <dd>Enables display of small capitals for both upper and lowercase letters
  4153     (OpenType features: <span class=tag>c2sc, smcp</span>).
  4155    <dt><dfn id=petite-caps>petite-caps</dfn>
  4157    <dd>Enables display of petite capitals (OpenType feature: <span
  4158     class=tag>pcap</span>).
  4160    <dt><dfn id=all-petite-caps>all-petite-caps</dfn>
  4162    <dd>Enables display of petite capitals for both upper and lowercase
  4163     letters (OpenType features: <span class=tag>c2pc, pcap</span>).
  4165    <dt><dfn id=unicase>unicase</dfn>
  4167    <dd>Enables display of mixture of small capitals for uppercase letters
  4168     with normal lowercase letters (OpenType feature: <span
  4169     class=tag>unic</span>).
  4171    <dt><dfn id=titling-caps>titling-caps</dfn>
  4173    <dd>Enables display of titling capitals (OpenType feature: <span
  4174     class=tag>titl</span>). Uppercase letter glyphs are often designed for
  4175     use with lowercase letters. When used in all uppercase titling sequences
  4176     they can appear too strong. Titling capitals are designed specifically
  4177     for this situation.
  4178   </dl>
  4180   <p>The availability of these glyphs is based on whether a given feature is
  4181    defined or not in the feature list of the font. User agents can optionally
  4182    decide this on a per-script basis but should explicitly not decide this on
  4183    a per-character basis.
  4185   <p>Some fonts may only support a subset or none of the features described
  4186    for this property. For backwards compatibility with CSS 2.1, if ‘<a
  4187    href="#small-caps"><code class=property>small-caps</code></a>’ or ‘<a
  4188    href="#all-small-caps"><code class=property>all-small-caps</code></a>’
  4189    is specified but small-caps glyphs are not available for a given font,
  4190    user agents should simulate a small-caps font, for example by taking a
  4191    normal font and replacing the glyphs for lowercase letters with scaled
  4192    versions of the glyphs for uppercase characters (replacing the glyphs for
  4193    both upper and lowercase letters in the case of ‘<a
  4194    href="#all-small-caps"><code class=property>all-small-caps</code></a>’).
  4196   <div class=figure style="padding: 0; margin: auto;"><img alt="synthetic vs.
  4197    real small-caps" class=hires src=synthetic-vs-real-small-caps.png
  4198    width=512>
  4199    <p class=caption>Synthetic vs. real small-caps
  4200   </div>
  4202   <p>To match the surrounding text, a font may provide alternate glyphs for
  4203    caseless characters when these features are enabled but when a user agent
  4204    simulates small capitals, it must not attempt to simulate alternates for
  4205    codepoints which are considered caseless.
  4207   <div class=figure style="padding: 0; margin: auto;"><img alt="caseless
  4208    characters with small-caps, all-small-caps enabled" class=hires
  4209    src=small-capitals-variations.png width=418>
  4210    <p class=caption>Caseless characters with small-caps, all-small-caps
  4211     enabled
  4212   </div>
  4214   <p>If either ‘<a href="#petite-caps"><code
  4215    class=property>petite-caps</code></a>’ or ‘<a
  4216    href="#all-petite-caps"><code class=property>all-petite-caps</code></a>’
  4217    is specified for a font that doesn't support these features, the property
  4218    behaves as if ‘<a href="#small-caps"><code
  4219    class=property>small-caps</code></a>’ or ‘<a
  4220    href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
  4221    respectively, had been specified. If ‘<a href="#unicase"><code
  4222    class=property>unicase</code></a>’ is specified for a font that doesn't
  4223    support that feature, the property behaves as if ‘<a
  4224    href="#small-caps"><code class=property>small-caps</code></a>’ was
  4225    applied only to lowercased uppercase letters. If ‘<a
  4226    href="#titling-caps"><code class=property>titling-caps</code></a>’ is
  4227    specified with a font that does not support this feature, this property
  4228    has no visible effect. When simulated small capital glyphs are used, for
  4229    scripts that lack uppercase and lowercase letters, ‘<a
  4230    href="#small-caps"><code class=property>small-caps</code></a>’, ‘<a
  4231    href="#all-small-caps"><code class=property>all-small-caps</code></a>’,
  4232    ‘<a href="#petite-caps"><code class=property>petite-caps</code></a>’,
  4233    ‘<a href="#all-petite-caps"><code
  4234    class=property>all-petite-caps</code></a>’ and ‘<a
  4235    href="#unicase"><code class=property>unicase</code></a>’ have no visible
  4236    effect.
  4238   <p>When casing transforms are used to simulate small capitals, the casing
  4239    transformations must match those used for the <span
  4240    class=property>‘<code class=property>text-transform</code>’</span>
  4241    property.
  4243   <p>As a last resort, unscaled uppercase letter glyphs in a normal font may
  4244    replace glyphs in a small-caps font so that the text appears in all
  4245    uppercase letters.
  4247   <div class=figure style="padding: 0; margin: auto;"><img alt="using
  4248    all-small-caps in acronym-laden text" class=hires
  4249    src=acronym-laden-text.png width=596>
  4250    <p class=caption>Using small capitals to improve readability in
  4251     acronym-laden text
  4252   </div>
  4254   <div class=example>
  4255    <p>Quotes rendered italicised, with small-caps on the first line:</p>
  4257    <pre>blockquote            { font-style: italic; }
  4258 blockquote:first-line { font-variant: small-caps; }
  4260 &lt;blockquote><a href="http://lists.w3.org/Archives/Public/www-style/2009Dec/0036.html" style="text-decoration: none; border: none;">I'll be honor-bound to slap them like a haddock.</a>&lt;/blockquote>
  4261 </pre>
  4262   </div>
  4263   <!-- prop: font-variant-numeric -->
  4265   <h3 id=font-variant-numeric-prop><span class=secno>6.7 </span>Numerical
  4266    formatting: the <a
  4267    href="#propdef-font-variant-numeric">font-variant-numeric</a> property</h3>
  4269   <table class=propdef id=namefont-variant-numericvaluenormal-ltnu>
  4270    <tbody>
  4271     <tr>
  4272      <td>Name:
  4274      <td><dfn id=propdef-font-variant-numeric>font-variant-numeric</dfn>
  4276     <tr>
  4277      <td>Value:
  4279      <td><a href="#font-variant-numeric-normal-value"
  4280       title="normal!!font-variant-numeric">normal</a> | [ <a
  4281       href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
  4282       || <a
  4283       href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
  4284       || <a
  4285       href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
  4286       || <a href="#ordinal">ordinal</a> || <a
  4287       href="#slashed-zero">slashed-zero</a> ]
  4289     <tr>
  4290      <td>Initial:
  4292      <td>normal
  4294     <tr>
  4295      <td>Applies to:
  4297      <td>all elements
  4299     <tr>
  4300      <td>Inherited:
  4302      <td>yes
  4304     <tr>
  4305      <td>Percentages:
  4307      <td>N/A
  4309     <tr>
  4310      <td>Media:
  4312      <td>visual
  4314     <tr>
  4315      <td>Computed value:
  4317      <td>as specified
  4319     <tr>
  4320      <td>Animatable:
  4322      <td>no
  4323   </table>
  4325   <p>Specifies control over numerical forms. The example below shows how some
  4326    of these values can be combined to influence the rendering of tabular data
  4327    with fonts that support these features. Within normal paragraph text,
  4328    proportional numbers are used while tabular numbers are used so that
  4329    columns of numbers line up properly:
  4331   <div class=figure style="padding: 0; margin: auto;"><img alt="combining
  4332    number styles" src=numberstyles.png>
  4333    <p class=caption>Using number styles
  4334   </div>
  4336   <p>Possible combinations:
  4338   <pre
  4339    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>
  4341   <pre
  4342    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>
  4344   <pre
  4345    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>
  4347   <p>Individual values have the following meanings:
  4349   <dl>
  4350    <dt><dfn id=font-variant-numeric-normal-value
  4351     title="normal!!font-variant-numeric">normal</dfn>
  4353    <dd>None of the features listed below are enabled.
  4355    <dt><dfn id=lining-nums>lining-nums</dfn>
  4357    <dd>Enables display of lining numerals (OpenType feature: <span
  4358     class=tag>lnum</span>).
  4360    <dt><dfn id=oldstyle-nums>oldstyle-nums</dfn>
  4362    <dd>Enables display of old-style numerals (OpenType feature: <span
  4363     class=tag>onum</span>).
  4365    <dt><dfn id=proportional-nums>proportional-nums</dfn>
  4367    <dd>Enables display of proportional numerals (OpenType feature: <span
  4368     class=tag>pnum</span>).
  4370    <dt><dfn id=tabular-nums>tabular-nums</dfn>
  4372    <dd>Enables display of tabular numerals (OpenType feature: <span
  4373     class=tag>tnum</span>).
  4375    <dt><dfn id=diagonal-fractions>diagonal-fractions</dfn>
  4377    <dd>Enables display of lining diagonal fractions (OpenType feature: <span
  4378     class=tag>frac</span>).
  4379   </dl>
  4381   <div class=featex><img alt="diagonal fraction example" src=frac.png></div>
  4383   <dl>
  4384    <dt><dfn id=stacked-fractions>stacked-fractions</dfn>
  4386    <dd>Enables display of lining stacked fractions (OpenType feature: <span
  4387     class=tag>afrc</span>).
  4388   </dl>
  4390   <div class=featex><img alt="stacked fraction example" src=afrc.png></div>
  4392   <dl>
  4393    <dt><dfn id=ordinal>ordinal</dfn>
  4395    <dd>Enables display of letter forms used with ordinal numbers (OpenType
  4396     feature: <span class=tag>ordn</span>).
  4397   </dl>
  4399   <div class=featex><img alt="ordinals example" src=ordinals.png></div>
  4401   <dl>
  4402    <dt><dfn id=slashed-zero>slashed-zero</dfn>
  4404    <dd>Enables display of slashed zeros (OpenType feature: <span
  4405     class=tag>zero</span>).
  4406   </dl>
  4408   <div class=featex><img alt="slashed zero example" src=zero.png></div>
  4410   <div class=example id=ordinal-example>
  4411    <p>In the case of ‘<a href="#ordinal"><code
  4412     class=property>ordinal</code></a>’, although ordinal forms are often
  4413     the same as superscript forms, they are marked up differently.</p>
  4415    <p>For superscripts, the variant property is only applied to the
  4416     sub-element containing the superscript:</p>
  4418    <pre>
  4419 sup { font-variant-position: super; }
  4420 x&lt;sup&gt;2&lt;/sup&gt;
  4421 </pre>
  4423    <p>For ordinals, the variant property is applied to the entire ordinal
  4424     number rather than just to the suffix (or to the containing paragraph):</p>
  4426    <pre>
  4427 .ordinal { font-variant-numeric: ordinal; }
  4428 &lt;span class="ordinal"&gt;17th&lt;/span&gt;
  4429 </pre>
  4431    <p>In this case only the "th" will appear in ordinal form, the digits will
  4432     remain unchanged. Depending upon the typographic traditions used in a
  4433     given language, ordinal forms may differ from superscript forms. In
  4434     Italian, for example, ordinal forms sometimes include an underline in the
  4435     ordinal design.</p>
  4436   </div>
  4438   <div class=example id=steak-marinade>
  4439    <p>A simple flank steak marinade recipe, rendered with automatic fractions
  4440     and old-style numerals:</p>
  4442    <pre>.amount { font-variant-numeric: oldstyle-nums diagonal-fractions; }
  4444 &lt;h4>Steak marinade:&lt;/h4>
  4445 &lt;ul>
  4446   &lt;li>&lt;span class="amount">2&lt;/span> tbsp olive oil&lt;/li>
  4447   &lt;li>&lt;span class="amount">1&lt;/span> tbsp lemon juice&lt;/li>
  4448   &lt;li>&lt;span class="amount">1&lt;/span> tbsp soy sauce&lt;/li>
  4449   &lt;li>&lt;span class="amount">1 1/2&lt;/span> tbsp dry minced onion&lt;/li>
  4450   &lt;li>&lt;span class="amount">2 1/2&lt;/span> tsp italian seasoning&lt;/li>
  4451   &lt;li>Salt &amp;amp; pepper&lt;/li>
  4452 &lt;/ul>
  4454 &lt;p>Mix the meat with the marinade and let it sit covered in the refrigerator
  4455 for a few hours or overnight.&lt;/p>
  4456 </pre>
  4458    <p>Note that the fraction feature is only applied to values not the entire
  4459     paragraph. Fonts often implement this feature using contextual rules
  4460     based on the use of the slash (‘<code class=css>/</code>’) character.
  4461     As such, it's not suitable for use as a paragraph-level style.</p>
  4462   </div>
  4463   <!-- prop: font-variant-alternates -->
  4465   <h3 id=font-variant-alternates-prop><span class=secno>6.8 </span>Alternates
  4466    and swashes: the <a
  4467    href="#propdef-font-variant-alternates">font-variant-alternates</a>
  4468    property</h3>
  4470   <table class=propdef id=namefont-variant-alternatesvaluenormal-s>
  4471    <tbody>
  4472     <tr>
  4473      <td>Name:
  4475      <td><dfn
  4476       id=propdef-font-variant-alternates>font-variant-alternates</dfn>
  4478     <tr>
  4479      <td>Value:
  4481      <td>normal | [ <a href="#stylistic"
  4482       title=stylistic>stylistic(&lt;feature-value-name&gt;)</a> || <a
  4483       href="#historical-forms">historical-forms</a> || <a href="#styleset"
  4484       title=styleset>styleset(&lt;feature-value-name&gt; #)</a> || <a
  4485       href="#character-variant"
  4486       title=character-variant>character-variant(&lt;feature-value-name&gt;
  4487       #)</a> || <a href="#swash"
  4488       title=swash>swash(&lt;feature-value-name&gt;)</a> || <a
  4489       href="#ornaments"
  4490       title=ornaments>ornaments(&lt;feature-value-name&gt;)</a> || <a
  4491       href="#annotation"
  4492       title=annotation>annotation(&lt;feature-value-name&gt;)</a> ]
  4494     <tr>
  4495      <td>Initial:
  4497      <td>normal
  4499     <tr>
  4500      <td>Applies to:
  4502      <td>all elements
  4504     <tr>
  4505      <td>Inherited:
  4507      <td>yes
  4509     <tr>
  4510      <td>Percentages:
  4512      <td>N/A
  4514     <tr>
  4515      <td>Media:
  4517      <td>visual
  4519     <tr>
  4520      <td>Computed value:
  4522      <td>as specified
  4524     <tr>
  4525      <td>Animatable:
  4527      <td>no
  4528   </table>
  4530   <p>For any given character, fonts can provide a variety of alternate glyphs
  4531    in addition to the default glyph for that character. This property
  4532    provides control over the selection of these alternate glyphs.
  4534   <p>For many of the property values listed below, several different
  4535    alternate glyphs are available. How many alternates are available and what
  4536    they represent is font-specific, so these are each marked <dfn
  4537    id=font-specific>font specific</dfn> in the value definitions below.
  4538    Because the nature of these alternates is font-specific, the <a
  4539    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  4540    rule is used to define values for a specific font family or set of
  4541    families that associate a font-specific numeric
  4542    <code>&lt;feature-index&gt;</code> with a custom
  4543    <code>&lt;feature-value-name&gt;</code>, which is then used in this
  4544    property to select specific alternates:
  4546   <pre>@font-feature-values Noble Script { @swash { swishy: 1; flowing: 2; } }
  4548 p {
  4549   font-family: Noble Script;
  4550   font-variant-alternates: swash(flowing); /* use swash alternate #2 */
  4551 }</pre>
  4553   <p>When a particular <code>&lt;feature-value-name&gt;</code> has not been
  4554    defined for a given family or for a particular feature type, the computed
  4555    value must be the same as if it had been defined. However, property values
  4556    that contain these undefined <code>&lt;feature-value-name&gt;</code>
  4557    identifiers must be ignored when choosing glyphs.
  4559   <pre>/* these two style rules are effectively the same */
  4560 p { font-variant-alternates: swash(unknown-value); } /* not a defined value, ignored */
  4561 p { font-variant-alternates: normal; }
  4562 </pre>
  4564   <p>This allows values to be defined and used for a given set of font
  4565    families but ignored if fallback occurs, since the font family name would
  4566    be different. If a given value is outside the range supported by a given
  4567    font, the value is ignored. These values never apply to generic font
  4568    families.
  4570   <p>Individual values have the following meanings:
  4572   <dl>
  4573    <dt><dfn id=font-variant-alternates-normal-value
  4574     title="normal!!font-variant-alternates">normal</dfn>
  4576    <dd>None of the features listed below are enabled.
  4578    <dt><dfn id=historical-forms>historical-forms</dfn>
  4580    <dd>Enables display of historical forms (OpenType feature: <span
  4581     class=tag>hist</span>).
  4582   </dl>
  4584   <div class=featex><img alt="historical form example" src=hist.png></div>
  4586   <dl>
  4587    <dt><dfn id=stylistic
  4588     title=stylistic>stylistic(&lt;feature-value-name&gt;)</dfn>
  4590    <dd>Enables display of stylistic alternates (<a
  4591     href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
  4592     class=tag>salt &lt;feature-index&gt;</span>).
  4593   </dl>
  4595   <div class=featex><img alt="stylistic alternate example" src=salt.png></div>
  4597   <dl>
  4598    <dt><dfn id=styleset title=styleset>styleset(&lt;feature-value-name&gt;
  4599     #)</dfn>
  4601    <dd>Enables display with stylistic sets (<a href="#font-specific"><em>font
  4602     specific</em></a>, OpenType feature: <span
  4603     class=tag>ss&lt;feature-index&gt;</span> OpenType currently defines <span
  4604     class=tag>ss01</span> through <span class=tag>ss20</span>).
  4605   </dl>
  4607   <div class=featex><img alt="styleset example" src=ssnn.png></div>
  4609   <dl>
  4610    <dt><dfn id=character-variant
  4611     title=character-variant>character-variant(&lt;feature-value-name&gt;
  4612     #)</dfn>
  4614    <dd>Enables display of specific character variants (<a
  4615     href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
  4616     class=tag>cv&lt;feature-index&gt;</span> OpenType currently defines <span
  4617     class=tag>cv01</span> through <span class=tag>cv99</span>).
  4619    <dt><dfn id=swash title=swash>swash(&lt;feature-value-name&gt;)</dfn>
  4621    <dd>Enables display of swash glyphs (<a href="#font-specific"><em>font
  4622     specific</em></a>, OpenType feature: <span class=tag>swsh
  4623     &lt;feature-index&gt;, cswh &lt;feature-index&gt;</span>).
  4624   </dl>
  4626   <div class=featex><img alt="swash example" src=swsh.png></div>
  4628   <dl>
  4629    <dt><dfn id=ornaments
  4630     title=ornaments>ornaments(&lt;feature-value-name&gt;)</dfn>
  4632    <dd>Enables replacement of default glyphs with ornaments, if provided in
  4633     the font (<a href="#font-specific"><em>font specific</em></a>, OpenType
  4634     feature: <span class=tag>ornm &lt;feature-index&gt;</span>). Some fonts
  4635     may offer ornament glyphs as alternates for a wide collection of
  4636     characters; however, displaying arbitrary characters (e.g.,
  4637     alphanumerics) as ornaments is poor practice as it distorts the semantics
  4638     of the data. Font designers are encouraged to encode all ornaments
  4639     (except those explicitly encoded in the Unicode Dingbats blocks, etc.) as
  4640     alternates for the bullet character (U+2022) to allow authors to select
  4641     the desired glyph using ‘<a href="#ornaments"><code
  4642     class=property>ornaments</code></a>’.
  4643   </dl>
  4645   <div class=featex><img alt="ornaments example" src=ornm.png></div>
  4647   <dl>
  4648    <dt><dfn id=annotation
  4649     title=annotation>annotation(&lt;feature-value-name&gt;)</dfn>
  4651    <dd>Enables display of alternate annotation forms (<a
  4652     href="#font-specific"><em>font specific</em></a>, OpenType feature: <span
  4653     class=tag>nalt &lt;feature-index&gt;</span>).
  4654   </dl>
  4656   <div class=featex><img alt="alternate annotation form example"
  4657    src=nalt.png></div>
  4659   <h3 id=font-feature-values><span class=secno>6.9 </span>Defining font
  4660    specific alternates: the <dfn id=at-font-feature-values-rule
  4661    style="font-weight: inherit; font-style:
  4662    inherit"><code>@font-feature-values</code></dfn> rule</h3>
  4664   <p>Several of the possible values of ‘<a
  4665    href="#propdef-font-variant-alternates"><code
  4666    class=property>font-variant-alternates</code></a>’ listed above are
  4667    labeled as <a href="#font-specific"><em>font specific</em></a>. For these
  4668    features fonts may define not just a single glyph but a set of alternate
  4669    glyphs with an index to select a given alternate. Since these are font
  4670    family specific, the <a
  4671    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  4672    rule is used to define named values for these indices for a given family.
  4674   <p class=note>See the <a href="#om-fontfeaturevalues">object model
  4675    reference section</a> for a description of the interfaces used to modify
  4676    these rules via the CSS Object Model.
  4678   <div class=example>
  4679    <p>In the case of the swash Q in the example shown above, the swash could
  4680     be specified using these style rules:</p>
  4682    <pre>
  4684 @font-feature-values Jupiter Sans {
  4685   @swash {
  4686     delicate: 1;
  4687     flowing: 2;
  4691 h2 { font-family: Jupiter Sans, sans-serif; }
  4693 /* show the second swash variant in h2 headings */
  4694 h2:first-letter { font-variant-alternates: swash(flowing); }
  4696 &lt;h2>Quick&lt;/h2></pre>
  4698    <p>When Jupiter Sans is present, the second alternate swash alternate will
  4699     be displayed. When not present, no swash character will be shown, since
  4700     the specific named value "flowing" is only defined for the Jupiter Sans
  4701     family. The @-mark indicates the name of the property value for which a
  4702     named value can be used. The name "flowing" is chosen by the author. The
  4703     index that represents each alternate is defined within a given font's
  4704     data.</p>
  4705   </div>
  4707   <h4 id=basic-syntax><span class=secno>6.9.1 </span>Basic syntax</h4>
  4709   <p>An <a
  4710    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  4711    rule is composed of a list of font families followed by a block containing
  4712    individual <a href="#featurevalueblock"><i
  4713    title="feature_value_block">feature value blocks</i></a> that take the
  4714    form of @-rules. Each block defines a set of named values for a specific
  4715    font feature when a given set of font families is used. Effectively, they
  4716    define a mapping of ⟨family, feature, ident⟩ → ⟨values⟩ where
  4717    ⟨values⟩ are the numeric indices used for specific features defined
  4718    for a given font.
  4720   <p>In terms of the grammar, this specification defines the following
  4721    productions:
  4723   <pre><dfn id=fontfeaturevaluesrule>font_feature_values_rule</dfn>
  4724   : <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>*
  4725     '{' <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>*
  4728 <dfn id=fontfamilynamelist>font_family_name_list</dfn>
  4729   : <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> ]*
  4732 <dfn id=fontfamilyname>font_family_name</dfn>
  4733   : <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> ]* ]
  4736 <dfn id=featurevalueblock>feature_value_block</dfn>
  4737   : <a href="#featuretype"><i>feature_type</i></a> <a href="http://www.w3.org/TR/CSS21/grammar.html#scanner"><i>S</i></a>*
  4738     '{' <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>*
  4741 <dfn id=featuretype>feature_type</dfn>:
  4742   <a href="http://www.w3.org/TR/CSS21/syndata.html#tokenization"><i>ATKEYWORD</i></a>
  4745 <dfn id=featurevaluedefinition>feature_value_definition</dfn>
  4746   : <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> ]*
  4748 </pre>
  4750   <p>The following new token is introduced:
  4752   <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>;}
  4753 </pre>
  4755   <p><a href="#featurevalueblock"><i title="feature_value_block">Feature
  4756    value blocks</i></a> are handled as <a
  4757    href="http://www.w3.org/TR/CSS2/syndata.html#at-rules">at-rules</a>, they
  4758    consist of everything up to the next block or semi-colon, whichever comes
  4759    first.
  4761   <p>The <a href="#fontfamilynamelist"><i title="font_family_name_list">font
  4762    family list</i></a> is a comma-delimited list of <a
  4763    href="#fontfamilyname"><i title="font_family_name">font family
  4764    names</i></a> that match the definition of <a
  4765    href="#family-name-value"><var>&lt;family-name&gt;</var></a> for the <a
  4766    href="#propdef-font-family" title="font-family!!property">‘<code
  4767    class=property>font-family</code>’</a> property. This means that only
  4768    named font families are allowed, rules that include generic or system
  4769    fonts in the list of font families are syntax errors. However, if a user
  4770    agent defines a generic font to be a specific named font (e.g. Helvetica),
  4771    the settings associated with that family name will be used. If syntax
  4772    errors occur within the font family list, the entire rule must be ignored.
  4774   <p>Within <a href="#featurevalueblock"><i
  4775    title="feature_value_block">feature value blocks</i></a>, the <a
  4776    href="#featuretype"><i title="feature_type">feature type</i></a> is
  4777    ‘<code class=css>@</code>’ followed by the name of one of the <a
  4778    href="#font-specific"><em>font specific</em></a> property values of ‘<a
  4779    href="#propdef-font-variant-alternates"><code
  4780    class=property>font-variant-alternates</code></a>’ (e.g. <a
  4781    href="#swash"><code>@swash</code></a>). The identifiers used within
  4782    feature value definitions follow the rules of CSS user identifiers and are
  4783    case-sensitive. They are unique only for a given set of font families and
  4784    <a href="#featuretype"><i title="feature_type">feature type</i></a>. The
  4785    same identifier used with a different <a href="#featuretype"><i
  4786    title="feature_type">feature type</i></a> is treated as a separate and
  4787    distinct value. If the same identifier is defined mulitple times for a
  4788    given <a href="#featuretype"><i title="feature_type">feature type</i></a>
  4789    and font family, the last defined value is used. Values associated with a
  4790    given identifier are limited to integer values 0 or greater.
  4792   <p>When syntax errors occur within a <a href="#featurevaluedefinition"><i
  4793    title="feature_value_definition">feature value definition</i></a>, such as
  4794    invalid identifiers or values, the entire <a
  4795    href="#featurevaluedefinition"><i title="feature_value_definition">feature
  4796    value definition</i></a> must be omitted, just as syntax errors in style
  4797    declarations are handled. When the <a href="#featuretype"><i
  4798    title="feature_type">feature type</i></a> is invalid, the entire
  4799    associated <a href="#featurevalueblock"><i
  4800    title="feature_value_block">feature value block</i></a> must be ignored.
  4802   <div class=example>
  4803    <p>Rules that are equivalent given syntax error handling:</p>
  4805    <pre>@font-feature-values Bongo {
  4806   @swash { ornate: 1; }
  4807   annotation { boxed: 4; } /* should be @annotation! */
  4808   @swash { double-loops: 1; flowing: -1; } /* negative value */
  4809   @ornaments ; /* incomplete definition */
  4810   @styleset { double-W: 14; sharp-terminals: 16 1 } /* missing ; */
  4811   <a href="http://www.angryalien.com/0504/shiningbunnies.html" style="text-decoration: none; border: none;">redrum</a>  /* random editing mistake */
  4812 }</pre>
  4814    <p>The example above is equivalent to:</p>
  4816    <pre>@font-feature-values Bongo {
  4817   @swash { ornate: 1; }
  4818   @swash { double-loops: 1; }
  4819   @styleset { double-W: 14; sharp-terminals: 16 1; }
  4820 }</pre>
  4821   </div>
  4823   <p>If multiple <a
  4824    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  4825    rules are defined for a given family, the resulting values definitions are
  4826    the union of the definitions contained within these rules. This allows a
  4827    set of named values to be defined for a given font family globally for a
  4828    site and specific additions made per-page.
  4830   <div class=example>
  4831    <p>Using both site-wide and per-page feature values:</p>
  4833    <pre>
  4834 site.css:
  4836   @font-feature-values Mercury Serif {
  4837     @styleset {
  4838       stacked-g: 3; /* "two-storey" versions of g, a */
  4839       stacked-a: 4;
  4843 page.css:
  4845   @font-feature-values Mercury Serif {
  4846     @styleset {
  4847       geometric-m: 7; /* alternate version of m */
  4851   body {
  4852     font-family: Mercury Serif, serif;
  4854     /* enable both the use of stacked g and alternate m */
  4855     font-variant-alternates: styleset(stacked-g, geometric-m);
  4856   }</pre>
  4857   </div>
  4859   <div class=example>
  4860    <p>Using a commonly named value allows authors to use a single style rule
  4861     to cover a set of fonts for which the underlying selector is different
  4862     for each font. If either font in the example below is found, a circled
  4863     number glyph will be used:</p>
  4865    <pre>@font-feature-values Taisho Gothic {
  4866   @annotation { boxed: 1; circled: 4; }
  4869 @font-feature-values Otaru Kisa {
  4870   @annotation { circled: 1; black-boxed: 3; }
  4873 h3.title {
  4874   /* circled form defined for both fonts */
  4875   font-family: Taisho Gothic, Otaru Kisa;
  4876   font-variant: annotation(circled);
  4877 }</pre>
  4878   </div>
  4880   <h4 id=multi-valued-feature-value-definitions><span class=secno>6.9.2
  4881    </span>Multi-valued feature value definitions</h4>
  4883   <p>Most <a href="#font-specific"><em>font specific</em></a> ‘<a
  4884    href="#propdef-font-variant-alternates"><code
  4885    class=property>font-variant-alternates</code></a>’ property values take
  4886    a single value (e.g. ‘<a href="#swash"><code
  4887    class=property>swash</code></a>’). The ‘<a
  4888    href="#character-variant"><code
  4889    class=property>character-variant</code></a>’ property value allows two
  4890    values and ‘<a href="#styleset"><code
  4891    class=property>styleset</code></a>’ allows an unlimited number.
  4893   <p>For the styleset property value, multiple values indicate the style sets
  4894    to be enabled. Values between 1 and 99 enable OpenType features <span
  4895    class=tag>ss01</span> through <span class=tag>ss99</span>. However, the
  4896    OpenType standard only officially defines <span class=tag>ss01</span>
  4897    through <span class=tag>ss20</span>. For OpenType fonts, values greater
  4898    than 99 or equal to 0 do not generate a syntax error when parsed but
  4899    enable no OpenType features.
  4901   <pre>@font-feature-values Mars Serif {
  4902   @styleset {
  4903     alt-g: 1;        /* implies ss01 = 1 */
  4904     curly-quotes: 3; /* implies ss03 = 1 */
  4905     code: 4 5;       /* implies ss04 = 1, ss05 = 1 */
  4908   @styleset {
  4909     dumb: 125;        /* &gt;99, ignored */
  4912   @swash {
  4913     swishy: 3 5;     /* more than 1 value for swash, syntax error */
  4917 p.codeblock {
  4918   /* implies ss03 = 1, ss04 = 1, ss05 = 1 */
  4919   font-variant-alternates: styleset(curly-quotes, code);
  4920 }</pre>
  4922   <p>For character-variant, a single value between 1 and 99 indicates the
  4923    enabling of OpenType feature <span class=tag>cv01</span> through <span
  4924    class=tag>cv99</span>. For OpenType fonts, values greater than 99 or equal
  4925    to 0 are ignored but do not generate a syntax error when parsed but enable
  4926    no OpenType features. When two values are listed, the first value
  4927    indicates the feature used and the second the value passed for that
  4928    feature. If more than two values are assigned to a given name, a syntax
  4929    error occurs and the entire <a href="#featurevaluedefinition"><i
  4930    title="feature_value_definition">feature value definition</i></a> is
  4931    ignored.
  4933   <pre>@font-feature-values MM Greek {
  4934   @character-variant { alpha-2: 1 2; }   /* implies cv01 = 2 */
  4935   @character-variant { beta-3: 2 3; }    /* implies cv02 = 3 */
  4936   @character-variant { epsilon: 5 3 6; } /* more than 2 values, syntax error, definition ignored */
  4937   @character-variant { gamma: 12; }      /* implies cv12 = 1 */
  4938   @character-variant { zeta:   20 3; }   /* implies cv20 = 3 */
  4939   @character-variant { zeta-2: 20 2; }   /* implies cv20 = 2 */
  4940   @character-variant { silly: 105; }     /* &gt;99, ignored */
  4941   @character-variant { dumb: 323 3; }    /* &gt;99, ignored */
  4944 #title {
  4945   /* use the third alternate beta, first alternate gamma */
  4946   font-variant-alternates: character-variant(beta-3, gamma);
  4949 p {
  4950   /* zeta-2 follows zeta, implies cv20 = 2  */
  4951   font-variant-alternates: character-variant(zeta, zeta-2);
  4954 .special {
  4955   /* zeta follows zeta-2, implies cv20 = 3  */
  4956   font-variant-alternates: character-variant(zeta-2, zeta);
  4957 }</pre>
  4959   <div class=figure><img alt="Matching text on Byzantine seals using
  4960    character variants" src=byzantineseal.png>
  4961    <p class=caption>Byzantine seal text displayed with character variants
  4962   </div>
  4964   <div class=example>
  4965    <p>In the figure above, the text in red is rendered using a font
  4966     containing character variants that mimic the character forms found on a
  4967     Byzantine seal from the 8th century A.D. Two lines below is the same text
  4968     displayed in a font without variants. Note the two variants for U and N
  4969     used on the seal.</p>
  4971    <pre>@font-feature-values Athena Ruby {
  4972   @character-variant {
  4973     leo-B: 2 1;
  4974     leo-M: 13 3;
  4975     leo-alt-N: 14 1;
  4976     leo-N: 14 2;
  4977     leo-T: 20 1;
  4978     leo-U: 21 2;
  4979     leo-alt-U: 21 4;
  4983 p {
  4984   font-variant: discretionary-ligatures,
  4985                 character-variant(leo-B, leo-M, leo-N, leo-T, leo-U);
  4988 span.alt-N {
  4989   font-variant-alternates: character-variant(leo-alt-N);
  4992 span.alt-U {
  4993   font-variant-alternates: character-variant(leo-alt-U);
  4996 &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>
  4998 &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>
  4999 </pre>
  5000   </div>
  5002   <h3 id=font-variant-east-asian-prop><span class=secno>6.10 </span>East
  5003    Asian text rendering: the <a
  5004    href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
  5005    property</h3>
  5007   <table class=propdef id=namefont-variant-east-asianvaluenormal-l>
  5008    <tbody>
  5009     <tr>
  5010      <td>Name:
  5012      <td><dfn
  5013       id=propdef-font-variant-east-asian>font-variant-east-asian</dfn>
  5015     <tr>
  5016      <td>Value:
  5018      <td><a href="#font-variant-east-asian-normal-value"
  5019       title="normal!!font-variant-east-asian">normal</a> | [ <a
  5020       href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
  5021       || <a
  5022       href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
  5023       || <a href="#ruby">ruby</a> ]
  5025     <tr>
  5026      <td>Initial:
  5028      <td>normal
  5030     <tr>
  5031      <td>Applies to:
  5033      <td>all elements
  5035     <tr>
  5036      <td>Inherited:
  5038      <td>yes
  5040     <tr>
  5041      <td>Percentages:
  5043      <td>N/A
  5045     <tr>
  5046      <td>Media:
  5048      <td>visual
  5050     <tr>
  5051      <td>Computed value:
  5053      <td>as specified
  5055     <tr>
  5056      <td>Animatable:
  5058      <td>no
  5059   </table>
  5061   <p>Allows control of glyph substitution and sizing in East Asian text.
  5063   <pre
  5064    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>
  5066   <pre
  5067    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>
  5069   <p>Individual values have the following meanings:
  5071   <dl>
  5072    <dt><dfn id=font-variant-east-asian-normal-value
  5073     title="normal!!font-variant-east-asian">normal</dfn>
  5075    <dd>None of the features listed below are enabled.
  5077    <dt><dfn id=jis78>jis78</dfn>
  5079    <dd>Enables rendering of JIS78 forms (OpenType feature: <span
  5080     class=tag>jp78</span>).
  5081   </dl>
  5083   <div class=featex><img alt="JIS78 form example" src=jp78.png></div>
  5085   <dl>
  5086    <dt><dfn id=jis83>jis83</dfn>
  5088    <dd>Enables rendering of JIS83 forms (OpenType feature: <span
  5089     class=tag>jp83</span>).
  5091    <dt><dfn id=jis90>jis90</dfn>
  5093    <dd>Enables rendering of JIS90 forms (OpenType feature: <span
  5094     class=tag>jp90</span>).
  5096    <dt><dfn id=jis04>jis04</dfn>
  5098    <dd>Enables rendering of JIS2004 forms (OpenType feature: <span
  5099     class=tag>jp04</span>).
  5100     <p>The various JIS variants reflect the glyph forms defined in different
  5101      Japanese national standards. Fonts generally include glyphs defined by
  5102      the most recent national standard but it's sometimes necessary to use
  5103      older variants, to match signage for example.</p>
  5105    <dt><dfn id=simplified>simplified</dfn>
  5107    <dd>Enables rendering of simplified forms (OpenType feature: <span
  5108     class=tag>smpl</span>).
  5110    <dt><dfn id=traditional>traditional</dfn>
  5112    <dd>Enables rendering of traditional forms (OpenType feature: <span
  5113     class=tag>trad</span>).
  5114   </dl>
  5116   <p>The ‘<a href="#simplified"><code
  5117    class=property>simplified</code></a>’ and ‘<a
  5118    href="#traditional"><code class=property>traditional</code></a>’ values
  5119    allow control over the glyph forms for characters which have been
  5120    simplified over time but for which the older, traditional form is still
  5121    used in some contexts. The exact set of characters and glyph forms will
  5122    vary to some degree by context for which a given font was designed.
  5124   <div class=featex><img alt="tradtional form example" src=trad.png></div>
  5126   <dl>
  5127    <dt><dfn id=full-width>full-width</dfn>
  5129    <dd>Enables rendering of full-width variants (OpenType feature: <span
  5130     class=tag>fwid</span>).
  5132    <dt><dfn id=proportional-width>proportional-width</dfn>
  5134    <dd>Enables rendering of proportionally-spaced variants (OpenType feature:
  5135     <span class=tag>pwid</span>).
  5136   </dl>
  5138   <div class=featex><img alt="proportionally spaced Japanese example"
  5139    src=pwid.png></div>
  5141   <dl>
  5142    <dt><dfn id=ruby>ruby</dfn>
  5144    <dd>Enables display of ruby variant glyphs (OpenType feature: <span
  5145     class=tag>ruby</span>). Since ruby text is generally smaller than the
  5146     associated body text, font designers can design special glyphs for use
  5147     with ruby that are more readable than scaled down versions of the default
  5148     glyphs. Only glyph selection is affected, there is no associated font
  5149     scaling or other change that affects line layout. The red ruby text below
  5150     is shown with default glyphs (top) and with ruby variant glyphs (bottom).
  5151     Note the slight difference in stroke thickness.
  5152   </dl>
  5154   <div class=featex><img alt="ruby variant example" src=rubyshinkansen.png></div>
  5156   <h3 id=font-variant-prop><span class=secno>6.11 </span>Overall shorthand
  5157    for font rendering: the <a href="#propdef-font-variant">font-variant</a>
  5158    property</h3>
  5160   <table class=propdef id=namefont-variantvaluenormal-none-ltcommo>
  5161    <tbody>
  5162     <tr>
  5163      <td>Name:
  5165      <td><dfn id=propdef-font-variant
  5166       title="font-variant!!property">font-variant</dfn>
  5168     <tr>
  5169      <td>Value:
  5171      <td><a href="#font-variant-normal-value"
  5172       title="normal!!font-variant">normal</a> | <a
  5173       href="#font-variant-none-value" title="none!!font-variant">none</a> | [
  5174       <a href="#common-lig-values"><var>&lt;common-lig-values&gt;</var></a>
  5175       || <a
  5176       href="#discretionary-lig-values"><var>&lt;discretionary-lig-values&gt;</var></a>
  5177       || <a
  5178       href="#historical-lig-values"><var>&lt;historical-lig-values&gt;</var></a>
  5179       || <a
  5180       href="#contextual-alt-values"><var>&lt;contextual-alt-values&gt;</var></a>
  5181       || <a href="#stylistic"><var
  5182       title=stylistic>stylistic(&lt;feature-value-name&gt;)</var></a> || <a
  5183       href="#historical-forms"><var>historical-forms</var></a> || <a
  5184       href="#styleset"><var
  5185       title=styleset>styleset(&lt;feature-value-name&gt; #)</var></a> || <a
  5186       href="#character-variant"><var
  5187       title=character-variant>character-variant(&lt;feature-value-name&gt;
  5188       #)</var></a> || <a href="#swash"><var
  5189       title=swash>swash(&lt;feature-value-name&gt;)</var></a> || <a
  5190       href="#ornaments"><var
  5191       title=ornaments>ornaments(&lt;feature-value-name&gt;)</var></a> || <a
  5192       href="#annotation"><var
  5193       title=annotation>annotation(&lt;feature-value-name&gt;)</var></a> || [
  5194       <a href="#small-caps"><i>small-caps</i></a> | <a
  5195       href="#all-small-caps"><i>all-small-caps</i></a> | <a
  5196       href="#petite-caps"><i>petite-caps</i></a> | <a
  5197       href="#all-petite-caps"><i>all-petite-caps</i></a> | <a
  5198       href="#unicase"><i>unicase</i></a> | <a
  5199       href="#titling-caps"><i>titling-caps</i></a> ] || <a
  5200       href="#numeric-figure-values"><var>&lt;numeric-figure-values&gt;</var></a>
  5201       || <a
  5202       href="#numeric-spacing-values"><var>&lt;numeric-spacing-values&gt;</var></a>
  5203       || <a
  5204       href="#numeric-fraction-values"><var>&lt;numeric-fraction-values&gt;</var></a>
  5205       || <a href="#ordinal"><i>ordinal</i></a> || <a
  5206       href="#slashed-zero"><i>slashed-zero</i></a> || <a
  5207       href="#east-asian-variant-values"><var>&lt;east-asian-variant-values&gt;</var></a>
  5208       || <a
  5209       href="#east-asian-width-values"><var>&lt;east-asian-width-values&gt;</var></a>
  5210       || <a href="#ruby"><i>ruby</i></a> ]
  5212     <tr>
  5213      <td>Initial:
  5215      <td>normal
  5217     <tr>
  5218      <td>Applies to:
  5220      <td>all elements
  5222     <tr>
  5223      <td>Inherited:
  5225      <td>yes
  5227     <tr>
  5228      <td>Percentages:
  5230      <td>see individual properties
  5232     <tr>
  5233      <td>Media:
  5235      <td>visual
  5237     <tr>
  5238      <td>Computed value:
  5240      <td>see individual properties
  5242     <tr>
  5243      <td>Animatable:
  5245      <td>see individual properties
  5246   </table>
  5248   <p>The <a href="#propdef-font-variant"
  5249    title="font-variant!!property">‘<code
  5250    class=property>font-variant</code>’</a> property is a shorthand for all
  5251    font-variant subproperties. The value <dfn id=font-variant-normal-value
  5252    title="normal!!font-variant">‘<code
  5253    class=property>normal</code>’</dfn> resets all subproperties of <a
  5254    href="#propdef-font-variant" title="font-variant!!property">‘<code
  5255    class=property>font-variant</code>’</a> to their inital value. The <dfn
  5256    id=font-variant-none-value title="none!!font-variant">‘<code
  5257    class=property>none</code>’</dfn> value sets ‘<a
  5258    href="#propdef-font-variant-ligatures"><code
  5259    class=property>font-variant-ligatures</code></a>’ to ‘<code
  5260    class=property>none</code>’ and resets all other font feature properties
  5261    to their initial value. Like other shorthands, using <a
  5262    href="#propdef-font-variant" title="font-variant!!property">‘<code
  5263    class=property>font-variant</code>’</a> resets unspecified <a
  5264    href="#propdef-font-variant" title="font-variant!!property">‘<code
  5265    class=property>font-variant</code>’</a> subproperties to their initial
  5266    values. It does not reset the values of either ‘<a
  5267    href="#propdef-font-language-override"><code
  5268    class=property>font-language-override</code></a>’ or <a
  5269    href="#propdef-font-feature-settings"
  5270    title="font-feature-settings!!property">‘<code
  5271    class=property>font-feature-settings</code>’</a>.
  5273   <h3 id=font-feature-settings-prop><span class=secno>6.12 </span>Low-level
  5274    font feature settings control: the <a
  5275    href="#propdef-font-feature-settings">font-feature-settings</a> property</h3>
  5277   <table class=propdef id=namefont-feature-settingsvaluenormal-ltf>
  5278    <tbody>
  5279     <tr>
  5280      <td>Name:
  5282      <td><dfn id=propdef-font-feature-settings
  5283       title="font-feature-settings!!property">font-feature-settings</dfn>
  5285     <tr>
  5286      <td>Value:
  5288      <td><a href="#font-feature-settings-normal-value"
  5289       title="normal!!font-feature-settings">normal</a> | <a
  5290       href="#feature-tag-value"><var>&lt;feature-tag-value&gt;</var></a> #
  5292     <tr>
  5293      <td>Initial:
  5295      <td>normal
  5297     <tr>
  5298      <td>Applies to:
  5300      <td>all elements
  5302     <tr>
  5303      <td>Inherited:
  5305      <td>yes
  5307     <tr>
  5308      <td>Percentages:
  5310      <td>N/A
  5312     <tr>
  5313      <td>Media:
  5315      <td>visual
  5317     <tr>
  5318      <td>Computed value:
  5320      <td>as specified
  5322     <tr>
  5323      <td>Animatable:
  5325      <td>no
  5326   </table>
  5328   <p>This property provides low-level control over OpenType font features. It
  5329    is intended as a way of providing access to font features that are not
  5330    widely used but are needed for a particular use case.
  5332   <p>Authors should generally use <a href="#propdef-font-variant"
  5333    title="font-variant!!property">‘<code
  5334    class=property>font-variant</code>’</a> and its related subproperties
  5335    whenever possible and only use this property for special cases where its
  5336    use is the only way of accessing a particular infrequently used font
  5337    feature.
  5339   <pre>/* enable small caps and use second swash alternate */
  5340 font-feature-settings: "smcp", "swsh" 2;</pre>
  5342   <p>A value of <dfn id=font-feature-settings-normal-value
  5343    title="normal!!font-feature-settings">‘<code
  5344    class=property>normal</code>’</dfn> means that no change in glyph
  5345    selection or positioning occurs due to this property.
  5347   <p>Feature tag values have the following syntax:
  5349   <pre
  5350    class=prod><dfn id=feature-tag-value><var>&lt;feature-tag-value&gt;</var></dfn> = &lt;string&gt; [ &lt;integer&gt; | on | off ]?</pre>
  5352   <p>The &lt;string&gt; is a case-sensitive OpenType feature tag. As
  5353    specified in the OpenType specification, feature tags contain four ASCII
  5354    characters. Tag strings longer or shorter than four characters, or
  5355    containing characters outside the U+20–7E codepoint range are invalid.
  5356    Feature tags need only match a feature tag defined in the font, so they
  5357    are not limited to explicitly registered OpenType features. Fonts defining
  5358    custom feature tags should follow the <a
  5359    href="http://www.microsoft.com/typography/otspec/featuretags.htm">tag name
  5360    rules</a> defined in the OpenType specification <a
  5361    href="#OPENTYPE-FEATURES"
  5362    rel=biblioentry>[OPENTYPE-FEATURES]<!--{{!OPENTYPE-FEATURES}}--></a>.
  5364   <p>Feature tags not present in the font are ignored; a user agent must not
  5365    attempt to synthesize fallback behavior based on these feature tags. The
  5366    one exception is that user agents may synthetically support the <span
  5367    class=tag>kern</span> feature with fonts that contain kerning data in the
  5368    form of a ‘<code class=property>kern</code>’ table but lack <span
  5369    class=tag>kern</span> feature support in the ‘<code
  5370    class=property>GPOS</code>’ table.
  5372   <p class=note>In general, authors should use the ‘<a
  5373    href="#propdef-font-kerning"><code
  5374    class=property>font-kerning</code></a>’ property to explicitly enable or
  5375    disable kerning since this property always affects fonts with either type
  5376    of kerning data.
  5378   <p>If present, a value indicates an index used for glyph selection. An
  5379    &lt;integer&gt; value must be 0 or greater. A value of 0 indicates that
  5380    the feature is disabled. For boolean features, a value of 1 enables the
  5381    feature. For non-boolean features, a value of 1 or greater enables the
  5382    feature and indicates the feature selection index. A value of ‘<code
  5383    class=property>on</code>’ is synonymous with 1 and ‘<code
  5384    class=property>off</code>’ is synonymous with 0. If the value is
  5385    omitted, a value of 1 is assumed.
  5387   <pre>
  5388 font-feature-settings: "dlig" 1;       /* dlig=1 enable discretionary ligatures */
  5389 font-feature-settings: "smcp" on;      /* smcp=1 enable small caps */
  5390 font-feature-settings: 'c2sc';         /* c2sc=1 enable caps to small caps */
  5391 font-feature-settings: "liga" off;     /* liga=0 no common ligatures */
  5392 font-feature-settings: "tnum", 'hist'; /* tnum=1, hist=1 enable tabular numbers and historical forms */
  5393 font-feature-settings: "tnum" "hist";  /* invalid, need a comma-delimited list */
  5394 font-feature-settings: "silly" off;    /* invalid, tag too long */
  5395 font-feature-settings: "PKRN";         /* PKRN=1 enable custom feature */
  5396 font-feature-settings: dlig;           /* invalid, tag must be a string */
  5397 </pre>
  5399   <p>When values greater than the range supported by the font are specified,
  5400    the behavior is explicitly undefined. For boolean features, in general
  5401    these will enable the feature. For non-boolean features, out of range
  5402    values will in general be equivalent to a 0 value. However, in both cases
  5403    the exact behavior will depend upon the way the font is designed
  5404    (specifically, which type of lookup is used to define the feature).
  5406   <p>Although specifically defined for OpenType feature tags, feature tags
  5407    for other modern font formats that support font features may be added in
  5408    the future. Where possible, features defined for other font formats should
  5409    attempt to follow the pattern of registered OpenType tags.
  5411   <div class=example>
  5412    <p>The Japanese text below will be rendered with half-width kana
  5413     characters:</p>
  5415    <pre lang=ja>
  5416 body { font-feature-settings: "hwid"; /* Half-width OpenType feature */ }
  5418 &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>
  5419 </pre>
  5420   </div>
  5422   <h3 id=font-language-override-prop><span class=secno>6.13 </span>Font
  5423    language override: the <a
  5424    href="#propdef-font-language-override">font-language-override</a> property</h3>
  5426   <table class=propdef id=namefont-language-overridevaluenormal-lt>
  5427    <tbody>
  5428     <tr>
  5429      <td>Name:
  5431      <td><dfn id=propdef-font-language-override>font-language-override</dfn>
  5433     <tr>
  5434      <td>Value:
  5436      <td><a href="#font-language-override-normal-value"
  5437       title="normal!!font-language-override">normal</a> | <a
  5438       href="#font-language-override-string-value"><var>&lt;string&gt;</var></a>
  5440     <tr>
  5441      <td>Initial:
  5443      <td><a href="#font-language-override-normal-value"
  5444       title="normal!!font-language-override">normal</a>
  5446     <tr>
  5447      <td>Applies to:
  5449      <td>all elements
  5451     <tr>
  5452      <td>Inherited:
  5454      <td>yes
  5456     <tr>
  5457      <td>Percentages:
  5459      <td>N/A
  5461     <tr>
  5462      <td>Media:
  5464      <td>visual
  5466     <tr>
  5467      <td>Computed value:
  5469      <td>as specified
  5471     <tr>
  5472      <td>Animatable:
  5474      <td>no
  5475   </table>
  5477   <p>Normally, authors can control the use of language-specific glyph
  5478    substitutions and positioning by setting the content language of an
  5479    element, as <a href="#language-specific-support">described above</a>:
  5481   <pre>&lt;!-- Display text using S'gaw Karen specific features -->
  5482 &lt;p lang="ksw">...&lt;/p></pre>
  5484   <p>In some cases, authors may need to specify a language system that
  5485    differs from the content language, for example due to the need to mimic
  5486    another language's typographic traditions. The ‘<a
  5487    href="#propdef-font-language-override"><code
  5488    class=property>font-language-override</code></a>’ property allows
  5489    authors to explicitly specify the language system of the font, overriding
  5490    the language system implied by the content language.
  5492   <p>Values have the following meanings:
  5494   <dl>
  5495    <dt><dfn id=font-language-override-normal-value
  5496     title="normal!!font-language-override">normal</dfn>
  5498    <dd>specifies that when rendering with OpenType fonts, the content
  5499     language of the element is used to infer the OpenType language system
  5501    <dt><dfn
  5502     id=font-language-override-string-value><var>&lt;string&gt;</var></dfn>
  5504    <dd>single three-letter case-sensitive OpenType <a
  5505     href="http://www.microsoft.com/typography/otspec/languagetags.htm">language
  5506     system tag</a>, specifies the OpenType language system to be used instead
  5507     of the language system implied by the language of the element
  5508   </dl>
  5509   <!-- For this level, string represents a single language code, there's no concept of "fallback" 
  5510 http://www.w3.org/2013/06/07-css-minutes.html#item04 -->
  5512   <p>Use of invalid OpenType language system tags must not generate a parse
  5513    error but must be ignored when doing glyph selection and placement.
  5515   <div class=example>
  5516    <p>The <a href="http://www.un.org/en/documents/udhr/index.shtml">Universal
  5517     Declaration of Human Rights</a> has been translated into a wide variety
  5518     of languages. In Turkish, Article 9 of this document might be marked up
  5519     as below:</p>
  5521    <pre lang=tr>&lt;body lang="tr">
  5523 &lt;h4>Madde 9&lt;/h4>
  5524 &lt;p>Hiç kimse keyfi olarak tutuklanamaz, alıkonulanamaz veya sürülemez.&lt;/p>
  5525 </pre>
  5527    <p>Here the user agent uses the value of the ‘<code
  5528     class=property>lang</code>’ attribute when rendering text and
  5529     appropriately renders this text without ‘<code
  5530     class=property>fi</code>’ ligatures. There is no need to use the ‘<a
  5531     href="#propdef-font-language-override"><code
  5532     class=property>font-language-override</code></a>’ property.</p>
  5534    <p>However, a given font may lack support for a specific language. In this
  5535     situation authors may need to use the typographic conventions of a
  5536     related language that are supported by that font:</p>
  5538    <pre lang=mk>&lt;body lang="mk">     &lt;!-- Macedonian lang code --&gt;
  5540 body { font-language-override: "SRB"; /* Serbian OpenType language tag */ }
  5542 &lt;h4>Члeн 9&lt;/h4>
  5543 &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>
  5545 </pre>
  5547    <p>The Macedonian text here will be rendered using Serbian typographic
  5548     conventions, with the assumption that the font specified supports
  5549     Serbian.</p>
  5550   </div>
  5552   <p><a id=rendering-considerations></a>
  5554   <h2 id=font-feature-resolution><span class=secno>7 </span>Font Feature
  5555    Resolution</h2>
  5557   <p>As described in the previous section, font features can be enabled in a
  5558    variety of ways, either via the use of <a href="#propdef-font-variant"
  5559    title="font-variant!!property">‘<code
  5560    class=property>font-variant</code>’</a> or <a
  5561    href="#propdef-font-feature-settings"
  5562    title="font-feature-settings!!property">‘<code
  5563    class=property>font-feature-settings</code>’</a> in a style rule or
  5564    within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
  5565    The resolution order for the union of these settings is defined below.
  5566    Features defined via CSS properties are applied on top of layout engine
  5567    default features.
  5569   <h3 id=default-features><span class=secno>7.1 </span>Default features</h3>
  5571   <p>For OpenType fonts, user agents must enable the default features defined
  5572    in the OpenType documentation for a given script and writing mode.
  5573    Required ligatures, common ligatures and contextual forms must be enabled
  5574    by default (OpenType features: <span class=tag>rlig, liga, clig,
  5575    calt</span>), along with localized forms (OpenType feature: <span
  5576    class=tag>locl</span>), and features required for proper display of
  5577    composed characters and marks (OpenType features: <span class=tag>ccmp,
  5578    mark, mkmk</span>). These features must always be enabled, even when the
  5579    value of the <a href="#propdef-font-variant"
  5580    title="font-variant!!property">‘<code
  5581    class=property>font-variant</code>’</a> and <a
  5582    href="#propdef-font-feature-settings"
  5583    title="font-feature-settings!!property">‘<code
  5584    class=property>font-feature-settings</code>’</a> properties is <span
  5585    title="normal value">‘<code class=property>normal</code>’</span>.
  5586    Individual features are only disabled when explicitly overridden by the
  5587    author, as when ‘<a href="#propdef-font-variant-ligatures"><code
  5588    class=property>font-variant-ligatures</code></a>’ is set to ‘<a
  5589    href="#no-common-ligatures"><code
  5590    class=property>no-common-ligatures</code></a>’. For handling complex
  5591    scripts such as <a
  5592    href="http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx">Arabic</a>,
  5593    <a
  5594    href="http://www.microsoft.com/typography/otfntdev/mongolot/features.htm">Mongolian</a>
  5595    or <a
  5596    href="http://www.microsoft.com/typography/otfntdev/devanot/features.aspx">Devanagari</a>
  5597    additional features are required. For upright text within vertical text
  5598    runs, vertical alternates (OpenType feature: <span class=tag>vert</span>)
  5599    must be enabled.
  5601   <h3 id=feature-precedence><span class=secno>7.2 </span>Feature precedence</h3>
  5603   <p>General and <a href="#font-specific"><em>font specific</em></a> font
  5604    feature property settings are resolved in the order below, in ascending
  5605    order of precedence. This ordering is used to construct a combined list of
  5606    font features that affect a given text run.
  5608   <ol>
  5609    <li>Font features enabled by default, including features required for a
  5610     given script.
  5612    <li>If the font is defined via an <a
  5613     href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
  5614     features implied by the font-variant descriptor in the <a
  5615     href="#at-font-face-rule"><code>@font-face</code></a> rule.
  5617    <li>If the font is defined via an <a
  5618     href="#at-font-face-rule"><code>@font-face</code></a> rule, the font
  5619     features implied by the font-feature-settings descriptor in the <a
  5620     href="#at-font-face-rule"><code>@font-face</code></a> rule.
  5622    <li>Font features implied by the value of the <a
  5623     href="#propdef-font-variant" title="font-variant!!property">‘<code
  5624     class=property>font-variant</code>’</a> property, the related <a
  5625     href="#propdef-font-variant" title="font-variant!!property">‘<code
  5626     class=property>font-variant</code>’</a> subproperties and any other CSS
  5627     property that uses OpenType features (e.g. the ‘<a
  5628     href="#propdef-font-kerning"><code
  5629     class=property>font-kerning</code></a>’ property).</li>
  5630    <!-- other CSS props override 'font-variant' but not 'font-feature-settings' -->
  5631    <!-- http://lists.w3.org/Archives/Public/www-style/2013Aug/0110.html -->
  5633    <li>Feature settings determined by properties other than <a
  5634     href="#propdef-font-variant" title="font-variant!!property">‘<code
  5635     class=property>font-variant</code>’</a> or <a
  5636     href="#propdef-font-feature-settings"
  5637     title="font-feature-settings!!property">‘<code
  5638     class=property>font-feature-settings</code>’</a>. For example, setting
  5639     a non-default value for the ‘<code
  5640     class=property>letter-spacing</code>’ property disables common
  5641     ligatures.
  5643    <li>Font features implied by the value of <a
  5644     href="#propdef-font-feature-settings"
  5645     title="font-feature-settings!!property">‘<code
  5646     class=property>font-feature-settings</code>’</a> property.
  5647   </ol>
  5649   <p>This ordering allows authors to set up a general set of defaults for
  5650    fonts within their <a
  5651    href="#at-font-face-rule"><code>@font-face</code></a> rules, then override
  5652    them with property settings for specific elements. General property
  5653    settings override the settings in <a
  5654    href="#at-font-face-rule"><code>@font-face</code></a> rules and low-level
  5655    font feature settings override <a href="#propdef-font-variant"
  5656    title="font-variant!!property">‘<code
  5657    class=property>font-variant</code>’</a> property settings.
  5659   <p>For situations where the combined list of font feature settings contains
  5660    more than one value for the same feature, the last value is used. When a
  5661    font lacks support for a given underlying font feature, text is simply
  5662    rendered as if that font feature was not enabled; font fallback does not
  5663    occur and no attempt is made to synthesize the feature except where
  5664    explicitly defined for specific properties.
  5666   <h3 id=feature-precedence-examples><span class=secno>7.3 </span>Feature
  5667    precedence examples</h3>
  5669   <div class=example>
  5670    <p>With the styles below, numbers are rendered proportionally when used
  5671     within a paragraph but are shown in tabular form within tables of prices:</p>
  5673    <pre>body {
  5674   font-variant-numeric: proportional-nums;
  5677 table.prices td {
  5678   font-variant-numeric: tabular-nums;
  5680 </pre>
  5681   </div>
  5683   <div class=example>
  5684    <p>When the <a href="#descdef-font-variant"
  5685     title="font-variant!!descriptor">font-variant</a> descriptor is used
  5686     within an <a href="#at-font-face-rule"><code>@font-face</code></a> rule,
  5687     it only applies to the font defined by that rule.</p>
  5689    <pre>@font-face {
  5690   font-family: MainText;
  5691   src: url(http://example.com/font.woff);
  5692   font-variant: oldstyle-nums proportional-nums styleset(1,3);
  5695 body {
  5696   font-family: MainText, Helvetica;
  5699 table.prices td {
  5700   font-variant-numeric: tabular-nums;
  5702 </pre>
  5704    <p>In this case, old-style numerals will be used throughout but only where
  5705     the font "MainText" is used. Just as in the previous example, tabular
  5706     values will be used in price tables since ‘<a
  5707     href="#tabular-nums"><code class=property>tabular-nums</code></a>’
  5708     appears in a general style rule and its use is mutually exclusive with
  5709     ‘<a href="#proportional-nums"><code
  5710     class=property>proportional-nums</code></a>’. Stylistic alternate sets
  5711     will only be used where MainText is used.</p>
  5712   </div>
  5714   <div class=example>
  5715    <p>The <a href="#at-font-face-rule"><code>@font-face</code></a> rule can
  5716     also be used to access font features in locally available fonts via the
  5717     use of <code>local()</code> in the ‘<a href="#descdef-src"><code
  5718     class=property>src</code></a>’ descriptor of the <a
  5719     href="#at-font-face-rule"><code>@font-face</code></a> definition:</p>
  5721    <pre>@font-face {
  5722   font-family: BodyText;
  5723   src: local("HiraMaruPro-W4");
  5724   font-variant: proportional-width;
  5725   font-feature-settings: "ital"; /* Latin italics within CJK text feature */
  5728 body { font-family: BodyText, serif; }
  5729 </pre>
  5731    <p>If available, a Japanese font "Hiragino Maru Gothic" will be used. When
  5732     text rendering occurs, Japanese kana will be proportionally spaced and
  5733     Latin text will be italicised. Text rendered with the fallback serif font
  5734     will use default rendering properties.</p>
  5735   </div>
  5737   <div class=example>
  5738    <p>In the example below, discretionary ligatures are enabled only for a
  5739     downloadable font but are disabled within spans of class "special":</p>
  5741    <pre>@font-face {
  5742   font-family: main;
  5743   src: url(fonts/ffmeta.woff) format("woff");
  5744   font-variant: discretionary-ligatures;
  5747 body         { font-family: main, Helvetica; }
  5748 span.special { font-variant-ligatures: no-discretionary-ligatures; }
  5749 </pre>
  5751    <p>Suppose one adds a rule using ‘<code
  5752     class=property>font-feature-settings</code>’ to enable discretionary
  5753     ligatures:</p>
  5755    <pre>body         { font-family: main, Helvetica; }
  5756 span         { font-feature-settings: "dlig"; }
  5757 span.special { font-variant-ligatures: no-discretionary-ligatures; }
  5758 </pre>
  5760    <p>In this case, discretionary ligatures <em>will</em> be rendered within
  5761     spans of class "special". This is because both the <a
  5762     href="#propdef-font-feature-settings"
  5763     title="font-feature-settings!!property">‘<code
  5764     class=property>font-feature-settings</code>’</a> and ‘<a
  5765     href="#propdef-font-variant-ligatures"><code
  5766     class=property>font-variant-ligatures</code></a>’ properties apply to
  5767     these spans. Although the ‘<code class=css>no-discretionary
  5768     ligatures</code>’ setting of ‘<a
  5769     href="#propdef-font-variant-ligatures"><code
  5770     class=property>font-variant-ligatures</code></a>’ effectively disables
  5771     the OpenType <span class=tag>dlig</span> feature, because the <a
  5772     href="#propdef-font-feature-settings"
  5773     title="font-feature-settings!!property">‘<code
  5774     class=property>font-feature-settings</code>’</a> is resolved after
  5775     that, the ‘<code class=property>dlig</code>’ value reenables
  5776     discretionary ligatures.</p>
  5777   </div>
  5779   <h2 id=object-model><span class=secno>8 </span>Object Model</h2>
  5781   <p>The contents of <a href="#at-font-face-rule"><code>@font-face</code></a>
  5782    and <a
  5783    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  5784    rules can be accessed via the following extensions to the CSS Object
  5785    Model.
  5787   <h3 id=om-fontface><span class=secno>8.1 </span>The <a
  5788    href="#cssfontfacerule"><code>CSSFontFaceRule</code></a> interface</h3>
  5790   <p>The <dfn id=cssfontfacerule>CSSFontFaceRule</dfn> interface represents a
  5791    <a href="#at-font-face-rule"><code>@font-face</code></a> rule.
  5793   <pre class=idl>
  5794 interface CSSFontFaceRule : CSSRule {
  5795   attribute DOMString family;
  5796   attribute DOMString src;
  5797   attribute DOMString style;
  5798   attribute DOMString weight;
  5799   attribute DOMString stretch;
  5800   attribute DOMString unicodeRange;
  5801   attribute DOMString variant;
  5802   attribute DOMString featureSettings;
  5803 }</pre>
  5805   <p>The DOM Level 2 Style specification <a href="#DOM-LEVEL-2-STYLE"
  5806    rel=biblioentry>[DOM-LEVEL-2-STYLE]<!--{{DOM-LEVEL-2-STYLE}}--></a>
  5807    defined a different variant of this rule. This definition supercedes that
  5808    one.
  5810   <h3 id=om-fontfeaturevalues><span class=secno>8.2 </span>The <a
  5811    href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
  5812    interface</h3>
  5814   <p>The <code>CSSRule</code> interface is extended as follows:
  5816   <pre class=idl>partial interface CSSRule {
  5817   const unsigned short FONT_FEATURE_VALUES_RULE = 14;
  5818 }</pre>
  5820   <p>The <dfn id=cssfontfeaturevaluesrule>CSSFontFeatureValuesRule</dfn>
  5821    interface represents a <a
  5822    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  5823    rule.
  5825   <pre class=idl>interface CSSFontFeatureValuesRule : CSSRule {
  5826   attribute DOMString fontFamily;
  5827   readonly attribute CSSFontFeatureValuesMap annotation;
  5828   readonly attribute CSSFontFeatureValuesMap ornaments;
  5829   readonly attribute CSSFontFeatureValuesMap stylistic;
  5830   readonly attribute CSSFontFeatureValuesMap swash;
  5831   readonly attribute CSSFontFeatureValuesMap characterVariant;
  5832   readonly attribute CSSFontFeatureValuesMap styleset;
  5835 [MapClass(DOMString, sequence&lt;unsigned long&gt;)]
  5836 interface CSSFontFeatureValuesMap {
  5837   void set(DOMString featureValueName,
  5838            (unsigned long or sequence&lt;unsigned long&gt;) values);
  5839 }</pre>
  5841   <dl class=idl-attributes>
  5842    <dt><var>fontFamily</var> of type <code>DOMString</code>
  5844    <dd>The list of one or more font families for which a given set of feature
  5845     values is defined.
  5847    <dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
  5849    <dd>Maps of feature values associated with feature value names for a given
  5850     ‘<a href="#propdef-font-variant-alternates"><code
  5851     class=property>font-variant-alternates</code></a>’ value type
  5852   </dl>
  5854   <p>Each value map attribute of <a
  5855    href="#cssfontfeaturevaluesrule"><code>CSSFontFeatureValuesRule</code></a>
  5856    reflects the values defined via a corresponding <a
  5857    href="#featurevalueblock"><i title="feature_value_block">feature value
  5858    block</i></a>. Thus, the <var title="annotation
  5859    attribute">annotation</var> attribute contains the values contained within
  5860    a <code title="@annotation">@annotation</code> <a
  5861    href="#featurevalueblock"><i title="feature_value_block">feature value
  5862    block</i></a>, the <var title="ornaments attribute">ornaments</var>
  5863    attribute contains the values contained with a <code
  5864    title="@ornaments">@ornaments</code> <a href="#featurevalueblock"><i
  5865    title="feature_value_block">feature value block</i></a> and so forth.
  5867   <p>The <code>CSSFontFeatureValuesMap</code> interface uses the <a
  5868    href="http://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map
  5869    class methods</a> but the <code>set</code> method has different behavior.
  5870    It takes a sequence of unsigned integers and associates it with a given
  5871    <code>featureValueName</code>. The method behaves the same as the default
  5872    map class method except that a single unsigned long value is treated as a
  5873    sequence of a single value. The method throws an exception if an invalid
  5874    number of values is passed in. If the associated <a
  5875    href="#featurevalueblock"><i title="feature_value_block">feature value
  5876    block</i></a> only allows a limited number of values, the <code>set</code>
  5877    method throws an <code>InvalidAccessError</code> exception when the input
  5878    sequence to <code>set</code> contains more than the limited number of
  5879    values. See the description of <a
  5880    href="#multi-valued-feature-value-definitions">multi-valued feature value
  5881    definitions</a> for details on the maximum number of values allowed for a
  5882    given type of <a href="#featurevalueblock"><i
  5883    title="feature_value_block">feature value block</i></a>. The
  5884    <code>get</code> method always returns a sequence of values, even if the
  5885    sequence only contains a single value.
  5887   <h2 class=no-num id=platform-props-to-css>Appendix A: Mapping platform font
  5888    properties to CSS properties</h2>
  5890   <p><em>This appendix is included as background for some of the problems and
  5891    situations that are described in other sections. It should be viewed as
  5892    informative only.</em>
  5894   <p>Font properties in CSS are designed to be independent of the underlying
  5895    font formats used; they can be used to specify bitmap fonts, Type1 fonts,
  5896    SVG fonts in addition to the common TrueType and OpenType fonts. But there
  5897    are facets of the TrueType and OpenType formats that often cause confusion
  5898    for authors and present challenges to implementers on different platforms.
  5900   <p>Originally developed at Apple, TrueType was designed as an outline font
  5901    format for both screen and print. Microsoft joined Apple in developing the
  5902    TrueType format and both platforms have supported TrueType fonts since
  5903    then. Font data in the TrueType format consists of a set of tables
  5904    distinguished with common four-letter tag names, each containing a
  5905    specific type of data. For example, naming information, including
  5906    copyright and license information, is stored in the ‘<code
  5907    class=property>name</code>’ table. The <a
  5908    href="#character-map"><em>character map</em></a> (‘<code
  5909    class=property>cmap</code>’) table contains a mapping of character
  5910    encodings to glyphs. Apple later added additional tables for supporting
  5911    enhanced typographic functionality; these are now called Apple Advanced
  5912    Typography, or AAT, fonts. Microsoft and Adobe developed a separate set of
  5913    tables for advanced typography and called their format OpenType <a
  5914    href="#OPENTYPE" rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a>.
  5916   <p>In many cases the font data used under Microsoft Windows or Linux is
  5917    slightly different from the data used under Apple's Mac OS X because the
  5918    TrueType format allowed for explicit variation across platforms. This
  5919    includes font metrics, names and <a href="#character-map"><em>character
  5920    map</em></a> data.
  5922   <p>Specifically, font family name data is handled differently across
  5923    platforms. For TrueType and OpenType fonts these names are contained in
  5924    the ‘<code class=property>name</code>’ table, in name records with
  5925    name ID 1. Mulitple names can be stored for different locales, but
  5926    Microsoft recommends fonts always include at least a US English version of
  5927    the name. On Windows, Microsoft made the decision for backwards
  5928    compatibility to limit this family name to a maximum of four faces; for
  5929    larger groupings the "preferred family" (name ID 16) or "WWS family" (name
  5930    ID 21) can be used. Other platforms such as OSX don't have this
  5931    limitation, so the family name is used to define all possible groupings.
  5933   <p>Other name table data provides names used to uniquely identify a
  5934    specific face within a family. The full font name (name ID 4) and the
  5935    Postscript name (name ID 6) describe a single face uniquely. For example,
  5936    the bold face of the Gill Sans family has a fullname of "Gill Sans Bold"
  5937    and a Postscript name of "GillSans-Bold". There can be multiple localized
  5938    versions of the fullname for a given face, but the Postscript name is
  5939    always a unique name made from a limited set of ASCII characters.
  5941   <p>On various platforms, different names are used to search for a font. For
  5942    example, with the Windows GDI CreateIndirectFont API, either a family or
  5943    fullname can be used to lookup a face, while on Mac OS X the
  5944    CTFontCreateWithName API call is used to lookup a given face using the
  5945    fullname and Postscript name. Under Linux, the fontconfig API allows fonts
  5946    to be searched using any of these names. In situations where platform
  5947    API's automatically substitute other font choices, it may be necessary to
  5948    verify a returned font matches a given name.
  5950   <p>The weight of a given face can be determined via the usWeightClass field
  5951    of the OS/2 table or inferred from the style name (name ID 2). Likewise,
  5952    the width can be determined via the usWidthClass of the OS/2 table or
  5953    inferred from the style name. For historical reasons related to synthetic
  5954    bolding at weights 200 or lower with the Windows GDI API, font designers
  5955    have sometimes skewed values in the OS/2 table to avoid these weights.
  5957   <p>Rendering complex scripts that use contextual shaping such as Thai,
  5958    Arabic and Devanagari requires features present only in OpenType or AAT
  5959    fonts. Currently, complex script rendering is supported on Windows and
  5960    Linux using OpenType font features while both OpenType and AAT font
  5961    features are used under Mac OS X.
  5963   <h2 class=no-num id=ch-ch-ch-changes>Changes</h2>
  5965   <h3 class=no-num id=recent-changes> Changes from the <a
  5966    href="http://www.w3.org/TR/2013/WD-css-fonts-3-20130711/">July 2013 CSS3
  5967    Fonts Last Call Working Draft</a></h3>
  5969   <ul>
  5970    <li>reorder feature precedence such that features implied by other CSS
  5971     properties override ‘<code class=property>font-variant</code>’
  5972     settings
  5974    <li>switched examples to use .woff files
  5976    <li>revised wording of font fetching algorithm
  5978    <li>drop ‘<code class=property>auto</code>’ value for ‘<a
  5979     href="#propdef-font-size-adjust"><code
  5980     class=property>font-size-adjust</code></a>’
  5982    <li>clarify effect of ‘<a href="#propdef-font-size-adjust"><code
  5983     class=property>font-size-adjust</code></a>’ on <a class=property
  5984     href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">‘<code
  5985     class=property>line-height</code>’</a>
  5987    <li>allow user agents to synthesize OpenType <span class=tag>kern</span>
  5988     feature
  5990    <li>add example of ordinals and associated markup
  5992    <li>minor editorial cleanups
  5993   </ul>
  5995   <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
  5997   <p>I'd like to thank Tal Leming, Jonathan Kew and Christopher Slye for all
  5998    their help and feedback. John Hudson was kind enough to take the time to
  5999    explain the subtleties of OpenType language tags and provided the example
  6000    of character variant usage for displaying text on Byzantine seals. Ken
  6001    Lunde and Eric Muller provided valuable feedback on CJK OpenType features
  6002    and Unicode variation selectors. The idea for supporting font features by
  6003    using <a href="#propdef-font-variant"
  6004    title="font-variant!!property">‘<code
  6005    class=property>font-variant</code>’</a> subproperties originated with
  6006    Håkon Wium Lie, Adam Twardoch and Tal Leming. Elika Etemad supplied some
  6007    of the initial design ideas for the <a
  6008    href="#at-font-feature-values-rule"><code>@font-feature-values</code></a>
  6009    rule. Thanks also to House Industries for allowing the use of Ed Interlock
  6010    in the discretionary ligatures example.
  6012   <p>A special thanks to Robert Bringhurst for the sublime mind expansion
  6013    that is <em>The Elements of Typographic Style</em>.
  6015   <h2 class=no-num id=conformance> Conformance</h2>
  6017   <h3 class=no-num id=conventions> Document Conventions</h3>
  6019   <p>Conformance requirements are expressed with a combination of descriptive
  6020    assertions and RFC 2119 terminology. The key words “MUST”, “MUST
  6021    NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
  6022    “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the
  6023    normative parts of this document are to be interpreted as described in RFC
  6024    2119. However, for readability, these words do not appear in all uppercase
  6025    letters in this specification.
  6027   <p>All of the text of this specification is normative except sections
  6028    explicitly marked as non-normative, examples, and notes. <a
  6029    href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>
  6031   <p>Examples in this specification are introduced with the words “for
  6032    example” or are set apart from the normative text with
  6033    <code>class="example"</code>, like this:
  6035   <div class=example>
  6036    <p>This is an example of an informative example.
  6037   </div>
  6039   <p>Informative notes begin with the word “Note” and are set apart from
  6040    the normative text with <code>class="note"</code>, like this:
  6042   <p class=note>Note, this is an informative note.
  6044   <h3 class=no-num id=conformance-classes> Conformance Classes</h3>
  6046   <p>Conformance to CSS Fonts Level 3 Module is defined for three conformance
  6047    classes:
  6049   <dl>
  6050    <dt><dfn id=style-sheet title="style sheet!!as conformance class">style
  6051     sheet</dfn>
  6053    <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS
  6054     style sheet</a>.
  6056    <dt><dfn id=renderer>renderer</dfn>
  6058    <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
  6059     that interprets the semantics of a style sheet and renders documents that
  6060     use them.
  6062    <dt><dfn id=authoring-tool>authoring tool</dfn>
  6064    <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a>
  6065     that writes a style sheet.
  6066   </dl>
  6068   <p>A style sheet is conformant to CSS Fonts Level 3 Module if all of its
  6069    declarations that use properties defined in this module have values that
  6070    are valid according to the generic CSS grammar and the individual grammars
  6071    of each property as given in this module.
  6073   <p>A renderer is conformant to CSS Fonts Level 3 Module if, in addition to
  6074    interpreting the style sheet as defined by the appropriate specifications,
  6075    it supports all the features defined by CSS Fonts Level 3 Module by
  6076    parsing them correctly and rendering the document accordingly. However,
  6077    the inability of a UA to correctly render a document due to limitations of
  6078    the device does not make the UA non-conformant. (For example, a UA is not
  6079    required to render color on a monochrome monitor.)
  6081   <p>An authoring tool is conformant to CSS Fonts Level 3 Module if it writes
  6082    style sheets that are syntactically correct according to the generic CSS
  6083    grammar and the individual grammars of each feature in this module, and
  6084    meet all other conformance requirements of style sheets as described in
  6085    this module.
  6087   <h3 class=no-num id=partial> Partial Implementations</h3>
  6089   <p>So that authors can exploit the forward-compatible parsing rules to
  6090    assign fallback values, CSS renderers <strong>must</strong> treat as
  6091    invalid (and <a
  6092    href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as
  6093    appropriate</a>) any at-rules, properties, property values, keywords, and
  6094    other syntactic constructs for which they have no usable level of support.
  6095    In particular, user agents <strong>must not</strong> selectively ignore
  6096    unsupported component values and honor supported values in a single
  6097    multi-value property declaration: if any value is considered invalid (as
  6098    unsupported values must be), CSS requires that the entire declaration be
  6099    ignored.
  6101   <h3 class=no-num id=experimental> Experimental Implementations</h3>
  6103   <p>To avoid clashes with future CSS features, the CSS2.1 specification
  6104    reserves a <a
  6105    href="http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords">prefixed
  6106    syntax</a> for proprietary and experimental extensions to CSS.
  6108   <p>Prior to a specification reaching the Candidate Recommendation stage in
  6109    the W3C process, all implementations of a CSS feature are considered
  6110    experimental. The CSS Working Group recommends that implementations use a
  6111    vendor-prefixed syntax for such features, including those in W3C Working
  6112    Drafts. This avoids incompatibilities with future changes in the draft.
  6114   <h3 class=no-num id=testing> Non-Experimental Implementations</h3>
  6116   <p>Once a specification reaches the Candidate Recommendation stage,
  6117    non-experimental implementations are possible, and implementors should
  6118    release an unprefixed implementation of any CR-level feature they can
  6119    demonstrate to be correctly implemented according to spec.
  6121   <p>To establish and maintain the interoperability of CSS across
  6122    implementations, the CSS Working Group requests that non-experimental CSS
  6123    renderers submit an implementation report (and, if necessary, the
  6124    testcases used for that implementation report) to the W3C before releasing
  6125    an unprefixed implementation of any CSS features. Testcases submitted to
  6126    W3C are subject to review and correction by the CSS Working Group.
  6128   <p>Further information on submitting testcases and implementation reports
  6129    can be found from on the CSS Working Group's website at <a
  6130    href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
  6131    Questions should be directed to the <a
  6132    href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a>
  6133    mailing list.
  6135   <h2 class=no-num id=references>References</h2>
  6137   <h3 class=no-num id=normative-references>Normative References</h3>
  6138   <!--begin-normative-->
  6139   <!-- Sorted by label -->
  6141   <dl class=bibliography>
  6142    <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
  6143     <!---->
  6145    <dt id=CHARMOD>[CHARMOD]
  6147    <dd>Martin J. Dürst; et al. <a
  6148     href="http://www.w3.org/TR/2005/REC-charmod-20050215/"><cite>Character
  6149     Model for the World Wide Web 1.0: Fundamentals.</cite></a> 15 February
  6150     2005. W3C Recommendation. URL: <a
  6151     href="http://www.w3.org/TR/2005/REC-charmod-20050215/">http://www.w3.org/TR/2005/REC-charmod-20050215/</a>
  6152     </dd>
  6153    <!---->
  6155    <dt id=CORS>[CORS]
  6157    <dd>Anne van Kesteren. <a
  6158     href="http://www.w3.org/TR/2013/CR-cors-20130129/"><cite>Cross-Origin
  6159     Resource Sharing.</cite></a> 29 January 2013. W3C Candidate
  6160     Recommendation. (Work in progress.) URL: <a
  6161     href="http://www.w3.org/TR/2013/CR-cors-20130129/">http://www.w3.org/TR/2013/CR-cors-20130129/</a>
  6162     </dd>
  6163    <!---->
  6165    <dt id=CSS21>[CSS21]
  6167    <dd>Bert Bos; et al. <a
  6168     href="http://www.w3.org/TR/2011/REC-CSS2-20110607/"><cite>Cascading Style
  6169     Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
  6170     2011. W3C Recommendation. URL: <a
  6171     href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a>
  6172     </dd>
  6173    <!---->
  6175    <dt id=CSS3VAL>[CSS3VAL]
  6177    <dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
  6178     href="http://www.w3.org/TR/2013/CR-css3-values-20130730/"><cite>CSS
  6179     Values and Units Module Level 3.</cite></a> 30 July 2013. W3C Candidate
  6180     Recommendation. (Work in progress.) URL: <a
  6181     href="http://www.w3.org/TR/2013/CR-css3-values-20130730/">http://www.w3.org/TR/2013/CR-css3-values-20130730/</a>
  6182     </dd>
  6183    <!---->
  6185    <dt id=HTML5>[HTML5]
  6187    <dd>Robin Berjon; et al. <a
  6188     href="http://www.w3.org/TR/2013/CR-html5-20130806/"><cite>HTML5.</cite></a>
  6189     6 August 2013. W3C Candidate Recommendation. (Work in progress.) URL: <a
  6190     href="http://www.w3.org/TR/2013/CR-html5-20130806/">http://www.w3.org/TR/2013/CR-html5-20130806/</a>
  6191     </dd>
  6192    <!---->
  6194    <dt id=OPEN-FONT-FORMAT>[OPEN-FONT-FORMAT]
  6196    <dd><a
  6197     href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009%28E%29.zip"><cite>Information
  6198     technology — Coding of audio-visual objects — Part 22: Open Font
  6199     Format.</cite></a> International Organization for Standardization.
  6200     ISO/IEC 14496-22:2009. URL: <a
  6201     href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009%28E%29.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c052136_ISO_IEC_14496-22_2009%28E%29.zip</a>
  6202     </dd>
  6203    <!---->
  6205    <dt id=OPENTYPE>[OPENTYPE]
  6207    <dd><a
  6208     href="http://www.microsoft.com/typography/otspec/default.htm"><cite>OpenType
  6209     specification.</cite></a> Microsoft. URL: <a
  6210     href="http://www.microsoft.com/typography/otspec/default.htm">http://www.microsoft.com/typography/otspec/default.htm</a>
  6211     </dd>
  6212    <!---->
  6214    <dt id=OPENTYPE-FEATURES>[OPENTYPE-FEATURES]
  6216    <dd><a
  6217     href="http://www.microsoft.com/typography/otspec/featurelist.htm"><cite>OpenType
  6218     feature registry.</cite></a> Microsoft. URL: <a
  6219     href="http://www.microsoft.com/typography/otspec/featurelist.htm">http://www.microsoft.com/typography/otspec/featurelist.htm</a>
  6220     </dd>
  6221    <!---->
  6223    <dt id=RFC2119>[RFC2119]
  6225    <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
  6226     words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
  6227     RFC 2119. URL: <a
  6228     href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
  6229     </dd>
  6230    <!---->
  6232    <dt id=UAX15>[UAX15]
  6234    <dd>Mark Davis; Ken Whistler. <a
  6235     href="http://www.unicode.org/reports/tr15/"><cite>Unicode Normalization
  6236     Forms.</cite></a> 31 August 2012. Unicode Standard Annex #15. URL: <a
  6237     href="http://www.unicode.org/reports/tr15/">http://www.unicode.org/reports/tr15/</a>
  6238     </dd>
  6239    <!---->
  6241    <dt id=UAX29>[UAX29]
  6243    <dd>Mark Davis. <a
  6244     href="http://www.unicode.org/reports/tr29/"><cite>Unicode Text
  6245     Segmentation.</cite></a> 12 September 2012. Unicode Standard Annex #29.
  6246     URL: <a
  6247     href="http://www.unicode.org/reports/tr29/">http://www.unicode.org/reports/tr29/</a>
  6248     </dd>
  6249    <!---->
  6251    <dt id=UNICODE>[UNICODE]
  6253    <dd>The Unicode Consortium. <a
  6254     href="http://www.unicode.org/standard/versions/enumeratedversions.html"><cite>The
  6255     Unicode Standard.</cite></a> 2012. Defined by: The Unicode Standard,
  6256     Version 6.2.0 (Mountain View, CA: The Unicode Consortium, 2012. ISBN
  6257     978-1-936213-07-8), as updated from time to time by the publication of
  6258     new versions URL: <a
  6259     href="http://www.unicode.org/standard/versions/enumeratedversions.html">http://www.unicode.org/standard/versions/enumeratedversions.html</a>
  6260     </dd>
  6261    <!---->
  6262   </dl>
  6263   <!--end-normative-->
  6264   <!--{{!CSS21}}-->
  6265   <!--{{!CSS3VAL}}-->
  6266   <!--{{!OPENTYPE}}-->
  6267   <!--{{!OPENTYPE-FEATURES}}-->
  6268   <!--{{!OPEN-FONT-FORMAT}}-->
  6269   <!--{{!UNICODE}}-->
  6270   <!--{{!UAX15}}-->
  6271   <!--{{!UAX29}}-->
  6272   <!--{{!CORS}}-->
  6273   <!--{{!HTML5}}-->
  6274   <!--{{!CHARMOD}}-->
  6276   <h3 class=no-num id=other-references>Other References</h3>
  6277   <!--begin-informative-->
  6278   <!-- Sorted by label -->
  6280   <dl class=bibliography>
  6281    <dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
  6282     <!---->
  6284    <dt id=AAT-FEATURES>[AAT-FEATURES]
  6286    <dd><a href="http://developer.apple.com/fonts/registry/"><cite>Apple
  6287     Advanced Typography font feature registry.</cite></a> Apple. URL: <a
  6288     href="http://developer.apple.com/fonts/registry/">http://developer.apple.com/fonts/registry/</a>
  6289     </dd>
  6290    <!---->
  6292    <dt id=ARABIC-TYPO>[ARABIC-TYPO]
  6294    <dd>Huda Smitshuijzen AbiFares. <cite>Arabic Typography: A Comprehensive
  6295     Sourcebook.</cite> Saqi Books. 2001. ISBN 0-86356-347-3.</dd>
  6296    <!---->
  6298    <dt id=CHARMOD-NORM>[CHARMOD-NORM]
  6300    <dd>François Yergeau; et al. <a
  6301     href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/"><cite>Character
  6302     Model for the World Wide Web 1.0: Normalization.</cite></a> 1 May 2012.
  6303     W3C Working Draft. (Work in progress.) URL: <a
  6304     href="http://www.w3.org/TR/2012/WD-charmod-norm-20120501/">http://www.w3.org/TR/2012/WD-charmod-norm-20120501/</a>
  6305     </dd>
  6306    <!---->
  6308    <dt id=CJKV-INFO-PROCESSING>[CJKV-INFO-PROCESSING]
  6310    <dd>Ken Lunde. <cite>CJKV Information Processing, Second Edition.</cite>
  6311     O'Reilly Media, Inc. 2009. ISBN 0-596-51447-1.</dd>
  6312    <!---->
  6314    <dt id=CSS3-CONDITIONAL>[CSS3-CONDITIONAL]
  6316    <dd>L. David Baron. <a
  6317     href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/"><cite>CSS
  6318     Conditional Rules Module Level 3.</cite></a> 4 April 2013. W3C Candidate
  6319     Recommendation. (Work in progress.) URL: <a
  6320     href="http://www.w3.org/TR/2013/CR-css3-conditional-20130404/">http://www.w3.org/TR/2013/CR-css3-conditional-20130404/</a>
  6321     </dd>
  6322    <!---->
  6324    <dt id=CSS3TEXT>[CSS3TEXT]
  6326    <dd>Elika J. Etemad; Koji Ishii. <a
  6327     href="http://www.w3.org/TR/2012/WD-css3-text-20121113/"><cite>CSS Text
  6328     Module Level 3.</cite></a> 13 November 2012. W3C Working Draft. (Work in
  6329     progress.) URL: <a
  6330     href="http://www.w3.org/TR/2012/WD-css3-text-20121113/">http://www.w3.org/TR/2012/WD-css3-text-20121113/</a>
  6331     </dd>
  6332    <!---->
  6334    <dt id=DIGITAL-TYPOGRAPHY>[DIGITAL-TYPOGRAPHY]
  6336    <dd>Richard Rubinstein. <cite>Digital Typography, An Introduction to Type
  6337     and Composition for Computer System Design.</cite> Addison-Wesley. 1988.
  6338     ISBN 0-201-17633-5.</dd>
  6339    <!---->
  6341    <dt id=DOM-LEVEL-2-STYLE>[DOM-LEVEL-2-STYLE]
  6343    <dd>Chris Wilson; Philippe Le Hégaret; Vidur Apparao. <a
  6344     href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/"><cite>Document
  6345     Object Model (DOM) Level 2 Style Specification.</cite></a> 13 November
  6346     2000. W3C Recommendation. URL: <a
  6347     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>
  6348     </dd>
  6349    <!---->
  6351    <dt id=ELEMTYPO>[ELEMTYPO]
  6353    <dd>Robert Bringhurst. <cite>The Elements of Typographic Style, Version
  6354     4.</cite> Hartley &amp; Marks. 2013. ISBN 0-88179-212-8.</dd>
  6355    <!---->
  6357    <dt id=LANGCULTTYPE>[LANGCULTTYPE]
  6359    <dd>John D. Berry, Ed. <cite>Language Culture Type.</cite> Graphis. 2001.
  6360     ISBN 1-932026-01-0.</dd>
  6361    <!---->
  6363    <dt id=OPENTYPE-FONT-GUIDE>[OPENTYPE-FONT-GUIDE]
  6365    <dd><a
  6366     href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf"><cite>OpenType
  6367     User Guide.</cite></a> FontShop International. URL: <a
  6368     href="https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf">https://www.fontfont.com/staticcontent/downloads/FF_OT_User_Guide.pdf</a>
  6369     </dd>
  6370    <!---->
  6372    <dt id=RASTER-TRAGEDY>[RASTER-TRAGEDY]
  6374    <dd>Beat Stamm. <a href="http://www.rastertragedy.com/"><cite>The Raster
  6375     Tragedy at Low-Resolution Revisited.</cite></a> 7 December 2011. URL: <a
  6376     href="http://www.rastertragedy.com/">http://www.rastertragedy.com/</a></dd>
  6377    <!---->
  6379    <dt id=WINDOWS-GLYPH-PROC>[WINDOWS-GLYPH-PROC]
  6381    <dd>John Hudson. <a
  6382     href="http://www.microsoft.com/typography/developers/opentype/default.htm"><cite>Windows
  6383     Glyph Processing.</cite></a> Microsoft Typogrraphy. URL: <a
  6384     href="http://www.microsoft.com/typography/developers/opentype/default.htm">http://www.microsoft.com/typography/developers/opentype/default.htm</a>
  6385     </dd>
  6386    <!---->
  6387   </dl>
  6388   <!--end-informative-->
  6389   <!--{{ARABIC-TYPO}}-->
  6390   <!--{{CJKV-INFO-PROCESSING}}-->
  6391   <!--{{DIGITAL-TYPOGRAPHY}}-->
  6392   <!--{{DOM-LEVEL-2-STYLE}}-->
  6393   <!--{{ELEMTYPO}}-->
  6394   <!--{{LANGCULTTYPE}}-->
  6395   <!--{{OPENTYPE-FONT-GUIDE}}-->
  6396   <!--{{RASTER-TRAGEDY}}-->
  6397   <!--{{WINDOWS-GLYPH-PROC}}-->
  6398   <!--{{CHARMOD-NORM}}-->
  6399   <!--{{AAT-FEATURES}}-->
  6400   <!--{{CSS3-CONDITIONAL}}-->
  6401   <!--{{CSS3TEXT}}-->
  6403   <h2 class=no-num id=index>Index</h2>
  6404   <!--begin-index-->
  6406   <ul class=indexlist>
  6407    <li>100...900 weight values, <a href="#font-weight-numeric-values"
  6408     title="100...900 weight values"><strong>3.2</strong></a>
  6410    <li><var>&lt;absolute-size&gt;</var>, <a href="#absolute-size-value"
  6411     title="&lt;absolute-size&gt;"><strong>3.5</strong></a>
  6413    <li><var>&lt;common-lig-values&gt;</var>, <a href="#common-lig-values"
  6414     title="&lt;common-lig-values&gt;"><strong>6.4</strong></a>
  6416    <li><var>&lt;contextual-alt-values&gt;</var>, <a
  6417     href="#contextual-alt-values"
  6418     title="&lt;contextual-alt-values&gt;"><strong>6.4</strong></a>
  6420    <li><var>&lt;discretionary-lig-values&gt;</var>, <a
  6421     href="#discretionary-lig-values"
  6422     title="&lt;discretionary-lig-values&gt;"><strong>6.4</strong></a>
  6424    <li><var>&lt;east-asian-variant-values&gt;</var>, <a
  6425     href="#east-asian-variant-values"
  6426     title="&lt;east-asian-variant-values&gt;"><strong>6.10</strong></a>
  6428    <li><var>&lt;east-asian-width-values&gt;</var>, <a
  6429     href="#east-asian-width-values"
  6430     title="&lt;east-asian-width-values&gt;"><strong>6.10</strong></a>
  6432    <li><var>&lt;family-name&gt;</var>, <a href="#family-name-value"
  6433     title="&lt;family-name&gt;"><strong>3.1</strong></a>
  6435    <li><var>&lt;feature-tag-value&gt;</var>, <a href="#feature-tag-value"
  6436     title="&lt;feature-tag-value&gt;"><strong>6.12</strong></a>
  6438    <li><var>&lt;font-face-name&gt;</var>, <a href="#font-face-name-value"
  6439     title="&lt;font-face-name&gt;"><strong>4.3</strong></a>
  6441    <li><var>&lt;font-variant-css21&gt;</var>, <a
  6442     href="#font-variant-css21-values"
  6443     title="&lt;font-variant-css21&gt;"><strong>3.7</strong></a>
  6445    <li><var>&lt;generic-family&gt;</var>, <a href="#generic-family-value"
  6446     title="&lt;generic-family&gt;"><strong>3.1</strong></a>
  6448    <li><var>&lt;historical-lig-values&gt;</var>, <a
  6449     href="#historical-lig-values"
  6450     title="&lt;historical-lig-values&gt;"><strong>6.4</strong></a>
  6452    <li><var>&lt;length&gt;</var>, <a href="#length-size-value"
  6453     title="&lt;length&gt;"><strong>3.5</strong></a>
  6455    <li><var>&lt;number&gt;</var>, <a href="#aspect-ratio-value"
  6456     title="&lt;number&gt;"><strong>3.6</strong></a>
  6458    <li><var>&lt;numeric-figure-values&gt;</var>, <a
  6459     href="#numeric-figure-values"
  6460     title="&lt;numeric-figure-values&gt;"><strong>6.7</strong></a>
  6462    <li><var>&lt;numeric-fraction-values&gt;</var>, <a
  6463     href="#numeric-fraction-values"
  6464     title="&lt;numeric-fraction-values&gt;"><strong>6.7</strong></a>
  6466    <li><var>&lt;numeric-spacing-values&gt;</var>, <a
  6467     href="#numeric-spacing-values"
  6468     title="&lt;numeric-spacing-values&gt;"><strong>6.7</strong></a>
  6470    <li><var>&lt;percentage&gt;</var>, <a href="#percentage-size-value"
  6471     title="&lt;percentage&gt;"><strong>3.5</strong></a>
  6473    <li><var>&lt;relative-size&gt;</var>, <a href="#relative-size-value"
  6474     title="&lt;relative-size&gt;"><strong>3.5</strong></a>
  6476    <li><var>&lt;string&gt;</var>, <a
  6477     href="#font-language-override-string-value"
  6478     title="&lt;string&gt;"><strong>6.13</strong></a>
  6480    <li><var>&lt;urange&gt;</var>, <a href="#urange-value"
  6481     title="&lt;urange&gt;"><strong>4.5</strong></a>
  6483    <li><code>@font-face</code>, <a href="#at-font-face-rule"
  6484     title="@font-face"><strong>4.1</strong></a>
  6486    <li><code>@font-feature-values</code>, <a
  6487     href="#at-font-feature-values-rule"
  6488     title="@font-feature-values"><strong>6.9</strong></a>
  6490    <li>all-petite-caps, <a href="#all-petite-caps"
  6491     title=all-petite-caps><strong>6.6</strong></a>
  6493    <li>all-small-caps, <a href="#all-small-caps"
  6494     title=all-small-caps><strong>6.6</strong></a>
  6496    <li>annotation, <a href="#annotation"
  6497     title=annotation><strong>6.8</strong></a>
  6499    <li>aspect value, <a href="#aspect-value0" title="aspect
  6500     value"><strong>3.6</strong></a>
  6502    <li>authoring tool, <a href="#authoring-tool" title="authoring
  6503     tool"><strong>#</strong></a>
  6505    <li>auto
  6506     <ul>
  6507      <li>font-kerning, <a href="#font-kerning-auto-value" title="auto,
  6508       font-kerning"><strong>6.3</strong></a>
  6509     </ul>
  6511    <li>bold, <a href="#bold" title=bold><strong>3.2</strong></a>
  6513    <li>bolder, <a href="#bolder" title=bolder><strong>3.2</strong></a>
  6515    <li>character map, <a href="#character-map" title="character
  6516     map"><strong>5.2</strong></a>
  6518    <li>character-variant, <a href="#character-variant"
  6519     title=character-variant><strong>6.8</strong></a>
  6521    <li>common-ligatures, <a href="#common-ligatures"
  6522     title=common-ligatures><strong>6.4</strong></a>
  6524    <li>composite face, <a href="#composite-face" title="composite
  6525     face"><strong>5.2</strong></a>
  6527    <li>condensed, <a href="#condensed"
  6528     title=condensed><strong>3.3</strong></a>
  6530    <li>contextual, <a href="#contextual"
  6531     title=contextual><strong>6.4</strong></a>
  6533    <li>CSSFontFaceRule, <a href="#cssfontfacerule"
  6534     title=CSSFontFaceRule><strong>8.1</strong></a>
  6536    <li>CSSFontFeatureValuesRule, <a href="#cssfontfeaturevaluesrule"
  6537     title=CSSFontFeatureValuesRule><strong>8.2</strong></a>
  6539    <li>cursive, definition of, <a href="#cursive0" title="cursive, definition
  6540     of"><strong>#</strong></a>
  6542    <li>default face, <a href="#default-face" title="default
  6543     face"><strong>5.2</strong></a>
  6545    <li>descriptor_declaration, <a href="#descriptordeclaration"
  6546     title="descriptor_declaration"><strong>4.1</strong></a>
  6548    <li>diagonal-fractions, <a href="#diagonal-fractions"
  6549     title=diagonal-fractions><strong>6.7</strong></a>
  6551    <li>discretionary-ligatures, <a href="#discretionary-ligatures"
  6552     title=discretionary-ligatures><strong>6.4</strong></a>
  6554    <li>effective character map, <a href="#effective-character-map"
  6555     title="effective character map"><strong>4.5</strong></a>
  6557    <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
  6559    <li>extra-condensed, <a href="#extra-condensed"
  6560     title=extra-condensed><strong>3.3</strong></a>
  6562    <li>extra-expanded, <a href="#extra-expanded"
  6563     title=extra-expanded><strong>3.3</strong></a>
  6565    <li>fantasy, definition of, <a href="#fantasy0" title="fantasy, definition
  6566     of"><strong>#</strong></a>
  6568    <li>feature_type, <a href="#featuretype"
  6569     title="feature_type"><strong>6.9.1</strong></a>
  6571    <li>feature_value_block, <a href="#featurevalueblock"
  6572     title="feature_value_block"><strong>6.9.1</strong></a>
  6574    <li>feature_value_definition, <a href="#featurevaluedefinition"
  6575     title="feature_value_definition"><strong>6.9.1</strong></a>
  6577    <li>first available font, <a href="#first-available-font" title="first
  6578     available font"><strong>5.2</strong></a>
  6580    <li>font, <a href="#propdef-font" title=font><strong>3.7</strong></a>
  6582    <li>font specific, <a href="#font-specific" title="font
  6583     specific"><strong>6.8</strong></a>
  6585    <li>font-family
  6586     <ul>
  6587      <li>descriptor, <a href="#descdef-font-family" title="font-family,
  6588       descriptor"><strong>4.2</strong></a>
  6590      <li>property, <a href="#propdef-font-family" title="font-family,
  6591       property"><strong>3.1</strong></a>
  6592     </ul>
  6594    <li>font-feature-settings
  6595     <ul>
  6596      <li>descriptor, <a href="#descdef-font-feature-settings"
  6597       title="font-feature-settings, descriptor"><strong>4.7</strong></a>
  6599      <li>property, <a href="#propdef-font-feature-settings"
  6600       title="font-feature-settings, property"><strong>6.12</strong></a>
  6601     </ul>
  6603    <li>font-kerning, <a href="#propdef-font-kerning"
  6604     title=font-kerning><strong>6.3</strong></a>
  6606    <li>font-language-override, <a href="#propdef-font-language-override"
  6607     title=font-language-override><strong>6.13</strong></a>
  6609    <li>font-size, <a href="#propdef-font-size"
  6610     title=font-size><strong>3.5</strong></a>
  6612    <li>font-size-adjust, <a href="#propdef-font-size-adjust"
  6613     title=font-size-adjust><strong>3.6</strong></a>
  6615    <li>font-stretch
  6616     <ul>
  6617      <li>descriptor, <a href="#descdef-font-stretch" title="font-stretch,
  6618       descriptor"><strong>4.4</strong></a>
  6620      <li>property, <a href="#propdef-font-stretch" title="font-stretch,
  6621       property"><strong>3.3</strong></a>
  6622     </ul>
  6624    <li>font-style
  6625     <ul>
  6626      <li>descriptor, <a href="#descdef-font-style" title="font-style,
  6627       descriptor"><strong>4.4</strong></a>
  6629      <li>property, <a href="#propdef-font-style" title="font-style,
  6630       property"><strong>3.4</strong></a>
  6631     </ul>
  6633    <li>font-synthesis, <a href="#propdef-font-synthesis"
  6634     title=font-synthesis><strong>3.8</strong></a>
  6636    <li>font-variant
  6637     <ul>
  6638      <li>descriptor, <a href="#descdef-font-variant" title="font-variant,
  6639       descriptor"><strong>4.7</strong></a>
  6641      <li>property, <a href="#propdef-font-variant" title="font-variant,
  6642       property"><strong>6.11</strong></a>
  6643     </ul>
  6645    <li>font-variant-alternates, <a href="#propdef-font-variant-alternates"
  6646     title=font-variant-alternates><strong>6.8</strong></a>
  6648    <li>font-variant-caps, <a href="#propdef-font-variant-caps"
  6649     title=font-variant-caps><strong>6.6</strong></a>
  6651    <li>font-variant-east-asian, <a href="#propdef-font-variant-east-asian"
  6652     title=font-variant-east-asian><strong>6.10</strong></a>
  6654    <li>font-variant-ligatures, <a href="#propdef-font-variant-ligatures"
  6655     title=font-variant-ligatures><strong>6.4</strong></a>
  6657    <li>font-variant-numeric, <a href="#propdef-font-variant-numeric"
  6658     title=font-variant-numeric><strong>6.7</strong></a>
  6660    <li>font-variant-position, <a href="#propdef-font-variant-position"
  6661     title=font-variant-position><strong>6.5</strong></a>
  6663    <li>font-weight
  6664     <ul>
  6665      <li>descriptor, <a href="#descdef-font-weight" title="font-weight,
  6666       descriptor"><strong>4.4</strong></a>
  6668      <li>property, <a href="#propdef-font-weight" title="font-weight,
  6669       property"><strong>3.2</strong></a>
  6670     </ul>
  6672    <li>font_face_rule, <a href="#fontfacerule"
  6673     title="font_face_rule"><strong>4.1</strong></a>
  6675    <li>FONT_FACE_SYM, <a href="#fontfacesym"
  6676     title="FONT_FACE_SYM"><strong>4.1</strong></a>
  6678    <li>font_family_name, <a href="#fontfamilyname"
  6679     title="font_family_name"><strong>6.9.1</strong></a>
  6681    <li>font_family_name_list, <a href="#fontfamilynamelist"
  6682     title="font_family_name_list"><strong>6.9.1</strong></a>
  6684    <li>font_feature_values_rule, <a href="#fontfeaturevaluesrule"
  6685     title="font_feature_values_rule"><strong>6.9.1</strong></a>
  6687    <li>FONT_FEATURE_VALUES_SYM, <a href="#fontfeaturevaluessym"
  6688     title="FONT_FEATURE_VALUES_SYM"><strong>6.9.1</strong></a>
  6690    <li>full-width, <a href="#full-width"
  6691     title=full-width><strong>6.10</strong></a>
  6693    <li>historical-forms, <a href="#historical-forms"
  6694     title=historical-forms><strong>6.8</strong></a>
  6696    <li>historical-ligatures, <a href="#historical-ligatures"
  6697     title=historical-ligatures><strong>6.4</strong></a>
  6699    <li>italic, <a href="#italic" title=italic><strong>3.4</strong></a>
  6701    <li>jis04, <a href="#jis04" title=jis04><strong>6.10</strong></a>
  6703    <li>jis78, <a href="#jis78" title=jis78><strong>6.10</strong></a>
  6705    <li>jis83, <a href="#jis83" title=jis83><strong>6.10</strong></a>
  6707    <li>jis90, <a href="#jis90" title=jis90><strong>6.10</strong></a>
  6709    <li>lighter, <a href="#lighter" title=lighter><strong>3.2</strong></a>
  6711    <li>lining-nums, <a href="#lining-nums"
  6712     title=lining-nums><strong>6.7</strong></a>
  6714    <li>monospace, definition of, <a href="#monospace0" title="monospace,
  6715     definition of"><strong>#</strong></a>
  6717    <li>no-common-ligatures, <a href="#no-common-ligatures"
  6718     title=no-common-ligatures><strong>6.4</strong></a>
  6720    <li>no-contextual, <a href="#no-contextual"
  6721     title=no-contextual><strong>6.4</strong></a>
  6723    <li>no-discretionary-ligatures, <a href="#no-discretionary-ligatures"
  6724     title=no-discretionary-ligatures><strong>6.4</strong></a>
  6726    <li>no-historical-ligatures, <a href="#no-historical-ligatures"
  6727     title=no-historical-ligatures><strong>6.4</strong></a>
  6729    <li>none
  6730     <ul>
  6731      <li>font-kerning, <a href="#font-kerning-none-value" title="none,
  6732       font-kerning"><strong>6.3</strong></a>
  6734      <li>font-size-adjust, <a href="#font-size-adjust-none-value"
  6735       title="none, font-size-adjust"><strong>3.6</strong></a>
  6737      <li>font-variant, <a href="#font-variant-none-value" title="none,
  6738       font-variant"><strong>6.11</strong></a>
  6740      <li>font-variant-ligatures, <a href="#font-variant-ligatures-none-value"
  6741       title="none, font-variant-ligatures"><strong>6.4</strong></a>
  6742     </ul>
  6744    <li>normal
  6745     <ul>
  6746      <li>font-feature-settings, <a href="#font-feature-settings-normal-value"
  6747       title="normal, font-feature-settings"><strong>6.12</strong></a>
  6749      <li>font-kerning, <a href="#font-kerning-normal-value" title="normal,
  6750       font-kerning"><strong>6.3</strong></a>
  6752      <li>font-language-override, <a
  6753       href="#font-language-override-normal-value" title="normal,
  6754       font-language-override"><strong>6.13</strong></a>
  6756      <li>font-stretch, <a href="#font-stretch-normal-value" title="normal,
  6757       font-stretch"><strong>3.3</strong></a>
  6759      <li>font-style, <a href="#font-style-normal-value" title="normal,
  6760       font-style"><strong>3.4</strong></a>
  6762      <li>font-variant, <a href="#font-variant-normal-value" title="normal,
  6763       font-variant"><strong>6.11</strong></a>
  6765      <li>font-variant-alternates, <a
  6766       href="#font-variant-alternates-normal-value" title="normal,
  6767       font-variant-alternates"><strong>6.8</strong></a>
  6769      <li>font-variant-caps, <a href="#font-variant-caps-normal-value"
  6770       title="normal, font-variant-caps"><strong>6.6</strong></a>
  6772      <li>font-variant-east-asian, <a
  6773       href="#font-variant-east-asian-normal-value" title="normal,
  6774       font-variant-east-asian"><strong>6.10</strong></a>
  6776      <li>font-variant-ligatures, <a
  6777       href="#font-variant-ligatures-normal-value" title="normal,
  6778       font-variant-ligatures"><strong>6.4</strong></a>
  6780      <li>font-variant-numeric, <a href="#font-variant-numeric-normal-value"
  6781       title="normal, font-variant-numeric"><strong>6.7</strong></a>
  6783      <li>font-variant-position, <a href="#font-variant-position-normal-value"
  6784       title="normal, font-variant-position"><strong>6.5</strong></a>
  6786      <li>font-weight, <a href="#font-weight-normal-value" title="normal,
  6787       font-weight"><strong>3.2</strong></a>
  6788     </ul>
  6790    <li>oblique, <a href="#oblique" title=oblique><strong>3.4</strong></a>
  6792    <li>oldstyle-nums, <a href="#oldstyle-nums"
  6793     title=oldstyle-nums><strong>6.7</strong></a>
  6795    <li>ordinal, <a href="#ordinal" title=ordinal><strong>6.7</strong></a>
  6797    <li>ornaments, <a href="#ornaments"
  6798     title=ornaments><strong>6.8</strong></a>
  6800    <li>petite-caps, <a href="#petite-caps"
  6801     title=petite-caps><strong>6.6</strong></a>
  6803    <li>proportional-nums, <a href="#proportional-nums"
  6804     title=proportional-nums><strong>6.7</strong></a>
  6806    <li>proportional-width, <a href="#proportional-width"
  6807     title=proportional-width><strong>6.10</strong></a>
  6809    <li>renderer, <a href="#renderer" title=renderer><strong>#</strong></a>
  6811    <li>ruby, <a href="#ruby" title=ruby><strong>6.10</strong></a>
  6813    <li>sans-serif, definition of, <a href="#sans-serif0" title="sans-serif,
  6814     definition of"><strong>#</strong></a>
  6816    <li>semi-condensed, <a href="#semi-condensed-"
  6817     title=semi-condensed><strong>3.3</strong></a>
  6819    <li>semi-expanded, <a href="#semi-expanded"
  6820     title=semi-expanded><strong>3.3</strong></a>
  6822    <li>serif, definition of, <a href="#serif0" title="serif, definition
  6823     of"><strong>#</strong></a>
  6825    <li>simplified, <a href="#simplified"
  6826     title=simplified><strong>6.10</strong></a>
  6828    <li>slashed-zero, <a href="#slashed-zero"
  6829     title=slashed-zero><strong>6.7</strong></a>
  6831    <li>small-caps, <a href="#small-caps"
  6832     title=small-caps><strong>6.6</strong></a>
  6834    <li>src, <a href="#descdef-src" title=src><strong>4.3</strong></a>
  6836    <li>stacked-fractions, <a href="#stacked-fractions"
  6837     title=stacked-fractions><strong>6.7</strong></a>
  6839    <li>style sheet
  6840     <ul>
  6841      <li>as conformance class, <a href="#style-sheet" title="style sheet, as
  6842       conformance class"><strong>#</strong></a>
  6843     </ul>
  6845    <li>styleset, <a href="#styleset" title=styleset><strong>6.8</strong></a>
  6847    <li>stylistic, <a href="#stylistic"
  6848     title=stylistic><strong>6.8</strong></a>
  6850    <li>sub, <a href="#sub" title=sub><strong>6.5</strong></a>
  6852    <li>super, <a href="#super" title=super><strong>6.5</strong></a>
  6854    <li>support, <a href="#support" title=support><strong>5.2</strong></a>
  6856    <li>swash, <a href="#swash" title=swash><strong>6.8</strong></a>
  6858    <li>system font fallback, <a href="#system-font-fallback" title="system
  6859     font fallback"><strong>5.2</strong></a>
  6861    <li>tabular-nums, <a href="#tabular-nums"
  6862     title=tabular-nums><strong>6.7</strong></a>
  6864    <li>titling-caps, <a href="#titling-caps"
  6865     title=titling-caps><strong>6.6</strong></a>
  6867    <li>traditional, <a href="#traditional"
  6868     title=traditional><strong>6.10</strong></a>
  6870    <li>ultra-condensed, <a href="#ultra-condensed"
  6871     title=ultra-condensed><strong>3.3</strong></a>
  6873    <li>ultra-expanded, <a href="#ultra-expanded"
  6874     title=ultra-expanded><strong>3.3</strong></a>
  6876    <li>unicase, <a href="#unicase" title=unicase><strong>6.6</strong></a>
  6878    <li>unicode-range, <a href="#descdef-unicode-range"
  6879     title=unicode-range><strong>4.5</strong></a>
  6881    <li>weight, <a href="#weight" title=weight><strong>2</strong></a>
  6883    <li>width, <a href="#width" title=width><strong>2</strong></a>
  6884   </ul>
  6885   <!--end-index-->
  6887   <h2 class=no-num id=property-index>Property index</h2>
  6888   <!--begin-properties-->
  6890   <table class=proptable>
  6891    <thead>
  6892     <tr>
  6893      <th>Property
  6895      <th>Values
  6897      <th>Initial
  6899      <th>Applies to
  6901      <th>Inh.
  6903      <th>Percentages
  6905      <th>Media
  6907    <tbody>
  6908     <tr>
  6909      <th><a class=property href="#propdef-font">font</a>
  6911      <td>[ [ &lt;‘font-style’&gt; || &lt;font-variant-css21&gt; ||
  6912       &lt;‘font-weight’&gt; || &lt;‘font-stretch’ ]?
  6913       &lt;‘font-size’&gt; [ / &lt;‘line-height’&gt; ]?
  6914       &lt;‘font-family’&gt; ] | caption | icon | menu | message-box |
  6915       small-caption | status-bar
  6917      <td>see individual properties
  6919      <td>all elements
  6921      <td>yes
  6923      <td>see individual properties
  6925      <td>visual
  6927     <tr>
  6928      <th><span class=property>font-family</span>
  6930      <td>[ &lt;family-name&gt; | &lt;generic-family&gt; ] #
  6932      <td>depends on user agent
  6934      <td>all elements
  6936      <td>yes
  6938      <td>N/A
  6940      <td>visual
  6942     <tr>
  6943      <th><span class=property>font-feature-settings</span>
  6945      <td>normal | &lt;feature-tag-value&gt; #
  6947      <td>normal
  6949      <td>all elements
  6951      <td>yes
  6953      <td>N/A
  6955      <td>visual
  6957     <tr>
  6958      <th><a class=property href="#propdef-font-kerning">font-kerning</a>
  6960      <td>auto | normal | none
  6962      <td>auto
  6964      <td>all elements
  6966      <td>yes
  6968      <td>N/A
  6970      <td>visual
  6972     <tr>
  6973      <th><a class=property
  6974       href="#propdef-font-language-override">font-language-override</a>
  6976      <td>normal | &lt;string&gt;
  6978      <td>normal
  6980      <td>all elements
  6982      <td>yes
  6984      <td>N/A
  6986      <td>visual
  6988     <tr>
  6989      <th><a class=property href="#propdef-font-size">font-size</a>
  6991      <td>&lt;absolute-size&gt; | &lt;relative-size&gt; | &lt;length&gt; |
  6992       &lt;percentage&gt;
  6994      <td>medium
  6996      <td>all elements
  6998      <td>yes
  7000      <td>refer to parent element's font size
  7002      <td>visual
  7004     <tr>
  7005      <th><a class=property
  7006       href="#propdef-font-size-adjust">font-size-adjust</a>
  7008      <td>none | &lt;number&gt;
  7010      <td>none
  7012      <td>all elements
  7014      <td>yes
  7016      <td>N/A
  7018      <td>visual
  7020     <tr>
  7021      <th><span class=property>font-stretch</span>
  7023      <td>normal | ultra-condensed | extra-condensed | condensed |
  7024       semi-condensed | semi-expanded | expanded | extra-expanded |
  7025       ultra-expanded
  7027      <td>normal
  7029      <td>all elements
  7031      <td>yes
  7033      <td>N/A
  7035      <td>visual
  7037     <tr>
  7038      <th><span class=property>font-style</span>
  7040      <td>normal | italic | oblique
  7042      <td>normal
  7044      <td>all elements
  7046      <td>yes
  7048      <td>N/A
  7050      <td>visual
  7052     <tr>
  7053      <th><a class=property href="#propdef-font-synthesis">font-synthesis</a>
  7055      <td>none | [ weight || style ]
  7057      <td>weight style
  7059      <td>all elements
  7061      <td>yes
  7063      <td>N/A
  7065      <td>visual
  7067     <tr>
  7068      <th><span class=property>font-variant</span>
  7070      <td>normal | none | [ &lt;common-lig-values&gt; ||
  7071       &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
  7072       &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
  7073       || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
  7074       character-variant(&lt;feature-value-name&gt; #) ||
  7075       swash(&lt;feature-value-name&gt;) ||
  7076       ornaments(&lt;feature-value-name&gt;) ||
  7077       annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
  7078       | petite-caps | all-petite-caps | unicase | titling-caps ] ||
  7079       &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
  7080       &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
  7081       &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
  7082       ruby ]
  7084      <td>normal
  7086      <td>all elements
  7088      <td>yes
  7090      <td>see individual properties
  7092      <td>visual
  7094     <tr>
  7095      <th><a class=property
  7096       href="#propdef-font-variant-alternates">font-variant-alternates</a>
  7098      <td>normal | [ stylistic(&lt;feature-value-name&gt;) || historical-forms
  7099       || styleset(&lt;feature-value-name&gt; #) ||
  7100       character-variant(&lt;feature-value-name&gt; #) ||
  7101       swash(&lt;feature-value-name&gt;) ||
  7102       ornaments(&lt;feature-value-name&gt;) ||
  7103       annotation(&lt;feature-value-name&gt;) ]
  7105      <td>normal
  7107      <td>all elements
  7109      <td>yes
  7111      <td>N/A
  7113      <td>visual
  7115     <tr>
  7116      <th><a class=property
  7117       href="#propdef-font-variant-caps">font-variant-caps</a>
  7119      <td>normal | small-caps | all-small-caps | petite-caps | all-petite-caps
  7120       | unicase | titling-caps
  7122      <td>normal
  7124      <td>all elements
  7126      <td>yes
  7128      <td>N/A
  7130      <td>visual
  7132     <tr>
  7133      <th><a class=property
  7134       href="#propdef-font-variant-east-asian">font-variant-east-asian</a>
  7136      <td>normal | [ &lt;east-asian-variant-values&gt; ||
  7137       &lt;east-asian-width-values&gt; || ruby ]
  7139      <td>normal
  7141      <td>all elements
  7143      <td>yes
  7145      <td>N/A
  7147      <td>visual
  7149     <tr>
  7150      <th><a class=property
  7151       href="#propdef-font-variant-ligatures">font-variant-ligatures</a>
  7153      <td>normal | none | [ &lt;common-lig-values&gt; ||
  7154       &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
  7155       &lt;contextual-alt-values&gt; ]
  7157      <td>normal
  7159      <td>all elements
  7161      <td>yes
  7163      <td>N/A
  7165      <td>visual
  7167     <tr>
  7168      <th><a class=property
  7169       href="#propdef-font-variant-numeric">font-variant-numeric</a>
  7171      <td>normal | [ &lt;numeric-figure-values&gt; ||
  7172       &lt;numeric-spacing-values&gt; || &lt;numeric-fraction-values&gt; ||
  7173       ordinal || slashed-zero ]
  7175      <td>normal
  7177      <td>all elements
  7179      <td>yes
  7181      <td>N/A
  7183      <td>visual
  7185     <tr>
  7186      <th><a class=property
  7187       href="#propdef-font-variant-position">font-variant-position</a>
  7189      <td>normal | sub | super
  7191      <td>normal
  7193      <td>all elements
  7195      <td>yes
  7197      <td>N/A
  7199      <td>visual
  7201     <tr>
  7202      <th><span class=property>font-weight</span>
  7204      <td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
  7205       | 700 | 800 | 900
  7207      <td>normal
  7209      <td>all elements
  7211      <td>yes
  7213      <td>N/A
  7215      <td>visual
  7216   </table>
  7217   <!--end-properties-->
  7218   <!--begin-descriptors-->
  7220   <table class=proptable>
  7221    <thead>
  7222     <tr>
  7223      <th>Descriptor
  7225      <th>Value
  7227      <th>Initial
  7229      <th>Percentages
  7231      <th>Media
  7233    <tbody>
  7234     <tr>
  7235      <th><span class=property>font-family</span>
  7237      <td>&lt;family-name&gt;
  7239      <td>N/A
  7241     <tr>
  7242      <th><span class=property>font-feature-settings</span>
  7244      <td>normal | &lt;feature-tag-value&gt; #
  7246      <td>normal
  7248     <tr>
  7249      <th><span class=property>font-stretch</span>
  7251      <td>normal | ultra-condensed | extra-condensed | condensed |
  7252       semi-condensed | semi-expanded | expanded | extra-expanded |
  7253       ultra-expanded
  7255      <td>normal
  7257     <tr>
  7258      <th><span class=property>font-style</span>
  7260      <td>normal | italic | oblique
  7262      <td>normal
  7264     <tr>
  7265      <th><span class=property>font-variant</span>
  7267      <td>normal | none | [ &lt;common-lig-values&gt; ||
  7268       &lt;discretionary-lig-values&gt; || &lt;historical-lig-values&gt; ||
  7269       &lt;contextual-alt-values&gt; || stylistic(&lt;feature-value-name&gt;)
  7270       || historical-forms || styleset(&lt;feature-value-name&gt; #) ||
  7271       character-variant(&lt;feature-value-name&gt; #) ||
  7272       swash(&lt;feature-value-name&gt;) ||
  7273       ornaments(&lt;feature-value-name&gt;) ||
  7274       annotation(&lt;feature-value-name&gt;) || [ small-caps | all-small-caps
  7275       | petite-caps | all-petite-caps | unicase | titling-caps ] ||
  7276       &lt;numeric-figure-values&gt; || &lt;numeric-spacing-values&gt; ||
  7277       &lt;numeric-fraction-values&gt; || ordinal || slashed-zero ||
  7278       &lt;east-asian-variant-values&gt; || &lt;east-asian-width-values&gt; ||
  7279       ruby ]
  7281      <td>normal
  7283     <tr>
  7284      <th><span class=property>font-weight</span>
  7286      <td>normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
  7288      <td>normal
  7290     <tr>
  7291      <th><a class=property href="#descdef-src">src</a>
  7293      <td>[ &lt;url> [format(&lt;string> #)]? | &lt;font-face-name&gt; ] #
  7295      <td>N/A
  7297     <tr>
  7298      <th><a class=property href="#descdef-unicode-range">unicode-range</a>
  7300      <td>&lt;urange&gt; #
  7302      <td>U+0-10FFFF
  7303   </table>
  7304   <!--end-descriptors-->
  7305   <script type="text/javascript">
  7306 window.onload = function () {
  7307   if (!("devicePixelRatio" in window && window.devicePixelRatio > 1)) return;
  7308   var i, hiresElements = document.getElementsByClassName("hires");
  7309   for (i = 0; i < hiresElements.length; i++) {
  7310     var h = hiresElements[i];
  7311     if (h.tagName != "IMG") continue;
  7312     var src = h.getAttribute("src");
  7313     var src2x = src.replace(/\.\w+$/, function(m) { return "@2x" + m; });
  7314     h.src = src2x;
  7317 </script>
  7318 </html>
  7319 <!-- Keep this comment at the end of the file
  7320 Local variables:
  7321 mode: sgml
  7322 sgml-declaration:"~/SGML/HTML4.decl"
  7323 sgml-default-doctype-name:"html"
  7324 sgml-minimize-attributes:t
  7325 sgml-nofill-elements:("pre" "style" "br")
  7326 sgml-live-element-indicator:t
  7327 sgml-omittag:nil
  7328 sgml-shorttag:nil
  7329 sgml-namecase-general:t
  7330 sgml-general-insert-case:lower
  7331 sgml-always-quote-attributes:t
  7332 sgml-indent-step:nil
  7333 sgml-indent-data:t
  7334 sgml-parent-document:nil
  7335 sgml-exposed-tags:nil
  7336 sgml-local-catalogs:nil
  7337 sgml-local-ecat-files:nil
  7338 End:
  7339 -->
  7340 <!--
  7342 to do:
  7344 - wording of OpenType family name handling
  7345 - handling combining sequences in the font matching algorithm
  7346 - fix-up fi ligature example
  7348 -->

mercurial