w3c / jlreq

Text Layout Requirements for Japanese
https://w3c.github.io/jlreq/
Other
101 stars 17 forks source link

Additional aspects of handling boten marks #338

Open r12a opened 2 years ago

r12a commented 2 years ago

This issue is applicable to Japanese & Chinese in particular.

Issue jlreq/173 looks at basic support for boten (emphasis) marks and their positioning. This gap report describes some additional aspects of boten handling that need further investigation.

Additional requirements arose while the text was being written for CSS. They relate to text that is annotated with ruby at the same time as annotation marks. The conclusions were:

  1. Emphasis marks go outside ruby, as shown by the emphasis dot above the ruby annotations in this example:
    Screenshot 2023-05-30 at 13 10 57
  2. If ruby only spans part of the emphasised word, emphasis marks stay as close as possible to the base, as shown in the emphasis dots on either side of the ruby text.
  3. Where a ruby annotation is hidden or empty, the emphasis marks should continue at the same height, as in the following example where the ruby element spans the whole word but no annotation is provided for the second character.
    Screenshot 2023-05-31 at 13 28 30

There are currently no requirements in jlreq for positioning boten marks with ruby.

[For further research] JLReq also requires that emphasis marks not appear over commas, full stops and brackets.

JLReq calls out the usual practise of using sesame shaped boten for vertical text, and bullets for horizontal. Controls for this exist in CSS, and tests show that it is supported by the browsers that support boten.

The default side for boten is to the right of vertical lines and above horizontal lines, according to JLReq. CSS controls allow this positioning to be set by the author, and in fact it is the default in both browsers that support boten for text where a lang tag identifies it as Japanese.

The Gap:

Gecko moves the boten marks alongside the ruby annotation, keeping the latter closest to the base. In Blink, and Webkit, the boten marks disappear when they occur over the same base as ruby annotations.

All browser engines keep the boten marks close to the base text where ruby annotations don't appear.

Tests & results:

Interactive test, Emphasis marks go outside ruby

Spec status:

3.4. Emphasis Mark Position: the text-emphasis-position property Indicates that the default expectation is for boten marks to appear outside the ruby, but also mentions how to hide the marks if that is your preference, or hide the ruby.

Action taken:

TBD: GeckoBlinkWebkit

Outcomes

TBC

Priority:

If the emphasis marks don't spill over to the text alongside the ruby annotations there is no indication that the text is emphasized, which is clearly a problem.

r12a commented 2 years ago

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: _ChineseJapanese_

xfq commented 2 years ago

The URI fragment of the Chinese document is broken.

r12a commented 2 years ago

The URI fragment of the Chinese document is broken.

Now fixed, thanks.

xfq commented 1 year ago

I created a test with both ruby and emphasis marks being applied to the same piece of text: https://github.com/w3c/character_phrase_tests/issues/55

r12a commented 1 year ago

Thanks @xfq but could you move it to the ruby test grid at https://w3c.github.io/i18n-tests/exploratory/inline_notes/int-ruby ? That makes it easier to experiment with small tweaks to the test (including horizontal/vertical direction). In the meantime, i'll apply the new template to this gap report.

r12a commented 1 year ago

I updated the report to the new template, and since i was doing it i changed the links in the test results page to point to the ruby interactive test grid.