Skip to content

Commit 2f7ea66

Browse files
committed
[css-text] text-justify:auto re-worked as per the resolution at Seoul F2F <http://lists.w3.org/Archives/Public/www-style/2014Jun/0167.html>
1 parent 79a953a commit 2f7ea66

2 files changed

Lines changed: 208 additions & 108 deletions

File tree

css-text/Overview.bs

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,17 +1558,6 @@ Canonical order: N/A
15581558
<dd>The UA determines the justification algorithm to follow, based
15591559
on a balance between performance and adequate presentation quality.
15601560
UAs should, where possible, use a justification algorithm appropriate to the text.
1561-
<p class="example">
1562-
For example, the UA could use by default a justification method that is a
1563-
simple universal compromise for all writing systems&mdash;such as
1564-
primarily expanding <i>word separators</i>
1565-
along with secondarily expanding between CJK and Southeast Asian <i>visually-perceived letters</i>.
1566-
Then, in cases where the <i>content language</i> of the paragraph is known,
1567-
it could choose a more language-tailored justification behavior
1568-
e.g. following [[JLREQ]] for Japanese,
1569-
using cursive elongation for Arabic,
1570-
using ''inter-word'' for German,
1571-
etc.
15721561

15731562
<div class="figure" id="fig-text-justify-cursive">
15741563
<p>
@@ -1657,6 +1646,13 @@ Expanding and Compressing Text</h4>
16571646
(such as font size, letter-spacing, glyph shape, position within the line, etc.)
16581647
may influence the distribution of space to <i>justification opportunities</i> within the line.
16591648

1649+
<p>The UA may enable or break optional ligatures or use other font features
1650+
such as alternate glyphs or glyph compression
1651+
to help justify the text under any method.
1652+
This behavior is not controlled by this level of CSS.
1653+
However, UAs <em>must not</em> break required ligatures
1654+
or otherwise disable features required to correctly shape complex scripts.
1655+
16601656
<h4 id="justify-symbols">
16611657
Handling Symbols and Punctuation</h4>
16621658

@@ -1706,6 +1702,32 @@ Cursive Scripts</h4>
17061702
<h4 id="justify-algos">
17071703
Possible Algorithms</h4>
17081704

1705+
<p>For <a value for=text-justify>auto</a> justification, this specification does not define
1706+
what all of the <i>justification opportunities</i> are,
1707+
how they are prioritized, or
1708+
when and how multiple levels of <i>justification opportunities</i> interact.
1709+
However, it does require that if a <i>justification opportunity</i> exists within a line,
1710+
it must be justified,
1711+
and that, unless contraindicated by the typographic traditions of the content language or adjacent symbols/punctuation,
1712+
each of the following provides a <i>justification opportunity</i>:
1713+
<ul>
1714+
<li><i>Word separators</i>
1715+
<li>The boundary between a <i>visually-perceived character</i> of any <i>block scripts</i> and any other <i>visually-perceived character</i>
1716+
<li>The boundary between a <i>visually-perceived character</i> of any <i>clustered scripts</i> and any other <i>visually-perceived character</i>
1717+
</ul>
1718+
1719+
<p class="example">
1720+
For example, the UA could use by default a justification method that is a
1721+
simple universal compromise for all writing systems&mdash;such as
1722+
primarily expanding <i>word separators</i>
1723+
along with secondarily expanding between CJK and Southeast Asian <i>visually-perceived letters</i>.
1724+
Then, in cases where the <i>content language</i> of the paragraph is known,
1725+
it could choose a more language-tailored justification behavior
1726+
e.g. following [[JLREQ]] for Japanese,
1727+
using cursive elongation for Arabic,
1728+
using ''inter-word'' for German,
1729+
etc.
1730+
17091731
<p>The guidelines in this level of CSS do not describe a complete
17101732
justification algorithm. They are merely a minimum set of requirements
17111733
that a complete algorithm should meet. Limiting the set of requirements
@@ -1747,13 +1769,6 @@ Possible Algorithms</h4>
17471769
Or it could keep the rule, but only enable it when the content language is known to be Japanese.
17481770
</div>
17491771

1750-
<p>The UA may enable or break optional ligatures or use other font features
1751-
such as alternate glyphs or glyph compression
1752-
to help justify the text under any method.
1753-
This behavior is not controlled by this level of CSS.
1754-
However, UAs <em>must not</em> break required ligatures
1755-
or otherwise disable features required to correctly shape complex scripts.
1756-
17571772
<h2 id="spacing">
17581773
Spacing</h2>
17591774

@@ -2445,18 +2460,34 @@ Appendix B: Default UA Stylesheet</h2>
24452460
with <kbd>[css-text]</kbd> in the subject line.</p>
24462461

24472462
<h2 class="no-num" id="script-groups">
2448-
Appendix C: Cursive Scripts</h2>
2463+
Appendix C: Scripts and Spacing</h2>
24492464

24502465
<p><em>This appendix is normative.</em></p>
2451-
2452-
<p>The following scripts in Unicode 6 are considered to be <dfn title="cursive script">cursive scripts</dfn>,
2466+
2467+
<p>Typographic behavior varies somewhat by language, but varies drastically by writing system.
2468+
This appendix categorizes some common scripts in Unicode 6.0 according to their justification and spacing behavior.
2469+
Category descriptions are descriptive, not prescriptive;
2470+
the determining factor is the prioritization of <i>justification opportunities</i>.
2471+
2472+
<dl>
2473+
<dt><dfn>block scripts</dfn></dt>
2474+
<dd>CJK and by extension all Wide characters. (See [[!UAX11]])
2475+
The following scripts are included: Bopomofo, Han, Hangul, Hiragana, Katakana, Yi
2476+
<dt><dfn>clustered scripts</dfn></dt>
2477+
<dd>Scripts that have discrete units but do not use spaces between words, such as many Southeast Asian systems.
2478+
The following scripts are included: Javanese, Khmer, Lao, Myanmar, Thai,
2479+
<span class=issue>This list is likely incomplete. What else fits here?</span>
2480+
<dt><dfn title="cursive script">cursive scripts</dfn>
2481+
<dd>
2482+
<p>The following scripts in Unicode 6 are considered to be cursive scripts,
24532483
and do not admit gaps between their letters for either justification or 'letter-spacing':
24542484
Arabic,
24552485
Mandaic,
24562486
Mongolian,
24572487
N'Ko,
24582488
Phags Pa,
24592489
Syriac
2490+
</dl>
24602491
<p>User agents should update this list as they update their Unicode support
24612492
to handle as-yet-unencoded cursive scripts in future versions of Unicode,
24622493
and are encouraged to ask the CSSWG to update this spec accordingly.

0 commit comments

Comments
 (0)