Another abandoned server code base... this is kind of an ancestor of taskrambler.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1209 lines
62 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CSS3 Ruby Module</title>
<style type="text/css">
dt {font-weight: normal}
/*.issue, .note {font-style: italic}*/
.figure {font-size: smaller;}
span.note-label {font-weight: bolder;}
/* Stolen from CSS2 Recommendation */
DIV.propdef TH {
text-align: right;
}
A.propdef-title {
background: yellow;
}
DIV.propdef {margin: 1.2em 0}
A.noxref:link, A.noxref:visited {color: black; /*color: inherit*/}
</style>
<style media="print" type="text/css">
img#edge { width: 80%; height: 70%;}dt.label { display: run-in; }
</style>
<link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css" />
<style type="text/css">
ins {
background-color: #99FF99;
text-decoration: none;
}
del {
display: inline;
color: silver;
}
.issue { color: #F00; }
.issuehead { background-color:#FF9; padding:2px 4px; border: 1px solid red; }
</style>
</head>
<body>
<div class="head">
<p><a href="http://www.w3.org/"><img alt="W3C" src="http://www.w3.org/Icons/w3c_home" height="48" width="72" /></a></p>
<h1>CSS3 Ruby Module</h1>
<h2 class="no-num no-toc" id="w3c-working">W3C Working Draft 30 June 2011</h2>
<dl>
<dt>This version:</dt>
<dd><a
href="http://www.w3.org/TR/2011/WD-css3-ruby-20110630/">http://www.w3.org/TR/2011/WD-css3-ruby-20110630/</a></dd>
<dt>Latest version:</dt>
<dd><a
href="http://www.w3.org/TR/css3-ruby/">http://www.w3.org/TR/css3-ruby/</a></dd>
<dt>Previous version:</dt>
<dd><a
href="http://www.w3.org/TR/2003/CR-css3-ruby-20030514">http://www.w3.org/TR/2003/CR-css3-ruby-20030514</a></dd>
<dt>Editor:</dt>
<dd>Richard Ishida (W3C)</dd>
<dt>Former editors:</dt>
<dd>Paul Nelson (Microsoft)</dd>
<dd>Michel Suignard (Microsoft)</dd>
<dd>Marcin Sawicki (Microsoft)</dd>
</dl>
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> &copy; 2011 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&reg;</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div>
<hr />
<h2><a id="Abstract">Abstract</a></h2>
<p>"Ruby" are short runs of text alongside the base text, typically
used in East Asian documents to indicate pronunciation or to provide a
short annotation. This document proposes a set of CSS properties
associated with the 'Ruby' elements. They can be used in combination
with the Ruby elements of HTML.</p>
<h2><a id="Status">Status of This Document</a></h2>
<p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>
<p>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.</p>
<p>The set of CSS properties proposed in this document can be used in combination
with the ruby elements of HTML to produce the stylistic effects needed to display ruby text appropriately relative to base text.</p>
<p>The (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
public mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a> (see <a href="http://www.w3.org/Mail/Request">instructions</a>) is preferred for
discussion of this specification. When sending e-mail, please put the
text “css3-ruby” in the subject, preferably like this:
“[<!---->css3-ruby<!---->] <em>…summary of comment…</em></p>
<p>This document was produced by the <a href="/Style/CSS/members">CSS
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).</p>
<p> This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a rel="disclosure" href="http://www.w3.org/2004/01/pp-impl/32061/status">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p>
<p>Text marked as an <span class="issue"><span class="issuehead">Issue</span></span> indicates proposals that are currently awaiting or under discussion. All such text will be subject to modification or removal.</p>
<p>See <a href="http://www.w3.org/Style/CSS/Tracker/products/25"> open issues in
Tracker.</a></p>
<!--end-status-->
<p>The comments that the CSS WG received during the previous Last Call review,
together with responses and resulting changes are listed in the <a
href="/Style/2003/css3-ruby-last-call">disposition of comments.</a></p>
<p>For the most up-to-date version of the specification, see the <a href="http://dev.w3.org/csswg/css3-ruby/">latest editor's copy</a> of this specification.</p>
<div class="subtoc">
<h2><a id="Contents">Table of Contents</a></h2>
<ul class="toc">
<li class="tocline2"><a href="#dependencies" class="tocxref">1. Dependencies</a></li>
<li class="tocline2"><a href="#introduction" class="tocxref">2. Introduction</a>
<ul class="toc">
<li class="tocline3"><a href="#conventions" class="tocxref">2.1 Document conventions</a></li>
<li class="tocline3"><a href="#ruby-def" class="tocxref">2.2 What is ruby?</a></li>
</ul>
</li>
<li class="tocline2"><a href="#css-model" class="tocxref">3. The CSS ruby model</a>
<ul class="toc">
<li class="tocline3"><a href="#display" class="tocxref">3.1 Ruby specific 'display' property values</a></li>
<li class="tocline3"><a href="#box-model" class="tocxref">3.2 Ruby box model</a></li>
<li class="tocline3"><a href="#ruby-line-height" class="tocxref">3.3 Ruby box and line
stacking</a></li>
<li class="tocline3"><a href="#ruby-line-breaking" class="tocxref">3.4 Ruby box and line
breaking</a></li>
</ul>
</li>
<li class="tocline2"><a href="#ruby-props" class="tocxref">4. Ruby Properties</a>
<ul class="toc">
<li class="tocline3"><a href="#rubypos" class="tocxref">4.1 Ruby
positioning: the 'ruby-position' property</a></li>
<li class="tocline3"><a href="#rubyalign" class="tocxref">4.2 Ruby
alignment: the 'ruby-align' property</a></li>
<li class="tocline3"><a href="#rubyover" class="tocxref">4.3 Ruby
overhanging: the 'ruby-overhang' property</a></li>
<li class="tocline3"><a href="#rubyspan" class="tocxref">4.4 Ruby
annotation spanning: the 'ruby-span' property</a></li>
</ul>
</li>
<li class="tocline2"><a href="#properties" class="tocxref">5. Properties index</a></li>
<li class="tocline2"><a href="#profiles" class="tocxref">6. Profiles</a></li>
<li class="tocline2"><a href="#glossary" class="tocxref">Glossary</a></li>
<li class="tocline2"><a href="#ack" class="tocxref">Acknowledgements</a></li>
<li class="tocline2"><a href="#references" class="tocxref">References</a></li>
</ul>
</div>
<hr />
<h2><a id="dependencies">1. Dependencies on other modules</a></h2>
<p>This CSS3 module depends on the following other CSS3 modules:</p>
<ul>
<li>Text</li>
<li>Line</li>
<li>Syntax</li>
<li>Values and units</li>
</ul>
<p class="issue"><span class="issuehead">Issue&nbsp;</span> Check these dependencies are correct.</p>
<h2><a id="introduction">2. Introduction</a></h2>
<h3><a id="conventions">2.1 Document conventions</a></h3>
<p>There are a number of illustrations in this document for which the following
legend is used:</p>
<p><img alt="Symbolic wide-cell glyph representation" class="example"
width="39" height="39" src="images/fullwidth.gif" /> - wide-cell glyph (e.g. Han)
which is the <i>n</i>-th character in the text run, they may also appear as
half size boxes when used as annotations.<br />
<img alt="Symbolic narrow-cell glyph representation" class="example"
width="19" height="39" src="images/halfwidth.gif" /> - narrow-cell glyph (e.g. Roman)
which is the <i>n</i>-th glyph in the text run.<br />
</p>
<p>Many typographical properties in East Asian typography depend on the fact
that a character is typically rendered as either a wide or narrow character. All
characters described by the Unicode Standard <a href="#UNICODE">[UNICODE]</a> can be categorized by a
width property. This is covered by the Unicode Standard Annex
<a href="#UAX11">[UAX#11]</a>. </p>
<p>The orientation which the above symbols assume in the diagrams corresponds
to the orientation that the glyphs they represent are intended to assume when
rendered by the user agent. Spacing between these characters in the diagrams is
usually symbolic, unless intentionally changed to make a point.</p>
<p>Finally, in this document, requirements are expressed using the key words
&quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot; and &quot;SHALL NOT&quot;. Recommendations are
expressed using the key words &quot;SHOULD&quot;, &quot;SHOULD NOT&quot; and &quot;RECOMMENDED&quot;. &quot;MAY&quot;
and &quot;OPTIONAL&quot; are used to indicate optional features or behavior. These
keywords are used in accordance with <a href="#rfc2119">[RFC 2119]</a>. For
legibility these keywords are used in lowercase form.</p>
<h3><a id="ruby-def">2.2 What is ruby?</a></h3>
<p>"Ruby" is the commonly used name for a run of text that appears in the
immediate vicinity of another run of text, referred to as the "base", and
serves as an annotation or a pronunciation guide associated with that run of
text. Ruby, as used in Japanese, is described in JIS X-4051 [<a
href="#jis4051">JIS4051</a>] (in Japanese) and in Requirements for Japanese Text Layout [<a href="#jlreq">JLREQ</a>] (in English and Japanese)]. The ruby structure and the XHTML markup to represent it
is described in the Ruby Annotation [<a href="#ruby">RUBY</a>] specification. This
section describes the CSS properties relevant to ruby. The following figures
show two examples of Ruby.</p>
<div class="figure">
<p>
<img alt="Example of ruby applied on top of a Japanese expression"
class="example" src="images/licence.png" /></p>
<p><b>Figure 2.2.1</b>: Example of ruby used in Japanese (simple case)</p>
</div>
<div class="figure">
<p>
<img
alt="Example showing complex ruby with annotation text before and after
the base characters"
class="example" src="images/ruby-univ.gif" width="277" height="108" /></p>
<p><strong>Figure 2.2.2</strong>: Complex ruby with annotation text before and after
the base characters</p>
</div>
<p>In the first example, a single annotation is used to annotate the base
sequence. In Japanese typography, this simple case is sometimes called&nbsp; &quot;<span lang="ja">taigo</span> ruby&quot; or group-ruby (per-word ruby).</p>
<p>In the second example, multiple annotations are attached to a base
sequence, the hiragana characters on top refer to the pronunciation of each of the
base Kanji characters (annotated in a <a href="#g-monoruby">mono-ruby</a> fashion), while the words 'Keio'
and 'University' on the bottom are
annotations describing the English translation of respectively the first four
and the last two Kanji characters
of the base. To allow correct association between the hiragana characters and
their corresponding Kanji base characters, the spacing between these Kanji
characters may be adjusted (this happens around the fourth Kanji character in the
figure 2.2.2 above).</p>
<p class="Note"><span class="note-label">Note:</span> To avoid variable spacing between the Kanji
characters in the example above the hiragana annotations can also be created as
a simple annotation ruby.</p>
<p>The two examples correspond respectively to two types of ruby: simple ruby using simple ruby markup and complex ruby using complex ruby
markup.</p>
<h2><a id="css-model">3. The CSS ruby model</a></h2>
<h3 id="display">3.1 Ruby specific 'display' property values</h3>
<p>The CSS ruby model is based on the W3C Ruby Annotation Recommendation
[<a href="#ruby">RUBY</a>], which is consistent with the XHTML Modularization
Framework [<a href="#xhtml-mod">XHTMLMOD</a>]. The Recommendation specifies the ruby structure in a way
to closely parallel
the visual layout of the ruby element. In this model, a ruby consists of one
or more base elements associated with one or more annotation elements.</p>
<p>The CSS model does not require that the document language include elements
that correspond to each of these components. For document languages (such as
XML applications) that do not have pre-defined ruby elements, authors must map
document language elements to ruby elements; this is done with the 'display'
property. The following 'display' values assign ruby semantics to an arbitrary
element:</p>
<dl>
<dt><strong>ruby</strong> (in XHTML: ruby)</dt>
<dd>Specifies that an element defines a ruby structure.</dd>
<dt><strong>ruby-base</strong> (in XHTML: rb)</dt>
<dd>Specifies that an element defines a ruby base.</dd>
<dt><strong>ruby-text</strong> (in XHTML: rt)</dt>
<dd>Specifies that an element defines a ruby text.</dd>
<dt><strong>ruby-base-container</strong> (in XHTML: rbc)</dt>
<dd>Specifies that an element contains one or more ruby base.</dd>
<dt><strong>ruby-text-container</strong> (in XHTML: rtc)</dt>
<dd>Specifies that an element contains one or more ruby text.</dd>
</dl>
<p class="issue"><span class="issuehead">Issue</span> I18n WG proposes that there should be a display value rp also, to allow XML-based formats to associate rp behaviour with elements. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20display:+rp+value&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">thread</a>.</p>
<p>The <a
href="http://www.w3.org/TR/ruby/#ruby"><samp>rbspan</samp></a> attribute should
also be used by XML applications to allow annotation spanning; but in addition, the
'<a href="#ruby-span">ruby-span</a>' property must be used by those applications to indicate to the user agent the number of
ruby base elements to be spanned.</p>
<h3><a id="box-model">3.2 Ruby box model</a></h3>
<p class="issue"><span class="issuehead">Issue</span> The spec needs to address anonymous box generation rules (and to make them compatible with HTML5 ruby markup).</p>
<p>In the following description, the elements specified by Ruby
Annotation [<a href="#ruby">RUBY</a>] are used to describe the box model. As mentioned
earlier, a user agent can obtain the same results by using the Ruby specific 'display'
property values. </p>
<p>For a user agent that supports the ruby markup, the ruby structure consists of three or more
boxes. The outermost container is the <a
href="http://www.w3.org/TR/ruby/#ruby"><samp>ruby</samp></a> element itself.
In the simple case, it is a container for two non-overlapping boxes: the ruby
text box (<a href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element)
and the ruby base box (<a
href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element). The
positioning of these two boxes relative to each other is controlled by the <a
href="#rubypos">'ruby-position'</a> property.</p>
<div class="figure">
<img class="example" width="223" height="93"
alt="Diagram of the ruby box model consisting of two boxes, one on top of the other, enclosed within a third box representing the ruby element"
src="images/r-box-t.gif" />
<p><b>Figure 3.2.1</b>: Ruby box model (simple case)</p>
</div>
<p>In the case of complex ruby, the ruby element is a container for two or
three non-overlapping boxes: one ruby base collection (<a
href="http://www.w3.org/TR/ruby/#rbc"><samp>rbc</samp></a> element), and one
or two ruby text collections (<a
href="http://www.w3.org/TR/ruby/#rtc"><samp>rtc</samp></a> element). The
<samp>rbc</samp> element is itself a container for one or several ruby base
box (<samp>rb</samp> element), while each <samp>rtc</samp> element is a
container for one or several ruby text box (rt element). The position of the
<samp>rtc</samp> element in relation to the related <samp>rbc</samp> element
is controlled by the <a href="#rubypos">'ruby-position'</a> property. The two
following figures show examples of these complex ruby.</p>
<div class="figure">
<img src="images/r-box-g.gif"
alt="Diagram of a group ruby with a full ruby text above and partial ruby text below" width="408" height="170" />
<p><b>Figure 3.2.2</b>: Ruby box model (complex ruby with an empty rt element
after)</p>
</div>
<p>In the example above, the ruby text after (below) the ruby bases contains two <samp>rt</samp> elements with the first one
being empty, the empty <samp>rt</samp> element corresponds to the first part
of the ruby base collection (the first part is identified by the first <samp>rb</samp> element
within the <samp> rbc</samp> element).</p>
<div class="figure">
<img src="images/r-box-h.gif"
alt="Diagram of a group ruby with a spanning ruby text above and partial ruby text below" width="400" height="173" />
<p><b>Figure 3.2.3</b>: Ruby box model (complex ruby with a spanning ruby text
element)</p>
</div>
<p>In the example above, the ruby text before (above) the ruby bases spans the whole ruby base collection. The
ruby text after (below) the ruby bases still contain two <samp>rt</samp> elements, one of
which is empty. The spanning behavior of <samp>rt</samp> text elements is
controlled by the <a
href="http://www.w3.org/TR/ruby/#ruby"><samp>rbspan</samp></a> attribute in a
way similar to the <samp>colspan</samp> attribute used for table column.</p>
<p class="issue"><span class="issuehead">Issue</span> The examples above contain the term 'group ruby', which is not used elsewhere in this specification. It appears to be used in a way that is different to the use of the term in JLREQ. I propose to replace it with just 'ruby'.</p>
<p class="note"><span class="note-label">Note:</span> The visual description of the ruby elements does not refer
necessarily to the logical orders of the elements</p>
<p>The width of the ruby box is by default determined by its widest child
element, whose width in turn is determined by its content. The width of all direct
children of the <samp>ruby</samp> element is the width of the widest children. In this respect, the ruby
box is much like a two or three row <samp>table</samp> element, with the
following exceptions:</p>
<ul>
<li>the ruby box is an inline element, like an image, even though it itself,
like a table, is a container of other boxes</li>
<li>the equivalent of the cells: the <samp>rb</samp> element and the
<samp>rt</samp> text element can only contain inline-level elements.</li>
<li>the content of each 'cell' is always measured at its maximum width</li>
<li>unlike a table, a ruby element doesn't have to fit in a line, the ruby
box may be split into several boxes at line boundary, depending of the
spanning of the ruby texts. This is however only possible for the complex
ruby and can only happen at the boundary of non spanning elements.</li>
<li>both the ruby text and the ruby base boxes may overlap with adjacent
text (outside of the ruby element) if an appropriate <a
href="#rubyover">'ruby-overhang'</a> parameter is set via CSS. Note
however that the actual content of the ruby base cannot overlap with that
adjacent text. The distribution of the content of the ruby base within the
ruby base box is controlled by the <a href="#rubyalign">'ruby-align'</a>
property.</li>
</ul>
<p>If the ruby text is not allowed to overhang, then the ruby behaves like a
traditional box, i.e. only its contents are rendered within its boundaries and
adjacent elements do not cross the box boundary:</p>
<div class="figure">
<p><img class="example" width="220" height="91"
alt="Diagram showing the ruby boxes interacting with adjacent text"
src="images/ro-n.gif" /></p>
<p><b>Figure 3.2.4</b>: Simple ruby whose text is not allowed to overhang
adjacent text</p>
</div>
<p>However, if ruby text is allowed to overhang adjacent elements and it
happens to be wider than its base, then the adjacent content is partially
rendered within the area of the ruby base box, while the ruby text may be
partially overlapping with the upper blank parts of the adjacent content:</p>
<div class="figure">
<p><img class="example" width="177" height="91"
alt="Diagram showing the ruby boxes interacting with adjacent text"
src="images/ro-a.gif" /></p>
<p><b>Figure 3.2.5</b>: Simple ruby whose text is allowed to overhang adjacent
text</p>
</div>
<p>The ruby text related to a ruby base can never overhang another ruby
base.</p>
<p>The alignment of the contents of the base or the ruby text is not affected
by the overhanging behavior. The alignment is achieved the same way regardless
of the overhang behavior setting and it is computed before the space available
for overlap is determined. It is controlled by the <a
href="#rubyalign">'ruby-align'</a> property.</p>
<p>The exact circumstances in which the ruby text will overhang other
elements, and to what degree it will do so, will be controlled by the <a
href="#rubyover">'ruby-overhang'</a> property.</p>
<p>This entire logic applies the same way in vertical ideographic layout, only
the dimension in which it works in such a layout is vertical, instead of
horizontal.</p>
<p class="note"><span class="note-label">Note:</span> Because the purpose of the XHTML <samp>rp</samp> element [<a
href="#ruby">RUBY</a>] is to allow pre-existing user agents
to parenthesize ruby text content, an XHTML user agent should use a styling rule
for these elements that avoids rendering them such as&nbsp; <samp>rp {display:
none}</samp>.</p>
<h3><a id="ruby-line-height">3.3 Ruby box and line stacking</a></h3>
<p>The interaction of the ruby box and line stacking is controlled by the
'line-stacking-ruby' property described in the CSS3 Line Module. That property
takes two values: 'include-ruby' and 'exclude-ruby. Depending on the property
value, the ruby box is considered or excluded for line stacking. Even if the
ruby box is considered for line stacking, some values of the
'line-stacking-strategy' property (also described in the CSS3 Line module) can
still create occurrences where a the ruby box will eventually be ignored (e.g.
case where the 'line-stacking-strategy' value is 'block-line-height').</p>
<p>In the following figure, each line box is shown with leading space
distributed before and after the two text segments ('Previous line' and 'Ruby
base'); the dotted lines show the line box for each line. The
'line-stacking-ruby' property is set to 'exclude-ruby'. The achieved effect is
that the ruby box does not affect the line to line spacing. It is however the
responsibility of the style author to avoid 'bleeding' effects between the ruby
text and the surrounding text of images.</p>
<div class="figure">
<p>
<img class="example"
alt="Diagram showing the ruby text using 2 half leading"
src="images/rlh-a.gif" width="210" height="138" /></p>
<p><b>Figure 3.3.1</b>: Excluded Ruby text</p>
</div>
<p>In the following figure, the line boxes have no extra leading space. The
'line-stacking-ruby' property is set to 'include-ruby' and the
'line-stacking-strategy' property is set to a value where inline boxes are
considered for line stacking. In this case, the line box with
the ruby text is affected and has its 'stack-height' increased by the amount
necessary to fit the ruby text.</p>
<div class="figure">
<p>
<img class="example"
alt="Diagram showing the ruby text expanding above base text"
src="images/rlh-b.gif" width="210" height="111" /></p>
<p><b>Figure 3.3.2</b>: Ruby text increasing line height</p>
</div>
<p>This mechanism allows rendering of evenly spaced lines of text within a
block-level element, whether a line contains ruby or not. The authors need
only to set for the block-level element a line height value larger than the
computed line-height of the largest ruby element within the block.</p>
<h3><a id="ruby-line-breaking">3.4 Ruby box and line breaking</a></h3>
<p>When a ruby falls at the end of a line where there is not sufficient room for the entire ruby to fit on the line, the complex ruby may be broken at locations where boxes of the ruby container align. Some examples are provided below to provide more clarity.</p>
<p>
<img class="example"
alt="Diagram showing the line breaking opportunity in a complex ruby"
src="images/r-break-a.gif" width="408" height="201" /></p>
<p><b>Figure 3.4.1</b>: Complex ruby line breaking opportunity</p>
<p>
<img class="example"
alt='Diagram showing the line breaking opportunity in a "Bopomofo" ruby'
src="images/r-break-b.gif" width="300" height="90" /></p>
<p><b>Figure 3.4.1</b>: "Bopomofo" ruby line breaking opportunity</p>
<p class="issue"><span class="issuehead">Issue</span> Line breaks should only be allowed within ruby if the ruby base text can be broken at that point. E.g. if complex Ruby is used to annotate the two morphemes of &quot;butterfly&quot;, the fact that we have added ruby annotations should not cause a line breaking opportunity to be present between &quot;butter&quot; and &quot;fly&quot; </p>
<h2><a id="ruby-props">4. Ruby Properties</a></h2>
<p>All properties, in addition to the noted values, take 'initial' and
'inherit'. These values are not repeated in each of the property value
enumeration. </p>
<h3><a id="rubypos"></a>4.1 Ruby positioning: the <a href="#ruby-position">'ruby-position'</a> property</h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-position">ruby-position</th></tr>
<tr>
<td><em>Value:</em></td>
<td>before | after | inter-character | inline</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>before</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>the parent of elements with display: ruby-text.</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages:</em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p class="issue"><span class="issuehead">Issue</span> We replaced 'right' with 'inter-character', since that was its original intended purpose and such removes potential ambiguity with 'inline' or 'before'. Bopomofo ruby needs special handling by the implementation, if ruby is to always appear to the right. (Note that the user may also choose to position bopomofo ruby before the base, in which case they would use the normal 'before' setting.)</p>
<p>This property is used by the parent of elements with display: ruby-text to
control the position of the ruby text with respect to its base. Such parents
are typically either the <samp>ruby</samp> element itself (simple ruby) or the
<samp>rtc</samp> element (complex ruby). This assures that all parts of a <samp>rtc</samp>
element will be displayed in the same position. Possible values:</p>
<p class="issue"><span class="issuehead">Issue-107:&nbsp;</span> Roland Steiner has requested the addition of an auto value as default. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=ruby-position%3A+undesirable+default+value+%27before%27+for+complex+ruby&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;period_month=&amp;period_year=&amp;index-grp=Public__FULL&amp;index-type=t&amp;type-index=www-style&amp;resultsperpage=20&amp;sortby=date">this thread</a> and <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=Styling+of+complex+Ruby&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;period_month=&amp;period_year=&amp;index-grp=Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core&amp;resultsperpage=20&amp;sortby=date">this one</a>.</p>
<dl>
<dt><strong>before</strong></dt>
<dd>The ruby text appears before the base. This is the most common setting
used in ideographic East Asian writing systems. This is the initial
value.
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing above the base"
class="example" src="images/shinkansen-top.gif" width="140" height="33" /></p>
<p><b>Figure 4.1.1</b>: Top ruby in horizontal layout applied to
Japanese text</p>
</div>
<p>If the base appears in a vertical-ideographic layout mode, the ruby
appears on the right side of the base and is rendered in the same layout
mode as the base (i.e. vertical-ideographic).</p>
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the right of the base"
class="example" src="images/shinkansen-right.gif" width="33" height="141" /></p>
<p><b>Figure 4.1.2</b>: Top ruby in vertical ideographic layout applied
to Japanese text</p>
</div>
</dd>
<dt><strong>after</strong></dt>
<dd>The ruby text appears after the base. This is a relatively rare
setting used in ideographic East Asian writing systems, most easily
found in educational text.
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in horizontal mode with ruby text appearing below the base"
class="example" src="images/shinkansen-bottom.gif" width="142" height="36" /></p>
<p><b>Figure 4.1.3</b>: Bottom ruby in horizontal layout applied to
Japanese text</p>
</div>
<p>If the base appears in a vertical ideographic mode, the bottom ruby
appears on the left side of the base and is rendered in the same layout
mode as the base (i.e. vertical).</p>
<div class="figure">
<p>
<img
alt="Diagram of ruby glyph layout in vertical mode with ruby text apearing vertically on the left of the base"
class="example" src="images/shinkansen-left.gif" width="37" height="141" /></p>
<p><b>Figure 4.1.4</b>: Bottom ruby in vertical ideographic layout applied
to Japanese text</p>
</div>
</dd>
<dt><strong>inter-character</strong></dt>
<dd>
<p class="issue"><span class="issuehead">Issue</span> We replaced 'right' with 'inter-character', since that was its original intended purpose and such removes potential ambiguity with 'inline' or 'before'. Bopomofo ruby needs special handling by the implementation, if ruby is to always appear to the right. (Note that the user may also choose to position bopomofo ruby before the base, in which case they would use the normal 'before' setting.) See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20Vertical+layout+not+enough+for+bopomofo&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a> following a request from the i18n WG.</p>
<p>The ruby text appears on the right of the base. Unlike 'before' and
'after', this value is visual and is not relative to the text flow direction.</p>
<p>This value is provided for the special case of traditional Chinese as used especially in
Taiwan: ruby (made of <a href="#g-bopomofo"><span
lang="zh">bopomofo</span></a> glyphs) in that context appears vertically along
the right side of the base glyph, whether the layout of the base characters is vertical or horizontal:</p>
<div class="figure">
<p><img alt="Example of Taiwanese-style ruby" class="example"
width="138" height="42" src="images/bopomofo.gif" /></p>
<p><b>Figure 4.1.5</b>: "<span lang="zh">Bopomofo</span>" ruby in
traditional Chinese (ruby text shown in blue for clarity) in horizontal
layout</p>
</div>
<p class="note"><span class="note-label">Note:</span> The bopomofo
transcription is written in the normal way as part of the ruby text.
The user agent is responsible for ensuring the correct relative alignment
and positioning of the glyphs, including those corresponding to the
tone marks, when displaying. Tone marks are spacing characters that occur in memory at the end of the ruby text for each base character. They are usually displayed in a separate column to the right of the bopomofo characters, and the height of the tone mark depends on the number of characters in the syllable. One tone mark, however, is placed above the bopomofo, not to the right of it.</p>
<p class="note"><span class="note-label">Note:</span> To make bopomofo annotations appear before or after the base text, like annotations for most other East Asian writing systems, use the 'before' and 'after' values of ruby-position.</p>
<p>It is not defined how a user-agent should handle ruby text that is not bopomofo when the value of ruby-position is set to 'right'.</p>
</dd>
<dt><strong>inline</strong></dt>
<dd>
<p>Ruby text follows the ruby base with no special styling. The value can be used to disable ruby text positioning.</p>
<p>If the author has used the XHTML <samp>rp</samp> element [<a href="#ruby">RUBY</a>] they should set the <samp>display</samp> value for that element to <samp>inline</samp>, so that the ruby text is distinguishable from the base text. If no <samp>rp</samp> element has been used, the author can use the <samp>content</samp> property with the <samp>:before</samp> and <samp>:after</samp> pseudo-elements to set off the ruby text. </p>
<p class="issue"><span class="issuehead">Issue</span> Here is a <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20inline+value+description+missing&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">request </a>for this section to be added, from the i18n WG..</p>
</dd>
</dl>
<p>If two rtc elements are set with the same ruby-position value, (for example
both &#39;before&#39;), the relative position of the two elements is undefined. This
setting should not be used.</p>
<h3>4<a id="rubyalign">.2 Ruby alignment: the 'ruby-align' property</a></h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-align">ruby-align</th></tr>
<tr>
<td><em>Value:</em></td>
<td>auto | start | left | center | end | right | distribute-letter |
distribute-space | line-edge</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>auto</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>all elements and generated content</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages: </em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p>This property can be used on any element to control the text alignment of
the ruby text and ruby base contents relative to each other. It applies to all
the rubys in the element. For simple ruby, the alignment is applied to the
ruby child element whose content is shorter: either the <a
href="http://www.w3.org/TR/ruby/#rb"><samp>rb</samp></a> element or the <a
href="http://www.w3.org/TR/ruby/#rt"><samp>rt</samp></a> element [<a
href="#ruby">RUBY</a>]. For complex ruby, the alignment is also applied to the
ruby child elements whose content is shorter: either the <samp>rb</samp>
element and/or one or two <samp>rt</samp> elements for each related ruby text
and ruby base element within the <samp>rtc</samp> and <samp>rbc</samp>
element.</p>
<p>Possible values:</p>
<p class="issue"><span class="issuehead">Issue</span> Tony Graham has <a href="http://www.w3.org/Style/XSL/Group/FO/wiki/Ruby#Treat_CSS3_.22ruby-align.22_As_Shorthand.3F">suggested </a>that distribute-letter and distribute-space be values of a ruby-group-distribution property, and line-edge be moved to a ruby-alignment-edge property, and that the rest be gathered under a ruby-alignment property. And that ruby-align become a shorthand.</p>
<dl>
<dt><strong>auto</strong></dt>
<dd>The user agent determines how the ruby contents are aligned. This is
the initial value. The behavior recommended by [<a href="#jlreq">JLREQ</a>] is for wide-cell ruby to be aligned in the 'distribute-space' mode:
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in auto aligned ruby when ruby text is shorter than base"
src="images/ra-ds.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in auto aligned ruby when ruby text is longer than base"
src="images/ra-ds-rb.gif" /></p>
<p><b>Figure 4.2.1</b>: Wide-cell text in 'auto' ruby alignment is
'distribute-space' justified</p>
</div>
<p>The recommended behavior for narrow-cell glyph ruby is to be
aligned in the 'center' mode.</p>
<div class="figure">
<p><img
alt="Diagram of glyph layout in auto aligned ruby when halfwidth ruby text is shorter than base"
class="example" width="145" height="91"
src="images/ra-c-h.gif" /><img
alt="Diagram of character layout in auto aligned ruby when ruby text is longer than narrow-width base"
class="example" width="145" height="91"
src="images/ra-c-rb-h.gif" /></p>
<p><b>Figure 4.2.2</b>: Narrow-width ruby text in 'auto' ruby alignment
is centered</p>
</div>
</dd>
<dt><strong>left</strong></dt>
<dd>The ruby text content is aligned with the start edge of the base.
<p class="issue"><span class="issuehead">Issue</span> The i18n WG feels that start and left should not be synonymous, and proposed to drop left (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a>.</p>
<div class="figure">
<p><img
alt="Diagram of glyph layout in left aligned ruby when ruby text is shorter than base"
class="example" width="145" height="91" src="images/ra-l.gif" /><img
class="example" width="145" height="91"
alt="Diagram of glyph layout in left aligned ruby when ruby text is longer than base"
src="images/ra-l-rb.gif" /></p>
<p><b>Figure 4.2.3</b>: Start ruby alignment</p>
</div>
</dd>
<dt><strong>center</strong></dt>
<dd>The ruby text content is centered within the width of the base. If the
length of the base is smaller than the length of the ruby text, then the
base is centered within the width of the ruby text.
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in center aligned ruby when ruby text is shorter than base"
src="images/ra-c.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in center aligned ruby when ruby text is longer than base"
src="images/ra-c-rb.gif" /></p>
<p><b>Figure 4.2.4</b>: Center ruby alignment</p>
</div>
</dd>
<dt><strong>right</strong></dt>
<dd>The ruby text content is aligned with the end edge of the base.
<p class="issue"><span class="issuehead">Issue</span> The i18n WG feels that end and right should not be synonymous, and proposed to drop right (there is no left/right in overhang)? See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20left/start+and+right/end&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a>.</p>
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in right aligned ruby when ruby text is shorter than base"
src="images/ra-r.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in right aligned ruby when ruby text is longer than base"
src="images/ra-r-rb.gif" /></p>
<p><b>Figure 4.2.5</b>: End ruby alignment</p>
</div>
</dd>
<dt><strong>distribute-letter</strong></dt>
<dd>If the width of the ruby text is smaller than that of the base, then
the ruby text contents are evenly distributed across the width of the
base, with the first and last ruby text glyphs lining up with the
corresponding first and last base glyphs. If the width of the ruby text
is at least the width of the base, then the letters of the base are
evenly distributed across the width of the ruby text.
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is shorter than base"
src="images/ra-dl.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-letter aligned ruby when ruby text is longer than base"
src="images/ra-dl-rb.gif" /></p>
<p><b>Figure 4.2.6</b>: Distribute-letter ruby alignment</p>
</div>
</dd>
<dt><strong>distribute-space</strong></dt>
<dd>If the width of the ruby text is smaller than that of the base, then
the ruby text contents are evenly distributed across the width of the
base, with a certain amount of white space preceding the first and
following the last character in the ruby text. That amount of white
space is normally equal to half the amount of inter-character space of
the ruby text. If the width of the ruby text is at least the width of
the base, then the same type of space distribution applies to the base.
In other words, if the base is shorter than the ruby text, the base is
distribute-space aligned. This type of alignment
is described by [<a href="#jlreq">JLREQ</a>].
<div class="figure">
<p><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is shorter than base"
src="images/ra-ds.gif" /><img class="example" width="145" height="91"
alt="Diagram of glyph layout in distribute-space aligned ruby when ruby text is longer than base"
src="images/ra-ds-rb.gif" /></p>
<p><b>Figure 4.2.7</b>: Distribute-space ruby alignment</p>
</div>
</dd>
<dt><strong>line-edge</strong></dt>
<dd>If the ruby text is not adjacent to a line edge, it is aligned as in
'auto'. If it is adjacent to a line edge, then it is still aligned as in
auto, but the side of the ruby text that touches the end of the line is
lined up with the corresponding edge of the base. This type of alignment
is described by [<a href="#jlreq">JLREQ</a>]. This type of alignment is
relevant only to the scenario where the ruby text is longer than the
ruby base. In the other scenarios, this is just 'auto'.
<div class="figure">
<p><img class="example" width="146" height="109"
alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is shorter than base"
src="images/ra-le-l.gif" /><img class="example" width="146"
height="110"
alt="Diagram of glyph layout in line-edge aligned ruby when ruby text is longer than base"
src="images/ra-le-r.gif" /></p>
<p><b>Figure 4.2.8</b>: Line edge ruby alignment</p>
</div>
</dd>
</dl>
<p>For a complex ruby with spanning elements, one additional consideration is
required. If the spanning element spans multiple 'rows' (other rbc or rtc
elements), and the ruby alignment requires space distribution among the
'spanned' elements, a ratio must be determined among the 'columns' of spanned
elements. This ratio is computed by taking into consideration the widest
element within each column.</p>
<p>In the context of this property, the 'left' and 'right' values are
synonymous with the 'start' and 'end' values respectively, i.e. their meaning
is relative according to the text layout flow. Most of the other CSS
properties interpret 'left' and 'right' on an 'absolute' term.</p>
<h3>4<a id="rubyover">.3 Ruby overhanging: the 'ruby-overhang' property</a></h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-overhang">ruby-overhang</th></tr>
<tr>
<td><em>Value:</em></td>
<td>auto | start | end | none</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>none</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>the parent of elements with display: ruby-text</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>yes</td>
</tr>
<tr>
<td><em>Percentages: </em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>specified value (except for initial and inherit)</td>
</tr>
</tbody>
</table>
<p>This property determines whether, and on which side, ruby text is allowed
to partially overhang any adjacent text in addition to its own base, when the
ruby text is wider than the ruby base. Note that ruby text is never allowed to
overhang glyphs belonging to another ruby base. <span class="issue"><span class="issuehead">Issue</span> This rule must be broken if we are to allow support for jukugo ruby.</span> Also the user agent is free to assume
a maximum amount by which ruby text may overhang adjacent text. The user agent may use
the [<a href="#jis4051">JIS4051</a>] recommendation of using one ruby text character
length as the maximum overhang length. Detailed rules for how ruby text can overhang adjacent characters for Japanese are described by [<a href="#jlreq">JLREQ</a>].</p>
<p>Possible values:</p>
<dl>
<dt><strong>auto</strong></dt>
<dd>The ruby text can overhang text adjacent to the base on either side. [<a href="#jlreq">JLREQ</a>] and [<a href="#jis4051">JIS4051</a>] specify the categories of characters that
ruby text can overhang. The user agent is free to follow those recommendations or specify its own classes of
characters to overhang. This is the initial value.
<div class="figure">
<p><img class="example" width="177" height="91"
alt="Diagram of glyph layout in overhanging ruby" src="images/ro-a.gif" /></p>
<p><b>Figure 4.3.1</b>: Ruby overhanging adjacent text</p>
</div>
</dd>
<dt><strong>start</strong></dt>
<dd>The ruby text can only overhang the text that precedes it. That means, for
example, that ruby cannot overhang text that is to the right of it in
horizontal LTR layout, and it cannot overhang text that is below it in
vertical-ideographic layout.
<div class="figure">
<p><img class="example" width="199" height="91"
alt="Diagram of glyph layout when ruby overhangs the preceding glyphs only"
src="images/ro-s.gif" /></p>
<p><b>Figure 4.3.2</b>: Ruby overhanging preceding text only</p>
</div>
</dd>
<dt><strong>end</strong></dt>
<dd>The ruby text can only overhang the text that follows it. That means, for
example, that ruby cannot overhang text that is to the left of it in
horizontal LTR layout, and it cannot overhang text that is above it in
vertical-ideographic layout.
<div class="figure">
<p><img class="example" width="198" height="91"
alt="Diagram of glyph layout when ruby overhangs the following characters only"
src="images/ro-e.gif" /></p>
<p><b>Figure 4.3.3</b>: Ruby overhanging following text only</p>
</div>
</dd>
<dt><strong>none</strong></dt>
<dd>The ruby text cannot overhang any text adjacent to its base, only its
own base.
<div class="figure">
<p><img class="example" width="220" height="91"
alt="Diagram of glyph layout in non-overhanging ruby"
src="images/ro-n.gif" /></p>
<p><b>Figure 4.3.4</b>: Ruby not allowed to overhang adjacent text</p>
</div>
</dd>
</dl>
<h3>4<a id="rubyspan">.4 Ruby annotation spanning: the 'ruby-span' property</a></h3>
<table class="propdef" cellspacing="0" cellpadding="0">
<tbody>
<tr align="left"><th>Name:</th><th id="ruby-span">ruby-span</th></tr>
<tr>
<td><em>Value:</em></td>
<td>attr(x) | none</td>
</tr>
<tr>
<td><em>Initial:</em></td>
<td>none</td>
</tr>
<tr>
<td><em>Applies to:</em></td>
<td>elements with display: ruby-text</td>
</tr>
<tr>
<td><em>Inherited:</em></td>
<td>no</td>
</tr>
<tr>
<td><em>Percentages: </em></td>
<td>N/A</td>
</tr>
<tr>
<td><em>Media:</em></td>
<td>visual</td>
</tr>
<tr>
<td><em>Computed value: </em></td>
<td>&lt;number&gt;</td>
</tr>
</tbody>
</table>
<p>This property controls the spanning behavior of annotation elements. </p>
<p class="note"><span class="note-label">Note:</span> A XHTML user agent may also use the <samp>rbspan</samp>
attribute to get the same effect.</p>
<p>Possible values:</p>
<dl>
<dt><strong>attr(x)</strong></dt>
<dd>The value of attribute 'x' as a string value. The string value is
evaluated as a &lt;number&gt; to determine the number of ruby base elements to be
spanned by the annotation element. If the &lt;number&gt; is &#39;0&#39;, it is replaced by
&#39;1&#39;.The &lt;number&gt; is the computed value. </dd>
<dt>none</dt>
<dd>No spanning. The computed value is &#39;1&#39;.</dd>
</dl>
<p>The following example shows an XML example using the 'display' property
values associated with the 'ruby structure and the 'ruby-span' property</p>
<pre class="xml">myruby { display: ruby; }
myrbc { display: ruby-base-container; }
myrb { display: ruby-base; }
myrtc.before { display: ruby-text-container; ruby-position: before}
myrtc.after { display: ruby-text-container; ruby-position: after}
myrt { display: ruby-text; ruby-span: attr(rbspan); }
...
&lt;myruby&gt;
&lt;myrbc&gt;
&lt;myrb&gt;10&lt;/myrb&gt;
&lt;myrb&gt;31&lt;/myrb&gt;
&lt;myrb&gt;2002&lt;/myrb&gt;
&lt;/myrbc&gt;
&lt;myrtc class=&quot;before&quot;&gt;
&lt;myrt&gt;Month&lt;/myrt&gt;
&lt;myrt&gt;Day&lt;/myrt&gt;
&lt;myrt&gt;Year&lt;/myrt&gt;
&lt;/myrtc&gt;
&lt;myrtc class=&quot;after&quot;&gt;
&lt;myrt rbspan=&quot;3&quot;&gt;Expiration Date&lt;/myrt&gt;
&lt;/myrtc&gt;
&lt;/myruby&gt;</pre>
<hr />
<h2><a id="properties">5. Properties index</a></h2>
<p id="properties0">In addition to the specified values, all properties take the
'inherit' and 'initial' values.</p>
<table class="proptable" border='1'>
<thead>
<tr align='center'>
<th>Name</th>
<th>Values</th>
<th>Initial</th>
<th>Applies to </th>
<th>Inh.</th>
<th>Percentages </th>
<th>Media groups<br />
</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#rubyalign">'ruby-align'</a></td>
<td>auto | start | left | center | end | right | distribute-letter |
distribute-space | line-edge</td>
<td>auto</td>
<td> all elements and generated content</td>
<td>yes</td>
<td>N/A </td>
<td>visual</td>
</tr>
<tr>
<td><a href="#rubyover">'ruby-overhang'</a></td>
<td>auto | start | end | none</td>
<td>none</td>
<td>the parent of elements with display: ruby-text</td>
<td>yes</td>
<td> N/A</td>
<td>visual</td>
</tr>
<tr>
<td><a href="#rubypos">'ruby-position'</a></td>
<td>before | after | right | inline</td>
<td>see individual properties</td>
<td>the parent of elements with display: ruby-text</td>
<td>yes</td>
<td> N/A</td>
<td>visual</td>
</tr>
<tr>
<td><a href="#rubyspan">'ruby-span'</a></td>
<td>attr(x) | none</td>
<td>none</td>
<td>elements with display: ruby-text</td>
<td>no</td>
<td>N/A</td>
<td>visual</td>
</tr>
</tbody>
</table>
<p class="issue"><span class="issuehead">Issue</span> The i18n WG has requested the addition of a sample user agent default style sheet, as promised by Ruby Annotation section 3.4. See <a href="http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&amp;hdr-1-name=subject&amp;hdr-1-query=[CSS3+Ruby]%20Default+stylesheet&amp;hdr-2-name=from&amp;hdr-2-query=&amp;hdr-3-name=message-id&amp;hdr-3-query=&amp;index-grp=Member__FULL+Public__FULL&amp;index-type=t&amp;type-index=public-i18n-core%40w3.org&amp;resultsperpage=20&amp;sortby=date">this thread</a>.</p>
<h2><a id="profiles">6. Profiles</a></h2>
<p>There are two modules defined by this module:</p>
<p>CSS3 Simple Ruby model</p>
<p>CSS3 Complex Ruby model.</p>
<p>They both contain all the properties specified by this CSS chapter, i.e. <a
href="#rubyalign">'ruby-align'</a>, <a href="#rubyover">'ruby-overhang'</a>, <a href="#rubypos">'ruby-position'</a>
and <a href="#rubyspan">'ruby-span'</a>. They differ by the required
'display' property values. The Simple Ruby model requires the values: 'ruby',
'ruby-base' and 'ruby-text'. The Complex Ruby model requires in addition the
values: 'ruby-base-container' and 'ruby-text-container'.</p>
<h2><a id="glossary">Glossary</a></h2>
<dl>
<dt><a id="g-bopomofo"><strong><span
lang="zh">Bopomofo</span></strong></a></dt>
<dd>37 characters and 4 tone markings used as phonetics in Chinese,
especially standard Mandarin.</dd>
<dt><a id="g-hanja"><strong><span
lang="ko">Hanja</span></strong></a></dt>
<dd>Subset of the Korean writing system that utilizes ideographic
characters borrowed or adapted from the Chinese writing system. Also see
<a href="#g-kanji"><span lang="ja">Kanji</span></a>.</dd>
<dt><a id="g-hiragana"><strong><span
lang="ja">Hiragana</span></strong></a></dt>
<dd>Japanese syllabic script, or character of that script. Rounded and
cursive in appearance. Subset of the Japanese writing system, used together
with kanji and katakana. In recent times, mostly used to write Japanese
words when kanji are not available or appropriate, and word endings and
particles. Also see <a
href="#g-katakana"><span lang="ja">Katakana</span></a>.</dd>
<dt><a id="g-ideogram"><strong>Ideograph</strong></a></dt>
<dd>A character that is used to represent an idea, word, or word component,
in contrast to a character from an alphabetic or syllabic script. The most
well-known ideographic script is used (with some variation) in East Asia
(China, Japan, Korea,...).</dd>
<dt><a id="g-kana"><strong><span lang="ja">Kana</span></strong></a></dt>
<dd>Collective term for hiragana and katakana.</dd>
<dt><a id="g-kanji"><strong>Kanji</strong></a></dt>
<dd>Japanese term for ideographs; ideographs used in Japanese. Subset of the
Japanese writing system, used together with hiragana and katakana. Also see <a
href="#g-hanja"><span lang="ko">Hanja</span></a>.</dd>
<dt><a id="g-katakana"><strong><span
lang="ja">Katakana</span></strong></a></dt>
<dd>Japanese syllabic script, or character of that script. Angular in
appearance. Subset of the Japanese writing system,&nbsp; used together with
kanji and hiragana. In recent times, mainly used to write foreign words. Also see <a
href="#g-hiragana"><span lang="ja">Hiragana</span></a>.</dd>
<dt><a id="g-monoruby" name="g-monoruby"><strong>Mono-ruby</strong></a></dt>
<dd>In Japanese typography: Ruby associated with a single character of
the base text.</dd>
<dt><a id="g-ruby"><strong>Ruby</strong></a></dt>
<dd>A run of text that appears in the vicinity of another run of text and
serves as an annotation or a pronunciation guide for that text.</dd>
</dl>
<hr />
<h2><a id="ack">Acknowledgements</a></h2>
<p>This specification would not have been possible without the help from:</p>
<p>Stephen Deach, Martin Dürst,  Hideki Hiura(<span lang="ja">樋浦 秀樹</span>), Masayasu Ishikawa(<span lang="ja">石川
雅康</span>), Chris
Pratley, Takao Suzuki(<span lang="ja">鈴木 孝雄</span>), Frank Yung-Fong Tang, Chris Thrasher, Masafumi Yabe<span lang="ja">家辺
勝文</span>), Steve Zilles.</p>
<hr />
<h2><a id="references">References</a></h2>
<dl>
<dt>[<a id="jis4051">JIS4051</a>]<span class="issue"> <span class="issuehead">Issue</span> Change this to the 2004 version of the spec.</span></dt>
<dd><em>Line composition rules for Japanese documents </em>(<span lang="ja">日本語文書の行組版方法</span>)</dd>
<dd>JIS X 4051-1995, Japanese Standards Association, 1995 (in
Japanese)</dd>
<dt>[<a id="jis4052">JIS4052</a>] </dt>
<dd><em>&quot;<cite>Exchange format for Japanese documents with composition markup</cite>&quot;</em>
(<span lang="ja">日本語文書の組版指定交換形式</span>) </dd>
<dd>JIS X 4052:2000, Japanese Standards Association, 2000 (in Japanese)</dd>
<dt>[<a id="jlreq">JLREQ</a>]</dt>
<dd><em>&quot;<cite>Requirements for Japanese Text Layout, W3C WG Note</cite>&quot;</em>
(<span lang="ja">日本語組版処理の要件(日本語版)</span>)</dd>
<dd>Yasuhiro Anan (阿南 康宏), Hiroyuki Chiba (千葉 弘幸), Junsaburo Edamoto (枝本 順三郎), Richard Ishida, Keiichiro Ishino (石野 恵一郎), Tatsuo Kobayashi (小林 龍生), Toshi Kobayashi (小林 敏), Kenzou Onozawa (小野澤 賢三), Felix Sasaki, 4 June 2009,<br />
Available at: <a href="http://www.w3.org/TR/jlreq/">http://www.w3.org/TR/jlreq/</a>, and <a href="http://www.w3.org/TR/2009/NOTE-jlreq-20090604/ja/">in Japanese</a></dd>
<dt>[<a id="rfc2119">RFC 2119</a>]</dt>
<dd> Scott Bradner, <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words
for use in RFCs to Indicate Requirement Levels</cite></a>, IETF RFC 2119.<br />
(See
<a href="http://www.ietf.org/rfc/rfc2119.txt">
http://www.ietf.org/rfc/rfc2119.txt</a>.)</dd>
<dt>[<a id="ruby">RUBY</a>]</dt>
<dd><em>Ruby Annotation, W3C Recommendation</em></dd>
<dd>Marcin Sawicki, Michel Suignard, Masayasu Ishikawa, Martin Dürst and
Tex Texin, 31 May 2001,<br />
Available at: <a
href="http://www.w3.org/TR/2001/REC-ruby-20010531/">http://www.w3.org/TR/2001/REC-ruby-20010531</a></dd>
<dt id="UNICODE">[UNICODE]</dt>
<dd>The Unicode Consortium. <cite>The Unicode Standard, Version 6.0.0</cite>, (Mountain View, CA: The Unicode Consortium, 2011. ISBN 978-1-936213-01-6) Available at: <a href="http://www.unicode.org/versions/Unicode6.0.0/">http://www.unicode.org/versions/Unicode6.0.0/</a>
<!---->
<br />
For more information, consult the Unicode Consortium's home page at
<a href="http://www.unicode.org/">http://www.unicode.org/</a></dd>
<dt id="UAX11">[UAX#11]</dt>
<dd>Asmus Freytag. <cite>East Asian Width.</cite> 15 March 2002. Unicode
Standard Annex #11. URL:<br />
<a href="http://www.unicode.org/reports/tr11/">http://www.unicode.org/reports/tr11/</a></dd>
<!---->
<dt>
[<a id="xhtml-mod">XHTMLMOD</a>]</dt>
<dd><em>Modularization of XHTML, W3C Recommendation</em></dd>
<dd>Murray Altheim, Shane McCarron, et al., 10 April 2001<br />
Available at:
<a href="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/">
http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410/</a></dd></dl>
</body>
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.dcl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-validate-command: "SP_BCTF=utf-8 nsgmls -s %s %s"
End:
-->