w3c / clreq

Requirements for Chinese Text Layout
https://www.w3.org/International/clreq/
Other
730 stars 61 forks source link

Handling long annotations over adjacent characters in Chinese #124

Open r12a opened 7 years ago

r12a commented 7 years ago

3.3.4.1 Basic Requirements 基本规则 http://w3c.github.io/clreq/#h-basic-requirements

只要不侵犯最小间距,可允许注文伸展到相邻基字上方。 Annotations are allowed to extend to the top of adjacent base text as long as the minimum spacing is ensured.

Is it possible to get some more detail on how this works? In JLReq annotations can overlap kana or punctuation, and then there are specific distances to be considered, but cannot overlap kanji. It sounds like romanized annotations can overlap adjacent hanzi characters in Chinese as well as punctuation. Is that correct? Are there any limitations (other than the need to separate the annotation by a minimum 1/4em space from adjacent ones)?

CLReq mentions that tracking may need to be adjusted where adjacent annotations are long enough to run into each other. Is this tracking meant to be for all characters on a line/in a paragraph/on a page? Or is it referring to just adding space around the affected characters?

r12a commented 4 years ago

I'm still curious about this. The following picture suggests that tracking has been evenly applied to the first two lines sufficient to accommodate the longer pinyin sylllables (i guess up to 5 characters per hanzi), and maintain the grid layout.

Screenshot 2020-02-17 at 17 41 34

Is this a common approach? (@r12a wishes he could go out and find chinese publications easily and scan typical examples...)

This is quite a different approach from that commonly used for Japanese, which tends to stretch things as and when needed.

I was wondering how to achieve that in CSS. It seemed that you'd want to apply letter-spacing:.25em to the paragraph, and then set letter-spacing:normal for the rt elements. Does that sound sensible??

xfq commented 4 years ago

Most publications I've seen use mono-ruby for each base characters, align the center of the ruby string and of the base character in the inline direction, and increase inter-character spacing for the whole article. See https://github.com/w3c/type-samples/issues/93 for an example.

But sometimes group-ruby, non-center-aligned-ruby, and/or ruby with some amount of overhang over the preceding and following base characters are used as well. See https://thetype.com/wp-content/uploads/2017/08/pinyinxuangua.png for an example.

re achieving it in CSS, I'm not sure if there are other better solutions, but applying extra inter-character space to the paragraph and use normal letter spacing for rt is indeed a solution. Here is a test (containing both mono-ruby and group-ruby).