Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Furigana in Swing (Or GUI Alternatives ...)

Put simple, I cannot find a way to easily display furigana in a JLabel.

For the record:

Furigana (振り仮名?) is a Japanese reading aid, consisting of smaller kana, or syllabic characters, printed next to a kanji (ideographic character) or other character to indicate its pronunciation. In horizontal text, yokogaki, they are placed above the line of text, while in vertical text, tategaki, they are placed to the right of the line of text, as illustrated below. It is one type of ruby text. Furigana are also known as yomigana (読み仮名?) or rubi (ルビ?) in Japanese.

In XHTML this is supported with the Ruby Annotation element, which is - in turn - not supported by Swing's limited HTML rendering capabilities.

I've recently tried to create a JRubyLabel class, capable of handeling Ruby Annotation elements, by stacking multiple JLabel elements in a JPanel - however, I am not so very familiar with Swing, so in a sense I feel like I'm over-complicating things.

My questions thus are, in order of preference:

  • Does Swing support the displaying of ruby text?
  • Can you see a simpler, or better way of implementing ruby text in Swing?
  • Lastly, is there any other GUI program - preferably for Java - that does support ruby text?
like image 528
wen Avatar asked Nov 05 '22 07:11

wen


1 Answers

Itadaki Source Forge project supports Furigana in Java Swing.

like image 61
Boris Pavlović Avatar answered Nov 11 '22 04:11

Boris Pavlović