|
1 | 1 | <!-- |
2 | 2 |
|
3 | 3 | Issues: |
4 | | - white space |
5 | | - line breaking |
6 | 4 | bidi |
| 5 | + line-stacking |
7 | 6 |
|
8 | 7 | Redo all examples with consistent font. (M+ 2p?) |
9 | 8 |
|
@@ -214,6 +213,9 @@ <h2 class="no-num no-toc" id=contents> Table of Contents</h2> |
214 | 213 |
|
215 | 214 | <li><a href="#line-breaking"><span class=secno>2.6. </span> Ruby box and |
216 | 215 | line breaking</a> |
| 216 | + |
| 217 | + <li><a href="#line-height"><span class=secno>2.7. </span> Ruby box and |
| 218 | + line stacking</a> |
217 | 219 | </ul> |
218 | 220 |
|
219 | 221 | <li><a href="#ruby-props"><span class=secno>3. </span> Ruby Properties</a> |
@@ -737,9 +739,13 @@ <h3 id=white-space><span class=secno>2.5. </span> White Space</h3> |
737 | 739 | <!-- --> <rt>とう</rt><rt>きょう</rt> |
738 | 740 | <!-- --></ruby></pre> |
739 | 741 |
|
740 | | - <p>However, this markup will: <!-- --><ruby> <!-- --> |
741 | | - <rb>東</rb> <rb>京</rb> <!-- --> <rt>とう</rt> |
742 | | - <rt>きょう</rt> <!-- --></ruby> |
| 742 | + <p>However, this markup will: |
| 743 | + |
| 744 | + <pre> |
| 745 | +<!-- --><ruby> |
| 746 | +<!-- --> <rb>東</rb> <rb>京</rb> |
| 747 | +<!-- --> <rt>とう</rt> <rt>きょう</rt> |
| 748 | +<!-- --></ruby></pre> |
743 | 749 | </div> |
744 | 750 |
|
745 | 751 | <p>Any preserved white space is then wrapped in an anonymous box belonging |
@@ -835,18 +841,69 @@ <h3 id=line-breaking><span class=secno>2.6. </span> Ruby box and line |
835 | 841 | <p class=caption>‘<code class=css>inter-character</code>’ ruby line |
836 | 842 | breaking opportunity |
837 | 843 | </div> |
838 | | - <!-- <h3 id="ruby-line-height"> |
839 | | -Ruby box and line stacking</h3> |
840 | 844 |
|
841 | | -<div class="figure"> |
842 | | -<p> |
843 | | -<img class="example" |
844 | | -alt="Diagram showing the ruby text using 2 half leading" |
845 | | -src="images/rlh-a.gif" width="210" height="138" /></p> |
| 845 | + <h3 id=line-height><span class=secno>2.7. </span> Ruby box and line |
| 846 | + stacking</h3> |
| 847 | + |
| 848 | + <p>The ‘<code class=property>line-height</code>’ property controls |
| 849 | + spacing between lines in CSS. When inline content on line is shorter than |
| 850 | + the ‘<code class=property>line-height</code>’, half-leading is added |
| 851 | + on either side of the content, as specificed in <a |
| 852 | + href="http://www.w3.org/TR/CSS21/visudet.html#line-height">CSS2.1§10.8</a>. |
| 853 | + <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> |
| 854 | + |
| 855 | + <p>In order to ensure consistent spacing of lines, documents with ruby |
| 856 | + typically ensure that the ‘<code class=property>line-height</code>’ is |
| 857 | + large enough to accommodate ruby between lines of text. Therefore, |
| 858 | + ordinarily, <a href="#ruby-annotation-container-box"><i>ruby annotation |
| 859 | + containers</i></a> and <a href="#ruby-annotation-box"><i>ruby annotation |
| 860 | + boxes</i></a> do not contribute to the measured height of a line's inline |
| 861 | + contents; any alignment (see ‘<code |
| 862 | + class=property>vertical-align</code>’) and line-height calculations are |
| 863 | + performed using only the <a href="#ruby-base-container-box"><i>ruby base |
| 864 | + container</i></a>, exactly as if it were a normal inline. |
| 865 | + |
| 866 | + <p>However, if the ‘<code class=property>line-height</code>’ specified |
| 867 | + on the <a href="#ruby-container-box"><i>ruby container</i></a> is less |
| 868 | + than the distance between the top of the top <a |
| 869 | + href="#ruby-annotation-container-box"><i>ruby annotation container</i></a> |
| 870 | + and the bottom of the bottom <a |
| 871 | + href="#ruby-annotation-container-box"><i>ruby annotation |
| 872 | + container</i></a>, then additional leading is added on the appropriate |
| 873 | + side of the <a href="#ruby-base-container-box"><i>ruby base |
| 874 | + container</i></a> such that if a block consisted of three lines each |
| 875 | + containing ruby identical to this, none of the <a |
| 876 | + href="#ruby-container-box"><i>ruby containers</i></a> would overlap. |
| 877 | + |
| 878 | + <p class=note>Note that this does not ensure that the <a |
| 879 | + href="#ruby-annotation-box"><i>ruby annotations</i></a> remain within the |
| 880 | + line box. It merely ensures that <em>if all lines had equal spacing</em> |
| 881 | + and equivalent amounts and positioning of <a |
| 882 | + href="#ruby-annotation-box"><i>ruby annotations</i></a>, there would be |
| 883 | + enough room to avoid overlap. |
| 884 | + |
| 885 | + <p>Authors should ensure appropriate ‘<code |
| 886 | + class=property>line-height</code>’ and ‘<code |
| 887 | + class=property>padding</code>’ to accommodate ruby, and be particularly |
| 888 | + careful at the beginning or end of a block and when a line contains |
| 889 | + inline-level content (such as images, inline blocks, or elements shifted |
| 890 | + with ‘<code class=property>vertical-align</code>’) taller than the |
| 891 | + paragraph's default font size. |
846 | 892 |
|
847 | | -<p><b>Figure 3.3.1</b>: Excluded Ruby text</p> |
848 | | -</div> |
849 | | ---> |
| 893 | + <div class=figure> |
| 894 | + <p><img |
| 895 | + alt="The content of each line sits in the middle of its line height; the additional space on each side is called half-leading. Ruby fits between lines if it is smaller than twice the half-leading, but this means that it occupies space belonging to the half-leading of the previous line." |
| 896 | + src="images/rlh-a.gif"> |
| 897 | + |
| 898 | + <p class=caption>Ruby annotations will often overflow the line; authors |
| 899 | + should ensure content over/under a ruby-annotated line is adequately |
| 900 | + spaced to leave room for the ruby. |
| 901 | + </div> |
| 902 | + |
| 903 | + <p class=note>More control over how ruby affects alignment and line layout |
| 904 | + will be part of the CSS Line Layout Module Level 3. Note, it is currently |
| 905 | + in the process of being rewritten; the current drafts should not be relied |
| 906 | + upon. |
850 | 907 |
|
851 | 908 | <h2 id=ruby-props><span class=secno>3. </span> Ruby Properties</h2> |
852 | 909 |
|
|
0 commit comments