You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-ruby-1] Treatment of multiple Latin words in space-between & space-around #771
I think it would be useful to have some text, and perhaps another illustration, showing what would happen if you have more than one word in narrow-cell annotations. For space-between, my assumption is that if you have a two word annotation in Latin script over a longer base, the left edge of the word on the left would be flush with the left edge of the base, and the rightmost character of the other word would be flush with the right edge of the longer item.
For space-between, my assumption is that if you have a two word annotation in Latin script over a longer base, the left edge of the word on the left would be flush with the left edge of the base, and the rightmost character of the other word would be flush with the right edge of the longer item.
I'm starting to think that this assumption derived from the spec text is incorrect, and that multiple word annotations in Latin text would simply be centred just like single word annotations.
My previous assumption arose because of the mention of justification being applied. However, i'm inclined to think that justification is not appropriate if the annotation contains narrow characters (pinyin, english,... ) including spaces – the approach is simply to centre the text. That way, a space would not send two words to opposite sides of the annotation space.
Note that space-around is the default value for ruby-align, so i think this divergent behaviour needs to be specified as standard for this value.
Note that Firefox already does this by default if the language of the ruby element is zh-hans/t.
I guess it would be helpful to ask the jlreq & clreq folks to confirm the expected behaviour.
I think we might want to specify explicitly that text-justify: auto, when applied in the context of a ruby annotation, does not offer a justification opportunity on space characters. This would get us the right behavior, and the author could opt into either inter-character or inter-word spacing explicitly if that was wanted.
For base text, though, I think it does need to be spaced out if the annotation is really long.
In JLReq, one note mentions a case of using far shorter annotation than base text, and a way to set maximum size of leading and trailing spacing as half of base character could be taken for preventing misleading appearance (to tell a correct range of ruby base). See attached figure also.
In certain case of Japanese digital publishing (list of demands item 155; only in Japanese; see background etc. in cover page), expanding Western word space for justification between base and annotation is included. (similar to one upper item, use Western word space characters for 1-2-1 spacing)
In discussion within JLReq TF, no strong desire was pointed, but could be similar tendency to CLReq one.
There are multiple difficult open questions, such as which ones (spaces between words or intercharacter points) to use for adjustment, to align leading and trailing between base and annotation (or to have spacing up to half of width of base character, etc.), and we'd keep out of scope.
changed the title [-][css-ruby-1] Treament of multiple Latin words in space-between & space-around[/-][+][css-ruby-1] Treatment of multiple Latin words in space-between & space-around[/+]on Sep 14, 2022
The CSS Working Group just discussed default alignment of ruby text, and agreed to the following:
RESOLVED: Add text-justify:ruby, which is like 'auto' but disables justification oppo on spaces and bopomofo.
RESOLVED: `rt, rtc { text-justify: ruby; }` to UA stylesheet
The full IRC log of that discussion
<TabAtkins> Topic: default alignment of ruby text
<TabAtkins> github: https://github.com//issues/771#issuecomment-1182339573
<fantasai> https://github.com//issues/779
<TabAtkins> fantasai: ruby text, when you put it on base text, it has different default alignment. latin text and bopomofo is centered, but cjk ruby, if the annotation is smaller than base, it'll be justified
<TabAtkins> fantasai: Straightforward way to handle this is to say that ruby annotations are justified by default, and to adjust the jsutification opportunities
<TabAtkins> fantasai: In nromal text we allow spaces to stretch, and inter-character for CJK
<TabAtkins> fantasai: So if we create a justification method where sapces don't expand, but CJK still does, we'll get the intended behavior
<TabAtkins> fantasai: And then people who want a different behavior can use text-justify: inter-word or inter-character if they want it
<TabAtkins> fantasai: So proposal is to create this new jsutification mode
<TabAtkins> fantasai: One, we could say text-justify:auto on ruby annotation has special behavior,
<TabAtkins> fantasai: Two, we could introduce a new text-justify:ruby keyword, and use that in the UA stylesheet
<TabAtkins> fantasai: Probably introducing a new keyword is a little more straightforward for impls
<TabAtkins> Sounds reasonable to me, but I'm not a text ipmlementor. Also lean slightly toward new keyword.
<TabAtkins> florian: I agree
<TabAtkins> Rossen_: Can we have a res with a path forward, not open options?
<TabAtkins> fantasai: Yes, one or the other
<TabAtkins> Rossen_: So proposal to add new text-justify mode as a keyword
<TabAtkins> fantasai: Yes, add text-justify:ruby. It disables justification opportunities on spaces and bopomofo, but otherwise is like 'auto'
<TabAtkins> RESOLVED: Add text-justify:ruby, which is like 'auto' but disables justification oppo on spaces and bopomofo.
<TabAtkins> fantasai: Also need a reoslution to apply it to rt and rtc in UA stylesheet
<TabAtkins> Rossen_: Objections?
<TabAtkins> RESOLVED: `rt, rtc { text-justify: ruby; }` to UA stylesheet
Activity
upsuper commentedon Dec 2, 2016
I think Edge's behavior looks better, but I have no idea how that can be speced.
fantasai commentedon Dec 7, 2016
It's controlled by
text-justify, so if the author or UA prefers inter-character spacing instead of inter-word, that can be specified.r12a commentedon Feb 25, 2020
I'm starting to think that this assumption derived from the spec text is incorrect, and that multiple word annotations in Latin text would simply be centred just like single word annotations.
My previous assumption arose because of the mention of justification being applied. However, i'm inclined to think that justification is not appropriate if the annotation contains narrow characters (pinyin, english,... ) including spaces – the approach is simply to centre the text. That way, a space would not send two words to opposite sides of the annotation space.
Note that
space-aroundis the default value forruby-align, so i think this divergent behaviour needs to be specified as standard for this value.Note that Firefox already does this by default if the language of the ruby element is zh-hans/t.
I guess it would be helpful to ask the jlreq & clreq folks to confirm the expected behaviour.
r12a commentedon Feb 25, 2020
For Chinese, the answer appears to be no justification is expected for multiple word annotations in narrow character text. See w3c/clreq#125
fantasai commentedon Feb 2, 2021
I think we might want to specify explicitly that
text-justify: auto, when applied in the context of a ruby annotation, does not offer a justification opportunity on space characters. This would get us the right behavior, and the author could opt into eitherinter-characterorinter-wordspacing explicitly if that was wanted.For base text, though, I think it does need to be spaced out if the annotation is really long.
r12a commentedon Feb 5, 2021
Yes. This is only about ruby text.
himorin commentedon Feb 15, 2021
For JLReq side:
[css-ruby-1] Draft additional requirements for justification opportun…
fantasai commentedon Jul 12, 2022
Proposal:
text-justify: auto, in the context of a ruby annotation, does not offer a justification opportunity on space characters.inter-characterorinter-wordspacing explicitly if that was wanted.@r12a @himorin Do you think this would solve the problem?
1 remaining item
r12a commentedon Jul 20, 2022
Seems good to me. Thanks.
fantasai commentedon Sep 13, 2022
Additional notes from #779:
[-][css-ruby-1] Treament of multiple Latin words in space-between & space-around[/-][+][css-ruby-1] Treatment of multiple Latin words in space-between & space-around[/+]css-meeting-bot commentedon Oct 12, 2022
The CSS Working Group just discussed
default alignment of ruby text, and agreed to the following:RESOLVED: Add text-justify:ruby, which is like 'auto' but disables justification oppo on spaces and bopomofo.RESOLVED: `rt, rtc { text-justify: ruby; }` to UA stylesheetThe full IRC log of that discussion
<TabAtkins> Topic: default alignment of ruby text<TabAtkins> github: https://github.com//issues/771#issuecomment-1182339573
<fantasai> https://github.com//issues/779
<TabAtkins> fantasai: ruby text, when you put it on base text, it has different default alignment. latin text and bopomofo is centered, but cjk ruby, if the annotation is smaller than base, it'll be justified
<TabAtkins> fantasai: Straightforward way to handle this is to say that ruby annotations are justified by default, and to adjust the jsutification opportunities
<TabAtkins> fantasai: In nromal text we allow spaces to stretch, and inter-character for CJK
<TabAtkins> fantasai: So if we create a justification method where sapces don't expand, but CJK still does, we'll get the intended behavior
<TabAtkins> fantasai: And then people who want a different behavior can use text-justify: inter-word or inter-character if they want it
<TabAtkins> fantasai: So proposal is to create this new jsutification mode
<TabAtkins> fantasai: One, we could say text-justify:auto on ruby annotation has special behavior,
<TabAtkins> fantasai: Two, we could introduce a new text-justify:ruby keyword, and use that in the UA stylesheet
<TabAtkins> fantasai: Probably introducing a new keyword is a little more straightforward for impls
<TabAtkins> Sounds reasonable to me, but I'm not a text ipmlementor. Also lean slightly toward new keyword.
<TabAtkins> florian: I agree
<TabAtkins> Rossen_: Can we have a res with a path forward, not open options?
<TabAtkins> fantasai: Yes, one or the other
<TabAtkins> Rossen_: So proposal to add new text-justify mode as a keyword
<TabAtkins> fantasai: Yes, add text-justify:ruby. It disables justification opportunities on spaces and bopomofo, but otherwise is like 'auto'
<TabAtkins> RESOLVED: Add text-justify:ruby, which is like 'auto' but disables justification oppo on spaces and bopomofo.
<TabAtkins> fantasai: Also need a reoslution to apply it to rt and rtc in UA stylesheet
<TabAtkins> Rossen_: Objections?
<TabAtkins> RESOLVED: `rt, rtc { text-justify: ruby; }` to UA stylesheet
[css-text-4][css-ruby-1] Define 'text-justify: ruby' to handle defaul…
frivoal commentedon Dec 28, 2022
@r12a This has now been edited it. Review appreciated.
[css-text-4][css-ruby-1] Define 'text-justify: ruby' to handle defaul…