One <axf:ruby-base> maps to one <axf:ruby-text>. A pair of one <axf:ruby-base> and <axf:ruby-text> is called the ruby container. The line can break between a ruby container and another ruby container though the line cannot break within a ruby container.

Ruby has three types and it is classified as follows. (<ruby> <rb> <rt> are used in the following example).

Mono-ruby can be considered as a group ruby whose base character consists of one character. The ruby container of mono-ruby is independent and ruby characters never overhang the base character of the adjacent ruby.

Group-ruby

Group-ruby is expressed as follows.

<ruby><rb>京都府</rb><rt>きようとふ</rt></ruby>

Group-ruby can be considered as a jyukugo (idiom) ruby consisting of one ruby container. Group-ruby is evenly arranged to the entire base characters.

Jyukugo-ruby consists of one or more ruby containers. The line can break between ruby containers. The method of arranging Jyukogo-ruby is complex. As a general rule, the ruby container arranges ruby as group-ruby. However when the ruby text is wider than the ruby base characters, ruby text is allowed to partially overhang any adjacent text in addition to its own base to adjust its position.

鬼門の方角を<ruby><rb>凝</rb><rt>ぎよう</rt><rb>視</rb><rt>し</rt></ruby>する。

When ruby is wider than its own base characters, ruby will overhang the adjacent character. In the following cases, ruby cannot overhang the character.

The adjacent content is a non-text structure, such as an image or <fo:inline-container>.

The adjacent content is ruby.

The font size of the adjacent base character differs from the ruby's own base or it's a script other than Kanji or Kana or there is any inappropriateness.

Ruby overhangs the adjacent character and there is no enough space between ruby and adjacent to the adjacent ruby. (Ruby might overhang partially).

Ruby and emphasis marks can be used together. When the ruby and emphasis marks are put on the same side, emphasis marks will be put outside of ruby. When you want to align emphasis marks to the text without ruby and emphasis marks to ruby, please specify axf:text-emphasis-offset.

The value specified by ruby-align in the Option Setting File is adopted.

distribute-space

Same as distribute-space center.

distribute-space center

Spaces leading and following the ruby text are made and the ruby text is evenly distributed. If the ruby text consists of one character, then it's center aligned.

distribute-space start

Spaces leading and following the ruby text are made and the ruby text is evenly distributed. If the ruby text consists of one character, then it is start aligned.

distribute-letter

Same as distribute-letter center.

distribute-letter center

Spaces leading and following the ruby text are not made and the ruby text is evenly distributed. If the ruby text consists of one character, then it is center aligned.

distribute-letter start

Spaces leading and following the ruby text are not made and the ruby text is evenly distributed. If the ruby text consists of one character, then it is start aligned.

center

Ruby is positioned at the center with solid setting.

start

Ruby is positioned on the start side with solid setting.

end

Ruby is positioned on the end side with solid setting.

start-if-vertical

Same as start if the writing-mode is vertical, same as center if the writing-mode is horizontal.

axf:ruby-align decides the alignment of ruby. Originally, center alignment and start alignment are the concept of mono-ruby, however, the same concept is also applied for group-ruby whose base text has 2 or more characters. When ruby is longer than its base characters, ruby will be positioned with solid setting.

Center alignment of mono-ruby can be specified as follows;

<ruby ruby-align="center"><rb>地</rb><rt>ち</rt></ruby>

Start alignment of mono-ruby can be specified as follows;

<ruby ruby-align="start"><rb>地</rb><rt>ち</rt></ruby>

The following shows the example of giving spaces leading and following the ruby text in group-ruby. The amount of spaces leading and following the ruby text is half the amount of inter-character space of the ruby text.

<ruby ruby-align="distribute-space"><rb>紫陽花</rb><rt>あじさい</rt></ruby>

The following shows the example of not giving spaces leading and following the ruby text in group-ruby.

Overhangs on the start side of the adjacent base character (if available).

end

Overhangs on the end side of the adjacent base character (if available).

except-kanji

Does not overhang when the adjacent base character is kanji.

except-katakana

Does not overhang when the adjacent base character is katakana.

except-start-open-parenthesis

Does not overhang when the open parenthesis is on the start side.

except-end-close-parenthesis

Does not overhang when the close parenthesis is on the end side.

When only except-* is specified and neither start nor end are specified, it is considered as start and end are specified.

axf:ruby-limit-overhang / CSS -ah-ruby-limit-overhang

Specifies the limit of the amount that ruby overhangs the adjacent base character when ruby is longer than its own base character.

Value:

<number> | <length> | <percentage>

Initial:

1.0

Applies to:

axf:ruby

Inherited:

yes

Percentages:

refer to the font size

Values have the following meanings.

<number>

The used value is this number multiplied by the font size of the ruby text (axf:ruby-font-size). The value must be non-negative.

<length>

Specifies the length. The value must be non-negative.

<percentage>

The computed value is this percentage multiplied by the font size of the axf:ruby element (not the font size of the ruby text). The value must be non-negative.

This value shows the amount that ruby overhangs the adjacent base character (It is not the protruding amount).

axf:ruby-limit-space / CSS -ah-ruby-limit-space

Specifies the limit of the amount of spaces leading and following the ruby text when the ruby text is shorter than its base characters.

Value:

<number> | <length> | <percentage> | none

Initial:

1.0

Applies to:

axf:ruby

Inherited:

yes

Percentages:

refer to the font size

Values have the following meanings.

<number>

The used value is this number multiplied by the font size of the ruby text (axf:ruby-font-size). The value must be non-negative.

<length>

Specifies the length. The value must be non-negative.

<percentage>

The computed value is this percentage multiplied by the font size of the axf:ruby element (not the font size of the ruby text). The value must be non-negative.

none

Does not limit the amount of the space.

Possible to avoid generating too much spaces leading and followings the ruby text because the ruby text is too shorter than its base characters when axf:ruby-align="distribute-space" is specified. The amount of the space will be limited to the specified value.

<ruby ruby-limit-space="none"><rb>なげきの聖母像</rb><rt>ピエタ</rt></ruby>

<ruby ruby-limit-space="1.0"><rb>なげきの聖母像</rb><rt>ピエタ</rt></ruby>

axf:ruby-small-kana / CSS -ah-ruby-small-kana

Specifies whether to allow using small kana for ruby text.

Value:

auto | convert

Initial:

auto

Applies to:

axf:ruby

Inherited:

yes

Percentages:

N/A

Values have the following meanings.

auto

Does nothing.

convert

Small kana is converted into regular kana. Only fullwidth (not halfwidth) characters are converted.

It's made available not to use small kana for ruby text. Even if small kana is specified to the ruby text, it will be transformed into regular kana.

<ruby ruby-small-kana="convert"><rb>一寸</rb><rt>ちょっと</rt></ruby>

When ruby-small-kana="auto" is specified, there is nothing special. Small kana will appear in the ruby text as is unless text-transform="fullsize-kana" is specified.

axf:ruby-condense / CSS -ah-ruby-condense

Specifies the font condense when the ruby text is longer than its base.

Value:

none | <percentage> | <number>

Initial:

none

Applies to:

axf:ruby

Inherited:

yes

Percentages:

refer to the ruby-font-size

Condenses ruby by "stretch" so that length of ruby becomes the same as its base characters when ruby is longer than its base characters. The numerical value shows the limit to be shorten at that time. If none is specified, ruby is not condensed.