[css-fonts] more editorial revisions

Mon, 20 May 2013 17:48:43 +0800

author
John Daggett <jdaggett@mozilla.com>
date
Mon, 20 May 2013 17:48:43 +0800
changeset 8198
d4d9fa6daec2
parent 8197
1e26e4454f98
child 8199
3e11e7e6517b

[css-fonts] more editorial revisions

css-fonts/Fonts.html file | annotate | diff | comparison | revisions
     1.1 --- a/css-fonts/Fonts.html	Mon May 20 16:31:55 2013 +0800
     1.2 +++ b/css-fonts/Fonts.html	Mon May 20 17:48:43 2013 +0800
     1.3 @@ -2066,18 +2066,19 @@
     1.4     <code>@font-face</code> rule</h3>
     1.5  
     1.6    <p>The <code>@font-face</code> rule allows for linking to fonts that are
     1.7 -   automatically activated when needed. This allows authors to select a font
     1.8 -   that closely matches the design goals for a given page rather than
     1.9 -   limiting the font choice to a set of fonts available on all platforms. A
    1.10 -   set of font descriptors define the location of a font resource, either
    1.11 -   locally or externally, along with the style characteristics of an
    1.12 -   individual face. Multiple <code>@font-face</code> rules can be used to
    1.13 -   construct font families with a variety of faces. Using CSS font matching
    1.14 -   rules, a user agent can selectively download only those faces that are
    1.15 -   needed for a given piece of text.
    1.16 -
    1.17 -  <p>In terms of the grammar, this specification defines the following
    1.18 -   productions:
    1.19 +   automatically fetched and activated when needed. This allows authors to
    1.20 +   select a font that closely matches the design goals for a given page
    1.21 +   rather than limiting the font choice to a set of fonts available on all
    1.22 +   platforms. A set of font descriptors define the location of a font
    1.23 +   resource, either locally or externally, along with the style
    1.24 +   characteristics of an individual face. Multiple <code>@font-face</code>
    1.25 +   rules can be used to construct font families with a variety of faces.
    1.26 +   Using CSS font matching rules, a user agent can selectively download only
    1.27 +   those faces that are needed for a given piece of text.
    1.28 +
    1.29 +  <p>The @font-face rule consists of the @font-face at-keyword followed by a
    1.30 +   block of descriptor declarations. In terms of the grammar, this
    1.31 +   specification defines the following productions:
    1.32  
    1.33    <pre><dfn id=fontfacerule>font_face_rule</dfn>
    1.34    : FONT_FACE_SYM S* '{' S* descriptor_declaration? [ ';' S* descriptor_declaration? ]* '}' S*
    1.35 @@ -2105,8 +2106,9 @@
    1.36     and do not apply to document language elements. There is no notion of
    1.37     which elements the descriptors apply to or whether the values are
    1.38     inherited by child elements. When a given descriptor occurs multiple times
    1.39 -   in a given <code>@font-face</code> rule, only the last specified value is
    1.40 -   used, all prior values for that descriptor are ignored.
    1.41 +   in a given <code>@font-face</code> rule, only the last descriptor
    1.42 +   declaration is used and all prior declarations for that descriptor are
    1.43 +   ignored.
    1.44  
    1.45    <div class=example>
    1.46     <p>To use a downloadable font called Gentium:</p>
    1.47 @@ -2126,30 +2128,27 @@
    1.48    </div>
    1.49  
    1.50    <p>A given set of <code>@font-face</code> rules define a set of fonts
    1.51 -   available to containing documents. Multiple rules can be used to define a
    1.52 -   family with a large set of faces. When font matching is done fonts defined
    1.53 -   using these rules are considered before other available fonts on a system.
    1.54 -   
    1.55 -
    1.56 -  <p>Downloaded fonts are only available to documents that reference them,
    1.57 -   the process of activating these fonts should not make them available to
    1.58 +   available for use within the documents that contain these rules. When font
    1.59 +   matching is done, fonts defined using these rules are considered before
    1.60 +   other available fonts on a system.
    1.61 +
    1.62 +  <p>Downloaded fonts are only available to documents that reference them.
    1.63 +   The process of activating these fonts must not make them available to
    1.64     other applications or to documents that don't directly link to the same
    1.65     font. User agent implementers might consider it convenient to use
    1.66     downloaded fonts when rendering characters in other documents for which no
    1.67     other available font exists as part of the system font fallback procedure.
    1.68 -   This would cause a security leak since the contents of one page would be
    1.69 -   able to affect other pages, something an attacker could use as an attack
    1.70 -   vector. These restrictions do not affect caching behavior, fonts are
    1.71 -   cached the same way other web resources are cached.
    1.72 -
    1.73 -  <p>User agents which do not understand the <code>@font-face</code> rule
    1.74 -   encounter the opening curly bracket and ignore forward until the closing
    1.75 -   curly bracket. This at-rule conforms with the forward-compatible parsing
    1.76 -   requirement of CSS, parsers may ignore these rules without error. Any
    1.77 -   descriptors that are not recognized or implemented by a given user agent
    1.78 -   must be ignored. <code>@font-face</code> rules require a font-family and
    1.79 -   src descriptor, if either of these are missing the <code>@font-face</code>
    1.80 -   must be ignored.
    1.81 +   However, this would cause a security leak since the contents of one page
    1.82 +   would be able to affect other pages, something an attacker could use as an
    1.83 +   attack vector. These restrictions do not affect caching behavior, fonts
    1.84 +   are cached the same way other web resources are cached.
    1.85 +
    1.86 +  <p>This at-rule follows the forward-compatible parsing rules of CSS. Like
    1.87 +   properties in a declaration block, declarations of any descriptors that
    1.88 +   are not supported by the user agent must be ignored.
    1.89 +   <code>@font-face</code> rules require a font-family and src descriptor; if
    1.90 +   either of these are missing, the <code>@font-face</code> rule is invalid
    1.91 +   and must be ignored entirely.
    1.92  
    1.93    <p>In cases where user agents have limited platform resources or implement
    1.94     the ability to disable downloadable font resources,
    1.95 @@ -2179,15 +2178,14 @@
    1.96    </table>
    1.97  
    1.98    <p>This descriptor defines the font family name that will be used in all
    1.99 -   CSS font family name matching, overriding font family names contained in
   1.100 -   the underlying font data. If the font family name is the same as a font
   1.101 -   family available in a given user's environment, it effectively hides the
   1.102 -   underlying font for documents that use the stylesheet. This permits a web
   1.103 -   author to freely choose font-family names without worrying about conflicts
   1.104 -   with font family names present in a given user's environment. Errors
   1.105 -   loading font data do not affect font name matching behavior. User agents
   1.106 -   that apply platform font aliasing rules to font family names defined via
   1.107 -   <code>@font-face</code> rules are considered non-conformant.
   1.108 +   CSS font family name matching. It is required for the @font-face rule to
   1.109 +   be valid. It overrides the font family names contained in the underlying
   1.110 +   font data. If the font family name is the same as a font family available
   1.111 +   in a given user's environment, it effectively hides the underlying font
   1.112 +   for documents that use the stylesheet. This permits a web author to freely
   1.113 +   choose font-family names without worrying about conflicts with font family
   1.114 +   names present in a given user's environment. Likewise, platform
   1.115 +   substitutions for a given font family name must not be used.
   1.116  
   1.117    <h3 id=src-desc><span class=secno>4.3 </span>Font reference: the <a
   1.118     href="#descdef-src">src</a> descriptor</h3>
   1.119 @@ -2202,7 +2200,7 @@
   1.120      <tr>
   1.121       <td>Value:
   1.122  
   1.123 -     <td>[ &lt;uri> [format(&lt;string>#)]? | &lt;font-face-name> ]#
   1.124 +     <td>[ &lt;url> [format(&lt;string>#)]? | &lt;font-face-name> ]#
   1.125  
   1.126      <tr>
   1.127       <td><em>Initial:</em>
   1.128 @@ -2211,15 +2209,14 @@
   1.129    </table>
   1.130  
   1.131    <p>This descriptor specifies the resource containing font data. It is
   1.132 -   required, whether the font is downloadable or locally installed. Its value
   1.133 -   is a prioritized, comma-separated list of external references or locally
   1.134 +   required for the <code>@font-face</code> rule to be valid. Its value is a
   1.135 +   prioritized, comma-separated list of external references or locally
   1.136     installed font face names. When a font is needed the user agent iterates
   1.137     over the set of references listed, using the first one it can successfully
   1.138     activate. Fonts containing invalid data or local font faces that are not
   1.139 -   found are ignored and the user agent loads the next font in the list
   1.140 -   (platform substitutions for a given font must not be used).
   1.141 -
   1.142 -  <p>As with other URIs in CSS, the URI may be partial, in which case it is
   1.143 +   found are ignored and the user agent loads the next font in the list.
   1.144 +
   1.145 +  <p>As with other URLs in CSS, the URL may be partial, in which case it is
   1.146     resolved relative to the location of the style sheet containing the <span
   1.147     class=index-inst id=font-face0
   1.148     title="@font-face"><code>@font-face</code></span> rule. In the case of SVG
   1.149 @@ -2239,8 +2236,8 @@
   1.150  src: url(fonts.svg#simple);   /* load SVG font with id 'simple' */
   1.151  </pre>
   1.152  
   1.153 -  <p>External references consist of a URI, followed by an optional hint
   1.154 -   describing the format of the font resource referenced by that URI. The
   1.155 +  <p>External references consist of a URL, followed by an optional hint
   1.156 +   describing the format of the font resource referenced by that URL. The
   1.157     format hint contains a comma-separated list of format strings that denote
   1.158     well-known font formats. Conformant user agents must skip downloading a
   1.159     font resource if the format hints indicate only unsupported or unknown
   1.160 @@ -2316,13 +2313,13 @@
   1.161     this).
   1.162  
   1.163    <p>When authors would prefer to use a locally available copy of a given
   1.164 -   font and download it if it's not, local() can be used. The locally
   1.165 -   installed <span class=index-def id=ltfont-face-namegt
   1.166 +   font and download it if it's not, <code>local()</code> can be used. The
   1.167 +   locally-installed <span class=index-def id=ltfont-face-namegt
   1.168     title="&lt;font-face-name&gt;"><a
   1.169 -   name=value-def-font-face-name>&lt;font-face-name&gt;</a></span> is a
   1.170 -   format-specific string that uniquely identifies a single font face within
   1.171 -   a larger family. The syntax for a &lt;font-face-name&gt; is a unique font
   1.172 -   face name enclosed by "local(" and ")".
   1.173 +   name=value-def-font-face-name>&lt;font-face-name&gt;</a></span> argument
   1.174 +   is a format-specific string that uniquely identifies a single font face
   1.175 +   within a larger family. The syntax for a &lt;font-face-name&gt; is a
   1.176 +   unique font face name enclosed by "local(" and ")".
   1.177  
   1.178    <pre>
   1.179  /* regular face of Gentium */
   1.180 @@ -2337,7 +2334,8 @@
   1.181     fonts, this string is used to match only the Postscript name or the full
   1.182     font name in the name table of locally available fonts. Which is used
   1.183     varies by platform and font, so authors should include both of these names
   1.184 -   to assure proper matching across platforms.
   1.185 +   to assure proper matching across platforms. Platform substitutions for a
   1.186 +   given font name must not be used.
   1.187  
   1.188    <pre>
   1.189  /* bold face of Gentium */
   1.190 @@ -2351,9 +2349,10 @@
   1.191  </pre>
   1.192  
   1.193    <p>Just as a <code>@font-face</code> rule specifies the characteristics of
   1.194 -   a single font within a family, the unique name used with local() specifies
   1.195 -   a single font, not an entire font family. Defined in terms of OpenType
   1.196 -   font data, the Postscript name is found in the font's <a
   1.197 +   a single font within a family, the unique name used with
   1.198 +   <code>local()</code> specifies a single font, not an entire font family.
   1.199 +   Defined in terms of OpenType font data, the Postscript name is found in
   1.200 +   the font's <a
   1.201     href="http://www.microsoft.com/typography/otspec/name.htm">name table</a>,
   1.202     in the name record with nameID = 6 (see <a href="#OPENTYPE"
   1.203     rel=biblioentry>[OPENTYPE]<!--{{!OPENTYPE}}--></a> for more details). The
   1.204 @@ -2409,10 +2408,9 @@
   1.205  }
   1.206  </pre>
   1.207  
   1.208 -   <p>Since localized fullnames should never match, a document with the
   1.209 -    header style rules below would always render using the default serif
   1.210 -    font, regardless whether a particular system locale parameter is set to
   1.211 -    Finnish or not:</p>
   1.212 +   <p>Since localized fullnames never match, a document with the header style
   1.213 +    rules below would always render using the default serif font, regardless
   1.214 +    whether a particular system locale parameter is set to Finnish or not:</p>
   1.215  
   1.216     <pre>
   1.217  @font-face {
   1.218 @@ -2424,7 +2422,7 @@
   1.219  h2 { font-family: SectionHeader, serif; }
   1.220  </pre>
   1.221  
   1.222 -   <p>A conformant user agent should never load the font ‘<code
   1.223 +   <p>A conformant user agent would never load the font ‘<code
   1.224      class=css>gentium.eot</code>’ in the example below, since it is
   1.225      included in the first definition of the ‘<a href="#descdef-src"><code
   1.226      class=property>src</code></a>’ descriptor which is overridden by the
   1.227 @@ -5183,9 +5181,9 @@
   1.228  
   1.229    <div class=example>
   1.230     <p>The <code>@font-face</code> rule can also be used to access font
   1.231 -    features in locally available fonts via the use of local() in the ‘<a
   1.232 -    href="#descdef-src"><code class=property>src</code></a>’ descriptor of
   1.233 -    the <code>@font-face</code> definition:</p>
   1.234 +    features in locally available fonts via the use of <code>local()</code>
   1.235 +    in the ‘<a href="#descdef-src"><code class=property>src</code></a>’
   1.236 +    descriptor of the <code>@font-face</code> definition:</p>
   1.237  
   1.238     <pre>@font-face {
   1.239    font-family: BodyText;
   1.240 @@ -6535,7 +6533,7 @@
   1.241      <tr>
   1.242       <th><a class=property href="#descdef-src">src</a>
   1.243  
   1.244 -     <td>[ &lt;uri> [format(&lt;string>#)]? | &lt;font-face-name> ]#
   1.245 +     <td>[ &lt;url> [format(&lt;string>#)]? | &lt;font-face-name> ]#
   1.246  
   1.247       <td>N/A
   1.248  

mercurial