Skip to content

[css-text] Better describe the likely outcomes of hyphenation (editorial) #5973

Closed

Description

@r12a

8 Breaking Within Words
https://drafts.csswg.org/css-text-4/#hyphenation
https://drafts.csswg.org/css-text-3/#hyphenation

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:

  1. 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.
  2. 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.
  3. 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.

Activity

  1. faceless2 commented on Feb 10, 2021

    @faceless2

    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.

  2. added
    i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.
    on Feb 11, 2021
  3. r12a commented on Feb 11, 2021

    @r12a
    ContributorAuthor

    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.

  4. frivoal commented on Apr 23, 2021

    @frivoal
    Collaborator

    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 :)

  5. frivoal commented on Apr 23, 2021

    @frivoal
    Collaborator

    (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)

  6. xfq commented on Apr 24, 2021

    @xfq
    Member

    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)

  7. added a commit that references this issue on Dec 28, 2022
  8. 27 remaining items

  9. frivoal commented on Oct 4, 2023

    @frivoal
    Collaborator

    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?

  10. r12a commented on Oct 4, 2023

    @r12a
    ContributorAuthor

    @frivoal i think we're almost done, but here are some final suggestions:

    1. 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.
    2. 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.
    3. 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.

    SVG images for Cree example:

    kasitaniwaninik
    kasitani-
    waninik

  11. frivoal commented on Oct 13, 2023

    @frivoal
    Collaborator

    Done (af3f01a). Also added a test in WPT for Cree (web-platform-tests/wpt#42523). Thanks for supplying this example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Closed Accepted by CSSWG ResolutionChanges backed by a CSSWG resolution.TestedMemory aid - issue has WPT testscss-text-3Current Workcss-text-4i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions