Struct nannou::text::Text [−][src]
pub struct Text<'a> { /* fields omitted */ }
Expand description
An instance of some multi-line text and its layout.
Implementations
Produce an iterator yielding information about each line.
The rectangle used to layout and build the text instance.
This is the same Rect
that was passed to the text::Builder::build
method.
The rectangle that describes the min and max bounds along each axis reached by the text.
The rectangle that describes the min and max bounds along each axis reached by the text.
This is similar to bounding_rect
but assumes that all lines have a height equal to
font_size
, rather than using the exact height.
The exact height of the full text accounting for font size and line spacing..
Determine the total height of a block of text with the given number of lines, font size and
line_spacing
(the space that separates each line of text).
The height of all lines of text are assumed to match the font_size
. If looking for the exact
height, see the exact_height
function.
Produce an iterator yielding each wrapped line within the Text.
pub fn line_rects(&self) -> TextLineRects<'_>ⓘNotable traits for TextLineRects<'a>
impl<'a> Iterator for TextLineRects<'a> type Item = Rect;
pub fn line_rects(&self) -> TextLineRects<'_>ⓘNotable traits for TextLineRects<'a>
impl<'a> Iterator for TextLineRects<'a> type Item = Rect;
The bounding rectangle for each line.
Produce an iterator yielding all lines of text alongside their bounding rects.
Produce an iterator yielding iterators yielding every glyph alongside its bounding rect for each line.
Produce an iterator yielding every glyph alongside its bounding rect.
This is the “flattened” version of the glyphs_per_line
method.
Produce an iterator yielding the path events for every glyph in every line.
Produce an iterator yielding positioned rusttype glyphs ready for caching.
The window dimensions (in logical space) and scale_factor are required to transform glyph positions into rusttype’s pixel-space, ready for caching into the rusttype glyph cache pixel buffer.
Converts this Text
instance into an instance that owns the inner text string.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Text<'a>
impl<'a> UnwindSafe for Text<'a>
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined range,
otherwise an OutOfBounds
error is returned which contains the unclamped color. Read more
pub fn vzip(self) -> V