W3C home > Mailing lists > Public > www-style@w3.org > January 2015

Re: [css-ruby] ruby annotation with identical fragments

From: Xidorn Quan <quanxunzhen@gmail.com>
Date: Fri, 23 Jan 2015 09:58:48 +1100
Message-ID: <CAMdq69_rqEd2EBFqpnnVteX=5dymfD-2rg6mhTng7RhKbLTFog@mail.gmail.com>
To: Célian Veyssière <contact@celian.eu>
Cc: www-style list <www-style@w3.org>
On Sat, Jan 10, 2015 at 6:19 AM, Célian Veyssière <contact@celian.eu> wrote:

>
> Is there something planned for automatic cutting fragments and to hide
> identical hiragana to avoid this ?
>
> <ruby>
>   <rbc><rb>亜樹</rb><rb>ゆす子< /rb><rbc>
>   <rtc><rt>あぎ</rt><rt>ゆすこ</rt></rtc>
> </ruby>
>
> Or it's only :
>
> <ruby>
>   <rbc><rb>亜樹</rb><rb>ゆす</rb><rb> 子</rb><rbc>
>   <rtc><rt>あぎ</rt><rt>ゆす</rt><rt>こ< /rt></rtc>
> </ruby>
>

We can only do the second. And in my opinion, it is better that you split
them as much as possible, so that it can be styled more flexible. So, for
your example, I think it is better to write:

<ruby>
  <rb>亜<rb>樹<rb>ゆ<rb>す<rb>子</rb>
  <rt>あ<rt>ぎ<rt>ゆ<rt>す<rt>こ</rt>
</ruby>

Note that <rbc> is not a valid html element, and <rtc> is also not
necessary in your example. In addition, closing tags of <rb> and <rt> are
not required. (If you prefer using XHTML, then your syntax is correct.)


> Idem with hiragana and katakana. Is it possible to hide hiragana of
> katakana ?
>
> <ruby>
>   <rbc><rb>Gユウスケ</rb></rtc>
>   <rtc><rt>ジーゆうすけ</rt></rtc>
> </ruby>
>
> <ruby>
>   <rbc><rb>G</rb><rb>ユウスケ</rb></rtc>
>   <rtc><rt>ジー</rb><rb>ゆうすけ</rt></rtc>
> </ruby>
>

In the current spec, it is not possible, because the autohide only happens
when the text content is completely identical. In addition, I don't think
we should autohide hiragana of katakana. It would further confuse authors.

But you can always specify styles like "visibility: hidden" (maybe
"font-size: 0" is better) to the annotation you want to hide. (Note that
"display: none" won't work properly because the ruby layout relies on the
display value)

For this case, I would suggest the css-text spec to add hiragana and
katakana to text-transform, and apply this property on the annotation. So,
might be something like:

<ruby>
  <rb>G<rb>ユウスケ</rb>
  <rt>ジー<rt style="text-transform: hiragana">ユウスケ</rt>
</ruby>

I guess it probably makes more sense.

- Xidorn
Received on Thursday, 22 January 2015 22:59:57 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:50 UTC