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
+43-41Lines changed: 43 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ A <dfn>drop initial</dfn> is a larger-than-usual letter at the start of a paragr
56
56
57
57
</div>
58
58
59
-
Drop initials are all about alignment. 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 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.
59
+
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
60
61
61
62
62
@@ -69,55 +69,22 @@ Drop initials are all about alignment. Reference points on the drop cap must ali
69
69
70
70
71
71
72
-
<div class="note">
73
-
<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>
74
72
75
73
76
-
<p>Actually calculating this font size is tricky. For an N-line drop initial, we find the drop initial font size to be:</p>
74
+
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.
77
75
78
76
79
77
<figure>
80
-
<img src="InitialCapEquation.png" width="604" alt="Equation to calcuate drop initial font size"/>
<p class="caption">Two-line drop initial in vertical writing mode</p>
81
80
</figure>
82
81
83
-
<!--
84
-
<pre>
85
-
Font size of drop cap = ((N-1) * line-height + [cap-height of para] * [font size of paragraph])/[cap-height ratio of drop initial font]
86
-
</pre>
87
-
-->
88
-
89
-
<!--
90
-
91
-
<div>
92
-
93
-
<math display="block"><mrow><mi>Font size of drop initial</mi><mo>=</mo></mrow><mfrac><mrow><mo>(</mo><mi>N</mi><mo>-</mo><mn>1</mn><mo>)</mo><mo>×</mo><mi>line-height</mi><mo>+</mo><mo>(</mo><mi>cap-height ratio of para font</mi><mo>×</mo><mi>font size of para</mi><mo>)</mo></mrow><mrow><mi>cap-height ratio of drop initial font</mi></mrow></mfrac></math>
94
-
</div>
95
-
96
-
-->
97
-
98
-
99
-
A three-line drop initial in Adobe Minion Pro would have a font size of 61.2pt, given 12pt text, 16pt line-height and a cap-height of 651/1000 (from the font’s OS/2 table).
100
-
</div>
101
-
102
-
103
-
The alignment constraints depend on the script used. In Japanese vertical writing mode, it appears that the initial letter extends from the start edge of the first line to the end edge of the Nth line.
104
-
105
82
<figure>
106
-
<img src="CJK-Initial.001.png" width="480" alt="Diagram of Japanese initial letter in vertical writing mode"/>
107
-
<p class="caption">Diagram of Japanese initial letter in vertical writing mode</p>
83
+
<img src="CJK-Initial.001.png" width="480" alt="Diagram of Japanese initial letter in vertical writing mode"/>
84
+
<p class="caption">Diagram of Japanese initial letter in vertical writing mode</p>
<p class="caption">Two-line drop initial in vertical writing mode</p>
115
-
</figure>
116
-
<p class="issue">This figure is probably incorrect.</p>
117
-
118
-
119
-
120
-
<p class="issue">Add content describing constraint that the block container have a baseline grid (or fixed line-height?).</p>
87
+
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.
<h3 id="aligning-initial-letter">Alignment of Initial Letters</h3>
226
195
227
196
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.
@@ -271,7 +240,38 @@ If 'initial-letter' is applied to an image or other atomic element that does not
271
240
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.
272
241
273
242
243
+
<h3>Sizing Initial Letters</h3>
244
+
245
+
<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
+
247
+
248
+
<p>Actually calculating this font size is tricky. For an N-line drop initial, we find the drop initial font size to be:</p>
249
+
250
+
251
+
<figure>
252
+
<img src="InitialCapEquation.png" width="604" alt="Equation to calcuate drop initial font size"/>
253
+
</figure>
254
+
255
+
<!--
256
+
<pre>
257
+
Font size of drop cap = ((N-1) * line-height + [cap-height of para] * [font size of paragraph])/[cap-height ratio of drop initial font]
258
+
</pre>
259
+
-->
260
+
261
+
<!--
262
+
263
+
<div>
274
264
265
+
<math display="block"><mrow><mi>Font size of drop initial</mi><mo>=</mo></mrow><mfrac><mrow><mo>(</mo><mi>N</mi><mo>-</mo><mn>1</mn><mo>)</mo><mo>×</mo><mi>line-height</mi><mo>+</mo><mo>(</mo><mi>cap-height ratio of para font</mi><mo>×</mo><mi>font size of para</mi><mo>)</mo></mrow><mrow><mi>cap-height ratio of drop initial font</mi></mrow></mfrac></math>
266
+
</div>
267
+
268
+
-->
269
+
270
+
<div class="example">
271
+
A three-line drop initial in Adobe Minion Pro would have a font size of 61.2pt, given 12pt text, 16pt line-height and a cap-height of 651/1000 (from the font’s OS/2 table).
272
+
</div>
273
+
274
+
The line height used in this calculation is the 'line-height' of the containing block (or, in the case where a baseline grid is in use, the baseline-to-baseline spacing required by the baseline grid [[CSS3-LINE-GRID]]). The contents of the lines spanned, and therefore any variation in their heights and positions, is not accounted for.
275
275
276
276
<h3 id="initial-letter-exclusions">Space Around Initial Letters</h3>
277
277
@@ -292,7 +292,7 @@ Text should be excluded around the glyph bounding boxes of the initial letters:
292
292
</figure>
293
293
294
294
295
-
<h3 id="initial-letter-paragraphs">Interactions of initial letters with surrounding paragraphs</h3>
<h4 id="raised-sunken-caps">Raised and sunken caps</h4>
298
298
@@ -304,6 +304,8 @@ An initial letter does not affect the position of its containing element. For
304
304
<p class="caption">Raised cap (<code>initial-letter: 3 1</code>) on right; note that the position of the “C” is the same in both cases, but on the right all text is moved down relative to the initial letter.</p>
305
305
</figure>
306
306
307
+
Issue: Handle glyph ink above cap height of font.
308
+
307
309
308
310
<h4 id="short-para-initial-letter">Short paragraphs with initial letters</h4>
0 commit comments