#[derive(Debug, Clone, Copy, Default)]
pub enum FontWeight {
Thin,
ExtraLight,
Light,
#[default]
Normal,
Medium,
SemiBold,
Bold,
ExtraBold,
Black,
Value(u16),
}
impl From<FontWeight> for cosmic_text::Weight {
fn from(value: FontWeight) -> Self {
match value {
FontWeight::Thin => cosmic_text::Weight::THIN,
FontWeight::ExtraLight => cosmic_text::Weight::EXTRA_LIGHT,
FontWeight::Light => cosmic_text::Weight::LIGHT,
FontWeight::Normal => cosmic_text::Weight::NORMAL,
FontWeight::Medium => cosmic_text::Weight::MEDIUM,
FontWeight::SemiBold => cosmic_text::Weight::SEMIBOLD,
FontWeight::Bold => cosmic_text::Weight::BOLD,
FontWeight::ExtraBold => cosmic_text::Weight::EXTRA_BOLD,
FontWeight::Black => cosmic_text::Weight::BLACK,
FontWeight::Value(value) => cosmic_text::Weight(value),
}
}
}