Skip to content

Commit 3fffea5

Browse files
committed
Add Alan Stearns' text explaining why 'text-justify' leaves so much to the UA and how the restrictions in CSS3 Text can be applied to simple justification algorithms as well as to TeX
1 parent cd206b9 commit 3fffea5

2 files changed

Lines changed: 70 additions & 20 deletions

File tree

css3-text/Overview.html

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
margin :auto;
2323
}
2424
</style>
25-
<link href="http://www.w3.org/StyleSheets/TR/W3C-WD.css" rel=stylesheet
25+
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
2626
type="text/css">
2727

2828
<body>
@@ -32,17 +32,17 @@
3232

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

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

3838
<dl>
39-
<dt>This version:</dt>
40-
<!--
41-
<dd><a href="http://dev.w3.org/csswg/css3-text/">$Date$ (CVS $Revision$)</a>
42-
-->
39+
<dt>This version:
4340

44-
<dd><a
45-
href="http://www.w3.org/TR/2012/WD-css3-text-20120118/">http://www.w3.org/TR/2012/WD-css3-text-20120118/</a>
41+
<dd><a href="http://dev.w3.org/csswg/css3-text/">$Date: 2012/01/18
42+
23:33:32 $ (CVS $Revision$)</a> <!--
43+
<dd><a href="http://www.w3.org/TR/2012/WD-css3-text-20120119/">http://www.w3.org/TR/2012/WD-css3-text-20120119/</a></dd>
44+
-->
45+
4646

4747
<dt>Latest version:
4848

@@ -2275,6 +2275,31 @@ <h3 id=text-justify><span class=secno>7.3. </span> Justification Method:
22752275
be followed when any justification method other than &lsquo;<code
22762276
class=property>auto</code>&rsquo; is specified.
22772277

2278+
<div class=note>
2279+
<p>The guidelines in this level of CSS do not describe a complete
2280+
justification algorithm. They are merely a minimum set of requirements
2281+
that a complete algorithm should meet. Limiting the set of requirements
2282+
gives UAs some latitude in choosing a justification algorithm that meets
2283+
their needs.
2284+
2285+
<p>For instance, a basic but fast &lsquo;<code
2286+
class=css>inter-word</code>&rsquo; justification algorithm might use a
2287+
simple greedy method for determining line breaks, then distribute space
2288+
using the <a href="#spacing">spacing limits provided</a>. This algorithm
2289+
could follow the guidelines by changing word spacing first, increasing
2290+
&lsquo;<a href="#letter-spacing0"><code
2291+
class=property>letter-spacing</code></a>&rsquo; only if &lsquo;<a
2292+
href="#word-spacing0"><code class=property>word-spacing</code></a>&rsquo;
2293+
hit a limit.
2294+
2295+
<p>A more sophisticated but slower &lsquo;<code
2296+
class=css>inter-word</code>&rsquo; justification algorithm might use a
2297+
Knuth/Plass method where spacing opportunities and spacing limits were
2298+
assigned weights and assessed with other line breaking considerations.
2299+
This algorithm could follow the guidelines by giving more weight to word
2300+
spacing than letter spacing.
2301+
</div>
2302+
22782303
<p id=expansion-opportunity>CSS defines <dfn
22792304
id=expansion-opportunities>expansion opportunities</dfn> as points where
22802305
the justification algorithm may alter spacing within the text. These
@@ -2501,9 +2526,6 @@ <h3 id=text-justify><span class=secno>7.3. </span> Justification Method:
25012526
such as alternate glyphs or glyph compression to help justify the text
25022527
under any method. This behavior is not controlled by this level of CSS.
25032528

2504-
<p class=issue>Add example of using &lsquo;<a href="#text-justify0"><code
2505-
class=property>text-justify</code></a>&rsquo; with the TeX algorithm.
2506-
25072529
<div class=example>
25082530
<p>3.8 Line Adjustment in <a href="#JLREQ"
25092531
rel=biblioentry>[JLREQ]<!--{{JLREQ}}--></a> gives an example of a set of
@@ -2708,7 +2730,8 @@ <h3 id=word-spacing><span class=secno>8.1. </span> Word Spacing: the
27082730
<!-- -->:lang(en) { word-spacing: 100%; }</pre>
27092731

27102732
<p>The following example will <em>add</em> half the the width of the
2711-
&ldquo;0&rdquo; glyph to word spacing character [[CSS3VALUES]]:
2733+
&ldquo;0&rdquo; glyph to word spacing character <a href="#CSS3VAL"
2734+
rel=biblioentry>[CSS3VAL]<!--{{CSS3VAL}}--></a>:
27122735

27132736
<pre>p { word-spacing: 0.5ch; }</pre>
27142737
</div>
@@ -4337,9 +4360,9 @@ <h3 id=text-shadow><span class=secno>10.3. </span> Text Shadows: the
43374360
<p>This property accepts a comma-separated list of shadow effects to be
43384361
applied to the text of the element. Values are interpreted as for <a
43394362
href="http://www.w3.org/TR/css3-background/#the-box-shadow">&lsquo;<code
4340-
class=property>box-shadow</code>&rsquo;</a>. [[!CSS3BACKGROUND]] The
4341-
shadow is applied to all of the element's text as well as any text
4342-
decorations it specifies.
4363+
class=property>box-shadow</code>&rsquo;</a>. <a href="#CSS3BG"
4364+
rel=biblioentry>[CSS3BG]<!--{{!CSS3BG}}--></a> The shadow is applied to
4365+
all of the element's text as well as any text decorations it specifies.
43434366

43444367
<p>The shadow effects are applied front-to-back: the first shadow is on
43454368
top. The shadows may thus overlay each other, but they never overlay the
@@ -4685,6 +4708,16 @@ <h3 class=no-num id=informative-ref>Informative references</h3>
46854708
</dd>
46864709
<!---->
46874710

4711+
<dt id=CSS3VAL>[CSS3VAL]
4712+
4713+
<dd>H&#229;kon Wium Lie; Tab Atkins; Elika J. Etemad. <a
4714+
href="http://www.w3.org/TR/2011/WD-css3-values-20110906/"><cite>CSS
4715+
Values and Units Module Level 3.</cite></a> 6 September 2011. W3C Working
4716+
Draft. (Work in progress.) URL: <a
4717+
href="http://www.w3.org/TR/2011/WD-css3-values-20110906/">http://www.w3.org/TR/2011/WD-css3-values-20110906/</a>
4718+
</dd>
4719+
<!---->
4720+
46884721
<dt id=JIS4051>[JIS4051]
46894722

46904723
<dd><cite>Formatting rules for Japanese documents

css3-text/Overview.src.html

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ <h2 class="no-num no-toc">[LONGSTATUS] [DATE]</h2>
3737

3838
<dl>
3939
<dt>This version:</dt>
40-
<!--
4140
<dd><a href="http://dev.w3.org/csswg/css3-text/">$Date$ (CVS $Revision$)</a>
42-
-->
41+
<!--
4342
<dd><a href="http://www.w3.org/TR/[YEAR]/WD-css3-text-[CDATE]/">http://www.w3.org/TR/[YEAR]/WD-css3-text-[CDATE]/</a></dd>
43+
-->
4444
<dt>Latest version:</dt>
4545
<dd><a href="http://www.w3.org/TR/css3-text/">http://www.w3.org/TR/css3-text/</a></dd>
4646
<dt>Latest editor's draft:</dt>
@@ -1628,6 +1628,26 @@ <h3 id="text-justify">
16281628
be followed when any justification method other than 'auto' is
16291629
specified.</p>
16301630

1631+
<div class="note">
1632+
<p>The guidelines in this level of CSS do not describe a complete
1633+
justification algorithm. They are merely a minimum set of requirements
1634+
that a complete algorithm should meet. Limiting the set of requirements
1635+
gives UAs some latitude in choosing a justification algorithm that
1636+
meets their needs.
1637+
1638+
<p>For instance, a basic but fast ''inter-word'' justification algorithm
1639+
might use a simple greedy method for determining line breaks, then
1640+
distribute space using the <a href="#spacing">spacing limits provided</a>.
1641+
This algorithm could follow the guidelines by changing word spacing
1642+
first, increasing 'letter-spacing' only if 'word-spacing' hit a limit.
1643+
1644+
<p>A more sophisticated but slower ''inter-word'' justification algorithm
1645+
might use a Knuth/Plass method where spacing opportunities and spacing
1646+
limits were assigned weights and assessed with other line breaking
1647+
considerations. This algorithm could follow the guidelines by giving
1648+
more weight to word spacing than letter spacing.
1649+
</div>
1650+
16311651
<p id="expansion-opportunity">CSS defines <dfn>expansion opportunities</dfn>
16321652
as points where the justification algorithm may alter spacing within
16331653
the text. These expansion opportunities fall into priority
@@ -1803,9 +1823,6 @@ <h3 id="text-justify">
18031823
justify the text under any method. This behavior is not controlled by
18041824
this level of CSS.</p>
18051825

1806-
<p class="issue">Add example of using 'text-justify' with the TeX
1807-
algorithm.</p>
1808-
18091826
<div class="example">
18101827
<p>3.8 Line Adjustment in [[JLREQ]] gives an example of a set of rules for
18111828
how a text formatter can justify Japanese text.

0 commit comments

Comments
 (0)