[−][src]Struct nannou::text::Text
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]
&'b self,
window_size: Vector2,
scale_factor: Scalar
) -> impl 'a + 'b + Iterator<Item = PositionedGlyph>
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
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]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,