Tue, 16 Jul 2013 16:24:23 -0700
[css-text] More details on expansion opportunities
css-text/Overview.html | file | annotate | diff | comparison | revisions | |
css-text/Overview.src.html | file | annotate | diff | comparison | revisions |
1.1 --- a/css-text/Overview.html Tue Jul 16 15:35:51 2013 -0700 1.2 +++ b/css-text/Overview.html Tue Jul 16 16:24:23 2013 -0700 1.3 @@ -315,7 +315,7 @@ 1.4 <li><a href="#justify-cursive"><span class=secno>7.3.4. </span> 1.5 Cursive Scripts</a> 1.6 1.7 - <li><a href="#justify-alt"><span class=secno>7.3.5. </span> Possible 1.8 + <li><a href="#justify-algos"><span class=secno>7.3.5. </span> Possible 1.9 Algorithms</a> 1.10 </ul> 1.11 </ul> 1.12 @@ -2207,13 +2207,36 @@ 1.13 <p>An <dfn id=expansion-opportunity>expansion opportunity</dfn> is a point 1.14 where the justification algorithm may alter spacing within the text. An 1.15 expansion opportunity can be provided by a single <a 1.16 - href="#character"><i>character</i></a> (such as a <i>word separator 1.17 - character</i>), or by the juxtaposition of two <a 1.18 - href="#character"><i>characters</i></a>. The UA divides <a 1.19 + href="#character"><i>character</i></a> (such as a <a 1.20 + href="#word-separator"><i>word separator</i></a>), or by the juxtaposition 1.21 + of two <a href="#character"><i>characters</i></a>. Space distributed by 1.22 + justification is <em>in addition to</em> the optimal spacing defined by 1.23 + the ‘<a href="#letter-spacing0"><code 1.24 + class=property>letter-spacing</code></a>’ or ‘<a 1.25 + href="#word-spacing0"><code class=property>word-spacing</code></a>’ 1.26 + properties. However, when space is distributed to a <a 1.27 + href="#word-separator"><i>word separator</i></a> <a 1.28 + href="#expansion-opportunity"><i>expansion opportunity</i></a>, it is 1.29 + applied under the same rules as for ‘<a href="#word-spacing0"><code 1.30 + class=property>word-spacing</code></a>’. Similarly, when space is 1.31 + distributed an <a href="#expansion-opportunity"><i>expansion 1.32 + opportunity</i></a> between two <a 1.33 + href="#character"><i>characters</i></a>, it is applied under the same 1.34 + rules as for ‘<a href="#letter-spacing0"><code 1.35 + class=property>letter-spacing</code></a>’. 1.36 + 1.37 + <p>A justification algorithm may divide <a 1.38 href="#expansion-opportunity"><i>expansion opportunities</i></a> into 1.39 - different priority levels: within a level, all <a 1.40 - href="#expansion-opportunity"><i>expansion opportunities</i></a> are 1.41 - expanded or compressed at the same priority. 1.42 + different priority levels. All <a 1.43 + href="#expansion-opportunity"><i>expansion opportunities</i></a> within a 1.44 + given level are expanded or compressed at the same priority, regardless of 1.45 + which <a href="#character"><i>characters</i></a> created that opportunity. 1.46 + For example, if <a href="#expansion-opportunity"><i>expansion 1.47 + opportunities</i></a> between two Han characters and between two Latin <a 1.48 + href="#letter0"><i>letters</i></a> are defined to be at the same level (as 1.49 + they are in the ‘<code class=css>distribute</code>’ justification 1.50 + style), they are not treated differently because they originate from 1.51 + different <a href="#character"><i>characters</i></a>. 1.52 1.53 <h4 id=justify-symbols><span class=secno>7.3.2. </span> Handling Symbols 1.54 and Punctuation</h4> 1.55 @@ -2255,7 +2278,7 @@ 1.56 introduced by <a href="#word-separator"><i>word separators</i></a>. How 1.57 any remaining space is distributed once all <a 1.58 href="#expansion-opportunity"><i>expansion opportunities</i></a> reach 1.59 - their limits is up to the UA. 1.60 + their specified limits is up to the UA. 1.61 1.62 <p>If the inline contents of a line cannot be stretched to the full width 1.63 of the line box, then they must be aligned as specified by the ‘<a 1.64 @@ -2282,7 +2305,7 @@ 1.65 between any pair of <i>cursive script</i> <a 1.66 href="#letter0"><i>letters</i></a>. 1.67 1.68 - <h4 id=justify-alt><span class=secno>7.3.5. </span> Possible Algorithms</h4> 1.69 + <h4 id=justify-algos><span class=secno>7.3.5. </span> Possible Algorithms</h4> 1.70 1.71 <p>The guidelines in this level of CSS do not describe a complete 1.72 justification algorithm. They are merely a minimum set of requirements 1.73 @@ -2433,10 +2456,11 @@ 1.74 character's <i>advance measure</i>. 1.75 </dl> 1.76 1.77 - <p>Additional spacing is applied to each <i>word separator character</i> 1.78 - left in the text after the <a href="#white-space-rules">white space 1.79 - processing rules</a> have been applied, and should be applied half on each 1.80 - side of the character unless otherwise dictated by typographic tradition. 1.81 + <p>Additional spacing is applied to each <a href="#word-separator"><i>word 1.82 + separator</i></a> left in the text after the <a 1.83 + href="#white-space-rules">white space processing rules</a> have been 1.84 + applied, and should be applied half on each side of the character unless 1.85 + otherwise dictated by typographic tradition. 1.86 1.87 <div class=example> 1.88 <p>The following example will make all the spaces between words in Arabic
2.1 --- a/css-text/Overview.src.html Tue Jul 16 15:35:51 2013 -0700 2.2 +++ b/css-text/Overview.src.html Tue Jul 16 16:24:23 2013 -0700 2.3 @@ -1613,21 +1613,33 @@ 2.4 <h4 id="expanding-text"> 2.5 Expanding and Compressing Text</h4> 2.6 2.7 - <p>When justifying text, the user agent takes the remaining space between 2.8 - the ends of a line's contents and the edges of its line box, and 2.9 - distributes that space throughout its contents so that the contents 2.10 - exactly fill the line box. 2.11 - The user agent may alternatively distribute negative space, 2.12 - putting more content on the line than would otherwise fit under normal spacing conditions. 2.13 + <p>When justifying text, the user agent takes the remaining space between 2.14 + the ends of a line's contents and the edges of its line box, and 2.15 + distributes that space throughout its contents so that the contents 2.16 + exactly fill the line box. 2.17 + The user agent may alternatively distribute negative space, 2.18 + putting more content on the line than would otherwise fit under normal spacing conditions. 2.19 2.20 - <p>An <dfn>expansion opportunity</dfn> is 2.21 - a point where the justification algorithm may alter spacing within the text. 2.22 - An expansion opportunity can be provided by a single <i>character</i> 2.23 - (such as a <i>word separator character</i>), 2.24 - or by the juxtaposition of two <i>characters</i>. 2.25 - The UA divides <i>expansion opportunities</i> into different priority levels: 2.26 - within a level, all <i>expansion opportunities</i> are 2.27 - expanded or compressed at the same priority. 2.28 + <p>An <dfn>expansion opportunity</dfn> is 2.29 + a point where the justification algorithm may alter spacing within the text. 2.30 + An expansion opportunity can be provided by a single <i>character</i> 2.31 + (such as a <i>word separator</i>), 2.32 + or by the juxtaposition of two <i>characters</i>. 2.33 + Space distributed by justification is <em>in addition to</em> 2.34 + the optimal spacing defined by the 'letter-spacing' or 'word-spacing' properties. 2.35 + However, when space is distributed to a <i>word separator</i> <i>expansion opportunity</i>, 2.36 + it is applied under the same rules as for 'word-spacing'. 2.37 + Similarly, when space is distributed an <i>expansion opportunity</i> between two <i>characters</i>, 2.38 + it is applied under the same rules as for 'letter-spacing'. 2.39 + 2.40 + <p>A justification algorithm may divide <i>expansion opportunities</i> into different priority levels. 2.41 + All <i>expansion opportunities</i> within a given level 2.42 + are expanded or compressed at the same priority, 2.43 + regardless of which <i>characters</i> created that opportunity. 2.44 + For example, if <i>expansion opportunities</i> between two Han characters 2.45 + and between two Latin <i>letters</i> are defined to be at the same level 2.46 + (as they are in the ''distribute'' justification style), 2.47 + they are not treated differently because they originate from different <i>characters</i>. 2.48 2.49 <h4 id="justify-symbols"> 2.50 Handling Symbols and Punctuation</h4> 2.51 @@ -1661,7 +1673,7 @@ 2.52 <p>The 'word-spacing' property can specify limits on 2.53 <i>expansion opportunities</i> introduced by <i>word separators</i>. 2.54 How any remaining space is distributed once all <i>expansion opportunities</i> 2.55 - reach their limits is up to the UA. 2.56 + reach their specified limits is up to the UA. 2.57 2.58 <p>If the inline contents of a line cannot be stretched to the full width of the line box, 2.59 then they must be aligned as specified by the 'text-align-last' property. 2.60 @@ -1680,7 +1692,7 @@ 2.61 It otherwise <em>must</em> assume that no <i>expansion opportunity</i> exists 2.62 between any pair of <i>cursive script</i> <i>letters</i>. 2.63 2.64 -<h4 id="justify-alt"> 2.65 +<h4 id="justify-algos"> 2.66 Possible Algorithms</h4> 2.67 2.68 <p>The guidelines in this level of CSS do not describe a complete 2.69 @@ -1798,7 +1810,7 @@ 2.70 character's <i>advance measure</i>. 2.71 </dl> 2.72 2.73 - <p>Additional spacing is applied to each <i>word separator character</i> 2.74 + <p>Additional spacing is applied to each <i>word separator</i> 2.75 left in the text after the <a href="#white-space-rules">white space processing rules</a> have been applied, 2.76 and should be applied half on each side of the character 2.77 unless otherwise dictated by typographic tradition.