[−][src]Struct nannou::text::layout::Builder
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
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]
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>,