[][src]Struct nannou::text::layout::Builder

pub struct Builder {
    pub line_spacing: Option<Scalar>,
    pub line_wrap: Option<Option<Wrap>>,
    pub font_size: Option<FontSize>,
    pub justify: Option<Justify>,
    pub font: Option<Option<Font>>,
    pub y_align: Option<Align>,
}

A context for building a text layout.

Fields

line_spacing: Option<Scalar>line_wrap: Option<Option<Wrap>>font_size: Option<FontSize>justify: Option<Justify>font: Option<Option<Font>>y_align: Option<Align>

Methods

impl Builder[src]

pub fn font_size(self, size: FontSize) -> Self[src]

The font size to use for the text.

pub fn line_wrap(self, line_wrap: Option<Wrap>) -> Self[src]

Specify whether or not text should be wrapped around some width and how to do so.

The default value is DEFAULT_LINE_WRAP.

pub fn no_line_wrap(self) -> Self[src]

Specify that the Text should not wrap lines around the width.

Shorthand for builder.line_wrap(None).

pub fn wrap_by_word(self) -> Self[src]

Line wrap the Text at the beginning of the first word that exceeds the width.

Shorthand for builder.line_wrap(Some(Wrap::Whitespace)).

pub fn wrap_by_character(self) -> Self[src]

Line wrap the Text at the beginning of the first character that exceeds the width.

Shorthand for builder.line_wrap(Some(Wrap::Character)).

pub fn font(self, font: Font) -> Self[src]

A method for specifying the Font used for displaying the Text.

pub fn justify(self, justify: Justify) -> Self[src]

Describe the end along the x axis to which the text should be aligned.

pub fn left_justify(self) -> Self[src]

Align the text to the left of its bounding Rect's x axis range.

pub fn center_justify(self) -> Self[src]

Align the text to the middle of its bounding Rect's x axis range.

pub fn right_justify(self) -> Self[src]

Align the text to the right of its bounding Rect's x axis range.

pub fn line_spacing(self, spacing: Scalar) -> Self[src]

Specify how much vertical space should separate each line of text.

pub fn y_align(self, align: Align) -> Self[src]

Specify how the whole text should be aligned along the y axis of its bounding rectangle

pub fn align_top(self) -> Self[src]

Align the top edge of the text with the top edge of its bounding rectangle.

pub fn align_middle_y(self) -> Self[src]

Align the middle of the text with the middle of the bounding rect along the y axis..

This is the default behaviour.

pub fn align_bottom(self) -> Self[src]

Align the bottom edge of the text with the bottom edge of its bounding rectangle.

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

Set all the parameters via an existing Layout

pub fn build(self) -> Layout[src]

Build the text layout.

Trait Implementations

impl Clone for Builder[src]

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

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>,