Skip to content

No bopomofo ruby support #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
r12a opened this issue Feb 4, 2020 · 11 comments
Open

No bopomofo ruby support #241

r12a opened this issue Feb 4, 2020 · 11 comments
Labels
doc:clreq Used for gap analysis (only) to indicate target document. gap The first comment in this issue is read by the gap-analysis document. i:inline_notes Inline notes & annotations l:zh Chinese p:basic s:hani Chinese script x:blink Blink needs to fix this. x:clreq This affects the clreq group of languages. x:gecko Gecko needs to fix this. x:webkit WebKit needs to fix this.

Comments

@r12a
Copy link
Contributor

r12a commented Feb 4, 2020

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 r12a added gap The first comment in this issue is read by the gap-analysis document. doc:clreq Used for gap analysis (only) to indicate target document. p:basic i:inline_notes Inline notes & annotations labels Feb 4, 2020
@r12a
Copy link
Contributor Author

r12a commented Feb 4, 2020

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 r12a added the x:clreq This affects the clreq group of languages. label May 11, 2021
@foolip
Copy link
Member

foolip commented Oct 8, 2021

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:

>
<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?

@r12a
Copy link
Contributor Author

r12a commented Oct 8, 2021

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

@foolip
Copy link
Member

foolip commented Oct 9, 2021

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.

@xfq
Copy link
Member

xfq commented Oct 9, 2021

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
Copy link
Member

xfq commented May 25, 2023

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

@r12a
Copy link
Contributor Author

r12a commented May 25, 2023

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 r12a moved this to Browser bug raised in Gap-analysis pipeline Jun 20, 2024
@r12a r12a added s:hani Chinese script l:zh Chinese labels Jun 29, 2024
@bobbytung
Copy link
Contributor

Safari / Webkit 18.2 support unprefixed 'ruby-position: inter-character' and it seems working well with font to adjust tone mark's position.

截圖 2024-12-12 晚上9 25 55

https://cmex-30.github.io/Bopomofo_on_Web/testpage/index.html

@xfq
Copy link
Member

xfq commented Dec 31, 2024

Thanks @bobbytung. I updated the first comment.

@r12a
Copy link
Contributor Author

r12a commented Jan 9, 2025

I largely rewrote the initial comment to update the format but also to make it clearer that Safari 18.2 still doesn't actually fix the problem (because it simply lists all bopomofo glyphs vertically).

@xfq i also reinstated the original problem statement and moved the new information to the Outcomes section. I also changed the example, so that it shows tone positioning.

@r12a r12a added x:blink Blink needs to fix this. x:gecko Gecko needs to fix this. x:webkit WebKit needs to fix this. labels Jan 9, 2025
@r12a
Copy link
Contributor Author

r12a commented Jan 9, 2025

Raised a WebKit bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc:clreq Used for gap analysis (only) to indicate target document. gap The first comment in this issue is read by the gap-analysis document. i:inline_notes Inline notes & annotations l:zh Chinese p:basic s:hani Chinese script x:blink Blink needs to fix this. x:clreq This affects the clreq group of languages. x:gecko Gecko needs to fix this. x:webkit WebKit needs to fix this.
Projects
Status: Browser bug raised
Development

No branches or pull requests

4 participants