adding text_svg to build text out of svgs

This commit is contained in:
Chris Cochrun 2025-03-27 09:38:57 -05:00
parent 89ec3145d1
commit 2b92b9b792
3 changed files with 28 additions and 1 deletions

View file

@ -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 {

View file

@ -308,7 +308,7 @@ impl SongEditor {
let svg = Handle::from_memory(r#"<svg viewBox="0 0 240 100" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="shadow2">
<feDropShadow dx="0" dy="0" stdDeviation="5.5" flood-color="cyan" />
<feDropShadow dx="0" dy="0" stdDeviation="0" flood-color="cyan" />
</filter>
</defs>
<text x="0" y="50" font-weight="bold" font-family="Quicksand" font-size="40" fill="white" stroke="black" stroke-width="2" style="filter:url(#shadow2);">

26
src/ui/text_svg.rs Normal file
View file

@ -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,
}