feature: font style and weight is configurable but not persistant
Some checks failed
/ test (push) Failing after 5m27s

This commit is contained in:
Chris Cochrun 2026-02-13 14:44:28 -06:00
parent 6327ed51b4
commit bf2fa842cd
3 changed files with 104 additions and 10 deletions

View file

@ -3,7 +3,11 @@ use std::{
};
use cosmic::{
cosmic_theme::palette::Srgb, iced::clipboard::mime::AsMimeTypes,
cosmic_theme::palette::Srgb,
iced::{
clipboard::mime::AsMimeTypes,
font::{Style, Weight},
},
};
use crisp::types::{Keyword, Symbol, Value};
use itertools::Itertools;
@ -44,6 +48,8 @@ pub struct Song {
pub text_alignment: Option<TextAlignment>,
pub font: Option<String>,
pub font_size: Option<i32>,
pub font_weight: Option<Weight>,
pub font_style: Option<Style>,
pub text_color: Option<Srgb>,
pub stroke_size: Option<u16>,
pub stroke_color: Option<Srgb>,
@ -295,6 +301,12 @@ impl ServiceTrait for Song {
.clone()
.unwrap_or_else(|| "Calibri".into()),
)
.style(
self.font_style.clone().unwrap_or_default(),
)
.weight(
self.font_weight.clone().unwrap_or_default(),
)
.size(self.font_size.unwrap_or(100) as u8);
let stroke_size =
self.stroke_size.unwrap_or_default();