Skip to content

Commit d7a21e7

Browse files
committed
Tweak text-underline-position syntax to be more friendly to non-Far-East users. Add examples. Shift around images and add better alt text.
1 parent a521b02 commit d7a21e7

2 files changed

Lines changed: 177 additions & 90 deletions

File tree

css3-text/Overview.html

Lines changed: 101 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232

3333
<h1>CSS Text Level 3</h1>
3434

35-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 12 January
35+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 13 January
3636
2012</h2>
3737

3838
<dl>
3939
<dt>This version:
4040

4141
<dd><a href="http://dev.w3.org/csswg/css3-text/">$Date: 2012/01/12
42-
09:09:41 $ (CVS $Revision$)</a> <!--
43-
<dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120112/">http://www.w3.org/TR/2012/WD-css3-text-20120112/</a></dd>
42+
23:36:47 $ (CVS $Revision$)</a> <!--
43+
<dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120113/">http://www.w3.org/TR/2012/WD-css3-text-20120113/</a></dd>
4444
-->
4545

4646

@@ -3666,7 +3666,7 @@ <h4 id=text-underline-position><span class=secno>10.1.6. </span> Text
36663666
<tr>
36673667
<th><a href="#values">Value</a>:
36683668

3669-
<td>auto | alphabetic | below && left | below && right
3669+
<td>auto | alphabetic | [ below || [ left | right ] ]
36703670

36713671
<tr>
36723672
<th>Initial:
@@ -3707,7 +3707,7 @@ <h4 id=text-underline-position><span class=secno>10.1.6. </span> Text
37073707
<dt><dfn id=auto2>&lsquo;<code class=css>auto</code>&rsquo;</dfn>
37083708

37093709
<dd>The user agent may use any algorithm to determine the underline's
3710-
position.
3710+
position; however it must be placed at or below the alphabetic baseline.
37113711
<p class=note>It is suggested that the underline position be &lsquo;<code
37123712
class=css>alphabetic</code>&rsquo; unless it crosses either subscripted
37133713
(or otherwise lowered) text, or it affects characters from Asian scripts
@@ -3720,65 +3720,112 @@ <h4 id=text-underline-position><span class=secno>10.1.6. </span> Text
37203720

37213721
<dd>The underline is positioned relative to the alphabetic baseline. In
37223722
this case the underline is likely to cross some descenders.
3723+
<div class=figure>
3724+
<p><img
3725+
alt="In a typical Latin font, the underline is positioned slightly below the alphabetic baseline, leaving a gap between the line and the bottom of most Latin letters, but crossing through descenders such as the stem of a 'p'."
3726+
src=underline-position-alphabetic.png
3727+
title="text-underline-position: alphabetic">
3728+
3729+
<p class=caption>&lsquo;<code class=css>text-underline-position:
3730+
alphabetic</code>&rsquo;</p>
3731+
</div>
37233732

3724-
<dt><dfn id=below-left>&lsquo;<code class=css>below
3725-
left</code>&rsquo;</dfn>
3726-
3727-
<dd>The underline is positioned relative to the under edge of the
3728-
element's content box. In this case the underline usually does not cross
3729-
the descenders. (This is sometimes called "accounting" underline.) If the
3730-
underline affects descendants with a lower content edge, the user agent
3731-
should shift the underline down further to the lowest underlined content
3732-
box edge. The user agent may ignore elements with &lsquo;<code
3733-
class=css>vertical-align</code>&rsquo; values given as lengths,
3734-
percentages, &lsquo;<code class=css>top</code>&rsquo;, or &lsquo;<code
3733+
<dt><dfn id=below>&lsquo;<code class=css>below</code>&rsquo;</dfn>
3734+
3735+
<dd>In horizontal typographic modes, the underline is positioned relative
3736+
to the under edge of the element's content box. In this case the
3737+
underline usually does not cross the descenders. (This is sometimes
3738+
called "accounting" underline.) If the underline affects descendants with
3739+
a lower content edge, the user agent should shift the underline down
3740+
further to the lowest underlined content box edge. The user agent may
3741+
ignore elements with &lsquo;<code class=css>vertical-align</code>&rsquo;
3742+
values given as lengths, percentages, &lsquo;<code
3743+
class=css>top</code>&rsquo;, or &lsquo;<code
37353744
class=css>bottom</code>&rsquo; when making this adjustment. (Note that
37363745
images that are not affected by the underline per &lsquo;<a
37373746
href="#text-decoration-skip0"><code
37383747
class=property>text-decoration-skip</code></a>&rsquo; will not affect the
37393748
position of the underline.)
3749+
<div class=figure>
3750+
<p><img
3751+
alt="In a typical Latin font, the underline is far enough below the text that it does not cross the bottom of a 'g'."
3752+
src=underline-position-below.png
3753+
title="text-underline-position: below">
3754+
3755+
<p class=caption>&lsquo;<code class=css>text-underline-position:
3756+
below</code>&rsquo;</p>
3757+
</div>
3758+
3759+
<div class=example>
3760+
<p>Because &lsquo;<a href="#text-underline-position0"><code
3761+
class=property>text-underline-position</code></a>&rsquo; inherits, and
3762+
is not reset by the &lsquo;<a href="#text-decoration0"><code
3763+
class=property>text-decoration</code></a>&rsquo; shorthand, the
3764+
following example switches the document to use &lsquo;<code
3765+
class=css>below</code>&rsquo; underlining, which can be more
3766+
appropriate for writing systems with long, complicated descenders. It
3767+
is also often useful for mathematical or chemical texts that use many
3768+
subscripts.
3769+
3770+
<pre>:root { text-underline-position: below; }</pre>
3771+
</div>
3772+
3773+
<dt><dfn id=left0>&lsquo;<code class=css>left</code>&rsquo;</dfn>
37403774

3741-
<dt><dfn id=below-right>&lsquo;<code class=css>below
3742-
right</code>&rsquo;</dfn>
3775+
<dd>In vertical typographic modes, the underline is aligned as for
3776+
&lsquo;<code class=css>below</code>&rsquo;, on the left edge of the text.
37433777

3744-
<dd>In horizontal typographic mode, this value is equivalent to
3745-
&lsquo;<code class=css>below left</code>&rsquo;. In vertical typographic
3746-
mode, the underline is aligned as for &lsquo;<code class=css>below
3747-
left</code>&rsquo;, except it is aligned to the right edge of the text.
3748-
If this causes the underline to be drawn on the "over" side of the text,
3749-
then an overline also switches sides and is drawn on the "under" side.
3778+
<dt><dfn id=right0>&lsquo;<code class=css>right</code>&rsquo;</dfn>
3779+
3780+
<dd>In vertical typographic modes, the underline is aligned as for
3781+
&lsquo;<code class=css>below</code>&rsquo;, except it is aligned to the
3782+
right edge of the text. If this causes the underline to be drawn on the
3783+
"over" side of the text, then an overline also switches sides and is
3784+
drawn on the "under" side.
37503785
</dl>
37513786

3787+
<p>If &lsquo;<code class=css>below</code>&rsquo; is specified alone,
3788+
&lsquo;<code class=css>left</code>&rsquo; is also implied. If &lsquo;<code
3789+
class=css>left</code>&rsquo; or &lsquo;<code class=css>right</code>&rsquo;
3790+
is specified alone, &lsquo;<code class=css>below</code>&rsquo; is also
3791+
implied.
3792+
37523793
<div class=figure class=data id=fig-text-underline-position>
37533794
<table>
37543795
<tbody>
37553796
<tr>
3756-
<td> <img alt="text-underline-position: alphabetic"
3757-
src=underline-position-alphabetic.png>
3758-
3759-
<td rowspan=3> <img alt="text-underline-position: left"
3760-
src=underline-position-left.png>
3761-
3762-
<td rowspan=3> <img alt="text-underline-position: right"
3763-
src=underline-position-right.png>
3764-
3765-
<tr>
3766-
<td>&lsquo;<code class=css>alphabetic</code>&rsquo;
3797+
<td> <img
3798+
alt="In mixed Japanese-Latin vertical text, 'text-underline-position: left' places the underline on the left side of the text."
3799+
src=underline-position-left.png title="text-underline-position: left">
3800+
37673801

3768-
<tr>
3769-
<td> <img alt="text-underline-position: below"
3770-
src=underline-position-below.png>
3802+
<td> <img
3803+
alt="In mixed Japanese-Latin vertical text, 'text-underline-position: right' places the underline on the right side of the text."
3804+
src=underline-position-right.png
3805+
title="text-underline-position: right">
37713806

37723807
<tr>
3773-
<td>&lsquo;<code class=css>below</code>&rsquo;
3774-
37753808
<td>&lsquo;<code class=css>left</code>&rsquo;
37763809

37773810
<td>&lsquo;<code class=css>right</code>&rsquo;
37783811
</table>
37793812

3780-
<p class=caption>&lsquo;<a href="#text-underline-position0"><code
3781-
class=property>text-underline-position</code></a>&rsquo; values</p>
3813+
<p class=caption>In vertical typographic modes, the &lsquo;<a
3814+
href="#text-underline-position0"><code
3815+
class=property>text-underline-position</code></a>&rsquo; values
3816+
&lsquo;<code class=css>left</code>&rsquo; and &lsquo;<code
3817+
class=css>right</code>&rsquo; allow placing the underline on either side
3818+
of the text. (In horizontal typographic modes, both values are treated as
3819+
&lsquo;<code class=css>below</code>&rsquo;.)</p>
3820+
</div>
3821+
3822+
<div class=example>
3823+
<p>The following example styles modern Chinese, Japanese, and Korean texts
3824+
with the appropriate underline positions in both horizontal and vertical
3825+
text:
3826+
3827+
<pre>:lang(ja), :lang(ko) { text-underline-position: below right; }
3828+
<!-- -->:lang(zh) { text-underline-position: below left; }</pre>
37823829
</div>
37833830

37843831
<div class=note>
@@ -4025,7 +4072,7 @@ <h4 id=text-emphasis-color><span class=secno>10.2.2. </span> Emphasis Mark
40254072
<td>as specified
40264073
</table>
40274074

4028-
<p>This property describes the foreground color of the emphasis marks.
4075+
<p>This property specifies the foreground color of the emphasis marks.
40294076

40304077
<h4 id=text-emphasis><span class=secno>10.2.3. </span> Emphasis Mark
40314078
Shorthand: the &lsquo;<a href="#text-emphasis0"><code
@@ -4146,17 +4193,17 @@ <h4 id=text-emphasis-position><span class=secno>10.2.4. </span> Emphasis
41464193

41474194
<dd>Draw marks over the text in horizontal typographic mode.
41484195

4149-
<dt><dfn id=below title="text-emphasis:below">&lsquo;<code
4196+
<dt><dfn id=below0 title="text-emphasis:below">&lsquo;<code
41504197
class=css>below</code>&rsquo;</dfn>
41514198

41524199
<dd>Draw marks under the text in horizontal typographic mode.
41534200

4154-
<dt><dfn id=right0 title="text-emphasis:right">&lsquo;<code
4201+
<dt><dfn id=right1 title="text-emphasis:right">&lsquo;<code
41554202
class=css>right</code>&rsquo;</dfn>
41564203

41574204
<dd>Draw marks to the right of the text in vertical typographic mode.
41584205

4159-
<dt><dfn id=left0 title="text-emphasis:left">&lsquo;<code
4206+
<dt><dfn id=left1 title="text-emphasis:left">&lsquo;<code
41604207
class=css>left</code>&rsquo;</dfn>
41614208

41624209
<dd>Draw marks to the left of the text in vertical typographic mode.
@@ -4252,7 +4299,7 @@ <h3 id=text-shadow><span class=secno>10.3. </span> Text Shadows: the
42524299
<tr>
42534300
<th><a href="#values">Value</a>:
42544301

4255-
<td>none | [ &lt;length>{2,3} && &gt;color>? ]#
4302+
<td>none | [ &lt;length>{2,3} && &lt;color>? ]#
42564303

42574304
<tr>
42584305
<th>Initial:
@@ -4716,6 +4763,11 @@ <h2 class=no-num id=default-stylesheet>Appendix D: Default UA Stylesheet</h2>
47164763
<!-- -->/* default emphasis mark position is 'below right' for Chinese */
47174764
<!-- --> text-emphasis-position: below right;
47184765
<!-- -->}
4766+
<!-- -->
4767+
<!-- -->:root:lang(zh), [lang|=zh] {
4768+
<!-- -->/* default underline position is 'below left' for Japanese and Korean */
4769+
<!-- --> text-underline-position: below right;
4770+
<!-- -->}
47194771
</code></pre>
47204772
</div>
47214773

@@ -5628,7 +5680,7 @@ <h2 class=no-num id=appendix-h-full-property-index>Appendix H: Full
56285680
<tr>
56295681
<th><a class=property href="#text-shadow0">text-shadow</a>
56305682

5631-
<td>none | [ &lt;length>{2,3} && &gt;color>? ]#
5683+
<td>none | [ &lt;length>{2,3} && &lt;color>? ]#
56325684

56335685
<td>none
56345686

@@ -5676,7 +5728,7 @@ <h2 class=no-num id=appendix-h-full-property-index>Appendix H: Full
56765728
<th><a class=property
56775729
href="#text-underline-position0">text-underline-position</a>
56785730

5679-
<td>auto | alphabetic | below && left | below && right
5731+
<td>auto | alphabetic | [ below || [ left | right ] ]
56805732

56815733
<td>auto
56825734

0 commit comments

Comments
 (0)