export font and text direction to string
This commit is contained in:
10
src/text.rs
10
src/text.rs
@@ -18,6 +18,16 @@ impl Font {
|
||||
_ => Font::Custom,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_string(&self) -> Result<String, &'static str> {
|
||||
match &self {
|
||||
Font::UnicodeEuropeanSmall => Ok("unicode_european_small".to_string()),
|
||||
Font::UnicodeEuropeanLarge => Ok("unicode_european_large".to_string()),
|
||||
Font::UnicodeAsian => Ok("unicode_asian".to_string()),
|
||||
Font::Arabic => Ok("arabic".to_string()),
|
||||
_ => Err("No string available for this Font"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
|
||||
Reference in New Issue
Block a user