Skip to content

Commit 38e5dcd

Browse files
committed
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%403000
1 parent 792d29e commit 38e5dcd

1 file changed

Lines changed: 44 additions & 28 deletions

File tree

css2/fonts.src

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
22
<html lang="en">
3-
<!-- $Id: fonts.src,v 2.98 2010-04-19 16:12:36 bbos Exp $ -->
3+
<!-- $Id: fonts.src,v 2.99 2010-07-19 18:59:31 bbos Exp $ -->
44
<head>
55
<title>Fonts</title>
66
<meta name="editor" lang="tr" content="Tantek &Ccedil;elik">
@@ -45,7 +45,7 @@ presented to each of them).
4545
<ol>
4646

4747
<li>The User Agent makes (or accesses) a database of relevant CSS&nbsp;2.1
48-
properties of all the fonts of which the UA is aware.
48+
properties of all the fonts of which the UA is aware.
4949
If there are two fonts with exactly the same properties, the user
5050
agent selects one of them.
5151
</li>
@@ -94,7 +94,7 @@ Otherwise the values must be matched exactly or font-style will fail.
9494
font labeled as 'small-caps', (2) a font in which the small caps are
9595
synthesized, or (3) a font where all lowercase letters are replaced by
9696
upper case letters. A small-caps font may be synthesized by
97-
electronically scaling uppercase letters from a normal font.
97+
electronically scaling uppercase letters from a normal font.
9898
'normal' matches a font's normal (non-small-caps) variant. A font cannot fail to have a normal variant. A font
9999
that is only available as small-caps shall be selectable as either a 'normal' face or a 'small-caps' face.
100100
</li>
@@ -105,7 +105,7 @@ never fail. (See 'font-weight' below.)
105105
UA-dependent margin of tolerance. (Typically, sizes for scalable fonts
106106
are rounded to the nearest whole pixel, while the tolerance for
107107
bitmapped fonts could be as large as 20%.) Further computations, e.g.,
108-
by 'em' values in other properties, are based on
108+
by 'em' values in other properties, are based on
109109
the computed value of 'font-size'.
110110
</li>
111111

@@ -166,23 +166,39 @@ as a last alternative. Generic font family names are keywords and must NOT be q
166166
</dd>
167167
</dl>
168168

169-
<p>If an unquoted font family name contains
170-
parentheses, brackets, and/or braces, they must still be
171-
escaped per CSS grammar rules. Similarly, quotation marks (both single and double), semicolons,
172-
exclamation marks, commas, and leading slashes within unquoted font family names must be escaped.
173-
Font names containing any such characters or white space should be quoted:
174-
</p>
169+
<p>Font family names must either be given quoted as <a
170+
href="syndata.html#strings">strings,</a> or unquoted as a sequence of
171+
one or more <a
172+
href="syndata.html#value-def-identifier">identifiers.</a> This means
173+
most punctuation characters and digits at the start of each token must
174+
be escaped in unquoted font family names.
175+
176+
<p>For example, the following declarations are invalid:
177+
178+
<pre>
179+
font-family: Red/Black, sans-serif;
180+
font-family: "Lucida" Grande, sans-serif;
181+
font-family: Ahem!, sans-serif;
182+
font-family: test@foo, sans-serif;
183+
font-family: #POUND, sans-serif;
184+
font-family: Hawaii 5-0, sans-serif;
185+
</pre>
186+
187+
<p>If a sequence of identifiers is given as a font family name, the
188+
computed value is the name converted to a string by joining all the
189+
identifiers in the sequence by single spaces.
190+
191+
<p>To avoid mistakes in escaping, it is recommended to quote font
192+
family names that contain white space, digits, or punctuation
193+
characters other than hyphens:
175194

176195
<pre>
177196
body { font-family: "New Century Schoolbook", serif }
178-
179-
&lt;BODY STYLE="font-family: 'My own font', fantasy"&gt;
197+
198+
&lt;BODY STYLE="font-family: '21st Century', fantasy">
180199
</pre>
181200

182-
<p>If quoting is omitted, any white space characters before and after
183-
the font name are ignored and any sequence of white space characters
184-
inside the font name is converted to a single space.
185-
Font family <em>names</em> that happen to be the same as a keyword
201+
<p>Font family <em>names</em> that happen to be the same as a keyword
186202
value ('inherit', 'serif', 'sans-serif', 'monospace', 'fantasy', and
187203
'cursive') must be quoted to prevent confusion with the keywords with
188204
the same names. The keywords 'initial' and 'default' are reserved for
@@ -389,7 +405,7 @@ characters. As a last resort, uppercase letters will be used as
389405
replacement for a small-caps font.
390406
</p>
391407
<p>The following example results in an 'H3' element in small-caps,
392-
with any emphasized words in oblique, and any emphasized words within
408+
with any emphasized words in oblique, and any emphasized words within
393409
an 'H3' oblique small-caps:
394410
</p>
395411
<pre>
@@ -434,7 +450,7 @@ strong { font-weight: bolder }
434450
values are names that are descriptive of the "weight" of a font. There
435451
is no accepted, universal meaning to these weight names. Their primary
436452
role is to distinguish faces of differing darkness within a single
437-
font family. Usage across font families is quite variant; for example,
453+
font family. Usage across font families is quite variant; for example,
438454
a font that one might think of as being bold might be described as
439455
being <em>Regular, Roman, Book, Medium, Semi-</em> or <em>DemiBold,
440456
Bold,</em> or <em>Black,</em> depending on how black the "normal" face
@@ -577,8 +593,8 @@ have the following meanings:</p>
577593
<dd>An &lt;absolute-size&gt; keyword is an index to a table of font
578594
sizes computed and kept by the UA. Possible values are:
579595
<p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
580-
<p>The following table provides user agent guidelines for the absolute-size
581-
mapping to HTML heading and absolute font-sizes. The 'medium' value is
596+
<p>The following table provides user agent guidelines for the absolute-size
597+
mapping to HTML heading and absolute font-sizes. The 'medium' value is
582598
the user's preferred font size and is used as the reference middle value.</p>
583599

584600
<table border="1" style="border-collapse: collapse" width="73%" id="AutoNumber2">
@@ -616,10 +632,10 @@ computing the table. The table may be different from one font family
616632
to another.
617633
</p>
618634

619-
<p class="note"><em><strong>Note 1.</strong> To preserve readability, a UA applying
635+
<p class="note"><em><strong>Note 1.</strong> To preserve readability, a UA applying
620636
these guidelines should nevertheless avoid creating font-size resulting
621637
in less than 9 pixels per EM unit on a computer display.</em></p>
622-
638+
623639
<p class="note"><em><strong>Note 2.</strong> In CSS1, the suggested
624640
scaling factor between adjacent indexes was 1.5, which user experience
625641
proved to be too large. In CSS2, the suggested scaling factor for a
@@ -688,10 +704,10 @@ sheet. The syntax of this property is based on a traditional
688704
typographical shorthand notation to set multiple properties related to
689705
fonts.
690706
</p>
691-
<p>All font-related properties are first reset to their initial values,
692-
including those listed in the preceding paragraph.
693-
Then, those properties that are given explicit values in the
694-
<span class="propinst-font">'font'</span> shorthand are set to those values.
707+
<p>All font-related properties are first reset to their initial values,
708+
including those listed in the preceding paragraph.
709+
Then, those properties that are given explicit values in the
710+
<span class="propinst-font">'font'</span> shorthand are set to those values.
695711
For a definition of allowed and initial values, see the previously defined properties.
696712
</p>
697713
<pre>
@@ -737,7 +753,7 @@ fonts">system fonts</span>:</p>
737753
</dl>
738754

739755
<p>System fonts may only be set as a whole; that is, the font
740-
family, size, weight, style, etc. are all set at the same time.
756+
family, size, weight, style, etc. are all set at the same time.
741757
These values may then be altered individually if desired. If no
742758
font with the indicated characteristics exists on a given platform,
743759
the user agent should either intelligently substitute (e.g., a smaller
@@ -781,7 +797,7 @@ button p {
781797
font-weight: 600;
782798
font-size: 9px;
783799
line-height: normal;
784-
}
800+
}
785801
</pre>
786802

787803
</div>

0 commit comments

Comments
 (0)