pub struct Text<'a> {
pub text: Cow<'a, str>,
pub font: Font,
pub size: f32,
pub wrap: TextWrap,
pub color: Color,
}
Expand description
A styled paragraph of text
Fields§
§text: Cow<'a, str>
The text
font: Font
Font to render the text with
size: f32
Font size to render the text with
wrap: TextWrap
Wrapping style to use
color: Color
Color to render the text with
Implementations§
Source§impl<'t> Text<'t>
impl<'t> Text<'t>
Sourcepub fn measure(&self, rect: Option<Rectangle>) -> Rectangle
pub fn measure(&self, rect: Option<Rectangle>) -> Rectangle
Measure the size of the text. If a rectangle is supplied and the text wraps, the layout will stay within the width of the given rectangle.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Text<'a>
impl<'a> RefUnwindSafe for Text<'a>
impl<'a> Send for Text<'a>
impl<'a> Sync for Text<'a>
impl<'a> Unpin for Text<'a>
impl<'a> UnwindSafe for Text<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more