-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Thanks for creating this great library! I'm currently creating a terminal UI library that uses libunicode for grapheme iteration and width measurement. Currently, to determine the width of a grapheme, I'm using unicode::width(view[0]), where view is the std::u32string_view returned by unicode::grapheme_segmenter::operator*(). This works in most cases, but I noticed it fails for strings containing "☝️" (U+261D U+FE0F) because U+261D by itself (☝) has a width of 1, but when followed by the variation selector U+FE0F, it should have a width of 2.
I'd like a way to determine the width of an entire multi-codepoint grapheme (and perhaps even an entire multi-grapheme string). Perhaps an overload of unicode::width that takes a std::u32string_view argument.