css-fonts/Fonts.html

changeset 8391
f8ed09648c85
parent 8387
f257ff301ad8
child 8397
8b231a13093c
     1.1 --- a/css-fonts/Fonts.html	Mon Jun 10 03:44:34 2013 -0400
     1.2 +++ b/css-fonts/Fonts.html	Mon Jun 10 17:08:11 2013 +0900
     1.3 @@ -2702,7 +2702,7 @@
     1.4    <p>The associated font might not contain glyphs for the entire set of
     1.5     codepoints defined by the ‘<a href="#descdef-unicode-range"><code
     1.6     class=property>unicode-range</code></a>’ descriptor. When the font is
     1.7 -   used the effective <a href="#character-map"><em>character map</em></a> is
     1.8 +   used, the <dfn id=effective-character-map>effective character map</dfn> is
     1.9     the intersection of the codepoints defined by ‘<a
    1.10     href="#descdef-unicode-range"><code
    1.11     class=property>unicode-range</code></a>’ with the font's <a
    1.12 @@ -3103,24 +3103,18 @@
    1.13  
    1.14    <p>As part of the font matching algorithm outlined below, user agents must
    1.15     match font family names used in style rules with actual font family names
    1.16 -   contained in fonts available in a given environment or defined via <a
    1.17 -   href="#at-font-face-rule"><code>@font-face</code></a> rules. User agents
    1.18 -   must match these names case insensitively, using the "Default Caseless
    1.19 -   Matching" algorithm outlined in the Unicode specification <a
    1.20 -   href="#UNICODE6" rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This
    1.21 -   algorithm is detailed in section 3.13 entitled "Default Case Algorithms".
    1.22 -   Specifically, the algorithm must be applied without normalizing the
    1.23 -   strings involved and without applying any language-specific tailorings.
    1.24 -   The case folding method specified by this algorithm uses the case mappings
    1.25 -   with status field ‘<code class=property>C</code>’ or ‘<code
    1.26 -   class=property>F</code>’ in the CaseFolding.txt file of the Unicode
    1.27 -   Character Database.
    1.28 -
    1.29 -  <p class=note> Implementors should take care to verify that a given
    1.30 -   caseless string comparison implementation uses this precise algorithm and
    1.31 -   not assume that a given platform string matching routine follows it, as
    1.32 -   many of these have locale-specific behavior or use some level of string
    1.33 -   normalization.
    1.34 +   contained in fonts available in a given environment or with font family
    1.35 +   names defined in <a href="#at-font-face-rule"><code>@font-face</code></a>
    1.36 +   rules. User agents must match these names case insensitively, using the
    1.37 +   "Default Caseless Matching" algorithm outlined in the Unicode
    1.38 +   specification <a href="#UNICODE6"
    1.39 +   rel=biblioentry>[UNICODE6]<!--{{!UNICODE6}}--></a>. This algorithm is
    1.40 +   detailed in section 3.13 entitled "Default Case Algorithms". Specifically,
    1.41 +   the algorithm must be applied without normalizing the strings involved and
    1.42 +   without applying any language-specific tailorings. The case folding method
    1.43 +   specified by this algorithm uses the case mappings with status field
    1.44 +   ‘<code class=property>C</code>’ or ‘<code class=property>F</code>’
    1.45 +   in the CaseFolding.txt file of the Unicode Character Database.
    1.46  
    1.47    <p class=note> For authors this means that font family names are matched
    1.48     case insensitively, whether those names exist in a platform font or in the
    1.49 @@ -3133,13 +3127,21 @@
    1.50     looks identical but which uses the precomposed lowercase a-ring character
    1.51     (U+00E5) instead of the combining sequence.
    1.52  
    1.53 +  <p class=note> Implementors should take care to verify that a given
    1.54 +   caseless string comparison implementation uses this precise algorithm and
    1.55 +   not assume that a given platform string matching routine follows it, as
    1.56 +   many of these have locale-specific behavior or use some level of string
    1.57 +   normalization.
    1.58 +
    1.59    <h3 id=font-style-matching><span class=secno>5.2 </span>Matching font
    1.60     styles</h3>
    1.61  
    1.62 -  <p>The procedure for choosing fonts consists of iterating over the font
    1.63 -   families determined by the font-family property, selecting a font face
    1.64 +  <p>The procedure for choosing a font for a given character in a run of text
    1.65 +   consists of iterating over the font families named by the <a
    1.66 +   href="#propdef-font-family" title="font-family!!property">‘<code
    1.67 +   class=property>font-family</code>’</a> property, selecting a font face
    1.68     with the appropriate style based on other font properties and then
    1.69 -   determining whether a glyph exists for a given character. This is done
    1.70 +   determining whether a glyph exists for the given character. This is done
    1.71     using the <dfn id=character-map>character map</dfn> of the font, data
    1.72     which maps characters to the default glyph for that character. Codepoint
    1.73     sequences consisting of a base character followed by a sequence of
    1.74 @@ -3152,24 +3154,24 @@
    1.75  
    1.76    <ol id=fontmatchingalg>
    1.77     <li>Using the computed font property values for a given element, the user
    1.78 -    agent starts with the first family name in the fontlist specified by the
    1.79 -    <a href="#propdef-font-family" title="font-family!!property">‘<code
    1.80 +    agent starts with the first family name specified by the <a
    1.81 +    href="#propdef-font-family" title="font-family!!property">‘<code
    1.82      class=property>font-family</code>’</a> property.
    1.83  
    1.84 -   <li>If the family name is unquoted and is a generic family name, the user
    1.85 -    agent looks up the appropriate font family name to be used. User agents
    1.86 -    may choose the generic font family to use based on the language of the
    1.87 -    containing element or the Unicode range of the character.
    1.88 +   <li>If the family name is a generic family keyword, the user agent looks
    1.89 +    up the appropriate font family name to be used. User agents may choose
    1.90 +    the generic font family to use based on the language of the containing
    1.91 +    element or the Unicode range of the character.
    1.92  
    1.93     <li>For other family names, the user agent attempts to find the family
    1.94      name among fonts defined via <a
    1.95      href="#at-font-face-rule"><code>@font-face</code></a> rules and then
    1.96 -    among available system fonts, matching names with a case-insensitive
    1.97 -    comparison as outlined <a href="#font-family-casing">in the section
    1.98 -    above</a>. On systems containing fonts with multiple localized font
    1.99 -    family names, user agents must match any of these names independent of
   1.100 -    the underlying system locale or platform API used. If the font resources
   1.101 -    defined for a given face in an <a
   1.102 +    among available system fonts, matching names with a <a
   1.103 +    href="#font-family-casing">case-insensitive comparison</a> as outlined in
   1.104 +    the section above. On systems containing fonts with multiple localized
   1.105 +    font family names, user agents must match any of these names independent
   1.106 +    of the underlying system locale or platform API used. If the font
   1.107 +    resources defined for a given face in an <a
   1.108      href="#at-font-face-rule"><code>@font-face</code></a> rule are either not
   1.109      available or contain invalid font data, then the face should be treated
   1.110      as not present in the family. If no faces are present for a family
   1.111 @@ -3179,7 +3181,12 @@
   1.112  
   1.113     <li>If a font family match occurs, the user agent assembles the set of
   1.114      font faces in that family and then narrows the set to a single face using
   1.115 -    other font properties in the order given below:
   1.116 +    other font properties in the order given below. A group of faces defined
   1.117 +    via <a href="#at-font-face-rule"><code>@font-face</code></a> rules with
   1.118 +    identical font descriptor values but differing ‘<a
   1.119 +    href="#descdef-unicode-range"><code
   1.120 +    class=property>unicode-range</code></a>’ values are considered to be a
   1.121 +    single <dfn id=composite-face>composite face</dfn> for this step:
   1.122      <ol id=fontstylematchingalg>
   1.123       <li><a href="#propdef-font-stretch"
   1.124        title="font-stretch!!property">‘<code
   1.125 @@ -3216,16 +3223,20 @@
   1.126        then oblique faces, then italic faces. Faces with other style values
   1.127        are excluded from the matching set. User agents are permitted to
   1.128        distinguish between italic and oblique faces within platform font
   1.129 -      families but this is not required, they may treat all italic or oblique
   1.130 -      faces as italic faces. However, within font families defined via <a
   1.131 -      href="#at-font-face-rule"><code>@font-face</code></a> rules, italic and
   1.132 -      oblique faces must be distinguished using the value of the <a
   1.133 +      families but this is not required, so all italic or oblique faces may
   1.134 +      be treated as italic faces. However, within font families defined via
   1.135 +      <a href="#at-font-face-rule"><code>@font-face</code></a> rules, italic
   1.136 +      and oblique faces must be distinguished using the value of the <a
   1.137        href="#descdef-font-style" title="font-style!!descriptor">‘<code
   1.138 -      class=property>font-style</code>’</a> descriptor.
   1.139 +      class=property>font-style</code>’</a> descriptor. For families that
   1.140 +      lack any italic or oblique faces, users agents may create artificial
   1.141 +      oblique faces, if this is permitted by the value of the ‘<a
   1.142 +      href="#propdef-font-synthesis"><code
   1.143 +      class=property>font-synthesis</code></a>’ property.
   1.144  
   1.145       <li><a href="#propdef-font-weight"
   1.146        title="font-weight!!property">‘<code
   1.147 -      class=property>font-weight</code>’</a> is matched next, it will
   1.148 +      class=property>font-weight</code>’</a> is matched next, so it will
   1.149        always reduce the matching set to a single font face. If bolder/lighter
   1.150        relative weights are used, the effective weight is calculated based on
   1.151        the inherited weight value, as described in the definition of the <a
   1.152 @@ -3262,22 +3273,45 @@
   1.153      </ol>
   1.154  
   1.155     <li>
   1.156 +    <p>If the matched face is defined via <a
   1.157 +     href="#at-font-face-rule"><code>@font-face</code></a> rules, user agents
   1.158 +     must use the procedure below to select a single font:
   1.159 +
   1.160 +    <ol>
   1.161 +     <li>If the font resource has not been loaded and the range of characters
   1.162 +      defined by the ‘<a href="#descdef-unicode-range"><code
   1.163 +      class=property>unicode-range</code></a>’ descriptor value includes
   1.164 +      the character in question, load the font.
   1.165 +
   1.166 +     <li>After downloading, if the <a
   1.167 +      href="#effective-character-map"><em>effective character map</em></a>
   1.168 +      supports the character in question, select that font.
   1.169 +    </ol>
   1.170 +
   1.171 +    <p>When the matched face is a <a href="#composite-face"><em>composite
   1.172 +     face</em></a>, user agents must use the procedure above on each of the
   1.173 +     faces in the <a href="#composite-face"><em>composite face</em></a> in
   1.174 +     reverse order of <a
   1.175 +     href="#at-font-face-rule"><code>@font-face</code></a> rule definition.</p>
   1.176 +
   1.177 +    <p>While the download occurs, user agents may either wait until the font
   1.178 +     is downloaded or render once with substituted font metrics and render
   1.179 +     again once the font is downloaded.</p>
   1.180 +
   1.181 +   <li>
   1.182      <p>If no matching face exists or the matched face does not contain a
   1.183       glyph for the character to be rendered, the next family name is selected
   1.184 -     and the previous two steps repeated. Glyphs from other faces in the
   1.185 +     and the previous three steps repeated. Glyphs from other faces in the
   1.186       family are not considered. The only exception is that user agents may
   1.187 -     optionally substitute a synthetic version of the <a
   1.188 +     optionally substitute a synthetically obliqued version of the <a
   1.189       href="#default-face"><em>default face</em></a> if that face supports a
   1.190 -     given glyph (e.g. a synthetic italic version of the regular face may be
   1.191 -     used if the italic face doesn't support glyphs for Arabic).</p>
   1.192 +     given glyph and synthesis of these faces is permitted by the value of
   1.193 +     the ‘<a href="#propdef-font-synthesis"><code
   1.194 +     class=property>font-synthesis</code></a>’ property. For example, a
   1.195 +     synthetic italic version of the regular face may be used if the italic
   1.196 +     face doesn't support glyphs for Arabic.</p>
   1.197      <!-- resolution on the above: http://lists.w3.org/Archives/Public/www-style/2012Nov/0292.html -->
   1.198      
   1.199 -    <p>If the matched font is defined via an <a
   1.200 -     href="#at-font-face-rule"><code>@font-face</code></a> rule and needs to
   1.201 -     be downloaded, the font resource is downloaded. While the download
   1.202 -     occurs, the user agent can either wait until the font is downloaded or
   1.203 -     render once with substituted font metrics and render again once the font
   1.204 -     is downloaded.</p>
   1.205  
   1.206     <li>If there are no more font families to be evaluated and no matching
   1.207      face has been found, then the user agent performs a <dfn
   1.208 @@ -5841,6 +5875,8 @@
   1.209  
   1.210     <li>Revised definition of ‘<a href="#descdef-unicode-range"><code
   1.211      class=property>unicode-range</code></a>’ descriptor
   1.212 +
   1.213 +   <li>Detailed font matching of composite faces
   1.214    </ul>
   1.215  
   1.216    <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
   1.217 @@ -6374,6 +6410,9 @@
   1.218     <li>common-ligatures, <a href="#common-ligatures"
   1.219      title=common-ligatures><strong>6.4</strong></a>
   1.220  
   1.221 +   <li>composite face, <a href="#composite-face" title="composite
   1.222 +    face"><strong>5.2</strong></a>
   1.223 +
   1.224     <li>condensed, <a href="#condensed"
   1.225      title=condensed><strong>3.3</strong></a>
   1.226  
   1.227 @@ -6401,6 +6440,9 @@
   1.228     <li>discretionary-ligatures, <a href="#discretionary-ligatures"
   1.229      title=discretionary-ligatures><strong>6.4</strong></a>
   1.230  
   1.231 +   <li>effective character map, <a href="#effective-character-map"
   1.232 +    title="effective character map"><strong>4.5</strong></a>
   1.233 +
   1.234     <li>expanded, <a href="#expanded" title=expanded><strong>3.3</strong></a>
   1.235  
   1.236     <li>extra-condensed, <a href="#extra-condensed"

mercurial