-
Notifications
You must be signed in to change notification settings - Fork 26
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
Comments
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
|
- 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
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. |
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! |
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/
The text was updated successfully, but these errors were encountered: