Add features for each script type

This commit is contained in:
2025-06-02 22:31:46 +08:00
parent abf30c8a55
commit 52811fe2eb
6 changed files with 107 additions and 0 deletions

View File

@@ -18,10 +18,16 @@ impl FixedFormatter {
}
}
#[cfg(feature = "circus")]
fn is_circus(&self) -> bool {
matches!(self.typ, Some(ScriptType::Circus))
}
#[cfg(not(feature = "circus"))]
fn is_circus(&self) -> bool {
false
}
pub fn format(&self, message: &str) -> String {
let mut result = String::new();
let vec: Vec<_> = UnicodeSegmentation::graphemes(message, true).collect();