Skip to content

[css-text] Line breaking for ambiguous characters; e.g., U+2010, U+2013 #4419

Closed
@kojiishi

Description

@kojiishi

@litherum found that Gecko handles U+2010 very nicely, and I'd like to consider using their idea.

Currently, the line-break property requires:

The following breaks are allowed for normal and loose line breaking if the writing system is Chinese or Japanese, and are otherwise forbidden:
breaks before hyphens:
‐ U+2010, – U+2013, 〜 U+301C, ゠ U+30A0

U+2010 and U+2013 are unified code points, and that it may affect English words in an undesired way. Not sure if this is intentional or not, Gecko supports this only when they follow Japanese characters, and not when they follow Latin letters, regardless of the content language.

jsbin test

It looks to me that this is a very good idea. Maybe not applicable to all cases, but at least these two code points a) are unified and ambiguous, and b) prohibit break before, so looking at the previous character makes sense to me.

Note, the jsbin test includes U+2010 and U+2013 in common CJK fonts, it looks like fonts disagree which code points have full-width CJK glyph and which has Latin glyph.

Thoughts?

/cc @fantasai @frivoal @emilio @jfkthame @drott

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed Accepted by CSSWG ResolutionTestedMemory aid - issue has WPT testsTracked in DoCcss-text-3Current Worki18n-clreqChinese language enablementi18n-jlreqJapanese language enablementi18n-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