forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFonts.html
More file actions
3203 lines (2383 loc) · 107 KB
/
Copy pathFonts.html
File metadata and controls
3203 lines (2383 loc) · 107 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head><meta content="text/html;charset=utf-8" http-equiv=Content-Type>
<title>CSS Fonts Level 3</title>
<!--
FIXME when publishing: copy the current default.css and link to
"default.css" rather than "../default.css"
-->
<link href="../default.css" rel=stylesheet type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<style type="text/css">
body {
padding: 2em 70px 2em 70px;
}
p + p, p.mtb {
margin-top: 0.8em;
text-indent: 0px;
}
#fontformats {
margin-left: 2em;
text-align: left;
}
#fontformats td {
padding-right: 2em;
}
dd {
margin-bottom: 1em;
}
pre {
font-size: 100%;
}
#authors dd {
margin-bottom: 0;
}
</style>
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo--></p>
<h1 id=css-fonts>CSS Fonts Level 3</h1>
<h2 class="no-num no-toc" id=longstatus>Editor's Draft 21 May 2008</h2>
<dl id=authors>
<dt>This version:
<dd><a
href="http://dev.w3.org/csswg/css3-fonts/">http://dev.w3.org/csswg/css3-fonts/</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-fonts/">http://www.w3.org/TR/css3-fonts/</a>
<dt>Editors:
<dd><a href="mailto:jdaggett@mozilla.com">John Daggett (Mozilla)</a>
<dd><a href="mailto:jason.cranfordteague@corp.aol.com">Jason Cranford
Teague (AOL)</a>
<dt>Previous Editors:
<dd><a href="mailto:paulnel@microsoft.com">Paul Nelson (Microsoft)</a>
<dd><a href="mailto:chris@w3.org">Chris Lilley (W3C)</a>
<dd><a href="mailto:marcins@microsoft.com">Marcin Sawicki (Microsoft)</a>
<dd><a href="mailto:michelsu@microsoft.com">Michel Suignard
(Microsoft)</a>
<dd><a href="mailto:szilles@adobe.com">Steve Zilles (Adobe)</a>
<dd><a href="mailto:tantekc@cs.stanford.edu">Tantek Çelik</a>
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2008 <a
href="http://www.w3.org/"><acronym title="World Wide Web
Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
of Technology">MIT</acronym></a>, <a
href="http://www.ercim.org/"><acronym title="European Research Consortium
for Informatics and Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<p class=note style="padding: 20px; background-color: #ddd;">Note: this
spec is still undergoing some major editing, so portions of it may appear
quite incoherent at times. Please wait a month or so before sending out
flames...
<div class=note style="margin-top: 20px;">
<ul></ul>
<p>To do:</p>
<ul>
<li>unicode-range description
<li>font matching algorithm
<li>font matching examples
<li>font-size, font-size-adjust descriptions
<li>font-variant
<li>font shorthand
<li>TrueType/OpenType nitty gritty
<li>make intro more concise and relevant to rest of the spec, point out
specific general problems
<li>illustrations of localized bold, italic names?
<li>tighten up font-weight wording
</ul>
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>[summarize contents and relate to other CSS3 modules]
<h2 class="no-num no-toc" id=status>Status of this document</h2>
<!--begin-status-->
<p>This is a public copy of the editors' draft. It is provided for
discussion only and may change at any moment. Its publication here does
not imply endorsement of its contents by W3C. Don't cite this document
other than as work in progress.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a> (see
<a href="http://www.w3.org/Mail/Request">instructions</a>) is preferred
for discussion of this specification. When sending e-mail, please put the
text “unknown-shortname” in the subject, preferably like this:
“[<!---->unknown-shortname<!---->] <em>…summary of
comment…</em>”
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also includes
instructions for disclosing a patent. An individual who has actual
knowledge of a patent which the individual believes contains <a
href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
W3C Patent Policy</a>.</p>
<!--end-status-->
<h2 class="no-num no-toc" id=contents>Table of contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
<li><a href="#font-properties"><span class=secno>2. </span>Font
properties</a>
<ul class=toc>
<li><a href="#font-family"><span class=secno>2.1 </span>Font family: the
‘<span class=property>font-family</span>’ property</a>
<ul class=toc>
<li><a href="#generic"><span class=secno>2.1.1 </span>Generic font
families</a>
<ul class=toc>
<li><a href="#serif"><span class=secno>2.1.1.1. </span> <span
class=index-def id=serif0 title="serif, definition
of">serif</span></a>
<li><a href="#sans-serif"><span class=secno>2.1.1.2. </span> <span
class=index-def id=sans-serif0 title="sans-serif, definition of">
sans-serif</span></a>
<li><a href="#cursive"><span class=secno>2.1.1.3. </span> <span
class=index-def id=cursive0 title="cursive, definition of">
cursive</span></a>
<li><a href="#fantasy"><span class=secno>2.1.1.4. </span> <span
class=index-def id=fantasy0 title="fantasy, definition of">
fantasy</span></a>
<li><a href="#monospace"><span class=secno>2.1.1.5. </span> <span
class=index-def id=monospace0 title="monospace, definition of">
monospace</span></a>
</ul>
</ul>
<li><a href="#font-weight"><span class=secno>2.2 </span>Font weight: the
‘<span class=property>font-weight</span>’ property</a>
<li><a href="#font-proportion"><span class=secno>2.3 </span>Font
proportion: the ‘<span class=property>font-stretch</span>’
property</a>
<li><a href="#font-style"><span class=secno>2.4 </span>Font style: the
‘<span class=property>font-style</span>’ property</a>
<li><a href="#small"><span class=secno>2.5 </span>Small caps: the
‘<span class=property>font-variant</span>’ property</a>
<li><a href="#font-size"><span class=secno>2.6 </span>Font size: the
‘<span class=property>font-size</span>’ property</a>
<li><a href="#relative"><span class=secno>2.7 </span>Relative sizing:
the ‘<span class=property>font-size-adjust</span>’
property</a>
<li><a href="#shorthand"><span class=secno>2.8 </span>Shorthand font
property: the ‘<span class=property>font</span>’
property</a>
</ul>
<li><a href="#font-resources"><span class=secno>3. </span>Font
resources</a>
<ul class=toc>
<li><a href="#the-font-face"><span class=secno>3.1 </span>The @font-face
rule</a>
<li><a href="#font-family0"><span class=secno>3.2 </span>Font family:
the ‘<span class=property>font-family</span>’
descriptor</a>
<li><a href="#font-reference"><span class=secno>3.3 </span>Font
reference: the ‘<span class=property>src</span>’
descriptor</a>
<li><a href="#font-style0"><span class=secno>3.4 </span>Font style: the
‘<span class=property>font-style</span>’ descriptor</a>
<li><a href="#font-weight0"><span class=secno>3.5 </span>Font weight:
the ‘<span class=property>font-weight</span>’
descriptor</a>
<li><a href="#font-stretch"><span class=secno>3.6 </span>Font stretch:
the ‘<span class=property>font-stretch</span>’
descriptor</a>
<li><a href="#character"><span class=secno>3.7 </span>Character range:
the ‘<span class=property>unicode-range</span>’
descriptor</a>
</ul>
<li><a href="#font-matching"><span class=secno>4. </span>Font matching
algorithm</a>
<ul class=toc>
<li><a href="#mapping"><span class=secno>4.1 </span>Mapping font weight
values to font names</a>
<li><a href="#examples"><span class=secno>4.2 </span>Examples of font
matching</a>
</ul>
<li><a href="#font-rendering"><span class=secno>5. </span>Font rendering
properties</a>
<li class=no-num><a href="#appendix">Appendix A: Mapping CSS properties to
font features</a>
<li class=no-num><a href="#appendix0">Appendix B: Font licensing
issues</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative">Normative</a>
<li class=no-num><a href="#informative">Informative</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<h2 id=introduction><span class=secno>1. </span>Introduction</h2>
<p>Font properties determine which fonts are used during rendering. Fonts
represent collections of letterforms, or glyphs, that uniquely describe
the visual appearance of the underlying characters. Typographic traditions
vary across the globe so there is no unique way to classify all fonts
across languages and cultures. For even common Latin letters, wide
variations are possible:
<div class=figure><img src=aaaaaa.png>
<p class=caption>One character, many glyph variations</p>
</div>
<p>Differences in the anatomy of letterforms is one way to distinguish
fonts. For Latin fonts, flourishes at the ends of a character's main
strokes, or serifs, can distinguish a font from those without. Similar
comparisons exist in non-Latin fonts. For Japanese fonts, a Mincho face
contains tapered strokes while a Gothic face does not:
<div class=figure><img src=serifvssansserif.png>
<p class=caption>Classifying by letterform style</p>
</div>
<p>Fonts contain letterforms and the data needed to map characters to these
letterforms. Often this may be a simple one-to-one mapping but more
complex mappings are also possible. The use of combining diacritic marks
creates many variations for an underlying letterform:
<div class=figure><img src=aaaaaa-diacritics.png>
<p class=caption>Variations with diacritic marks</p>
</div>
<p class=issue>Include stacking diacritics? Hmm, Vietnamese example?
<p>A sequence of characters can be represented by a single glyph known as a
ligature:
<div class=figure><img src=final-ligature.png>
<p class=caption>Ligature example</p>
</div>
<p>Visual transformations based on textual context like this may be a
stylistic option for European langauges but are required to correctly
render languages like Arabic; the lam and alef characters below
<em>must</em> be combined when they exist in sequence:
<div class=figure><img src=lamaleflig.png>
<p class=caption>Required Arabic ligature</p>
</div>
<p>The relative complexity of these shaping transformations requires
additional data within the font.
<p>Sets of font faces with various stylistic variations are often grouped
together into font families. In the simplest case a regular face is
supplemented with bold and italic faces but much more extensive groupings
are possible. Variations in the thickness of letterform strokes, or the
weight, or the overall proportions of the letterform, or the width, are
most common. In the example below, each letter uses a different font face
within the Univers font family. The width used increases from top to
bottom and the weight increases from left to right:
<div class=figure><img src=weightwidthvariations.png>
<p class=caption>Weight and width variations within a single font family</p>
</div>
<p>Creating fonts that support multiple scripts is an extremely difficult
design problem; designers need to understand the cultural traditions
surronding the use of type in different scripts and come up with
letterforms that somehow share a common theme. Many languages often share
a common script and each of these languages may have noticeable stylistic
differences. The Arabic script is shared by Persian and Urdu and Cyrillic
is used with many languages, not just Russian.
<p>Fonts provide a character map that details the set of characters for
they have glyphs. If a document contains characters not supported by a
specified font, a user agent may revert to a system font fallback
procedure to find glyphs to render these characters correctly. If no font
can be found, some form of "missing glyph" character is rendered by the
user agent. Often these are the result of authors failing to explicitly
indicate the encoding used by a document.
<h2 id=font-properties><span class=secno>2. </span>Font properties</h2>
<p>The particular font face used to render a character is determined by the
font family and other font properties that apply to a given element. This
structure allows settings to be varied independent of each other.</p>
<!-- prop: font-family -->
<h3 id=font-family><span class=secno>2.1 </span>Font family: the ‘<a
class=property href="#font-family2">font-family</a>’ property</h3>
<table class=propdef id=namefont-family>
<tbody>
<tr>
<td>Name:
<td><dfn id=font-family1>font-family</dfn>
<tr>
<td>Value:
<td>[[ <family-name> | <generic-family> ] [, <family-name>|
<generic-family>]* ] | inherit
<tr>
<td>Initial:
<td>depends on user agent
<tr>
<td>Applies to:
<td>all elements
<tr>
<td>Inherited:
<td>yes
<tr>
<td>Percentages:
<td>N/A
<tr>
<td>Media:
<td>visual
<tr>
<td>Computed value:
<td>as specified
</table>
<p>This property specifies a prioritized list of font family names or
generic family names. A user agent iterates through the list of family
names until it matches an available font that contains a glyph for the
character to be rendered. This allows for differences in available fonts
across across platforms and for differences in the range of characters
supported by individual fonts.
<p>A font family name only specifies a name given to a set of font faces,
it does not specify an individual face. Given the availability of the
fonts below, Futura would match but Futura Medium would not:
<div class=figure><img src=familyvsfacename.png>
<p class=caption>Family and individual face names</p>
</div>
<p>Some font formats support the use of multiple family names for different
localizations. User agents should recognize any of these names independent
of the underlying platform localization, system API used or document
encoding:
<div class=figure><img src=localizedfamilynames.png>
<p class=caption>Localized family names</p>
</div>
<p>Consider the example below:
<div class=example>
<pre>body {
font-family: Helvetica, Verdana, sans-serif;
}</pre>
</div>
<p>If Helvetica is available it will be used when rendering. If neither
Helvetica or Verdana is present, then the user agent defined sans serif
font will be used.
<p>There are two types of font family names:
<dl>
<dt><family-name>
<dd>The name of a font family of choice such as Helvetica or Verdana in
the previous example. Font family names containing whitespace should be
quoted. If quoting is omitted, any whitespace characters before and after
the font name are ignored and any sequence of whitespace characters
inside the font name is converted to a single space.
<p class=issue>Need better description of when quoting is needed.
Reference syntax module?</p>
<dt><generic-family>
<dd> The following generic family keywords are defined: ‘<a
class=property href="#serif2">serif</a>’, ‘<a class=property
href="#sans-serif2">sans-serif</a>’, ‘<a class=property
href="#cursive2">cursive</a>’, ‘<a class=property
href="#fantasy2">fantasy</a>’, and ‘<a class=property
href="#monospace2">monospace</a>’. These keywords can be used as a
general fallback mechanism when an author's desired font choices are not
available. As keywords, they should not be quoted. Authors are encouraged
to append a generic font family as a last alternative for improved
robustness.
</dl>
<p class=note>Hmmm, this example doesn't really fit here, put it somewhere
else.
<div class=example>
<p>The selector syntax may be used to create language-sensitive
typography. For example, some Chinese and Japanese characters are unified
to have the same Unicode codepoint, although the abstract glyphs are not
the same in the two languages.</p>
<pre>*:lang(ja-jp) { font: 900 14pt/16pt "Heisei Mincho W9", serif; }
*:lang(zh-tw) { font: 800 14pt/16.5pt "Li Sung", serif; }
</pre>
<p>This selects any element that has the given language - Japanese or
Traditional Chinese - and requests the appropriate font.</p>
</div>
<h4 id=generic><span class=secno>2.1.1 </span>Generic font families</h4>
<p>All five generic font families are defined to exist in all CSS
implementations (they need not necessarily map to five distinct actual
fonts). User agents should provide reasonable default choices for the
generic font families, which express the characteristics of each family as
well as possible within the limits allowed by the underlying technology.
User agents are encouraged to allow users to select alternative choices
for the generic fonts.
<h5 id=serif><span class=secno>2.1.1.1. </span> <span class=index-def
id=serif1 title="serif, definition of"><a name=serif-def><dfn
id=serif2>serif</dfn></a></span></h5>
<p>Glyphs of serif fonts, as the term is used in CSS, have finishing
strokes, flared or tapering ends, or have actual serifed endings
(including slab serifs). Serif fonts are typically proportionately-spaced.
They often display a greater variation between thick and thin strokes than
fonts from the ‘<a class=property
href="#sans-serif2">sans-serif</a>’ generic font family. CSS uses
the term ‘<a class=property href="#serif2">serif</a>’ to apply
to a font for any script, although other names may be more familiar for
particular scripts, such as Mincho (Japanese), Sung or Song (Chinese),
Batang (Korean). Any font that is so described may be used to represent
the generic ‘<a class=property href="#serif2">serif</a>’
family.
<div class=figure><img src=serifexamples.png>
<p class=caption>Sample serif fonts</p>
</div>
<h5 id=sans-serif><span class=secno>2.1.1.2. </span> <span class=index-def
id=sans-serif1 title="sans-serif, definition of"> <a
name=sans-serif-def><dfn id=sans-serif2>sans-serif</dfn></a></span></h5>
<p>Glyphs in sans-serif fonts, as the term is used in CSS, have stroke
endings that are plain -- without any flaring, cross stroke, or other
ornamentation. Sans-serif fonts are typically proportionately-spaced. They
often have little variation between thick and thin strokes, compared to
fonts from the ‘<a class=property href="#serif2">serif</a>’
family. CSS uses the term ‘<a class=property
href="#sans-serif2">sans-serif</a>’ to apply to a font for any
script, although other names may be more familiar for particular scripts,
such as Gothic (Japanese), Kai (Chinese), or Gulim (Korean). Any font that
is so described may be used to represent the generic ‘<a
class=property href="#sans-serif2">sans-serif</a>’ family.
<p class=note>Kai for Chinese looks wrong, looks to be a serif-like face.
<div class=figure><img src=sansserifexamples.png>
<p class=caption>Sample sans-serif fonts</p>
</div>
<h5 id=cursive><span class=secno>2.1.1.3. </span> <span class=index-def
id=cursive1 title="cursive, definition of"> <a name=cursive-def><dfn
id=cursive2>cursive</dfn></a></span></h5>
<p>Glyphs in cursive fonts, as the term is used in CSS, generally have
either joining strokes or other cursive characteristics beyond those of
italic typefaces. The glyphs are partially or completely connected, and
the result looks more like handwritten pen or brush writing than printed
letterwork. Some scripts, such as Arabic, are almost always cursive. CSS
uses the term ‘<a class=property href="#cursive2">cursive</a>’
to apply to a font for any script, although other names such as Chancery,
Brush, Swing and Script are also used in font names.
<div class=figure><img src=cursiveexamples.png>
<p class=caption>Sample cursive fonts</p>
</div>
<h5 id=fantasy><span class=secno>2.1.1.4. </span> <span class=index-def
id=fantasy1 title="fantasy, definition of"> <a name=fantasy-def><dfn
id=fantasy2>fantasy</dfn></a></span></h5>
<p>Fantasy fonts are primarily decorative fonts that contain playful
representations of characters. These do not include Pi or Picture fonts
which do not represent actual characters.
<div class=figure><img src=fantasyexamples.png>
<p class=caption>Sample fantasy fonts</p>
</div>
<h5 id=monospace><span class=secno>2.1.1.5. </span> <span class=index-def
id=monospace1 title="monospace, definition of"> <a name=monospace-def><dfn
id=monospace2>monospace</dfn></a></span></h5>
<p>The sole criterion of a monospace font is that all glyphs have the same
fixed width. This is often used to render samples of computer code.
<div class=figure><img src=monospaceexamples.png>
<p class=caption>Sample monospace fonts</p>
</div>
<!-- prop: font-weight -->
<h3 id=font-weight><span class=secno>2.2 </span>Font weight: the ‘<a
class=property href="#font-weight2">font-weight</a>’ property</h3>
<table class=propdef id=namefont-weight>
<tbody>
<tr>
<td>Name:
<td><dfn id=font-weight1>font-weight</dfn>
<tr>
<td>Value:
<td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600
| 700 | 800 | 900 | inherit
<tr>
<td>Initial:
<td>normal
<tr>
<td>Applies to:
<td>all elements
<tr>
<td>Inherited:
<td>yes
<tr>
<td>Percentages:
<td>N/A
<tr>
<td>Media:
<td>visual
<tr>
<td>Computed value:
<td>see description
</table>
<p> The <a class=noxref href="#font-weight"><span
class=property>‘<span
class=property>font-weight</span>’</span></a> property specifies the
degree of blackness or stroke thickness glyphs in a font. Values have the
following meanings:
<dl>
<dt>100 to 900
<dd>These values form an ordered sequence, where each number indicates a
weight that is at least as dark as its predecessor. These roughly
correspond to the commonly used weight names below:
</dl>
<ul>
<li>100 - Thin
<li>200 - Extra Light (Ultra Light)
<li>300 - Light
<li>400 - Normal
<li>500 - Medium
<li>600 - Semi Bold (Demi Bold)
<li>700 - Bold
<li>800 - Extra Bold (Ultra Bold)
<li>900 - Black (Heavy)
</ul>
<dl>
<dt><strong>normal</strong>
<dd>Same as ‘<code class=css>400</code>’.
<dt><strong>bold</strong>
<dd>Same as ‘<code class=css>700</code>’.
<dt><strong>bolder</strong>
<dd>Specifies the next weight that is assigned to a font that is darker
than the inherited one. If there is no such weight, it simply results in
the next darker numerical value (and the font remains unchanged), unless
the inherited value was ‘<code class=css>900</code>’, in
which case the resulting weight is also ‘<code
class=css>900</code>’.
<dt><strong>lighter</strong>
<dd>Specifies the next weight that is assigned to a font that is lighter
than the inherited one. If there is no such weight, it simply results in
the next lighter numerical value (and the font remains unchanged), unless
the inherited value was ‘<code class=css>100</code>’, in
which case the resulting weight is also ‘<code
class=css>100</code>’.
</dl>
<div class=issue>
<p>Both of these definitions are problematic, specifically the "next
lighter numerical value" doesn't really work well in practice nor is it
actually what most browsers implement.</p>
<pre>p { font-weight: 100 }
strong { font-weight: bolder }</pre>
<p>So what happens with a strong element contained within a paragraph
given a font family with just a single normal weight face?</p>
</div>
<div class=example>
<p style=display:none>Example(s):</p>
<pre>p { font-weight: normal; } /* 400 */
h1 { font-weight: 700; } /* bold */
body { font-weight: 400; }
strong { font-weight: bolder; } /* 500 or next higher value available */
</pre>
</div>
<p>The ‘<a class=property href="#font-weight2">font-weight</a>’
property values are given on a numerical scale in which the value
‘<code class=css>400</code>’ (or ‘<span
class=property>normal</span>’) corresponds to the "normal"
text face for that family. The weight name associated with that face will
typically be Book, Regular, Roman, Normal or sometimes Medium.
<div class=figure>
<p class=caption>Common localizations of bold names</p>
</div>
<p>The association of other weights within a family to the numerical weight
values is intended only to preserve the ordering of weights within that
family. User agents must map names to values in a way that preserves
visual order; a face mapped to a value must not be lighter than faces
mapped to lower values. There is no guarantee on how a user agent will map
font faces within a family to weight values. However, the following
heuristics tell how the assignment is done in typical cases: If the font
family already uses a numerical scale with nine values (as e.g., OpenType
does), the font weights should be mapped directly.
<p>If there is a font of a format that does not have a font weight value,
but relies on name values for determining weight, and both a face labeled
Medium and one labeled Book, Regular, Roman or Normal, then the Medium is
normally assigned to the ‘<code class=css>500</code>’. If
there is a font weight value in the font, that value is used instead of a
string label.
<p>The font labeled "Bold" will often correspond to the weight
value ‘<code class=css>700</code>’. Once again, if the font
has font weight value, that value is used instead of a string label.
<p>If there are fewer then 9 weights in the family, the default algorithm
for filling the "holes" is as follows. If ‘<code
class=css>500</code>’ is unassigned, it will be assigned the same
font as ‘<code class=css>400</code>’. If any of the values
‘<code class=css>600</code>’, ‘<code
class=css>700</code>’, ‘<code class=css>800</code>’, or
‘<code class=css>900</code>’ remains unassigned, they are
assigned to the same face as the next darker assigned keyword, if any, or
the next lighter one otherwise. If any of ‘<code
class=css>300</code>’, ‘<code class=css>200</code>’, or
‘<code class=css>100</code>’ remains unassigned, it is
assigned to the next lighter assigned keyword, if any, or the next darker
otherwise.
<p>There is no guarantee that there will be a darker face for each of the
‘<a class=property href="#font-weight2">font-weight</a>’
values; for example, some fonts may have only a normal and a bold face,
others may have eight different face weights.
<p>Child elements inherit the computed value of the weight.
<p class=issue>When does synthesized bolding occur, especially in the
context of bolder/lighter?</p>
<!-- prop: font-stretch -->
<h3 id=font-proportion><span class=secno>2.3 </span>Font proportion: the
‘<a class=property href="#font-stretch1">font-stretch</a>’
property</h3>
<table class=propdef id=namefont-stretch>
<tbody>
<tr>
<td>Name:
<td><dfn id=font-stretch0>font-stretch</dfn>
<tr>
<td>Value:
<td>normal | wider | narrower | ultra-condensed | extra-condensed |
condensed | semi-condensed | semi-expanded | expanded | extra-expanded
| ultra-expanded | inherit
<tr>
<td>Initial:
<td>normal
<tr>
<td>Applies to:
<td>all elements
<tr>
<td>Inherited:
<td>yes
<tr>
<td>Percentages:
<td>N/A
<tr>
<td>Media:
<td>visual
<tr>
<td>Computed value:
<td>as specified
</table>
<p>The <a class=noxref href="#font-stretch"><span
class=property>‘<span
class=property>font-stretch</span>’</span></a> property selects a
normal, condensed, or extended face from a font family. Absolute keyword
values have the following ordering, from narrowest to widest:
<ul>
<li>Ultra Condensed
<li>Extra Condensed
<li>Condensed
<li>Semi Condensed
<li>Normal
<li>Semi Expanded
<li>Expanded
<li>Extra Expanded
<li>Ultra Expanded
</ul>
<p>The relative keyword ‘<span class=property>wider</span>’
sets the value to the next expanded value above the inherited value (while
not increasing it above ‘<span
class=property>ultra-expanded</span>’); the relative keyword
‘<span class=property>narrower</span>’ sets the value to the
next condensed value below the inherited value (while not decreasing it
below ‘<span class=property>ultra-condensed</span>’).
<p class=issue>Do we really need all these keywords?!? Would
ultra-extended, extended, normal, condensed, ultra-condensed suffice?
<p class=issue>What about synthesized condensed/expanded?</p>
<!-- prop: font-style -->
<h3 id=font-style><span class=secno>2.4 </span>Font style: the ‘<a
class=property href="#font-style2">font-style</a>’ property</h3>
<table class=propdef id=namefont-style>
<tbody>
<tr>
<td>Name:
<td><dfn id=font-style1>font-style</dfn>
<tr>
<td>Value:
<td>normal | italic | oblique | inherit
<tr>
<td>Initial:
<td>normal
<tr>
<td>Applies to:
<td>all elements
<tr>
<td>Inherited:
<td>yes
<tr>
<td>Percentages:
<td>N/A
<tr>
<td>Media:
<td>visual
<tr>
<td>Computed value:
<td>as specified
</table>
<p>The <a class=noxref href="#font-style"><span class=property>‘<span
class=property>font-style</span>’</span></a> property allows italic
or oblique faces to be selected. Italic faces are commonly thought of as
sloped variations but the distinction is actually more subtle than that.
Italic forms are generally cursive in nature while oblique faces are
typically sloped versions of the regular face. Oblique faces can be
simulated by artificially sloping the glyphs of the regular face. Compare
the artificially sloped renderings of Palatino ‘<span
class=property>a</span>’ and Baskerville ‘<span
class=property>N</span>’ in grey with the actual italic versions:
<div class=figure><img src=realvsfakeitalics.png>
<p class=caption>Artificial sloping versus real italics</p>
</div>
<p>A value of ‘<span class=property>normal</span>’ selects a
face that is classified as ‘<span
class=property>normal</span>’, while ‘<span
class=property>oblique</span>’ selects a font that is labeled
‘<span class=property>oblique</span>’. A value of ‘<span
class=property>italic</span>’ selects a font that is labeled
‘<span class=property>italic</span>’, or, if that is not
available, one labeled ‘<span class=property>oblique</span>’.
If no italic or oblique faces is available, an oblique face can by
synthesized by rendering the normal face with a sloping transformation
applied.
<div class=figure>
<p class=caption>Common localizations of italic and oblique names</p>
</div>
<p>Many scripts lack the tradition of mixing a cursive form within text
rendered with a normal face. Chinese, Japanese and Korean fonts almost
always lack italic or oblique faces. Fonts that support a mixture of
scripts will sometimes omit specific scripts such as Arabic from the set
of glyphs supported in the italic face. User agents should be careful
about making character map assumptions across faces.
<p class=issue>What is the existing behavior for oblique? Is it actually
<em>ever</em> relevant, i.e. is there a font that defines both italic and
oblique faces? Or is it effectively an alias for italic?</p>
<!-- prop: font-variant -->
<h3 id=small><span class=secno>2.5 </span>Small caps: the ‘<a
class=property href="#font-variant">font-variant</a>’ property</h3>
<table class=propdef id=namefont-variant>
<tbody>
<tr>
<td>Name:
<td><dfn id=font-variant>font-variant</dfn>
<tr>
<td>Value:
<td>normal | small-caps | inherit
<tr>