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
+49-27Lines changed: 49 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -573,41 +573,73 @@ In the <a>inline axis</a>, the position of the inline letter is given by alignin
573
573
However, if the <a>initial letter</a> is a non-atomic inline with zero padding and borders, the UA must apply an additional negative offset on the start side of the amount necessary to optically align the first glyph to the containing block edge as it would be in normal text.
Applies to: <code>::first-letter</code> pseudo-elements and inline-level first child of a block container
584
-
Inherited: no
584
+
Inherited: yes
585
585
Percentages: N/A
586
586
Media: visual
587
587
Computed value: as specified
588
588
</pre>
589
589
590
+
This property specifies whether lines impacted by an <a>initial letter</a>
591
+
are shortened to fit the rectangular shape of the <a>initial letter</a> box
592
+
or follow the contour of its end-edge glyph outline.
593
+
590
594
<dl dfn-for=initial-letter-wrap dfn-type=value>
591
595
<dt><dfn>none</dfn>
592
-
<dd>No wrapping is performed.</dd>
593
-
<dt><dfn>auto</dfn></dt>
594
-
<dd>For each line of text impacted by the initial letter, the line box adjacent to the intial letter starts at the left-most point that touches the ink of the initial letter, plus a fixed amount of offset.</dd>
596
+
<dd>No contour-fitting is performed:
597
+
each impacted line is aligned flush to the end margin edge of the <a>initial letter</a>.</dd>
595
598
596
-
Issue: How much offset? Based on the right side-bearing of the initial letter? That could be a problem as it's sometimes negative (see Zapfino).
599
+
<dt><dfn>all</dfn></dt>
600
+
<dd>For each line of text impacted by the initial letter, the line box adjacent to the intial letter starts at the start-most point that touches the ink of the initial letter, plus the amount of the <a>initial letter</a>’s end-side border+padding+margin.</dd>
597
601
598
-
<dt><dfn>first-line</dfn>
599
-
<dd>As auto, but wrapping only performed on the first line of the block containing the initial letter.</dd>
600
-
</dl>
601
602
602
-
Issue: Rewrite for logical directions.
603
+
<dt><dfn>first</dfn>
604
+
<dd>Behaves as for ''all'' on the first line of the block containing the initial letter and as ''none'' on the rest.</dd>
605
+
606
+
<dt><dfn>auto</dfn>
607
+
<dd>Behaves as ''none'' if
608
+
the <a>initial letter</a>’s end-side padding or margin is nonzero <em>or</em>
609
+
the first <a>typographic character unit</a> after the <a>initial letter</a> belongs to Unicode General Category Zs <em>or</em>
610
+
the last <a>typographic character unit</a> of the <a>initial letter</a>
611
+
<ul>
612
+
<li>belongs to the Symbols <a>Unicode General Category</a> (<code>S</code>)
613
+
<li>has an <a>East Asian Width</a> property of <code>Wide</code> or <code>Fullwidth</code>
614
+
<li>belongs to a script that is commonly used without spaces between words.
615
+
(Such scripts include:
616
+
Cham,
617
+
Han,
618
+
Khmer,
619
+
Lao,
620
+
Thai,
621
+
Yi
622
+
)
623
+
</ul>
624
+
Behaves as ''first'' otherwise.
603
625
604
-
Issue: Bikeshed value names.
626
+
Issue: Do we want to make this script-dependent?
627
+
628
+
</dl>
605
629
606
630
607
631
Issue: Do we need anything else for scripts where this behavior is undesirable? Or is default "none" sufficient?
608
632
609
633
610
-
Note: If the next character after the initial letter is a whitespace character, auto and first-line compute to none, in order to avoid the initial letter appearing to be part of the subsequent word.
634
+
Note: If the next character after the initial letter is a whitespace character, auto and first compute to none, in order to avoid the initial letter appearing to be part of the subsequent word.
635
+
636
+
637
+
<figure>
638
+
<img src="images/OpticalKerning.png" alt="optical kerning in the presence or absence of a space after the initial letter" width="200"/>
639
+
<p class="caption">In the top paragraph, the initial letter "A" has a word space after it. In the middle paragraph, the initial letter "A" is part of a word. In this case, the first line of text should be kerned into the initial letter's area as shown in the bottom paragraph.</p>
640
+
</figure>
641
+
642
+
Issue: Edit figure to show how auto behaves in varying contexts
611
643
612
644
613
645
<div class="example">
@@ -643,13 +675,13 @@ Text follows shape of initial letter. Each line box should just touch the ink of
643
675
<pre>
644
676
p::first-letter {
645
677
initial-letter: 3;
646
-
initial-letter-wrap: first-line;
678
+
initial-letter-wrap: first;
647
679
}
648
680
</pre>
649
681
650
682
<img alt="text wrapping around dropcap A but only on first line" src="images/A-wraparound-first.png" width="600">
651
683
652
-
Only first line is moved up against the ink of the initial letter.
684
+
Only the first line is moved up against the ink of the initial letter.
653
685
654
686
</div>
655
687
@@ -672,19 +704,9 @@ Only first line is moved up against the ink of the initial letter.
672
704
673
705
</div>
674
706
675
-
Issue: What should happen with initial letters that are concave on the (right) side? Wrapping the middle line in a three-line initial "K" can look very strange.
676
707
677
708
678
-
Additionally, when borders and padding are zero
679
-
and the next <a>typographic character unit</a> after the <a>initial letter</a>
680
-
is not a space (<a>Unicode general category</a><code>Zs</code>),
681
-
the UA should optically kern the first line of text into the <a>initial letter</a>’s area
682
-
as necessary to maintain perceptual continuity of the text.
683
709
684
-
<figure>
685
-
<img src="images/OpticalKerning.png" alt="optical kerning in the presence or absence of a space after the initial letter" width="200"/>
686
-
<p class="caption">In the top paragraph, the initial letter "A" has a word space after it. In the middle paragraph, the initial letter "A" is part of a word. In this case, the first line of text should be kerned into the initial letter's area as shown in the bottom paragraph.</p>
0 commit comments