Skip to content

Commit 1f3b6f5

Browse files
committed
[css-inline] add values to initial letter align to allow alignment to margin box or content box
1 parent 133da4a commit 1f3b6f5

2 files changed

Lines changed: 33 additions & 7 deletions

File tree

css-inline/Overview.bs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,27 +415,38 @@ As mentioned earlier, the alignment of initial letters depends on the script use
415415

416416
<pre class="propdef" id="initial-letter-align">
417417
Name: <dfn id="propdef-initial-letter-align">initial-letter-align</dfn>
418-
Value: [ auto | alphabetic | hanging | ideographic ]
418+
Value: auto | alphabetic | hanging | ideographic | margin-box | content-box
419419
Initial: auto
420420
Applies to: <code>::first-letter</code> pseudo elements and inline level first child of a block container
421421
Inherited: no
422422
Percentages: N/A
423423
Media: visual
424-
Computed value: ???
424+
Computed value: specified value
425425
</pre>
426426

427427

428428
<dl dfn-type="value" dfn-for="initial-letter-align">
429429
<dt>auto</dt>
430430
<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>
431+
431432
<dt>alphabetic</dt>
432433
<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>
433434

434435
<dt>hanging</dt>
435436
<dd>The hanging baseline of the initial letter aligns with the hanging baseline of the first line of text. </dd>
436437

437438
<dt>ideographic</dt>
438-
<dd>The initial letter is centered in the N-line area. </dd>
439+
<dd>The initial letter is centered in the N-line area.
440+
441+
<dt>margin-box</dt>
442+
<dd>Uses the <a>line-over</a> and <a>line-under</a> margin edges
443+
as the <a>over</a> and <a>under</a> alignment points, respectively.
444+
445+
<dt>content-box</dt>
446+
<dd>Uses the <a>line-over</a> and <a>line-under</a> content edges
447+
as the <a>over</a> and <a>under</a> alignment points, respectively.
448+
(In most cases, these will correspond to
449+
the <a>over</a> and <a>under</a> edges of the glyph bounding box.)
439450
</dl>
440451

441452
<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>

css-inline/Overview.html

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ <h3 class="heading settled" data-level="2.4" id="aligning-initial-letter"><span
897897
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-initial-letter-align">initial-letter-align<a class="self-link" href="#propdef-initial-letter-align"></a></dfn>
898898
<tr class="value">
899899
<th>Value:
900-
<td class="prod">[ auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> alphabetic <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> hanging <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> ideographic ]
900+
<td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> alphabetic <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> hanging <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> ideographic <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> margin-box <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-3/#comb-one">|</a> content-box
901901
<tr>
902902
<th>Initial:
903903
<td>auto
@@ -915,7 +915,7 @@ <h3 class="heading settled" data-level="2.4" id="aligning-initial-letter"><span
915915
<td>visual
916916
<tr>
917917
<th>Computed value:
918-
<td>???
918+
<td>specified value
919919
<tr>
920920
<th>Animatable:
921921
<td>no</table>
@@ -928,6 +928,7 @@ <h3 class="heading settled" data-level="2.4" id="aligning-initial-letter"><span
928928

929929
<dd>The user agent selects the value which corresponds to the language of the text. Western languages would default to <a class="css" data-link-type="maybe" href="#valdef-dominant-baseline-alphabetic">alphabetic</a>, CJK languages to <span class="css">ideographic</span>, and some Indic languages to <a class="css" data-link-type="maybe" href="#valdef-dominant-baseline-hanging">hanging</a>.
930930

931+
931932
<dt>alphabetic
932933

933934
<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.
@@ -941,6 +942,20 @@ <h3 class="heading settled" data-level="2.4" id="aligning-initial-letter"><span
941942
<dt>ideographic
942943

943944
<dd>The initial letter is centered in the N-line area.
945+
946+
947+
<dt>margin-box
948+
949+
<dd>Uses the <a data-link-type="dfn">line-over</a> and <a data-link-type="dfn">line-under</a> margin edges
950+
as the <a data-link-type="dfn">over</a> and <a data-link-type="dfn">under</a> alignment points, respectively.
951+
952+
953+
<dt>content-box
954+
955+
<dd>Uses the <a data-link-type="dfn">line-over</a> and <a data-link-type="dfn">line-under</a> content edges
956+
as the <a data-link-type="dfn">over</a> and <a data-link-type="dfn">under</a> alignment points, respectively.
957+
(In most cases, these will correspond to
958+
the <a data-link-type="dfn">over</a> and <a data-link-type="dfn">under</a> edges of the glyph bounding box.)
944959
</dl>
945960

946961

@@ -1721,14 +1736,14 @@ <h2 class="no-num heading settled" id="property-index"><span class="content">Pro
17211736
<td>as specified
17221737
<tr>
17231738
<th scope="row"><a class="css" data-link-type="property" href="#propdef-initial-letter-align">initial-letter-align</a>
1724-
<td>[ auto | alphabetic | hanging | ideographic ]
1739+
<td>auto | alphabetic | hanging | ideographic | margin-box | content-box
17251740
<td>auto
17261741
<td>::first-letter pseudo elements and inline level first child of a block container
17271742
<td>no
17281743
<td>N/A
17291744
<td>visual
17301745
<td>no
1731-
<td>???
1746+
<td>specified value
17321747
<tr>
17331748
<th scope="row"><a class="css" data-link-type="property" href="#propdef-initial-letter-wrap">initial-letter-wrap</a>
17341749
<td>none | all | first | auto

0 commit comments

Comments
 (0)