use super::super::JoiningType;
use super::UserData;
use crate::GlyphId;
#[derive(Copy, Clone, Debug)]
pub struct Char {
pub ch: char,
pub offset: u32,
pub shape_class: ShapeClass,
pub joining_type: JoiningType,
pub ignorable: bool,
pub contributes_to_shaping: bool,
pub glyph_id: GlyphId,
pub data: UserData,
}
impl Default for Char {
fn default() -> Self {
Self {
ch: '\0',
shape_class: ShapeClass::Base,
joining_type: JoiningType::U,
ignorable: false,
contributes_to_shaping: true,
glyph_id: 0,
data: 0,
offset: 0,
}
}
}
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq, Debug)]
#[repr(u8)]
pub enum ShapeClass {
Reph,
Pref,
Kinzi,
Base,
Mark,
Halant,
MedialRa,
VMPre,
VPre,
VBlw,
Anusvara,
Zwj,
Zwnj,
Control,
Vs,
Other,
}
impl Default for ShapeClass {
fn default() -> Self {
Self::Base
}
}