diff --git a/scripts/unicode.py b/scripts/unicode.py index 9f757eb..ac8c257 100755 --- a/scripts/unicode.py +++ b/scripts/unicode.py @@ -307,9 +307,9 @@ class WidthState(enum.IntEnum): "(\\uE0061..=\\uE007A){6} \\uE007F \\u200D `Emoji_Presentation`" # Kirat Rai - KIRAT_RAI_VOWEL_SIGN_E = 0b0000_0000_0010_0000 + KIRAT_RAI_VOWEL_SIGN_E = 0b0011_1100_0010_0000 "\\u16D67 (\\u16D67 \\u16D67)+ and canonical equivalents" - KIRAT_RAI_VOWEL_SIGN_AI = 0b0000_0000_0010_0001 + KIRAT_RAI_VOWEL_SIGN_AI = 0b0011_1100_0010_0001 "(\\u16D68)+ and canonical equivalents" # VARIATION SELECTORS diff --git a/src/gen/width_info.rs b/src/gen/width_info.rs index fa750a3..d83514b 100644 --- a/src/gen/width_info.rs +++ b/src/gen/width_info.rs @@ -36,8 +36,8 @@ impl WidthInfo { pub(crate) const TAG_A4_END_ZWJ_EMOJI_PRESENTATION: Self = Self(0b0000000000011100); pub(crate) const TAG_A5_END_ZWJ_EMOJI_PRESENTATION: Self = Self(0b0000000000011101); pub(crate) const TAG_A6_END_ZWJ_EMOJI_PRESENTATION: Self = Self(0b0000000000011110); - pub(crate) const KIRAT_RAI_VOWEL_SIGN_E: Self = Self(0b0000000000100000); - pub(crate) const KIRAT_RAI_VOWEL_SIGN_AI: Self = Self(0b0000000000100001); + pub(crate) const KIRAT_RAI_VOWEL_SIGN_E: Self = Self(0b0011110000100000); + pub(crate) const KIRAT_RAI_VOWEL_SIGN_AI: Self = Self(0b0011110000100001); pub(crate) const VARIATION_SELECTOR_1_2_OR_3: Self = Self(0b0000001000000000); pub(crate) const VARIATION_SELECTOR_15: Self = Self(0b0100000000000000); pub(crate) const VARIATION_SELECTOR_16: Self = Self(0b1000000000000000); diff --git a/tests/tests.rs b/tests/tests.rs index 0f83c65..b55fddd 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -656,6 +656,20 @@ fn test_vs1_vs2_vs3() { } } +#[test] +fn test_kirat_rai() { + // Per the crate docs, inserting default-ignorable combining marks or ZWJ + // anywhere in a script ligature must not change its width. + assert_width!("\u{16D68}", 1, 1); + assert_width!("\u{16D63}\u{16D67}", 1, 1); + assert_width!("\u{16D63}\u{200D}\u{16D67}", 1, 1); + assert_width!("\u{16D63}\u{034F}\u{16D67}", 1, 1); + assert_width!("\u{16D63}\u{16D68}", 1, 1); + assert_width!("\u{16D63}\u{200D}\u{16D68}", 1, 1); + assert_width!("\u{16D69}\u{16D67}", 1, 1); + assert_width!("\u{16D69}\u{200D}\u{16D67}", 1, 1); +} + #[test] fn test_char_iter() { assert_eq!(char_iter_width(['a', 'b', '🔬'].into_iter()), 4)