clreq icon indicating copy to clipboard operation
clreq copied to clipboard

No bopomofo ruby support

Open r12a opened this issue 5 years ago • 11 comments

This issue is applicable to Chinese, particularly in Taiwan.

Bopomofo, also named Zhuyin Fuhao, is a transliteration and writing system for Chinese. Although it can sometimes be used for writing Chinese, or local Taiwanese languages, however it has been widely used for 100 years to indicate phonetic annotations of Chinese characters.

Bopomofo is usually written in vertical columns to the right of the Han character. Importantly, most tone marks are set in a second column to the right of the bopomofo letters, and the vertical placement of the tone relative to the letters follows certain rules.

For example: 「嘴」字的國語注音符號拼式

There are two potential ways to implement Bopomofo:

  1. Make special fonts, and combine the Chinese character and the Bopomofo characters into the glyph. Use spans, CSS, and webfonts to toggle fonts. This approach works in all browsers, but it is not very accessible and it is not easy to handle polyphones.

  2. Use HTML ruby/rt, ruby-position: inter-character, and OpenType fonts for all characters in rt (see https://github.com/cmex-30/Bopomofo_on_Web/blob/master/BOPOMOFO%20TYPOGRAPHY.pdf). The CSS spec inter-character value for the ruby-position property is specifically "provided for the special case of traditional Chinese as used especially in Taiwan".

Use of ruby { writing-mode: vertical-lr; } to achieve this (see an example) doesn't produce the needed positioning.

More:

The GAP

Bopomofo ruby is not supported by any browser. This is because:

  1. the annotation is not positioned to the right of the Han characters, and
  2. correct positioning of the internal items needs additional and bopomofo-specific positioning rules to place the bopomofo letters vertically alongside the base character, and to position the tone marks relative to them, either above or in a second column with particular alignments.

Priority

Since this is important for education, it is prioritised as a basic issue.

Tests & results

I18n test suite, ruby-position:inter-character will make zhuyin annotations appear in vertical columns alongside the base in horizontal text.

I18n test suite, ruby-position:inter-character will make zhuyin non-neutral tone marks appear in the correct relative positions alongside the zhuyin characters in horizontal text.

I18n test suite, ruby-position:inter-character will make zhuyin neutral tone marks appear above the zhuyin characters in horizontal text.

Action taken

BlinkGeckoWebKit

Outcomes

Version 18.2 of Safari (WebKit) supports ruby-position: inter-character in so far as it positions bopomofo glyphs vertically to the right of the Han characters — however, it doesn't position the tone marks correctly relative to the bopomofo letters, and therefore it doesn't yet provide a solution to this issue.

r12a avatar Feb 04 '20 12:02 r12a

The first comment in this issue contains text that will automatically appear in one or more gap-analysis documents as a subsection with the same title as this issue. Any edits made to that comment will be immediately available in the document. Proposals for changes or discussion of the content can be made in comments below this point.

Relevant gap analysis documents include: Chinese

r12a avatar Feb 04 '20 12:02 r12a

I found my way here from https://github.com/w3c/i18n-activity/projects/3?card_filter_query=ruby and am curious what's missing. I tried recreating the Wikipedia example with HTML:

<!DOCTYPE html>
<style>
ruby {
  font-size: 64px;
  ruby-position: inter-character;
}
rt { font-size: 16px; }
</style>
<body lang=zh-Hant>
<ruby>
瓶<rt>ㄆㄧㄥˊ</rt>
子<rt>˙ㄗ</rt>
</ruby>

It's rendered similarly in Chrome, Firefox and Safari, here's a screenshot from Safari: image

It looks like ruby-position: inter-character isn't supported by any browser, and perhaps that's common for bopomofo?

I'm also not sure if the tone marks are combined correctly in particular "˙ ㄗ" seems weird, but then I don't know how horizontal bopomofo is supposed to look like.

Are there more issues here?

foolip avatar Oct 08 '21 08:10 foolip

When i'm able to get to it, i'll improve the problem statement here. In the meantime, you may find this illuminating:

Basically, bopomofo ruby is not normally rendered above the base, but rather each character is annotated to its right side with one vertical column containing the syllabics and one of the tones, and if other tones are used they appear in a second column, where the tone marks are aligned with the syllabics in various ways.

(And, btw, if rendering above the base, the vertical and horizontal alignment in your screen snap is pretty awful.)

hth

r12a avatar Oct 08 '21 11:10 r12a

Thank you Richard, that was great reading you linked to. It looks like I wasn't far off with my guess, that tone marks and in particular the light tone need special support.

foolip avatar Oct 09 '21 05:10 foolip

See more info below.

Spec: css-ruby

Tests & results: https://www.w3.org/International/i18n-tests/results/css-ruby#ruby_position_intercharacter

Browser bug reports: BlinkGecko

xfq avatar Oct 09 '21 07:10 xfq

I rewrote the first comment to add more information about Bopomofo.

xfq avatar May 25 '23 10:05 xfq

I applied the new template, but also added text to the problem statement to describe what the gap actually is. Note also that in principle the spec links should briefly describe whether the specs already provide what is needed, or whether they need work – rather than just linking to relevant sections.

r12a avatar May 25 '23 13:05 r12a