Closed imsnif closed 2 years ago
Please read the note in the README. Rendered width is font and engine dependent and is not computable from just the string.
My apologies - this was a lack of understanding on my part. So just to make sure I understand (if you feel like replying): handling the fe0f
character, which as I understand it is: https://emojipedia.org/variation-selector-16/, is something that's the responsibility of the font/rendering engine and not strictly a unicode-width thing?
Yes, we follow the Unicode spec here
fe0f
is also part of the spec, and as a newcomer to this discipline this distinction wasn't immediately clear to me. Which is why I appreciate your response.
Yes, I'm aware that variation selectors are part of the unicode spec, I'm saying that they're not handled the way you expect in the unicode width spec
https://github.com/unicode-rs/unicode-width/pull/41 added support for U+FE0F. (Emoji ZWJ sequences and skintone modifiers remain unsupported, however.)
Hey there - we've been using this library extensively for calculating widths and it's frankly been a godsend. Thank you for it.
I recently found an issue which has to do with the character: ❄️ I'm not sure how to better represent it so it won't get lost in formatting, so I'm going to try the output of this snippet:
However, when using unicode-width, it's calculated as 1:
I'm far from being an expert here, I just know that this offsets our UI in Zellij in some cases. I hope I'm not barking up the wrong tree?
Thanks!