[−][src]Struct fontdue::layout::LayoutSettings
Settings to configure how text layout is constrained. Text layout is considered best effort and layout may violate the constraints defined here if they prevent text from being laid out.
Fields
x: f32
The leftmost boundary of the text region.
y: f32
The topmost boundary of the text region.
max_width: Option<f32>
An optional rightmost boundary on the text region. A line of text that exceeds the max_width is wrapped to the line below. If the width of a glyph is larger than the max_width, the glyph will overflow past the max_width. The application is responsible for handling the overflow.
max_height: Option<f32>
An optional bottom boundary on the text region. This is used for positioning the vertical_align option. Text that exceeds the defined max_height will overflow past it. The application is responsible for handling the overflow.
horizontal_align: HorizontalAlign
The default is Left. This option does nothing if the max_width isn't set.
vertical_align: VerticalAlign
The default is Top. This option does nothing if the max_height isn't set.
wrap_style: WrapStyle
The default is Word. Wrap style is a hint for how strings of text should be wrapped to the next line. Line wrapping can happen when the max width/height is reached.
wrap_hard_breaks: bool
The default is true. This option enables hard breaks, like new line characters, to prematurely wrap lines. If false, hard breaks will not prematurely create a new line.
include_whitespace: bool
The default is false. This option sets whether or not to include whitespace in the layout output. By default, whitespace is not included in the output as it's not renderable. You may want this enabled if you care about the positioning of whitespace for an interactable user interface.
Trait Implementations
impl Clone for LayoutSettings
[src]
fn clone(&self) -> LayoutSettings
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for LayoutSettings
[src]
impl Default for LayoutSettings
[src]
fn default() -> LayoutSettings
[src]
impl PartialEq<LayoutSettings> for LayoutSettings
[src]
fn eq(&self, other: &LayoutSettings) -> bool
[src]
fn ne(&self, other: &LayoutSettings) -> bool
[src]
impl StructuralPartialEq for LayoutSettings
[src]
Auto Trait Implementations
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,
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> 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>,