Skip to content
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

Move LB8a and LB9 out of the table #5001

Merged
merged 10 commits into from
Jun 6, 2024

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Jun 4, 2024

Hopefully no functional change.

Last time I attempted to look at Unicode 15.1 line breaking, that was made impractical by the need, for every new state X, to add an X_ZWJ state, transitions X CM → X, X ZWJ → X_ZWJ, X_ZWJ CM → X, as well as X_ZWJ Y → Z for every transition X Y → Z, and to add or update rules to prevent breaks after X_ZWJ.

Hopefully this will make that upgrade a little more tractable. (Incidentally it makes the state table a bit smaller.)

Tested with 200 000 monkeys (recall that only 200 are checked in).

Related to #3255; see my comment there for the rationale.

Aside: While looking at this, it came to my attention that the LineBreakStrictness::Anywhere option does not do what the standard says, cf. https://drafts.csswg.org/css-text-3/#valdef-line-break-anywhere and https://drafts.csswg.org/css-text-3/#typographic-character-unit referenced therein. Of course, we do have a correct implementation of line-break: anywhere, since we have a grapheme cluster segmenter.

@eggrobin eggrobin marked this pull request as ready for review June 5, 2024 12:29
@Manishearth Manishearth removed their request for review June 5, 2024 20:13
Copy link
Member

@robertbastian robertbastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't tell for sure that this is correct, but if the tests pass I'm very happy that it removes 1k lines from the state table file, and 6k bytes from the data.

@eggrobin eggrobin merged commit d62ee27 into unicode-org:main Jun 6, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants