Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/gen/width_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down