-
-
Notifications
You must be signed in to change notification settings - Fork 41
Add word-break setting to boundary analysis #89
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
Conversation
Actually, let me see if there's a way to do this per-cluster |
3053aa4
to
83d62cc
Compare
I've got an implementation that seems to work for Parley, but I suspect may still be incorrect. The API is not very elegant--the iterator returned by I'm not sure what the extra entries in the pair table are for, but they seem to carry some extra state. For implementing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon looking more closely at the Parley PR I think it might make sense to consolidate the definitions of WordBreakStrength
since they are otherwise the same.
83d62cc
to
1c0431d
Compare
I've updated the definition of |
Requires upstream support in Swash (dfrg/swash#89). This implements the CSS `word-break` and `overflow-wrap` style properties (including the latter's influence on the layout's min-content size). This replaces the "emergency break" logic with something that should be simpler. Different browsers seem to disagree on exactly which ranges of text the properties apply to. The behavior implemented here should be reasonable. In the table below, red is the default wrapping settings, blue is `overflow-wrap: anywhere`, and green is `word-break: break-all`: | Gecko | Blink | WebKit | Parley | | - | - | - | - |  |  |  |   |  |  |   |  |  |  |  |  |   |  |  |   |  |  |  \*  |  |  |  \* *This doesn't match browsers, but the behavior is officially unspecified per w3c/csswg-drafts#3897
This is necessary for implementing linebender/parley#303.
In the long term, Parley should move to some other Unicode analysis crate, but this should do for now.