Skip to content

Treat emoji presentation sequences as fullwidth - #35

Closed
Jules-Bertholet wants to merge 13 commits into
unicode-rs:masterfrom
Jules-Bertholet:emoji-presentation
Closed

Jules-Bertholet wants to merge 13 commits into
unicode-rs:masterfrom
Jules-Bertholet:emoji-presentation

Conversation

@Jules-Bertholet

@Jules-Bertholet Jules-Bertholet commented Feb 10, 2024 •

Copy link
Copy Markdown
Contributor

UAX11 says:

[UTS51] emoji presentation sequences behave as though they were East Asian Wide, regardless of their assigned East_Asian_Width property value.

Lookup is done with a 2-level trie.

@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

In terms of UTS 51 conformance, with this PR, this crate will give the correct widths for:

However, it may overestimate (though never underestimate) the rendered widths of:

@Jules-Bertholet

Jules-Bertholet commented Feb 14, 2024 •

Copy link
Copy Markdown
Contributor Author

I've replaced the binary search with a better datastructure, and also added a section in the rustdoc documenting the full width rules.

Comment thread scripts/unicode.py Resolved
Comment thread src/tables.rs Resolved
Comment thread scripts/unicode.py Resolved
@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

The not-yet-released Unicode 16 adds 8 new non-emoji standardized variation sequences that affect width: https://unicode.org/alloc/Pipeline.html#variation_sequences, https://www.unicode.org/L2/L2023/23212r-quotes-svs-proposal.pdf. In time, we'll need to support those as well.

@Jules-Bertholet Jules-Bertholet mentioned this pull request Apr 23, 2024
@Jules-Bertholet

Copy link
Copy Markdown
Contributor Author

This PR is bloated, I'm splitting it up.

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