- From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
- Date: Tue, 06 Jun 2023 11:19:38 +0000
- To: public-css-archive@w3.org
This is very desirable indeed. Sometimes people want this, as you said, in headlines, or for legibility questions. Sometimes people want this because it helps with some forms of dyslexia, or because it's easier on your children and language learners (and in those cases, it is occasionally paired with automated spacing of words). > Historically, in web browsers, line breaks are allowed between most Japanese characters. Not just in browsers. That's how Japanese is done the vast majority of the time in all mediums, so even if there was no performance concern, we'd still not want to do this by default. But indeed, there are desirable exceptions, so this is a good problem to solve. This problem is one of the things https://drafts.csswg.org/css-text-4/#word-boundaries is intending to enable, but I must note that this part of the spec has received a bunch feedback, based on which a significant overhaul is needed. I've got a pending action item to try and recast it into something that hangs off [word-break](https://drafts.csswg.org/css-text-4/#word-break-property) (as you suggested may be the easier solution). I think this is likely to work quite well, with some open questions: * For Japanese, the need is typically expressed as wanting line breaks at phrase segment boundaries (文節に / よる / 改行を / 行う), not word boundaries (文節 / に / よる / 改行 / を / 行う), though we may want both modes to let authors pick, depending on context. This could be addressed by two keywords (`word-break: […] | auto-words | auto-phrase`). Or maybe we don't give a choice, and that's just a quality of implementation question. * If we do have both modes, the phrase segment mode could possibly be applied to languages with spaces as well, including those in the Latin alphabet, as is sometimes used in contexts like headings ("The wizard / of Oz" vs "The / wizard / of / Oz"). Do we want to open that up too, or should this be limited to languages that don't use spaces in the first place? Does this only (selectively) suppress the same kind of wrapping opportunities as `keep-all` could, or can it also turn spaces into NBSPs? * >(One interesting side-effect is that, because there are significantly fewer line breaking opportunities throughout the text, the right edge, which used to be flush, now becomes ragged.) This raises a interesting question: Authors might want to conditionally apply some other styles when this works, for example justification. If the value of `word-break` that turns this on does not include a language parameter (which seems desirable), `@supports` won't help, because the value may be supported in general without the browser knowing how to do it for a particular language. What then? (There is a related problem for hyphenation https://github.com/w3c/csswg-drafts/issues/5530) * What about the other thing that https://drafts.csswg.org/css-text-4/#word-boundaries does (space injection at word boundaries)? Some related related issues: https://github.com/w3c/csswg-drafts/issues/6730 https://github.com/w3c/csswg-drafts/issues/7193 https://github.com/w3c/csswg-drafts/issues/4285 -- GitHub Notification of comment by frivoal Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8920#issuecomment-1578520014 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 6 June 2023 11:19:40 UTC