Expand description
§ezemoji
ezemoji is a lightweight Rust library for working with Unicode character groups, including letters, numbers, symbols, and emojis.
It is always no_std and stores all data as &'static [u32], making it suitable for embedded and minimal runtime environments.
§Usage
You can use the predefined character groups, or define your own custom groups.
§Using predefined groups
#[cfg(feature = "std")]
use ezemoji::{CharGroup, GroupKind};
// Iterate over lowercase alphabet characters
let alpha_group = CharGroup::ALPHALOW;
for cp in alpha_group.iter() {
// Print the Unicode code point
println!("{}", cp);
}
// Access a numeric group and check display width
let num_group = CharGroup::NUM;
assert_eq!(num_group.width(), 1); // ASCII numbers are single-width§Defining your own custom group
use ezemoji::{CharGroup, GroupKind, CharWidth, MultiRange};
// Create a new custom group of just crab emojis
let crab_group = CharGroup::new(GroupKind::Custom("crab"), MultiRange::new(&[0x1F980..0x1F981]), CharWidth::Double);
assert_eq!(crab_group.width(), 2); // This emoji is double-widthStructs§
- Char
Group - A named group of Unicode characters.
- Multi
Range - Multi
Range Iterator
Enums§
Constants§
- ALPHALOW_
RANGE - ALPHANUM_
RANGE - ALPHAUP_
RANGE - ARROW_
0_ RANGE - ARROW_
1_ RANGE - ARROW_
2_ RANGE - BIN_
RANGE - BRAILLE_
RANGE - CARD_
0_ RANGE - CARD_
1_ RANGE - CARD_
2_ RANGE - CARD_
3_ RANGE - CLOCK_
RANGE - CRAB_
RANGE - DOMINOSH_
RANGE - DOMINOSV_
RANGE - EARTH_
RANGE - EMOJIS_
0_ RANGE - EMOJIS_
1_ RANGE - EMOJIS_
2_ RANGE - JAP_
RANGE - LARGELETTERS_
RANGE - LETTEREDCUBES_
RANGE - MOON_
RANGE - NUMBEREDBALLS_
RANGE - NUM_
RANGE - PLANTS_
RANGE - SHAPES_
RANGE - SMILE_
RANGE