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-text] Better describe the likely outcomes of hyphenation (editorial) #5973
I think it would be worthwhile to add a note which explains that hyphenation should produce a number of effects, depending on the language in question, and give examples, in order to remind implementers to implement a solution that is open to cultural adaptation. These examples include:
In some cases the spelling of a word needs to be changed around hyphenation, for example in Dutch cafeetje → café-tje and skiërs → ski-ers, and in Hungarian Összeg → Ösz-szeg.
The symbol used to indicate that a word was broken at the end of a line is not always one that looks like a hyphen. Cree uses ᐀ [U+1400 CANADIAN SYLLABICS HYPHEN], Armenian uses ֊ [U+058A ARMENIAN HYPHEN], Balinese uses ᭠ [U+1B60 BALINESE PAMENENG], etc. Some languages, such as Malayalam or Tamil may produce no visual marker.
The location of the mark is not always at the end of the line – some languages put it at the start of the following line, such as Traditional Mongolian.
It should also be made clear that such effects are triggered not only by browser code applying algorithms, but by ­ or wbr (see #5972) when they fall within a range to which the hyphens property has been applied (with relevant values), and that ­ should only produce a glyph at the end of a line that looks like a hyphen if that is appropriate for the language in question.
Polish language is one I believe? I understand the OpenOffice hyphenation rules for Polish apply a hyphen to both the end of the first line and the start of the next.
As you're looking at this, we noticed that hyphenate-character allows you to override the defaults, but it doesn't allow you to specify whether your overridden character is at the end of the first line or the start of the second (or both). Two easy ways to specify this would be to give hyphenate-character an optional second argument, eg hyphenate-character: "" "-", or a single string with a newline to separate the two values, eg hyphenate-character: "-\A-". How necessary this is, I don't know.
Here's another example of the visual marker appearing at the beginning of a line. Unicode Standard, v11, p536:
In writing Mongolian and Todo, U+1806 mongolian todo soft hyphen is used at the beginning of the second line to indicate resumption of a broken word. It functions like U+2010 hyphen, except that U+1806 appears at the beginning of a line rather than at the end.
Do you have a suggestion for a short example that we could include, for instance right after the first paragraph of 5.4? If we do add something, it would be good to keep it short, just to illustrate the point that hyphenation can be different / more complicated than what is typical of English. But I wouldn't attempt to list too many cases. As much as I find that sort of things interesting, css-text cannot scale to describing all the peculiarities of all the world's languages :)
(Given generic language in the spec that generically allows and expects "the right thing" for all languages, automated tests in wpt might be a more effective place to highlight the specificity of various languages)
The line breaking / hyphenation of pinyin can be an example too, but it may be less common than the above examples (and may be more suitable for css-ruby?).
@frivoal i think we're almost done, but here are some final suggestions:
Per the discussion in this comment, I would like to add one more line to the Hyphenation Across Languages examples, to show a hyphenation mark in LTR text that is clearly not a hyphen. I suggest using the svg images for Plains Cree at the bottom of this comment field.
I don't think it helps much to have to expand example 16 to view it – the table isn't huge, so i'd remove the details tag.
The first para in 5.4 says "and visually indicating the split (usually by inserting a hyphen, U+2010)" (my emphasis). My view is that, even though we call this 'hyphenation', that is a western bias, and 'hyphenation' actually relates to splitting of words to fit on a line, and doesn't necessarily indicate that there needs to be a visual indicator. For example, Malayalam needs hyphenation rules but uses no visual indicator – see an example. I think the text could say "usually indicating the split", or we could drop that phrase.
Activity
faceless2 commentedon Feb 10, 2021
Polish language is one I believe? I understand the OpenOffice hyphenation rules for Polish apply a hyphen to both the end of the first line and the start of the next.
As you're looking at this, we noticed that
hyphenate-characterallows you to override the defaults, but it doesn't allow you to specify whether your overridden character is at the end of the first line or the start of the second (or both). Two easy ways to specify this would be to givehyphenate-characteran optional second argument, eghyphenate-character: "" "-", or a single string with a newline to separate the two values, eghyphenate-character: "-\A-". How necessary this is, I don't know.r12a commentedon Feb 11, 2021
Here's another example of the visual marker appearing at the beginning of a line. Unicode Standard, v11, p536:
frivoal commentedon Apr 23, 2021
Do you have a suggestion for a short example that we could include, for instance right after the first paragraph of 5.4? If we do add something, it would be good to keep it short, just to illustrate the point that hyphenation can be different / more complicated than what is typical of English. But I wouldn't attempt to list too many cases. As much as I find that sort of things interesting, css-text cannot scale to describing all the peculiarities of all the world's languages :)
frivoal commentedon Apr 23, 2021
(Given generic language in the spec that generically allows and expects "the right thing" for all languages, automated tests in wpt might be a more effective place to highlight the specificity of various languages)
xfq commentedon Apr 24, 2021
The line breaking / hyphenation of pinyin can be an example too, but it may be less common than the above examples (and may be more suitable for css-ruby?).
(Related clreq issue: w3c/clreq#351)
[css-text-3] Add table of examples from differanguages #5973
[css-text-3][css-text-4] Language-specific rules apply to explicit hy…
[css-text] Fix markup
27 remaining items
frivoal commentedon Oct 4, 2023
At this point, I am not sure what the request is on the spec. Do we consider the examples already present good enough to show some diversity, or not?
r12a commentedon Oct 4, 2023
@frivoal i think we're almost done, but here are some final suggestions:
SVG images for Cree example:
[css-text] editorial improvements to i18n hyphenation example
Add hyphenatin example for cree
frivoal commentedon Oct 13, 2023
Done (af3f01a). Also added a test in WPT for Cree (web-platform-tests/wpt#42523). Thanks for supplying this example.
Add hyphenatin example for cree
Add hyphenatin example for cree
Bug 1858888 [wpt PR 42523] - Add hyphenation example for Cree, a=test…
Bug 1858888 [wpt PR 42523] - Add hyphenation example for Cree, a=test…
Bug 1858888 [wpt PR 42523] - Add hyphenation example for Cree, a=test…
Bug 1858888 [wpt PR 42523] - Add hyphenation example for Cree, a=test…
Bug 1807893 [wpt PR 37694] - Add tests for i18n variations on hyphena…
Bug 1858888 [wpt PR 42523] - Add hyphenation example for Cree, a=test…