From 2b92b9b792a31ac0649d068cc2f3f787a6b52a30 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 27 Mar 2025 09:38:57 -0500 Subject: [PATCH] adding text_svg to build text out of svgs --- src/ui/mod.rs | 1 + src/ui/song_editor.rs | 2 +- src/ui/text_svg.rs | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/ui/text_svg.rs diff --git a/src/ui/mod.rs b/src/ui/mod.rs index e14da85..259e2c1 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -4,6 +4,7 @@ pub mod double_ended_slider; pub mod library; pub mod presenter; pub mod song_editor; +pub mod text_svg; pub mod video; pub enum EditorMode { diff --git a/src/ui/song_editor.rs b/src/ui/song_editor.rs index 47aaed7..ddb0677 100644 --- a/src/ui/song_editor.rs +++ b/src/ui/song_editor.rs @@ -308,7 +308,7 @@ impl SongEditor { let svg = Handle::from_memory(r#" - + diff --git a/src/ui/text_svg.rs b/src/ui/text_svg.rs new file mode 100644 index 0000000..74bc260 --- /dev/null +++ b/src/ui/text_svg.rs @@ -0,0 +1,26 @@ +use cosmic::iced::Font; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct TextSvg { + text: String, + font: Font, + shadow: Shadow, + stroke: Color, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Color {} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Shadow { + offset_x: i16, + offset_y: i16, + spread: u16, + color: Color, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Stroke { + size: u16, + color: Color, +}