FFFF Multi-script examples for 'word-break' and 'hyphens'; fix glitch in '… · simonwuelker/csswg-drafts@2a1b97d · GitHub
Skip to content

Commit 2a1b97d

Browse files
committed
Multi-script examples for 'word-break' and 'hyphens'; fix glitch in 'word-break: break-all' definition.
1 parent 868c9e6 commit 2a1b97d

2 files changed

Lines changed: 88 additions & 19 deletions

File tree

css3-text/Overview.html

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929

3030
<h1>CSS Text Level 3</h1>
3131

32-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 6 January 2012</h2>
32+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 7 January 2012</h2>
3333

3434
<dl>
3535
<dt>This version:
3636

3737
<dd><a href="http://dev.w3.org/csswg/css3-text/">$Date: 2012/01/06
38-
22:56:54 $ (CVS $Revision$)</a> <!--
39-
<dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120106/">http://www.w3.org/TR/2012/WD-css3-text-20120106/</a></dd>
38+
22:59:32 $ (CVS $Revision$)</a> <!--
39+
<dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120107/">http://www.w3.org/TR/2012/WD-css3-text-20120107/</a></dd>
4040
-->
4141

4242

@@ -1414,10 +1414,11 @@ <h3 id=word-break><span class=secno>4.2. </span> Word Breaking Rules: the
14141414
<dt><dfn id=break-all title="word-break:break-all">&lsquo;<code
14151415
class=css>break-all</code>&rsquo;</dfn>
14161416

1417-
<dd>Lines may break between any two characters within words. Hyphenation
1418-
is not applied. This option is used mostly in a context where the text is
1419-
predominantly using CJK characters with few non-CJK excerpts and it is
1420-
desired that the text be better distributed on each line.
1417+
<dd>In addition to normal opportunities, lines may break between any two
1418+
letters within words. Hyphenation is not applied. This option is used
1419+
mostly in a context where the text is predominantly using CJK characters
1420+
with few non-CJK excerpts and it is desired that the text be better
1421+
distributed on each line.
14211422

14221423
<dt><dfn id=keep-all title="word-break:keep-all">&lsquo;<code
14231424
class=css>keep-all</code>&rsquo;</dfn>
@@ -1429,6 +1430,40 @@ <h3 id=word-break><span class=secno>4.2. </span> Word Breaking Rules: the
14291430
line-breaking opportunities, as in Korean.
14301431
</dl>
14311432

1433+
<div class=example>
1434+
<p>Here's a mixed-script sample text:
1435+
1436+
<pre>这是一些汉字, and some Latin text,<!--
1437+
--> &#x0648; &#x06A9;&#x0645;&#x06CC; &#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646; &#x0639;&#x0631;&#x0628;&#x06CC;, <!--
1438+
-->and some complex LTR.</pre>
1439+
1440+
<p>The break-points are determined as follows (indicated by
1441+
&lsquo;&middot;&rsquo;):
1442+
1443+
<dl>
1444+
<dt>&lsquo;<code class=css>word-break: normal</code>&rsquo;
1445+
1446+
<dd>
1447+
<pre>这·是·一·些·汉·字,·and·some·Latin·text,<!--
1448+
-->·&#x0648;·&#x06A9;&#x0645;&#x06CC;·&#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646;·&#x0639;&#x0631;&#x0628;&#x06CC;·<!--
1449+
-->and·some·complex·LTR.</pre>
1450+
1451+
<dt>&lsquo;<code class=css>word-break: break-all</code>&rsquo;
1452+
1453+
<dd>
1454+
<pre>这·是·一·些·汉·字·a·n·d·s·o·m·e·L·a·t·i·n·t·e·x·t,<!--
1455+
-->·&#x0648;·&#xFB90;·&#xFEE4;·&#xFEF0;·&#xFEE7;·&#xFEEE;·&#xFEB7;·&#xFE98;·&#xFEE6;·&#xFECB;·&#xFEAE;·&#xFE91;·&#xFEF0;,·<!--
1456+
-->a·n·d·s·o·m·e·c·o·m·p·l·e·x·L·T·R.</pre>
1457+
1458+
<dt>&lsquo;<code class=css>word-break: keep-all</code>&rsquo;
1459+
1460+
<dd>
1461+
<pre>这是一些汉字,·and·some·Latin·text,<!--
1462+
-->·&#x0648;·&#x06A9;&#x0645;&#x06CC;·&#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646;·&#x0639;&#x0631;&#x0628;&#x06CC;,·<!--
1463+
-->and·some·complex·LTR.</pre>
1464+
</dl>
1465+
</div>
1466+
14321467
<p>When shaping scripts such as Arabic are allowed to break within words
14331468
due to &lsquo;<code class=css>break-all</code>&rsquo;, the characters must
14341469
still be shaped as if the word were not broken.
@@ -1516,12 +1551,9 @@ <h3 id=hyphens><span class=secno>5.1. </span>Hyphenation Control: the
15161551
explicit hyphen. Unicode Standard Annex #14 describes the <a
15171552
href="http://unicode.org/reports/tr14/#SoftHyphen">role of soft hyphens
15181553
in</a> Unicode line breaking. <a href="#UAX14"
1519-
rel=biblioentry>[UAX14]<!--{{!UAX14}}--></a>
1520-
</div>
1521-
1522-
<div class=example>
1523-
<p>In HTML, &amp;shy; represents the soft hyphen character which
1524-
suggests a line break opportunity.
1554+
rel=biblioentry>[UAX14]<!--{{!UAX14}}--></a> In HTML, &amp;shy;
1555+
represents the soft hyphen character which suggests a hyphenation
1556+
opportunity.
15251557

15261558
<pre>ex&amp;shy;ample</pre>
15271559
</div>
@@ -1547,6 +1579,14 @@ <h3 id=hyphens><span class=secno>5.1. </span>Hyphenation Control: the
15471579
due to hyphenation, the characters must still be shaped as if the word
15481580
were not broken.
15491581

1582+
<div class=example>
1583+
<p>For example, if the word
1584+
&ldquo;&#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646;&rdquo; were
1585+
hyphenated, it would appear as
1586+
&ldquo;&#xFEE7;&#xFEEE;&#xFEB7;-&#xFE98;&#xFEE6;&rdquo; not as
1587+
&ldquo;&#xFEE7;&#xFEEE;&#xFEB5;-&#xFE97;&#xFEE6;&rdquo;.
1588+
</div>
1589+
15501590
<h2 id=wrapping><span class=secno>6. </span> Text Wrapping</h2>
15511591

15521592
<p>Text wrapping is controlled by the &lsquo;<a href="#text-wrap0"><code

css3-text/Overview.src.html

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,8 @@ <h3 id="word-break">
952952
<dt><dfn title="word-break:normal">''normal''</dfn></dt>
953953
<dd>Break lines according to their usual rules.</dd>
954954
<dt><dfn title="word-break:break-all">''break-all''</dfn></dt>
955-
<dd>Lines may break between any two characters within words.
955+
<dd>In addition to normal opportunities, lines may break between any two
956+
letters within words.
956957
Hyphenation is not applied. This option is used mostly in a context where
957958
the text is predominantly using CJK characters with few non-CJK excerpts
958959
and it is desired that the text be better distributed on each line.</dd>
@@ -964,6 +965,31 @@ <h3 id="word-break">
964965
characters still creates line-breaking opportunities, as in Korean.</dd>
965966
</dl>
966967

968+
<div class="example">
969+
<p>Here's a mixed-script sample text:
970+
<pre>这是一些汉字, and some Latin text,<!--
971+
--> &#x0648; &#x06A9;&#x0645;&#x06CC; &#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646; &#x0639;&#x0631;&#x0628;&#x06CC;, <!--
972+
-->and some complex LTR.</pre>
973+
<p>The break-points are determined as follows (indicated by &lsquo;&middot;&rsquo;):
974+
<dl>
975+
<dt>''word-break: normal''</dt>
976+
<dd>
977+
<pre>这·是·一·些·汉·字,·and·some·Latin·text,<!--
978+
-->·&#x0648;·&#x06A9;&#x0645;&#x06CC;·&#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646;·&#x0639;&#x0631;&#x0628;&#x06CC;·<!--
979+
-->and·some·complex·LTR.</pre>
980+
<dt>''word-break: break-all''</dt>
981+
<dd>
982+
<pre>这·是·一·些·汉·字·a·n·d·s·o·m·e·L·a·t·i·n·t·e·x·t,<!--
983+
-->·&#x0648;·&#xFB90;·&#xFEE4;·&#xFEF0;·&#xFEE7;·&#xFEEE;·&#xFEB7;·&#xFE98;·&#xFEE6;·&#xFECB;·&#xFEAE;·&#xFE91;·&#xFEF0;,·<!--
984+
-->a·n·d·s·o·m·e·c·o·m·p·l·e·x·L·T·R.</pre>
985+
<dt>''word-break: keep-all''</dt>
986+
<dd>
987+
<pre>这是一些汉字,·and·some·Latin·text,<!--
988+
-->·&#x0648;·&#x06A9;&#x0645;&#x06CC;·&#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646;·&#x0639;&#x0631;&#x0628;&#x06CC;,·<!--
989+
-->and·some·complex·LTR.</pre>
990+
</dl>
991+
</div>
992+
967993
<p>When shaping scripts such as Arabic are allowed to break within words
968994
due to ''break-all'', the characters must still be shaped as if the
969995
word were not broken.</p>
@@ -1027,11 +1053,8 @@ <h3 id="hyphens">Hyphenation Control: the 'hyphens' property</h3>
10271053
explicit hyphen. Unicode Standard Annex #14 describes the
10281054
<a href="http://unicode.org/reports/tr14/#SoftHyphen">role of soft hyphens in</a>
10291055
Unicode line breaking. [[!UAX14]]
1030-
</div>
1031-
1032-
<div class="example">
1033-
<p>In HTML, &amp;shy; represents the soft hyphen character which
1034-
suggests a line break opportunity.
1056+
In HTML, &amp;shy; represents the soft hyphen character which
1057+
suggests a hyphenation opportunity.
10351058
<pre>ex&amp;shy;ample</pre>
10361059
</div>
10371060
<dt><dfn title="hyphens:auto">''auto''</dfn>
@@ -1055,6 +1078,12 @@ <h3 id="hyphens">Hyphenation Control: the 'hyphens' property</h3>
10551078
due to hyphenation, the characters must still be shaped as if the word
10561079
were not broken.</p>
10571080

1081+
<div class="example">
1082+
<p>For example, if the word &ldquo;&#x0646;&#x0648;&#x0634;&#x062A;&#x0646;&#x0646;&rdquo;
1083+
were hyphenated, it would appear as &ldquo;&#xFEE7;&#xFEEE;&#xFEB7;-&#xFE98;&#xFEE6;&rdquo;
1084+
not as &ldquo;&#xFEE7;&#xFEEE;&#xFEB5;-&#xFE97;&#xFEE6;&rdquo;.
1085+
</div>
1086+
10581087
<h2 id="wrapping">
10591088
Text Wrapping</h2>
10601089

0 commit comments

Comments
 (0)