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
[css-inline] add initial-letter-align property to start a18n work; rename initial-letters as initial-letter due to general preference for singular names
Copy file name to clipboardExpand all lines: css-inline/Overview.bs
+75-25Lines changed: 75 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -592,7 +592,7 @@ top after the box has been aligned with 'vertical-align'.
592
592
593
593
594
594
595
-
<h5>Old, remove this:</h5>
595
+
<h5 id="old-remove-this">Old, remove this:</h5>
596
596
597
597
<p>Line stacking is the mechanism by which a line box is determined for each
598
598
line in a block and then these lines are stacked in the block-progression
@@ -2290,11 +2290,11 @@ A <dfn>drop initial</dfn> is a larger-than-usual letter at the start of a paragr
2290
2290
2291
2291
</div>
2292
2292
2293
-
Drop initials are all about alignment. Reference points on the drop cap must align precisely with reference points in the text. In the most common case, used in Western languages, 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. Figure three shows a simple two-line drop cap, with the relevant reference lines marked.
2293
+
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.
2294
2294
2295
2295
2296
2296
2297
-
<figure>
2297
+
<figure id="f2">
2298
2298
<img src="Dropcap-lines.png" width="600" alt="drop cap showing alignment"/>
2299
2299
2300
2300
<p class="caption">Two-line drop cap showing baselines (green lines), cap-height (red line), and ascender (cyan line).</p>
@@ -2303,18 +2303,11 @@ Drop initials are all about alignment. Reference points on the drop cap must ali
2303
2303
2304
2304
2305
2305
2306
-
2307
-
2308
-
2309
-
2310
-
2311
-
2312
-
2313
2306
<div class="note">
2314
-
<p>The size of a drop cap is determined by the need to satisfy the alignments specified above. For an N-line drop cap as described above, 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>
2307
+
<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>
2315
2308
2316
2309
2317
-
<p>Actually calculating the font size is tricky. Given the font size F of the main text, the line-height L, the number of lines N, and the cap-height of the font c, we find the drop initial font size D to be:</p>
2310
+
<p>Actually calculating this font size is tricky. Given the font size F of the main text, the line-height L, the number of lines N, and the cap-height of the font c, we find the drop initial font size D to be:</p>
2318
2311
2319
2312
2320
2313
<pre>
@@ -2325,12 +2318,24 @@ A three-line drop initial in Adobe Minion Pro would have a font size of 61.2pt,
2325
2318
</div>
2326
2319
2327
2320
2321
+
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.
2322
+
2323
+
<p class="issue">Input from Japanese typographers would be very helpful.</p>
Initial letters are typically a single letter, which can be selected by the <code>::first-letter</code> pseudo-element, as defined in [[SELECT]]. Authors who need more control over which characters are included in an initial letter can also apply the 'initial-letters' property to the first inline child of a block container.
2338
+
Initial letters are typically a single letter, which can be selected by the <code>::first-letter</code> pseudo-element, as defined in [[SELECT]]. Authors who need more control over which characters are included in an initial letter can also apply the 'initial-letter' property to the first inline child of a block container.
2334
2339
2335
2340
2336
2341
@@ -2352,18 +2357,19 @@ Only the following properties can be applied to the <code>::first-letter</code>
2352
2357
<li>'float'</li>
2353
2358
<li>text-shadow</li>
2354
2359
<li>'clear'</li>
2355
-
<li>'initial-letters'</li>
2360
+
<li>'initial-letter'</li>
2361
+
<li>'initial-letter-align'</li>
2356
2362
</ul>
2357
2363
2358
2364
2359
2365
2360
2366
2361
-
<h3 id="sizing-drop-initials">Creating Initial Letters: The 'initial-letters' Property</h3>
2367
+
<h3 id="sizing-drop-initials">Creating Initi
93C6
al Letters: The 'initial-letter' Property</h3>
2362
2368
2363
-
The 'initial-letters' property takes two positive integer values. The first argument defines the number of lines the initial letter should sink. An N-line initial letter sinks to the Nth text baseline. The optional second argument defines how many lines the initial letter occupies. If not specified, it duplicates the first argument.
2369
+
The 'initial-letter' property takes two positive integer values. The first argument defines the number of lines the initial letter should sink. An N-line initial letter sinks to the Nth text baseline. The optional second argument defines how many lines the initial letter occupies. If not specified, it duplicates the first argument.
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
@@ -2384,16 +2390,14 @@ Computed value: ???
2384
2390
</figure>
2385
2391
<pre>
2386
2392
p::first-letter {
2387
-
initial-letters: 3;
2393
+
initial-letter: 3;
2388
2394
}
2389
2395
</pre>
2390
-
2391
-
2392
2396
</div>
2393
2397
2394
2398
2395
2399
2396
-
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-letters' specifies the size of an initial letter, as if it were an n-line drop cap.
2400
+
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.
239
77FA
7
2401
2398
2402
2399
2403
@@ -2408,7 +2412,7 @@ Some styles of drop initials do not align with the first line of text. For examp
2408
2412
<pre>
2409
2413
2410
2414
p::first-letter {
2411
-
initial-letters: 2 3;
2415
+
initial-letter: 2 3;
2412
2416
}
2413
2417
2414
2418
</pre>
@@ -2423,18 +2427,64 @@ If the first argument is ''1'', that creates a pure raised initial letter (often
<p class="caption">Raised cap. The initial letter is the size of a 3-line initial, but does not drop.</p>
2427
2431
</figure>
2428
2432
<pre>
2429
2433
2430
2434
p::first-letter {
2431
-
initial-letters: 1 3;
2435
+
initial-letter: 1 3;
2432
2436
}
2433
2437
2434
2438
</pre>
2435
2439
2436
2440
</div>
2437
2441
2442
+
2443
+
<h3 id="aligning-initial-letter">Alignment of Initial Letters</h3>
2444
+
2445
+
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.
<dd>The user agent selects the value which corresponds to the language of the text. Western languages would default to ''alphabetic'', CJK languages to ''ideographic'', and some Indic languages to ''hanging''. </dd>
2462
+
<dt>alphabetic</dt>
2463
+
<dd>As described above, the cap height of the initial letter aligns with the cap height of the first line of text. The baseline of the initial letter aligns with the baseline of the Nth text baseline.</dd>
2464
+
2465
+
<dt>hanging</dt>
2466
+
<dd>The hanging baseline of the initial letter aligns with the hanging baseline of the first line of text. </dd>
2467
+
2468
+
<dt>ideographic</dt>
2469
+
<dd>The initial letter is centered in the N-line area. </dd>
2470
+
</dl>
2471
+
2472
+
<p class="issue">Input from those knowledgeable about non-Western typographic traditions would be very helpful in describing the appropriate alignments. More values may be required for this property.</p>
2473
+
2474
+
<div class="example">
2475
+
The vertical writing mode example from <a href="#f2">Figure 2</a> could be coded as:
2476
+
2477
+
<pre>
2478
+
span.initial {
2479
+
initial-letter: 2;
2480
+
initial-letter-alignment: ideographic;
2481
+
}
2482
+
</pre>
2483
+
2484
+
2485
+
</div>
2486
+
2487
+
2438
2488
<h3 id="initial-letter-exclusions">Space Around Initial Letters</h3>
2439
2489
2440
2490
If an initial letter has a descender, it could crash into the (n+1)th line of text. This is not desirable.
0 commit comments