Skip to content

[css-ruby] Adjacent overhanging ruby text should not run together in scripts with spaces between words (e.g. Latin) #3498

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
hftf opened this issue Jan 9, 2019 · 5 comments
Labels
css-ruby-1 Current Work css-ruby-2 i18n-clreq Chinese language enablement i18n-jlreq Japanese language enablement i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Needs Design / Proposal

Comments

@hftf
Copy link

hftf commented Jan 9, 2019

Should there always be a visible space between adjacent ruby text in Latin (or other scripts with spaces between words)? Since ruby text is often longer than its base, overhang can prevent awkward gaps in a sentence; however, overhang is not strictly necessary for ruby text to run together.

In the example in this JSFiddle, overhang is desired (ideally the comma should abut the previous word), but the annotations should not abut because they are two different words/belong to two different bases:

Chrome 71/Mac

Ruby text renders with some overhang, and ends up running together

Firefox 64/Mac

Ruby text renders without overhang, so ends up being visibly kept apart

@upsuper upsuper added the css-ruby-1 Current Work label Jan 9, 2019
@upsuper
Copy link
Member

upsuper commented Jan 9, 2019

The current level of spec doesn't have any normative requirement to overhanging, so maybe there's no much we can do for this case in the spec. It's probably more a implementation quality issue at this moment.

Note that JLReq does mention that it is not recommended to have overhanging ruby to become consecutive even in Japanese, and in that case, it's generally recommended to add a space in-between. (See the note around Fig. 3.81)

@xfq xfq added i18n-jlreq Japanese language enablement i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. labels Nov 24, 2019
@frivoal
Copy link
Collaborator

frivoal commented Feb 1, 2021

This is a very interesting problem, and the recently introduced ruby-overhang property does not solve it: even if you use ruby-overhang:none, if you're annotating in latin (or something that uses spaces) over Japanese (or something that doesn't use spaces), the words can run into each other and make an unreadable mess.

It seems that maybe some extra value (ruby-overhang: [ auto | none ] || space) could request that the width of a single U+0020 space be inserted between two adjacent annotation containers if they would otherwise run into each other and at least one of them has that value.
Doing it fully automatically based on the text would be nice, but it seems really complicated to come up with rules for that across all languages and symbols/punctuation.

@fantasai
Copy link
Collaborator

fantasai commented Feb 1, 2021

For Level 1, do we want to allow the UA to do something automatic, similar to how we handle ruby overhang and line-edge alignment?

<h3 id="ruby-spacing">
Ruby Annotation and Overhang Spacing</h3>

	For writing systems that use a space between words,
	the [=annotations=] of two adjacent [=ruby containers=]
	can unreadably collide
	if they run into each other without any intervening spacing.
	UAs may automatically space such [=ruby containers=] apart
	by applying extra margin to each [=ruby container=].

	This level of CSS Ruby does not provide a mechanism to control this behavior.

@hftf
Copy link
Author

hftf commented Feb 1, 2021

the width of a single U+0020 space be inserted between two adjacent annotation containers if they would otherwise run into each other and at least one of them has that value.

It might be nice for users to control the minimum distance; I’m worried that separating two rubies by only a single U+0020 space would be too small of a distance for technical documents in Latin script, though it’s much better than nothing.

@xfq
Copy link
Member

xfq commented Feb 3, 2021

Related text in clreq:

The space between two adjacent annotations should not be smaller than the size of a normal Western-language space, which is about 1/4 em.

https://w3c.github.io/clreq/#id138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-ruby-1 Current Work css-ruby-2 i18n-clreq Chinese language enablement i18n-jlreq Japanese language enablement i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Needs Design / Proposal
Projects
None yet
Development

No branches or pull requests

5 participants