summaryrefslogtreecommitdiffstats
path: root/graphics/src/layer/text.rs
diff options
context:
space:
mode:
authorLibravatar shan <shankern@protonmail.com>2022-10-05 10:49:58 -0700
committerLibravatar shan <shankern@protonmail.com>2022-10-05 10:49:58 -0700
commit30432cbade3d9b25c4df62656a7494db3f4ea82a (patch)
tree186ca59e50caede84ede2e2381dc01dd0483806b /graphics/src/layer/text.rs
parent6e7b3ced0b1daf368e44e181ecdb4ae529877eb6 (diff)
downloadiced-30432cbade3d9b25c4df62656a7494db3f4ea82a.tar.gz
iced-30432cbade3d9b25c4df62656a7494db3f4ea82a.tar.bz2
iced-30432cbade3d9b25c4df62656a7494db3f4ea82a.zip
Readjusted namespaces, removed Geometry example as it's no longer relevant.
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..b6dd4b7f
--- /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,
+} \ No newline at end of file