Struct speedy2d::font::TextOptions[][src]

pub struct TextOptions { /* fields omitted */ }

A series of options for specifying how text should be laid out.

Implementations

impl TextOptions[src]

#[must_use]pub fn new() -> Self[src]

Instantiates a new TextOptions with the default settings.

#[must_use]pub fn with_tracking(self, tracking: f32) -> Self[src]

Sets the tracking of the font. This is the amount of extra space (in pixels) to put between each character.

The default is 0.0.

#[must_use]pub fn with_wrap_to_width(
    self,
    wrap_words_after_width_px: f32,
    alignment: TextAlignment
) -> Self
[src]

Limits the width of the text block to the specified pixel value, wrapping words to a new line if they exceed that limit.

This function also sets the alignment, within the specified width.

The default is to not wrap text.

#[must_use]pub fn with_line_spacing_multiplier(self, line_spacing_multiplier: f32) -> Self[src]

Sets the amount of space between each line of text. The gap between the baseline of each line of text is multiplied by this value.

The default is 1.0.

Trait Implementations

impl Default for TextOptions[src]

Auto Trait Implementations

Blanket Implementations

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> From<T> for T[src]

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

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.