Struct speedy2d::font::TextOptions [−][src]
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]
self,
wrap_words_after_width_px: f32,
alignment: TextAlignment
) -> Self
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
impl RefUnwindSafe for TextOptions
impl Send for TextOptions
impl Sync for TextOptions
impl Unpin for TextOptions
impl UnwindSafe for TextOptions
Blanket Implementations
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,
pub fn borrow_mut(&mut self) -> &mut T
[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, 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.
pub 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>,