Skip to content

Commit d877d0b

Browse files
committed
[css2] Tantek's proposed additional text.
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402006
1 parent 86bd24d commit d877d0b

1 file changed

Lines changed: 75 additions & 68 deletions

File tree

css2/fonts.src

Lines changed: 75 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
22
"http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
33
<html lang="en">
4-
<!-- $Id: fonts.src,v 2.70 2002-12-17 19:12:27 bbos Exp $ -->
4+
<!-- $Id: fonts.src,v 2.71 2003-01-13 12:30:31 bbos Exp $ -->
55
<head>
66
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
77
<title>Fonts</title>
@@ -165,8 +165,18 @@ as a last alternative. Generic font family names are keywords and must NOT be q
165165
</dd>
166166
</dl>
167167

168+
<ins class="proposed">
169+
<p>If an unquoted font family name contains
170+
parentheses, brackets, and/or braces, they must still be either balanced or
171+
escaped per CSS grammar rules. Similarly, quote marks, semicolons,
172+
exclamation marks and commas within unquoted font family names must be escaped.
173+
Font names containing any such characters or whitespace should be quoted:
174+
</p>
175+
</ins>
176+
<del class="proposed">
168177
<p>Font names containing whitespace should be quoted:
169178
</p>
179+
</del>
170180
<pre>
171181
body { font-family: "New Century Schoolbook", serif }
172182

@@ -193,20 +203,20 @@ labeled 'oblique'. A value of 'italic' selects a font that is labeled
193203
</p>
194204
<p>The font that is labeled 'oblique' in the UA's font database may
195205
actually have been generated by electronically slanting a normal font.
196-
206+
</p>
197207
<p>Fonts with Oblique, Slanted or Incline in their names will
198208
typically be labeled 'oblique' in the UA's font database. Fonts with
199209
<em>Italic, Cursive</em> or <em>Kursiv</em> in their names will
200210
typically be labeled 'italic'.
201-
211+
</p>
202212
<pre>
203213
h1, h2, h3 { font-style: italic }
204214
h1 em { font-style: normal }
205215
</pre>
206216

207217
<p>In the example above, emphasized text within 'H1' will appear in a
208218
normal face.
209-
219+
</p>
210220
<h2><a name="small-caps">Small-caps</a>: the
211221
<span class="propinst-font-variant">'font-variant'</span> property</h2>
212222

@@ -216,18 +226,18 @@ normal face.
216226
In a small-caps font the lower case letters look similar to the
217227
uppercase ones, but in a smaller size and with slightly different
218228
proportions. The 'font-variant' property selects that font.
219-
229+
</p>
220230
<p>A value of 'normal' selects a font that is not a small-caps font,
221231
'small-caps' selects a small-caps font. It is acceptable (but not
222232
required) in CSS&nbsp;2.1 if the small-caps font is a created by taking a
223233
normal font and replacing the lower case letters by scaled uppercase
224234
characters. As a last resort, uppercase letters will be used as
225235
replacement for a small-caps font.
226-
236+
</p>
227237
<p>The following example results in an 'H3' element in small-caps,
228238
with any emphasized words in oblique, and any emphasized words within
229239
an 'H3' oblique small-caps:
230-
240+
</p>
231241
<pre>
232242
h3 { font-variant: small-caps }
233243
em { font-style: oblique }
@@ -236,11 +246,11 @@ em { font-style: oblique }
236246
<p>There may be other variants in the font family as well, such as
237247
fonts with old-style numerals, small-caps numerals, condensed or
238248
expanded letters, etc. CSS&nbsp;2.1 has no properties that select those.
239-
249+
</p>
240250
<p><em>Note:</em> insofar as this property causes text to be
241251
transformed to uppercase, the same considerations as for <a
242252
href="#text-transform">'text-transform'</a> apply.
243-
253+
</p>
244254
<h2><a name="font-boldness">Font boldness</a>: the
245255
<span class="propinst-font-weight">'font-weight'</span> property</h2>
246256

@@ -253,21 +263,21 @@ keyword 'normal' is synonymous with '400', and 'bold' is synonymous
253263
with '700'. Keywords other than 'normal' and 'bold' have been shown to
254264
be often confused with font names and a numerical scale was therefore
255265
chosen for the 9-value list.
256-
266+
</p>
257267
<pre>
258268
p { font-weight: normal } /* 400 */
259269
h1 { font-weight: 700 } /* bold */
260270
</pre>
261271

262272
<p>The 'bolder' and 'lighter' values select font weights that are
263273
relative to the weight inherited from the parent:
264-
274+
</p>
265275
<pre>
266276
strong { font-weight: bolder }
267277
</pre>
268278

269279
<p>Child elements inherit the resultant weight, not the keyword value.
270-
280+
</p>
271281
<p>Fonts (the font data) typically have one or more properties whose
272282
values are names that are descriptive of the "weight" of a font. There
273283
is no accepted, universal meaning to these weight names. Their primary
@@ -282,24 +292,23 @@ scale in which the value '400' (or 'normal') corresponds to the
282292
"normal" text face for that family. The weight name associated with
283293
that face will typically be <em>Book, Regular, Roman, Normal</em> or
284294
sometimes <em>Medium</em>.
285-
295+
</p>
286296
<p>The association of other weights within a family to the numerical
287297
weight values is intended only to preserve the ordering of darkness
288298
within that family. However, the following heuristics tell how the
289299
assignment is done in typical cases:
290-
300+
</p>
291301
<ul>
292-
293302
<li>If the font family already uses a numerical scale with nine values
294303
(like e.g. <em>OpenType</em> does), the font weights should be mapped
295304
directly.
296-
305+
</li>
297306
<li>If there is both a face labeled <em>Medium</em> and one labeled
298307
<em>Book, Regular, Roman</em> or <em>Normal,</em> then the
299308
<em>Medium</em> is normally assigned to the '500'.
300-
309+
</li>
301310
<li>The font labeled "Bold" will often correspond to the weight value '700'.
302-
311+
</li>
303312
<li>If there are fewer then 9 weights in the family, the default
304313
algorithm for filling the "holes" is as follows. If '500' is
305314
unassigned, it will be assigned the same font as '400'. If any of the
@@ -308,7 +317,7 @@ assigned to the same face as the next darker assigned keyword, if any,
308317
or the next lighter one otherwise. If any of '300', '200' or '100'
309318
remains unassigned, it is assigned to the next lighter assigned
310319
keyword, if any, or the next darker otherwise.
311-
320+
</li>
312321
</ul>
313322

314323
<p>The following two examples show typical mappings.</p>
@@ -320,12 +329,12 @@ darkest: <em>Regular, Medium, Bold, Heavy.</em></p>
320329
<caption>First example of font-weight mapping</caption>
321330
<!-- rattlesnake, ostrich and more at the Austin meeting -->
322331
<thead>
323-
<tr><th>Available faces <th>Assignments <th>Filling the holes
332+
<tr><th>Available faces </th><th>Assignments </th><th>Filling the holes</th></tr>
324333
</thead>
325-
<tr><td>"Rattlesnake Regular" <td> 400 <td> 100, 200, 300
326-
<tr><td>"Rattlesnake Medium" <td> 500 <td>&nbsp;
327-
<tr><td>"Rattlesnake Bold" <td> 700 <td> 600
328-
<tr><td>"Rattlesnake Heavy" <td> 800 <td> 900
334+
<tr><td>"Rattlesnake Regular"</td><td> 400 </td><td> 100, 200, 300</td></tr>
335+
<tr><td>"Rattlesnake Medium" </td><td> 500 </td><td>&nbsp;</td></tr>
336+
<tr><td>"Rattlesnake Bold" </td><td> 700 </td><td> 600</td></tr>
337+
<tr><td>"Rattlesnake Heavy" </td><td> 800 </td><td> 900</td></tr>
329338
</table>
330339
</div>
331340

@@ -340,14 +349,14 @@ value to "Ice Prawn ExtraBlack".</p>
340349
that ExtraBlack is not mapped to a value.">
341350
<caption>Second example of font-weight mapping</caption>
342351
<thead>
343-
<tr><th>Available faces <th>Assignments <th>Filling the holes
352+
<tr><th>Available faces </th><th>Assignments </th><th>Filling the holes</th></tr>
344353
</thead>
345-
<tr><td>"Ice Prawn Book" <td> 400 <td> 100, 200, 300
346-
<tr><td>"Ice Prawn Medium" <td> 500 <td>&nbsp;
347-
<tr><td>"Ice Prawn Bold" <td> 700 <td> 600
348-
<tr><td>"Ice Prawn Heavy" <td> 800 <td>&nbsp;
349-
<tr><td>"Ice Prawn Black" <td> 900 <td>&nbsp;
350-
<tr><td>"Ice Prawn ExtraBlack" <td> (none) <td>&nbsp;
354+
<tr><td>"Ice Prawn Book" </td><td> 400 </td><td> 100, 200, 300</td></tr>
355+
<tr><td>"Ice Prawn Medium"</td><td> 500 </td><td>&nbsp;</td></tr>
356+
<tr><td>"Ice Prawn Bold" </td><td> 700 </td><td> 600</td></tr>
357+
<tr><td>"Ice Prawn Heavy" </td><td> 800 </td><td>&nbsp;</td></tr>
358+
<tr><td>"Ice Prawn Black" </td><td> 900 </td><td>&nbsp;</td></tr>
359+
<tr><td>"Ice Prawn ExtraBlack"</td><td> (none) </td><td>&nbsp;</td></tr>
351360
</table>
352361
</div>
353362

@@ -359,20 +368,19 @@ the matching of 'bolder' is to the next darker face available on the
359368
client within the family and the matching of 'lighter' is to the next
360369
lighter face within the family. To be precise, the meaning of the
361370
relative keywords 'bolder' and 'lighter' is as follows:
362-
371+
</p>
363372
<ul>
364-
365373
<li>'bolder' selects the next weight that is assigned to a font that
366374
is darker than the inherited one. If there is no such weight, it
367375
simply results in the next darker numerical value (and the font
368376
remains unchanged), unless the inherited value was '900' in which case
369377
the resulting weight is also '900'.
370-
378+
</li>
371379
<li>'lighter' is similar, but works in the opposite direction: it
372380
selects the next lighter keyword with a different font from the
373381
inherited one, unless there is no such font, in which case it selects
374382
the next lighter numerical value (and keeps the font unchanged).
375-
383+
</li>
376384
</ul>
377385

378386
<p>There is no guarantee that there will be a darker face for each of
@@ -381,7 +389,7 @@ normal and a bold face, while others may have eight face weights.
381389
There is no guarantee on how a UA will map font faces within a family
382390
to weight values. The only guarantee is that a face of a given value
383391
will be no less dark than the faces of lighter values.
384-
392+
</p>
385393
<h2><a name="font-size-props">Font size</a>: the <span
386394
class="propinst-font-size">'font-size'</span>
387395
property</h2>
@@ -394,10 +402,10 @@ have the following meanings:</p>
394402

395403
<dl>
396404
<dt><b><a name="value-def-absolute-size">&lt;absolute-size&gt;</a></b>
397-
405+
</dt>
398406
<dd>An &lt;absolute-size&gt; keyword is an index to a table of font
399407
sizes computed and kept by the UA. Possible values are:
400-
<p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]
408+
<p> [ xx-small | x-small | small | medium | large | x-large | xx-large ]</p>
401409
<p>The following table provides user agent guidelines for the absolute-size
402410
scaling factor and their mapping to HTML heading and absolute font-sizes. The
403411
'medium' value is used as the reference middle value. The user agent may fine
@@ -468,9 +476,9 @@ screen between adjacent indexes was 1.2 which still created issues for the small
468476
sizes. The new scaling factor varies between each index to provide better
469477
readability.</em></p>
470478

471-
479+
</dd>
472480
<dt><b><a name="value-def-relative-size">&lt;relative-size&gt;</a></b>
473-
481+
</dt>
474482
<dd>A &lt;relative-size&gt; keyword is interpreted relative to the
475483
table of font sizes and the font size of the parent element. Possible
476484
values are: [ larger | smaller ]. For example, if the parent element
@@ -480,24 +488,24 @@ is not close to a table entry, the UA is free to interpolate between
480488
table entries or round off to the closest one. The UA may have to
481489
extrapolate table values if the numerical value goes beyond the
482490
keywords.
483-
491+
</dd>
484492
</dl>
485493

486494
<p>Length and percentage values should not take the font size table
487495
into account when calculating the font size of the element.
488-
496+
</p>
489497
<p>Negative values are not allowed.
490-
498+
</p>
491499
<p>On all other properties, 'em' and 'ex' length values refer to the
492500
computed font size of the current element. On the 'font-size' property, these
493501
length units refer to the computed font size of the parent element.
494-
502+
</p>
495503
<p>Note that an application may reinterpret an explicit size,
496504
depending on the context. E.g., inside a VR scene a font may get a
497505
different size because of perspective distortion.
498-
506+
</p>
499507
<p>Examples:
500-
508+
</p>
501509
<pre>
502510
p { font-size: 16px; }
503511
@media print {
@@ -525,13 +533,13 @@ setting
525533
sheet. The syntax of this property is based on a traditional
526534
typographical shorthand notation to set multiple properties related to
527535
fonts.
528-
536+
</p>
529537
<p>All font-related properties are first reset to their initial values,
530538
including those listed in the preceding paragraph.
531539
Then, those properties that are given explicit values in the
532540
<span class="propinst-font">'font'</span> shorthand are set to those values.
533541
For a definition of allowed and initial values, see the previously defined properties.
534-
542+
</p>
535543
<pre>
536544
p { font: 12px/14px sans-serif }
537545
p { font: 80% sans-serif }
@@ -543,35 +551,35 @@ p { font: normal small-caps 120%/120% fantasy }
543551
<p>In the second rule, the font size percentage value ('80%') refers
544552
to the font size of the parent element. In the third rule, the line
545553
height percentage refers to the font size of the element itself.
546-
554+
</p>
547555
<p>In the first three rules above, the 'font-style', 'font-variant'
548556
and 'font-weight' are not explicitly mentioned, which means they are
549557
all three set to their initial value ('normal'). The fourth rule sets
550558
the 'font-weight' to 'bold', the 'font-style' to 'italic' and
551559
implicitly sets 'font-variant' to 'normal'.
552-
560+
</p>
553561
<p>The fifth rule sets the 'font-variant' ('small-caps'), the
554562
'font-size' (120% of the parent's font), the 'line-height' (120% times
555563
the font size) and the 'font-family' ('fantasy'). It follows that the
556564
keyword 'normal' applies to the two remaining properties: 'font-style'
557565
and 'font-weight'.
558-
566+
</p>
559567
<p>The following values refer to <span class="index-def" title="system
560568
fonts">system fonts</span>:</p>
561569

562570
<dl>
563-
<dt>caption
564-
<dd>The font used for captioned controls (e.g., buttons, drop-downs, etc.).
565-
<dt>icon
566-
<dd>The font used to label icons.
567-
<dt>menu
568-
<dd>The font used in menus (e.g., dropdown menus and menu lists).
569-
<dt>message-box
570-
<dd>The font used in dialog boxes.
571-
<dt>small-caption
572-
<dd>The font used for labeling small controls.
573-
<dt>status-bar
574-
<dd>The font used in window status bars.
571+
<dt>caption</dt>
572+
<dd>The font used for captioned controls (e.g., buttons, drop-downs, etc.).</dd>
573+
<dt>icon</dt>
574+
<dd>The font used to label icons.</dd>
575+
<dt>menu</dt>
576+
<dd>The font used in menus (e.g., dropdown menus and menu lists).</dd>
577+
<dt>message-box</dt>
578+
<dd>The font used in dialog boxes.</dd>
579+
<dt>small-caption</dt>
580+
<dd>The font used for labeling small controls.</dd>
581+
<dt>status-bar</dt>
582+
<dd>The font used in window status bars.</dd>
575583
</dl>
576584

577585
<p>System fonts may only be set as a whole; that is, the font
@@ -584,15 +592,14 @@ font), or substitute a user agent default font. As for regular fonts,
584592
if, for a system font, any of the individual properties are not part
585593
of the operating system's available user preferences, those properties
586594
should be set to their initial values.
587-
595+
</p>
588596
<p id="almost">That is why this property is "almost" a shorthand property: system
589597
fonts can only be specified with this property, not with <span
590598
class="propinst-font-family">'font-family'</span> itself, so <span
591599
class="propinst-font">'font'</span> allows authors to do more than the
592600
sum of its subproperties. However, the individual properties such as <span class="propinst-font-weight">'font-weight'</span> are still given values taken from the system font, which can be independently varied.</p>
593601

594-
<div class="example"><p>
595-
602+
<div class="example">
596603
<pre>
597604
button { font: 300 italic 1.3em/1.7em "FB Armada", sans-serif }
598605
button p { font: menu }
@@ -603,15 +610,15 @@ button p em { font-weight: bolder }
603610
happened to be, for example, 9-point Charcoal, with a weight of 600, then P
604611
elements that were descendants of BUTTON would be displayed as if
605612
this rule were in effect:
606-
613+
</p>
607614
<pre>
608615
button p { font: 600 9px Charcoal }
609616
</pre>
610617

611618
<p>Because the <span class="propinst-font">'font'</span> shorthand
612619
property resets any property not explicitly given a value
613620
to its initial value, this has the same effect as this declaration:
614-
621+
</p>
615622
<pre>
616623
button p {
617624
font-family: Charcoal;

0 commit comments

Comments
 (0)