[][src]Struct nannou::text::Text

pub struct Text<'a> { /* fields omitted */ }

An instance of some multi-line text and its layout.

Methods

impl<'a> Text<'a>[src]

pub fn line_infos(&self) -> &[Info][src]

Produce an iterator yielding information about each line.

pub fn text(&self) -> &str[src]

The full string of text as a slice.

pub fn layout(&self) -> &Layout[src]

The layout parameters for this text instance.

pub fn font(&self) -> &Font[src]

The font used for this text instance.

pub fn num_lines(&self) -> usize[src]

The number of lines in the text.

pub fn layout_rect(&self) -> Rect[src]

The rectangle used to layout and build the text instance.

This is the same Rect that was passed to the text::Builder::build method.

pub fn bounding_rect(&self) -> Rect[src]

The rectangle that describes the min and max bounds along each axis reached by the text.

pub fn bounding_rect_by_lines(&self) -> Rect[src]

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.

pub fn width(&self) -> Scalar[src]

The width of the widest line of text.

pub fn height(&self) -> Scalar[src]

The exact height of the full text accounting for font size and line spacing..

pub fn height_by_lines(&self) -> Scalar[src]

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.

pub fn lines(&self) -> TextLines[src]

Produce an iterator yielding each wrapped line within the Text.

pub fn line_rects(&self) -> TextLineRects[src]

The bounding rectangle for each line.

pub fn lines_with_rects(&self) -> TextLinesWithRects[src]

Produce an iterator yielding all lines of text alongside their bounding rects.

pub fn glyphs_per_line(&self) -> TextGlyphsPerLine[src]

Produce an iterator yielding iterators yielding every glyph alongside its bounding rect for each line.

pub fn glyphs(&self) -> TextGlyphs[src]

Produce an iterator yielding every glyph alongside its bounding rect.

This is the "flattened" version of the glyphs_per_line method.

pub fn path_events<'b>(&'b self) -> impl 'b + Iterator<Item = PathEvent>[src]

Produce an iterator yielding the path events for every glyph in every line.

pub fn rt_glyphs<'b: 'a>(
    &'b self,
    window_size: Vector2,
    scale_factor: Scalar
) -> impl 'a + 'b + Iterator<Item = PositionedGlyph>
[src]

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.

pub fn into_owned(self) -> Text<'static>[src]

Converts this Text instance into an instance that owns the inner text string.

Trait Implementations

impl<'a> Clone for Text<'a>[src]

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<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,