#[cfg(feature = "serde")]
use serde::Serialize;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
pub enum TextFontAlignmentValues {
Automatic,
Baseline,
Bottom,
Center,
Top,
}
impl TextFontAlignmentValues {
pub(crate) fn default() -> Self {
Self::Automatic
}
pub(crate) fn from_string(s: Option<String>) -> Self {
let Some(s) = s else {
return Self::default();
};
return match s.as_ref() {
"auto" => Self::Automatic,
"base" => Self::Baseline,
"b" => Self::Bottom,
"ctr" => Self::Center,
"t" => Self::Top,
_ => Self::default(),
};
}
}