summaryrefslogtreecommitdiffstats
path: root/graphics/src/layer/text.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-11-03 18:57:09 +0100
committerLibravatar GitHub <noreply@github.com>2022-11-03 18:57:09 +0100
commitd222b5c8b0befab665c20ba0112b28199df0ae44 (patch)
tree0ac3a59f04e1c1ca89ff43800efbefd825b015ea /graphics/src/layer/text.rs
parenta8f510c39917b2ac42fcc854f0a7eff13aee9838 (diff)
parentf31c8f2504ea7c004c5caed8913e5da28d2e50e2 (diff)
downloadiced-d222b5c8b0befab665c20ba0112b28199df0ae44.tar.gz
iced-d222b5c8b0befab665c20ba0112b28199df0ae44.tar.bz2
iced-d222b5c8b0befab665c20ba0112b28199df0ae44.zip
Merge pull request #1448 from bungoboingo/fear/linear-gradients
Add linear gradient support to canvas widget
Diffstat (limited to 'graphics/src/layer/text.rs')
-rw-r--r--graphics/src/layer/text.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/graphics/src/layer/text.rs b/graphics/src/layer/text.rs
new file mode 100644
index 00000000..74f7a676
--- /dev/null
+++ b/graphics/src/layer/text.rs
@@ -0,0 +1,26 @@
+use crate::{alignment, Font, Rectangle};
+
+/// A paragraph of text.
+#[derive(Debug, Clone, Copy)]
+pub struct Text<'a> {
+ /// The content of the [`Text`].
+ pub content: &'a str,
+
+ /// The layout bounds of the [`Text`].
+ pub bounds: Rectangle,
+
+ /// The color of the [`Text`], in __linear RGB_.
+ pub color: [f32; 4],
+
+ /// The size of the [`Text`].
+ pub size: f32,
+
+ /// The font of the [`Text`].
+ pub font: Font,
+
+ /// The horizontal alignment of the [`Text`].
+ pub horizontal_alignment: alignment::Horizontal,
+
+ /// The vertical alignment of the [`Text`].
+ pub vertical_alignment: alignment::Vertical,
+}