summaryrefslogtreecommitdiffstats
path: root/graphics/src/geometry/text.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
commit633f405f3f78bc7f82d2b2061491b0e011137451 (patch)
tree5ebfc1f45d216a5c14a90492563599e6969eab4d /graphics/src/geometry/text.rs
parent41836dd80d0534608e7aedfbf2319c540a23de1a (diff)
parent21bd51426d900e271206f314e0c915dd41065521 (diff)
downloadiced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.gz
iced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.bz2
iced-633f405f3f78bc7f82d2b2061491b0e011137451.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # Cargo.toml # core/src/window/icon.rs # core/src/window/id.rs # core/src/window/position.rs # core/src/window/settings.rs # examples/integration/src/main.rs # examples/integration_opengl/src/main.rs # glutin/src/application.rs # native/src/subscription.rs # native/src/window.rs # runtime/src/window/action.rs # src/lib.rs # src/window.rs # winit/Cargo.toml # winit/src/application.rs # winit/src/icon.rs # winit/src/settings.rs # winit/src/window.rs
Diffstat (limited to '')
-rw-r--r--graphics/src/geometry/text.rs (renamed from graphics/src/widget/canvas/text.rs)13
1 files changed, 10 insertions, 3 deletions
diff --git a/graphics/src/widget/canvas/text.rs b/graphics/src/geometry/text.rs
index 056f8204..c584f3cd 100644
--- a/graphics/src/widget/canvas/text.rs
+++ b/graphics/src/geometry/text.rs
@@ -1,5 +1,6 @@
-use crate::alignment;
-use crate::{Color, Font, Point};
+use crate::core::alignment;
+use crate::core::text::{LineHeight, Shaping};
+use crate::core::{Color, Font, Point};
/// A bunch of text that can be drawn to a canvas
#[derive(Debug, Clone)]
@@ -19,12 +20,16 @@ pub struct Text {
pub color: Color,
/// The size of the text
pub size: f32,
+ /// The line height of the text.
+ pub line_height: 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: Shaping,
}
impl Default for Text {
@@ -34,9 +39,11 @@ impl Default for Text {
position: Point::ORIGIN,
color: Color::BLACK,
size: 16.0,
- font: Font::Default,
+ line_height: LineHeight::Relative(1.2),
+ font: Font::default(),
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Top,
+ shaping: Shaping::Basic,
}
}
}