implement font and text direction; call std and mock directly instead of importing
This commit is contained in:
27
src/text.rs
Normal file
27
src/text.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum Font {
|
||||
AsciiSmall, // default - does not appear in game data
|
||||
UnicodeEuropeanSmall,
|
||||
UnicodeEuropeanLarge,
|
||||
UnicodeAsian,
|
||||
Arabic,
|
||||
Custom,
|
||||
}
|
||||
|
||||
impl Font {
|
||||
pub(crate) fn from(str: &str) -> Font {
|
||||
match str {
|
||||
"unicode_european_small" => Font::UnicodeEuropeanSmall,
|
||||
"unicode_european_large" => Font::UnicodeEuropeanLarge,
|
||||
"unicode_asian" => Font::UnicodeAsian,
|
||||
"arabic" => Font::Arabic,
|
||||
_ => Font::Custom,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum TextDirection {
|
||||
LeftToRight, // default
|
||||
RightToLeft,
|
||||
}
|
||||
Reference in New Issue
Block a user