How do I correctly display furigana?


I've started to program for android recently and one of my side projects is to
make a simple app for learning basic japanese vocabulary and I've been
wondering what's the correct way to display furigana between these two.

1.![enter image description here](https://i.stack.imgur.com/sIccX.png)

2.![enter image description here](https://i.stack.imgur.com/Q6nP7.png)

Is one more standard than the other, or are both just as fine?




If this is a programming question, it belongs on Stack Overflow. I'm going to
assume it's a linguistic question for now, however, based on the graphics.

Of the two examples, option 1 is preferred. The primary reason for this is
that while most Japanese words written in kanji have readings that correspond
to specific characters, there are several words for which this is not the case
due to _[gikun](http://en.wikipedia.org/wiki/Gikun#Gikun)_. For example:

  * 大人【おとな】
  * 今日【きょう】
  * 今朝【けさ】
  * 山手線【やまのてせん】

The short of it is that breaking them apart for each character can suggest an
association where it doesn't exist, and using one style consistently is
generally preferable.




If this is a programming question, it belongs on Stack Overflow. I'm going to
assume it's a linguistic question for now, however, based on the graphics.

Of the two examples, option 1 is preferred. The primary reason for this is
that while most Japanese words written in kanji have readings that correspond
to specific characters, there are several words for which this is not the case
due to _[gikun](http://en.wikipedia.org/wiki/Gikun#Gikun)_. For example:

  * 大人【おとな】
  * 今日【きょう】
  * 今朝【けさ】
  * 山手線【やまのてせん】

The short of it is that breaking them apart for each character can suggest an
association where it doesn't exist, and using one style consistently is
generally preferable.

