adding text_svg to build text out of svgs
This commit is contained in:
parent
89ec3145d1
commit
2b92b9b792
|
@ -4,6 +4,7 @@ pub mod double_ended_slider;
|
||||||
pub mod library;
|
pub mod library;
|
||||||
pub mod presenter;
|
pub mod presenter;
|
||||||
pub mod song_editor;
|
pub mod song_editor;
|
||||||
|
pub mod text_svg;
|
||||||
pub mod video;
|
pub mod video;
|
||||||
|
|
||||||
pub enum EditorMode {
|
pub enum EditorMode {
|
||||||
|
|
|
@ -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">
|
let svg = Handle::from_memory(r#"<svg viewBox="0 0 240 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
<defs>
|
<defs>
|
||||||
<filter id="shadow2">
|
<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>
|
</filter>
|
||||||
</defs>
|
</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);">
|
<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
26
src/ui/text_svg.rs
Normal 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,
|
||||||
|
}
|
Loading…
Reference in a new issue