font errors
This commit is contained in:
parent
1bbfaceeb4
commit
66cb9bdd4d
|
@ -27,6 +27,7 @@ pub enum Error {
|
|||
Dialogue,
|
||||
Ending,
|
||||
Exit,
|
||||
Font,
|
||||
Game {
|
||||
missing: NotFound,
|
||||
},
|
||||
|
|
14
src/text.rs
14
src/text.rs
|
@ -13,19 +13,19 @@ impl Font {
|
|||
match str {
|
||||
"unicode_european_small" => Font::UnicodeEuropeanSmall,
|
||||
"unicode_european_large" => Font::UnicodeEuropeanLarge,
|
||||
"unicode_asian" => Font::UnicodeAsian,
|
||||
"arabic" => Font::Arabic,
|
||||
_ => Font::Custom,
|
||||
"unicode_asian" => Font::UnicodeAsian,
|
||||
"arabic" => Font::Arabic,
|
||||
_ => Font::Custom,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn to_string(&self) -> Result<String, &'static str> {
|
||||
pub(crate) fn to_string(&self) -> Result<String, crate::Error> {
|
||||
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"),
|
||||
Font::UnicodeAsian => Ok("unicode_asian".to_string()),
|
||||
Font::Arabic => Ok("arabic".to_string()),
|
||||
_ => Err(crate::Error::Font),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue