diff options
Diffstat (limited to 'wgpu/src/layer/text.rs')
-rw-r--r-- | wgpu/src/layer/text.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/wgpu/src/layer/text.rs b/wgpu/src/layer/text.rs new file mode 100644 index 00000000..ba1bdca8 --- /dev/null +++ b/wgpu/src/layer/text.rs @@ -0,0 +1,34 @@ +use crate::core::alignment; +use crate::core::text; +use crate::core::{Color, 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: Color, + + /// The size of the [`Text`] in logical pixels. + pub size: f32, + + /// The line height of the [`Text`]. + pub line_height: text::LineHeight, + + /// 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, + + /// The shaping strategy of the text. + pub shaping: text::Shaping, +} |