summaryrefslogtreecommitdiffstats
path: root/wgpu/src/widget/canvas/text.rs
diff options
context:
space:
mode:
authorLibravatar Artur Sapek <me@artur.co>2020-03-05 22:05:05 -0700
committerLibravatar Artur Sapek <artur@lich.io>2020-03-06 22:01:21 -0700
commit1bb85556915bb00057ef2ee66a596592c292b15b (patch)
tree4a624fb4bc225ecb72b434176da69096411efda7 /wgpu/src/widget/canvas/text.rs
parent29219500b7144f31dbf50fcc64653f7d2ce806d0 (diff)
downloadiced-1bb85556915bb00057ef2ee66a596592c292b15b.tar.gz
iced-1bb85556915bb00057ef2ee66a596592c292b15b.tar.bz2
iced-1bb85556915bb00057ef2ee66a596592c292b15b.zip
implement text support in canvas widget
Diffstat (limited to 'wgpu/src/widget/canvas/text.rs')
-rw-r--r--wgpu/src/widget/canvas/text.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/wgpu/src/widget/canvas/text.rs b/wgpu/src/widget/canvas/text.rs
new file mode 100644
index 00000000..5f6abe58
--- /dev/null
+++ b/wgpu/src/widget/canvas/text.rs
@@ -0,0 +1,20 @@
+use iced_native::{Color, Font, HorizontalAlignment, Rectangle, VerticalAlignment};
+
+/// A text node to be drawn to a canvas
+#[derive(Debug, Clone)]
+pub struct TextNode {
+ /// The contents of the text
+ pub content: String,
+ /// The bounds of the text
+ pub bounds: Rectangle,
+ /// The color of the text
+ pub color: Color,
+ /// 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: HorizontalAlignment,
+ /// The vertical alignment of the text
+ pub vertical_alignment: VerticalAlignment,
+}