@@ -25,25 +25,26 @@ fn main() {
25
25
```
26
26
27
27
** NOTE:** The computed width values may not match the actual rendered column
28
- width. For example, the woman scientist emoji comprises of a woman emoji, a
29
- zero-width joiner and a microscope emoji. Such [ emoji ZWJ sequences ] ( https://www.unicode.org/reports/tr51/#Emoji_ZWJ_Sequences )
30
- are considered to have the sum of the widths of their constituent parts :
28
+ width. For example, many Brahmic scripts like Devanagari have complex rendering rules
29
+ which this crate does not currently handle (and will never fully handle, because
30
+ the exact rendering depends on the font) :
31
31
32
32
``` rust
33
33
extern crate unicode_width;
34
34
use unicode_width :: UnicodeWidthStr ;
35
35
36
36
fn main () {
37
- assert_eq! (" 👩 " . width (), 2 ); // Woman
38
- assert_eq! (" 🔬 " . width (), 2 ); // Microscope
39
- assert_eq! (" 👩🔬 " . width (), 4 ); // Woman scientist
37
+ assert_eq! (" क " . width (), 1 ); // Devanagari letter Ka
38
+ assert_eq! (" ष " . width (), 1 ); // Devanagari letter Ssa
39
+ assert_eq! (" क्ष " . width (), 2 ); // Ka + Virama + Ssa
40
40
}
41
41
```
42
42
43
43
Additionally, [ defective combining character sequences] ( https://unicode.org/glossary/#defective_combining_character_sequence )
44
44
and nonstandard [ Korean jamo] ( https://unicode.org/glossary/#jamo ) sequences may
45
45
be rendered with a different width than what this crate says. (This is not an
46
- exhaustive list.)
46
+ exhaustive list.) For a list of what this crate * does* handle, see
47
+ [ docs.rs] ( https://docs.rs/unicode-width/latest/unicode_width/#rules-for-determining-width ) .
47
48
48
49
## crates.io
49
50
0 commit comments