[−][src]Struct pixel_widgets::text::Text
A styled paragraph of text
Fields
text: Cow<'a, str>The text
font: FontFont to render the text with
size: f32Font size to render the text with
wrap: TextWrapWrapping style to use
color: ColorColor to render the text with
Implementations
impl<'t> Text<'t>[src]
pub fn measure(&self, rect: Option<Rectangle>) -> Rectangle[src]
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.
pub fn measure_range(
&self,
from: usize,
to: usize,
rect: Rectangle
) -> ((f32, f32), (f32, f32))[src]
&self,
from: usize,
to: usize,
rect: Rectangle
) -> ((f32, f32), (f32, f32))
Measure the start and end coordinates of some selected glyphs
pub fn hitdetect(&self, cursor: (f32, f32), rect: Rectangle) -> usize[src]
Find out the index of a character where the mouse is.
impl<'a> Text<'a>[src]
Trait Implementations
Auto Trait Implementations
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
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,