Skip to content

Variation Selector-16 Support #27

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

Closed
jquast opened this issue Dec 17, 2023 · 3 comments
Closed

Variation Selector-16 Support #27

jquast opened this issue Dec 17, 2023 · 3 comments

Comments

@jquast
Copy link

jquast commented Dec 17, 2023

Hello,

There is a set of Emoji characters that are displayed Narrow, such as U+23F1 (Stopwatch) which unicode-display_width correctly measures as 1.

But, when joined in sequence with U+FE0F (Variation Selector-16), they become wide. This is a bit rare, as currently it is true for only 7 of ~24 popular terminals. It took me years to fully understand what the heck was going on...

You might be interested in the Specification that I have written for the python wcwidth library, the ucs-detect used to asses terminal compliance, and the test results of more than 20 popular terminals.

I have written about all of those things in this article https://www.jeffquast.com/post/ucs-detect-test-results/

@jquast
Copy link
Author

jquast commented Dec 17, 2023

require 'unicode/display_width'

display_width = Unicode::DisplayWidth.new(emoji: true)

puts display_width.of "\u23F1" # => 1
puts display_width.of "\u23F1\uFE0F" # => 1 .. should be 2

outputs

1
1

janlelis added a commit that referenced this issue Nov 12, 2024
- Enable by default
- Only reduce Emoji string width for RGI Emoji (configurable)
- VS16 turns Emoji characters of width 1 into full-width #27
- Add option to make Text Presentation Emoji full-width
@janlelis
Copy link
Owner

Hello Jeff, thanks for bringing this up. I've just released v3.0.0 which includes support for Emoji-VS16 strings to be of width 2.

I haven't added support for VS15 yet, because I am still unsure if it will be adopted, what do you think?

While investigating Emoji handling in terminals, I decided to revamp Emoji handling completely. My main learning was, that the need to display Emoji sequences as separate single Emoji won't go away. More details here.

@jquast
Copy link
Author

jquast commented Nov 13, 2024

I also have not implemented VS-15, my testing with my https://ucs-detect.readthedocs.io/ project has brought up wildly different results, I can't find any good common result! Still considering what I should do!

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

No branches or pull requests

2 participants