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

Variation Selector-16 Support #27

Open
jquast opened this issue Dec 17, 2023 · 1 comment
Open

Variation Selector-16 Support #27

jquast opened this issue Dec 17, 2023 · 1 comment

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

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

1 participant