HTML and CSS Reference
In-Depth Information
In many languages, such as Arabic, Hebrew, or East Asian languages, text meaning largely depends on
pronunciation. Web content written in such languages may apply Ruby annotation with ruby , rt , and rp elements in
order to provide information about the pronunciation and meaning of text fragments.
ruby annotations were introduced a long time ago in Far eastern textbooks to provide hints for students about
complex characters. For example, Japanese texts written in the Kanji syllabary (writing system) often contain characters
that are known only by those Japanese who have at least a high school diploma. ruby texts written in hiragana, which is
a syllabary all Japanese are familiar with, can make the text clearer. similarly, traditional Chinese texts can be displayed
in simplified Chinese using ruby annotations.
Note
Using Ruby, a base text can be declared within the Ruby markup (the content of the ruby element), along with
the associated Ruby text (the rt element), and optionally the Ruby parentheses ( rp ), that can be declared for browsers
that cannot render Ruby text correctly. For example, pronunciation hints can be provided for words on an educational
portal, while foreign words or unusual names can be transliterated into English (Listing 10-4) or represented using the
International Phonetic Alphabet (IPA) (Listing 10-5).
Listing 10-4. Ruby Annotation for Tokyo
<ruby>
東京
<rp> (</rp>
<rt>T ō ky ō </rt>
<rp>)</rp>
</ruby>
In the case of simple Ruby markup, user agents should render the Ruby text above the base text at approximately
half the font size. In our case, the result should look like Figure 10-5 .
Figure 10-5. The Ruby annotation for the word Tokyo rendered in IE9
Note
ruby annotations are rendered most accurately by internet explorer.
 
 
Search WWH ::




Custom Search