You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-inline/Overview.bs
+67-88Lines changed: 67 additions & 88 deletions
Original file line number
Diff line number
Diff line change
@@ -24,56 +24,45 @@ Link Defaults: css-fonts-3 (property) font-family
24
24
25
25
26
26
27
-
<h2>Line Heights and Baseline Alignment</h2>
27
+
<h2 id="line-height">Line Heights and Baseline Alignment</h2>
28
28
29
29
<p class="issue">This section is being rewritten. Refer to <a href="http://www.w3.org/TR/CSS21/visudet.html#line-height">section 10.8</a> of [[CSS21]] for the normative CSS definition or the <a href="http://www.w3.org/TR/2002/WD-css3-linebox-20020515/">2002 Working Draft</a> if you want pretty pictures. (But ignore the old text, half of it's wrong. We're not specifying which half, that's to be determined.)</p>
30
30
31
31
32
32
33
-
<h2 id="Initial">Initial Lines and Initial Letters</h2>
33
+
<h2 id="initial-letter-styling">
34
+
<!--<a name="Initial"></a>-->
35
+
Initial Letters</h2>
34
36
35
-
36
-
37
+
<p class="issue">The editors would appreciate any examples of drop initials in non-western scripts, especially Arabic and Indic scripts.</p>
37
38
38
-
<h3 id="DropInitial">An Introduction to Initial Letters</h3>
39
+
<h3 id="initial-letter-intro">
40
+
<!--<a name="DropInitial"></a>-->
41
+
An Introduction to Initial Letters</h3>
39
42
40
43
Large, decorative letters have been used to start new sections of text since before the invention of printing. In fact, their use predates lowercase letters entirely.
41
44
42
-
A <dfn>drop initial</dfn> is a larger-than-usual letter at the start of a paragraph, with a baseline at least one line lower than the first baseline of the paragraph. The size of the drop initial is usually indicated by how many lines it occuppies. Two- and three-line drop initials are very common.
43
-
44
-
45
+
<h4 id="drop-initial">
46
+
Drop Initial</h4>
45
47
48
+
A <dfn>dropped initial</dfn> (or “drop cap”) is a larger-than-usual letter at the start of a paragraph, with a baseline at least one line lower than the first baseline of the paragraph. The size of the drop initial is usually indicated by how many lines it occupies. Two- and three-line drop initials are very common.
46
49
47
50
<figure>
48
-
<img alt="3-line drop cap with E Acute" src="Dropcap-E-acute-3line.png" width="480">
49
-
50
-
<p class="caption">Three-line drop initial with E acute. Since the cap-height of the drop initial aligns with the cap-height of the main text, the accent extends above the paragraph.</p>
51
-
51
+
<img alt="3-line drop cap with E Acute" src="Dropcap-E-acute-3line.png" width="480">
52
+
<p class="caption">Three-line drop initial with E acute. Since the cap-height of the drop initial aligns with the cap-height of the main text, the accent extends above the paragraph.</p>
52
53
</figure>
53
54
54
-
55
-
56
-
57
-
</div>
58
-
59
55
The exact size and position of a drop cap depends on the alignment of its glyph. [TK] Reference points on the drop cap must align precisely with reference points in the text. In Western scripts, the top reference points are the cap height of the initial letter and of the first line of text. The bottom reference points are the alphabetic baseline of the initial letter and the baseline of the Nth line of text. <a href="#f2">Figure 2</a> shows a simple two-line drop cap, with the relevant reference lines marked.
60
56
61
57
62
58
63
59
<figure id="f2">
64
-
<img src="Dropcap-lines.png" width="600" alt="drop cap showing alignment"/>
65
-
66
-
<p class="caption">Two-line drop cap showing baselines (green lines), cap-height (red line), and ascender (cyan line).</p>
67
-
60
+
<img src="Dropcap-lines.png" width="600" alt="drop cap showing alignment"/>
61
+
<p class="caption">Two-line drop cap showing baselines (green lines), cap-height (red line), and ascender (cyan line).</p>
68
62
</figure>
69
63
70
-
71
-
72
-
73
-
74
64
The alignment constraints for drop initials depend on the writing system. In Japanese, the initial letter extends from the <a>block-start</a> edge of the first line to the <a>block-end</a> edge of the Nth line.
<p class="caption">Two-line drop initial in vertical writing mode</p>
@@ -86,6 +75,29 @@ The alignment constraints for drop initials depend on the writing system. In Jap
86
75
87
76
Note: In some cases, the exclusion area for the drop initial is larger than its glyph in order to preserve inline-axis alignment. This effect is out-of-scope for this level. However, extra spacing can still be given using margins.
88
77
78
+
<h4 id="sunk-initial">
79
+
Sunken Initial Letters</h4>
80
+
81
+
Some styles of drop initials do not align with the first line of text. A <dfn>sunken initial</dfn> (or “sunken cap”) both sinks below the first baseline, and extends above the first line of text.
82
+
83
+
<figure>
84
+
<img src="SunkenCapA.png" width="480" alt="sunken drop initial"/>
85
+
<p class="caption">Sunken cap. The letter drops two lines, but is the size of a three-line initial letter.</p>
86
+
</figure>
87
+
88
+
<h4 id="raise-initial">
89
+
Raised Initial Letters</h4>
90
+
91
+
A <dfn>raised initial</dfn> (often called a “raised cap” or “stick-up cap”) “sinks” to the first text baseline. Unlike simply increasing the font size, which affects the line spacing below it to make room for potential descenders, it does not sink below that.
@@ -104,93 +116,61 @@ Initial letters are typically a single letter, which can be selected by the <cod
104
116
::first-letter, /* style first paragraph's T */
105
117
img, /* style illuminated H */
106
118
span /* drop Words may also */
107
-
{ initial-letters: 2; }
119
+
{ initial-letter: 2; }
108
120
</pre>
109
121
</div>
110
122
111
123
<h3 id="sizing-drop-initials">Creating Initial Letters: the 'initial-letter' property</h3>
112
124
113
-
This property takes two arguments. The first argument defines the size of the initial letter, in terms of how many lines it occupies. The optional second argument argument defines the number of lines the initial letter should sink. An N-line initial letter sinks to the Nth text baseline. If not specified, it duplicates the first argument.
Applies to: <code>::first-letter</code> pseudoelements and inlinelevel first child of a block container
129
+
Applies to: <code>::first-letter</code> pseudo-elements and inline-level first child of a block container
120
130
Inherited: no
121
131
Percentages: N/A
122
132
Media: visual
123
-
Computed value: as described
133
+
Computed value: as specified
124
134
</pre>
125
135
136
+
This property specifies styling for dropped, raised, and sunken initial letters. It takes the following values:
126
137
127
-
<div class="example">
128
-
129
-
<figure>
130
-
<img alt="3-line drop cap with C" src="Dropcap-C-3line.png" width="480">
131
-
132
-
<p class="caption">Three-line drop initial.</p>
133
-
134
-
</figure>
135
-
<pre>
136
-
p::first-letter {
137
-
initial-letter: 3;
138
-
}
139
-
</pre>
140
-
</div>
141
-
142
-
143
-
144
-
145
-
146
-
147
-
Some styles of drop initials do not align with the first line of text. For example, “sunken caps” both sink below the first baseline, and extend above the first line of text. In these cases, the size of the initial cap needs to be defined. The optional second argument of 'initial-letter' specifies the size of an initial letter, as if it were an n-line drop cap.
148
-
149
-
150
-
138
+
<dl for=initial-letter>
139
+
<dt><dfn>normal</dfn>
140
+
<dd>No special initial-letter effect. Text behaves as normal.
141
+
<dt><dfn><<number>></dfn>
142
+
<dd>This first argument defines the size of the initial letter, in terms of how many lines it occupies. Negative values are not allowed.
143
+
<dt><dfn><<integer>></dfn>
144
+
<dd>This optional second argument argument defines the number of lines the initial letter should sink. Values must be greater than zero. If omitted, it duplicates the first argument, floored to the nearest positive whole number.
145
+
</dl>
151
146
152
147
<div class="example">
148
+
Here are some examples of 'initial-letter' usage:
153
149
154
-
<figure>
155
-
<img src="SunkenCapA.png" width="480" alt="sunken drop initial"/>
156
-
<p class="caption">Sunken cap. The letter drops two lines, but is the size of a three-line initial letter.</p>
157
-
</figure>
158
-
<pre>
159
-
160
-
p::first-letter {
161
-
initial-letter: 3 2;
162
-
}
150
+
<dl>
151
+
<dt>''initial-letter: 3''
152
+
<dt>(''initial-letter: 3 3'')
153
+
<dd>Represents a <a>dropped initial</a> 3 lines high, 3 lines deep.
163
154
164
-
</pre>
155
+
<dt>''initial-letter: 3 2''
156
+
<dd>Represents a <a>sunken initial</a> 3 lines high, 2 lines deep.
165
157
158
+
<dt>''initial-letter: 3 1''
159
+
<dd>Represents a <a>raised initial</a> 3 lines high, 1 line deep.
160
+
</dl>
161
+
162
+
Issue: Add pictures.
166
163
</div>
167
164
168
-
169
-
If the second argument is ''1'', that creates a pure raised initial letter (often called “raised cap” or “stick-up cap.” It “sinks” to the first text baseline.
<p class="caption">Raised cap. The initial letter is the size of a 3-line initial, but does not drop.</p>
177
-
</figure>
178
-
<pre>
179
-
180
-
p::first-letter {
181
-
initial-letter: 3 1;
182
-
}
183
-
184
-
</pre>
185
-
166
+
The following code will create a 2-line dropped initial letter at the beginning of each paragraph:
167
+
<pre>p::first-letter { initial-letter: 2; }</pre>
186
168
</div>
187
169
188
170
189
171
190
172
191
173
192
-
193
-
194
174
<h3 id="aligning-initial-letter">Alignment of Initial Letters</h3>
195
175
196
176
As mentioned earlier, the alignment of initial letters depends on the script used. The 'initial-letter-align' property can be used to specify the proper alignment.
@@ -240,7 +220,7 @@ If 'initial-letter' is applied to an image or other atomic element that does not
240
220
Issue: Need to decide whether using margin edges or content edges for alignment. Writing Modes uses the margin edges for baseline alignment of replaced elements. There are cases for both content-alignment and margin-alignment for text. In both cases the margin box needs to be excluded.
<p>The size of a drop initial is determined by the need to satisfy the required alignment. For an N-line drop initial in a Western script, the cap-height of the letter needs to be (N – 1) times the line-height, plus the cap-height of the surrounding text. Note this height is <b>not</b> the font size of the drop initial.</p>
246
226
@@ -327,7 +307,6 @@ If the subsequent paragraph starts with an initial letter, then it must clear th
327
307
328
308
329
309
330
-
<p class="issue">Define appropriate behavior for non-western scripts. The editors would appreciate any examples of drop initials in such scripts.</p>
331
310
332
311
333
312
@@ -340,4 +319,4 @@ Eric A. Meyer and Michel Suignard.
340
319
341
320
<p>In additions to the authors, this specification would not have been possible without the help from:
342
321
343
-
<p>David Baron, John Daggett, Stephen Deach, Sujal Parikh, Grzegorz Zygmunt, Chris Wilson, David M Brown.
322
+
<p>David Baron, John Daggett, Stephen Deach, Sujal Parikh, Grzegorz Zygmunt, Chris Wilson, David M Brown, Bobby Tung, Shinyu Murakami, David Hyatt, Sylvain Galineau, Alan Stearns.
0 commit comments