Skip to content

Commit d67200a

Browse files
author
dauwhe
committed
[css-inline] Make initial-letter a shorthand for initial-letter-drop and initial-letter-size. Clarify boundaries of content box for initial-letter. This is all in response to http://lists.w3.org/Archives/Public/www-style/2014Sep/0049.html
1 parent 18cc9fb commit d67200a

2 files changed

Lines changed: 135 additions & 37 deletions

File tree

css-inline/Overview.bs

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ The alignment constraints depend on the script used. In Japanese vertical writin
23462346

23472347

23482348

2349-
<p class="issue">Add content describing constraint that the block container have a baseline grid (or fixed line-height?).</p>
2349+
<p class="issue">Add content describing constraint that the block container have a baseline grid (or fixed line-height?). Can we say that the UA can treat other inline or replaced elements in the para as having line-height equal to zero when calculating the initial letter's alignment?</p>
23502350

23512351

23522352
<h3 id="selecting-drop-initials">Selecting Initial Letters</h3>
@@ -2380,13 +2380,13 @@ Only the following properties can be applied to the <code>::first-letter</code>
23802380

23812381

23822382

2383-
<h3 id="sizing-drop-initials">Creating Initial Letters: The 'initial-letter' Property</h3>
2383+
<h3 id="sizing-drop-initials">Creating Initial Letters: The 'initial-letter' shorthand</h3>
23842384

2385-
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.
2385+
This <i>shorthand property</i> for 'initial-letter-drop' and 'initial-letter-size' 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.
23862386

23872387
<pre class="propdef">
23882388
Name: <dfn id="propdef-initial-letter">initial-letter</dfn>
2389-
Value: [<<integer>> <<integer>>?]
2389+
Value: normal | [<<integer>> <<integer>>?]
23902390
Initial: normal
23912391
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
23922392
Inherited: no
@@ -2395,6 +2395,8 @@ Media: visual
23952395
Computed value: ???
23962396
</pre>
23972397

2398+
<p class="note">Unlike most shorthands, omitting an argument does not result in the initial value for that argument being used.</p>
2399+
23982400

23992401
<div class="example">
24002402

@@ -2413,7 +2415,47 @@ p::first-letter {
24132415

24142416

24152417

2416-
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.
2418+
2419+
2420+
2421+
2422+
<h3>The initial-letter-drop property</h3>
2423+
2424+
This longhand describes the line to which an initial letter “sinks.” As in the above example, the baseline of a three-line initial letter aligns to the third text baseline of the paragraph.
2425+
2426+
2427+
2428+
<pre class="propdef">
2429+
Name: <dfn id="propdef-initial-letter-drop">initial-letter-drop</dfn>
2430+
Value: normal | <<integer>>
2431+
Initial: normal
2432+
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
2433+
Inherited: no
2434+
Percentages: N/A
2435+
Media: visual
2436+
Computed value: ???
2437+
</pre>
2438+
2439+
<h3>The initial-letter-size property</h3>
2440+
2441+
2442+
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 'initial-letter-size' property specifies the size of the initial letter, as if it were an n-line drop cap.
2443+
2444+
2445+
2446+
2447+
<pre class="propdef">
2448+
Name: <dfn id="propdef-initial-letter-size">initial-letter-size</dfn>
2449+
Value: normal | <<integer>>
2450+
Initial: normal
2451+
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
2452+
Inherited: no
2453+
Percentages: N/A
2454+
Media: visual
2455+
Computed value: ???
2456+
</pre>
2457+
2458+
24172459

24182460

24192461

@@ -2426,20 +2468,25 @@ Some styles of drop initials do not align with the first line of text. For examp
24262468

24272469
<figure>
24282470
<img src="SunkenCapA.png" width="480" alt="sunken drop initial"/>
2429-
<p class="caption">Sunken cap. The letter drops two lines, but is the size of a three-line initial letter.</p>
2471+
<p class="caption">Sunken cap. The letter drops to the second line, but is the size of a three-line initial letter.</p>
24302472
</figure>
24312473
<pre>
2432-
2474+
/* shorthand */
24332475
p::first-letter {
24342476
initial-letter: 2 3;
24352477
}
24362478

2479+
/* longhand */
2480+
p::first-letter {
2481+
initial-letter-drop: 2;
2482+
initial-letter-size: 3;
2483+
}
24372484
</pre>
24382485

24392486
</div>
24402487

24412488

2442-
If the first argument is ''1'', that creates a pure raised initial letter (often called “raised cap” or “stick-up cap.”
2489+
If 'initial-letter-drop' is ''1'', that creates a pure raised initial letter (often called a “raised cap” or “stick-up cap.” It “sinks” to the first text baseline.
24432490

24442491

24452492
<div class="example">
@@ -2449,11 +2496,16 @@ If the first argument is ''1'', that creates a pure raised initial letter (often
24492496
<p class="caption">Raised cap. The initial letter is the size of a 3-line initial, but does not drop.</p>
24502497
</figure>
24512498
<pre>
2452-
2499+
/* shorthand */
24532500
p::first-letter {
24542501
initial-letter: 1 3;
24552502
}
24562503

2504+
/* longhand */
2505+
p::first-letter {
2506+
initial-letter-drop: 1;
2507+
initial-letter-size: 3;
2508+
}
24572509
</pre>
24582510

24592511
</div>
@@ -2502,11 +2554,10 @@ span.initial {
25022554
initial-letter-alignment: ideographic;
25032555
}
25042556
</pre>
2505-
2506-
25072557
</div>
25082558

25092559

2560+
25102561
<h3 id="initial-letter-exclusions">Space Around Initial Letters</h3>
25112562

25122563
If an initial letter has a descender, it could crash into the (n+1)th line of text. This is not desirable.
@@ -2526,6 +2577,10 @@ Text should be excluded around the glyph bounding boxes of the initial letters:
25262577
</figure>
25272578

25282579

2580+
<p class="note">For Western scripts, an initial letter acts as a content box bounded at the top by the cap height of the font, and at the bottom by the glyph bounding box. Borders, margins, and padding will extend from this content box.</p>
2581+
<p class="issue">The content box will need to be different for non-Western scripts. Perhaps this should be defined as part of the 'initial-letter-alignment' property.</p>
2582+
2583+
25292584
<h3 id="initial-letter-paragraphs">Interactions of initial letters with surrounding paragraphs</h3>
25302585

25312586
<h4>Raised and sunken caps</h4>

0 commit comments

Comments
 (0)