Skip to content

Commit 227fc20

Browse files
committed
Spec WG consensus on text-combine, first cut.
1 parent 3235f9c commit 227fc20

2 files changed

Lines changed: 109 additions & 58 deletions

File tree

css3-writing-modes/Overview.html

Lines changed: 68 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ <h2 class="no-num no-toc" id=Contents> Table of Contents</h2>
271271
page progression direction</a>
272272

273273
<li><a href="#text-combine"><span class=secno>9. </span> Glyph
274-
Composition: the &lsquo;<code class=property>text-combine</code>&rsquo;
275-
property</a>
274+
Composition: the &lsquo;<code
275+
class=property>text-combine-horizontal</code>&rsquo; property</a>
276276

277277
<li class=no-num><a href="#changes">Changes</a>
278278
<ul class=toc>
@@ -2729,20 +2729,21 @@ <h2 id=page-direction><span class=secno>8. </span> Page Flow: the page
27292729
progression.)
27302730

27312731
<h2 id=text-combine><span class=secno>9. </span> Glyph Composition: the
2732-
&lsquo;<a href="#text-combine0"><code
2733-
class=property>text-combine</code></a>&rsquo; property</h2>
2732+
&lsquo;<a href="#text-combine-horizontal"><code
2733+
class=property>text-combine-horizontal</code></a>&rsquo; property</h2>
27342734

27352735
<table class=propdef>
27362736
<tbody>
27372737
<tr>
27382738
<th>Name:
27392739

2740-
<td><dfn id=text-combine0>text-combine</dfn>
2740+
<td><dfn id=text-combine-horizontal>text-combine-horizontal</dfn>
27412741

27422742
<tr>
27432743
<th>Value:
27442744

2745-
<td>none | [ horizontal &lt;number&gt;? ]
2745+
<td>none | all | [ digits &lt;integer>? || alpha &lt;integer>? ||
2746+
alphanumeric &lt;integer>? ] && [ use-glyphs | scale ]?
27462747

27472748
<tr>
27482749
<th>Initial:
@@ -2757,7 +2758,7 @@ <h2 id=text-combine><span class=secno>9. </span> Glyph Composition: the
27572758
<tr>
27582759
<th>Inherited:
27592760

2760-
<td>no
2761+
<td>yes
27612762

27622763
<tr>
27632764
<th>Percentages:
@@ -2786,33 +2787,71 @@ <h2 id=text-combine><span class=secno>9. </span> Glyph Composition: the
27862787

27872788
<dd>No special processing.
27882789

2789-
<dt><dfn id=horizontal title="text-combine:horizontal">horizontal</dfn>
2790+
<dt><dfn id=all title="text-combine:all">all</dfn>
27902791

27912792
<dd>
27922793
<p>In vertical writing mode, attempt to display the text contents of the
27932794
element horizontally within the vertical line box, ideally within the
27942795
space of one ideographic character (1em square).
27952796

2796-
<p>The glyphs are stacked horizontally (similar to the contents of an
2797-
inline-box with a horizontal writing mode and a line-height of 1em) and
2798-
the baseline of the resulting composition chosen such that it is
2799-
centered between the content edges of its parent inline box.
2800-
2801-
<p>The UA should determine how to render the composed glyph into the
2802-
space. If the UA has compressed glyphs available for the contents of the
2803-
element, then it may use those glyphs to attempt sizing the contents to
2804-
1em square. For example, a two digit number may use halfwidth or
2805-
proportional glyphs, a three-digit number may use 1/3-em glyphs (if
2806-
available, else halfwidth glyphs), etc.
2797+
<p>The combined glyphs are stacked horizontally (similar to the contents
2798+
of an inline-box with a horizontal writing mode and a line-height of
2799+
1em) and the baseline of the resulting composition chosen such that it
2800+
is centered between the content edges of its parent inline box. The
2801+
effective height of the composition is assumed to be 1em square;
2802+
anything outside the square bleeds and is not measured for layout
2803+
purposes.
2804+
2805+
<p>In horizontal mode, this value is equivalent to &lsquo;<code
2806+
class=css>none</code>&rsquo;.
2807+
2808+
<dt><dfn id=digits title="text-combine:digits">digits</dfn>
2809+
2810+
<dd>Within the element, each sequence of consecutive horizontal digits
2811+
that has as many or fewer characters than the integer given (or 2, if
2812+
none is given) is treated as if it were in an anonymous inline box with
2813+
&lsquo;<code class=css>text-combine: all</code>&rsquo;. For this
2814+
property, a digit is any character belonging to a Number category (N*)
2815+
that does not belong to a vertical script.
2816+
2817+
<dt><dfn id=alpha title="text-combine:alpha">alpha</dfn>
2818+
2819+
<dd>Within the element, each sequence of consecutive horizontal letters
2820+
that has as many or fewer characters than the integer given (or 2, if
2821+
none is given) is treated as if it were in an anonymous inline box with
2822+
&lsquo;<code class=css>text-combine: all</code>&rsquo;. For this
2823+
property, a horizonal letter is any character belonging to a Letter
2824+
category (L*) that is not East Asian Fullwidth or Wide, and that does not
2825+
belong to a vertical script.
2826+
2827+
<dt><dfn id=alphanumeric
2828+
title="text-combine:alphanumeric">alphanumeric</dfn>
2829+
</dl>
28072830

2808-
<p>The UA may scale the contents to fit instead, or in addition to the
2809-
method above.
2831+
<p>Within the element, each sequence of consecutive horizontal digits
2832+
and/or letters that has as many or fewer characters than the integer given
2833+
(or 2, if none is given) is treated as if it were in an anonymous inline
2834+
box with &lsquo;<code class=css>text-combine: all</code>&rsquo;.
28102835

2811-
<p>In horizontal mode, or if the number of <i>grapheme clusters</i> in
2812-
the element exceeds the number specified (if any), this value is
2813-
equivalent to &lsquo;<code class=css>none</code>&rsquo;.
2836+
<dl>
2837+
<dt><dfn id=use-glyphs title="text-combine:use-glyphs">use-glyphs</dfn> If
2838+
the UA has compressed glyphs available for the contents of the element,
2839+
then it must use those glyphs to attempt sizing the contents to 1em
2840+
square. For example, a two digit number may use halfwidth or proportional
2841+
glyphs, a three-digit number may use 1/3-em glyphs (if available, else
2842+
halfwidth glyphs), etc. If such glyphs are not available, the UA must
2843+
compress the composition horizontally until they fit within the 1em
2844+
square.
2845+
2846+
<dt><dfn id=scale title="text-combine:scale">scale</dfn> Compress the
2847+
composition horizontally until it fits within 1em square.
28142848
</dl>
28152849

2850+
<p class=issue>Define interaction with text-transform
2851+
2852+
<p class=issue>Do we need a tolerance value for scaling? (e.g. 1.1 instead
2853+
of 1em)
2854+
28162855
<div class=example>
28172856
<p>In East Asian documents, the &lsquo;<code class=css>text-combine:
28182857
horizontal</code>&rsquo; effect is often used to display Latin-based
@@ -2844,13 +2883,6 @@ <h2 id=text-combine><span class=secno>9. </span> Glyph Composition: the
28442883

28452884
<p>In Japanese, this effect is known as <i lang=ja>tate-chu-yoko</i>.
28462885
</div>
2847-
<!--
2848-
Some people have requested a way to have numbers
2849-
automatically text-combine'd. Maybe a text-auto-combine property?
2850-
Note that whether a number should be tate-chu-yoko'd is often
2851-
context-sensitive: this would give very weird results when applied
2852-
to an arbitrary paragraph.</p>
2853-
-->
28542886

28552887
<h2 class=no-num id=changes>Changes</h2>
28562888

@@ -3675,15 +3707,17 @@ <h2 class=no-num id=property-index> Property Index</h2>
36753707
<td>as defined in [CSS21]
36763708

36773709
<tr>
3678-
<td><a class=property href="#text-combine0">text-combine</a>
3710+
<td><a class=property
3711+
href="#text-combine-horizontal">text-combine-horizontal</a>
36793712

3680-
<td>none | [ horizontal &lt;number&gt;? ]
3713+
<td>none | all | [ digits &lt;integer>? || alpha &lt;integer>? ||
3714+
alphanumeric &lt;integer>? ] && [ use-glyphs | scale ]?
36813715

36823716
<td>none
36833717

36843718
<td>non-replaced inline elements
36853719

3686-
<td>no
3720+
<td>yes
36873721

36883722
<td>N/A
36893723

css3-writing-modes/Overview.src.html

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,17 +2029,19 @@ <h2 id="page-direction">
20292029
progression.)
20302030

20312031
<h2 id="text-combine">
2032-
Glyph Composition: the 'text-combine' property</h2>
2032+
Glyph Composition: the 'text-combine-horizontal' property</h2>
20332033

20342034
<table class="propdef">
20352035
<tbody>
20362036
<tr>
20372037
<th>Name:</th>
2038-
<td><dfn>text-combine</dfn></td>
2038+
<td><dfn>text-combine-horizontal</dfn></td>
20392039
</tr>
20402040
<tr>
20412041
<th>Value:</th>
2042-
<td>none | [ horizontal &lt;number&gt;? ]</td>
2042+
<td>none | all |
2043+
[ digits &lt;integer>? || alpha &lt;integer>? || alphanumeric &lt;integer>? ]
2044+
&& [ use-glyphs | scale ]?</td>
20432045
</tr>
20442046
<tr>
20452047
<th>Initial:</th>
@@ -2051,7 +2053,7 @@ <h2 id="text-combine">
20512053
</tr>
20522054
<tr>
20532055
<th>Inherited:</th>
2054-
<td>no</td>
2056+
<td>yes</td>
20552057
</tr>
20562058
<tr>
20572059
<th>Percentages:</th>
@@ -2078,30 +2080,53 @@ <h2 id="text-combine">
20782080
<dl>
20792081
<dt><dfn title="text-combine:none">none</dfn>
20802082
<dd>No special processing.</dd>
2081-
<dt><dfn title="text-combine:horizontal">horizontal</dfn>
2083+
<dt><dfn title="text-combine:all">all</dfn>
20822084
<dd><p>In vertical writing mode, attempt to display the text contents
20832085
of the element horizontally within the vertical line box, ideally
20842086
within the space of one ideographic character (1em square).
2085-
<p>The glyphs are stacked
2087+
<p>The combined glyphs are stacked
20862088
horizontally (similar to the contents of an inline-box with a
20872089
horizontal writing mode and a line-height of 1em) and the baseline
20882090
of the resulting composition chosen such that it is centered between
2089-
the content edges of its parent inline box.
2090-
<p>The UA should determine how to render the composed glyph
2091-
into the space.
2091+
the content edges of its parent inline box. The effective height of
2092+
the composition is assumed to be 1em square; anything outside the
2093+
square bleeds and is not measured for layout purposes.
2094+
<p>In horizontal mode, this value is equivalent to ''none''.
2095+
<dt><dfn title="text-combine:digits">digits</dfn>
2096+
<dd>Within the element, each sequence of consecutive horizontal digits
2097+
that has as many or fewer characters than the integer given (or 2,
2098+
if none is given) is treated as if it were in an anonymous inline box
2099+
with ''text-combine: all''.
2100+
For this property, a digit is any character belonging to a Number
2101+
category (N*) that does not belong to a vertical script.
2102+
<dt><dfn title="text-combine:alpha">alpha</dfn>
2103+
<dd>Within the element, each sequence of consecutive horizontal letters
2104+
that has as many or fewer characters than the integer given (or 2,
2105+
if none is given) is treated as if it were in an anonymous inline box
2106+
with ''text-combine: all''.
2107+
For this property, a horizonal letter is any character belonging to
2108+
a Letter category (L*) that is not East Asian Fullwidth or Wide, and
2109+
that does not belong to a vertical script.
2110+
<dt><dfn title="text-combine:alphanumeric">alphanumeric</dfn>
2111+
<p>Within the element, each sequence of consecutive horizontal digits and/or
2112+
letters that has as many or fewer characters than the integer given (or 2,
2113+
if none is given) is treated as if it were in an anonymous inline box
2114+
with ''text-combine: all''.
2115+
<dt><dfn title="text-combine:use-glyphs">use-glyphs</dfn>
20922116
If the UA has compressed glyphs available for the contents of the
2093-
element, then it may use those glyphs to attempt sizing the
2117+
element, then it must use those glyphs to attempt sizing the
20942118
contents to 1em square. For example, a two digit number may use
20952119
halfwidth or proportional glyphs, a three-digit number may use 1/3-em glyphs
20962120
(if available, else halfwidth glyphs), etc.
2097-
<p>The UA may scale the contents to fit instead,
2098-
or in addition to the method above.
2099-
<p>In horizontal mode, or if the number of <i>grapheme clusters</i> in the
2100-
element exceeds the number specified (if any), this value is
2101-
equivalent to ''none''.
2102-
</dd>
2121+
If such glyphs are not available, the UA must compress the composition
2122+
horizontally until they fit within the 1em square.
2123+
<dt><dfn title="text-combine:scale">scale</dfn>
2124+
Compress the composition horizontally until it fits within 1em square.
21032125
</dl>
21042126

2127+
<p class="issue">Define interaction with text-transform
2128+
<p class="issue">Do we need a tolerance value for scaling? (e.g. 1.1 instead of 1em)
2129+
21052130
<div class="example">
21062131
<p>In East Asian documents, the ''text-combine: horizontal'' effect is often
21072132
used to display Latin-based strings such as components of a date or
@@ -2129,14 +2154,6 @@ <h2 id="text-combine">
21292154
<p>In Japanese, this effect is known as <i lang="ja">tate-chu-yoko</i>.
21302155
</div>
21312156

2132-
<!--
2133-
Some people have requested a way to have numbers
2134-
automatically text-combine'd. Maybe a text-auto-combine property?
2135-
Note that whether a number should be tate-chu-yoko'd is often
2136-
context-sensitive: this would give very weird results when applied
2137-
to an arbitrary paragraph.</p>
2138-
-->
2139-
21402157
<h2 class="no-num" id="changes">Changes</h2>
21412158
<h3 class="no-num" id="recent-changes">
21422159
Changes from the <a href="http://www.w3.org/TR/2011/WD-css3-writing-modes-20110428/">April

0 commit comments

Comments
 (0)