unicode library Ultraviolet

Unicode grapheme iteration and terminal display-width utilities.

Enums

WidthMethod
Specifies the method used to calculate character display width.

Extensions

WidthMethodX on WidthMethod
Extension on WidthMethod providing string width calculation.

Properties

emojiPresentationWidth ↔ int
Runtime configuration for width calculations that depend on terminal behavior.
getter/setter pair

Functions

codePoints(String s) → List<int>
Decodes a Dart String (UTF-16) into Unicode scalar values (code points).
firstCodePoint(String s) → int
graphemes(String s) → Iterable<String>
Returns a lazy grapheme-cluster iterable.
isSingleCodePoint(String s) → bool
maxLineWidth(String s) → int
Returns the maximum display width across all lines in s.
readGraphemeAt(String s, int index) → ({String grapheme, int nextIndex})
Reads the grapheme cluster starting at index and returns it along with the next UTF-16 code-unit index.
runeWidth(int rune) → int
Returns the display width of a single Unicode code point.
setEmojiPresentationWidth(int width) → void
Sets the display width used for emoji presentation characters.
stringWidth(String s) → int
Returns the terminal display width of s, counting per grapheme cluster.