Struct fontdue::layout::LayoutSettings [−][src]
pub struct LayoutSettings { pub x: f32, pub y: f32, pub max_width: Option<f32>, pub max_height: Option<f32>, pub horizontal_align: HorizontalAlign, pub vertical_align: VerticalAlign, pub wrap_style: WrapStyle, pub wrap_hard_breaks: bool, }
Expand description
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
Expand description
The leftmost boundary of the text region.
y: f32
Expand description
The topmost boundary of the text region.
max_width: Option<f32>
Expand description
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>
Expand description
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
Expand description
The default is Left. This option does nothing if the max_width isn’t set.
vertical_align: VerticalAlign
Expand description
The default is Top. This option does nothing if the max_height isn’t set.
wrap_style: WrapStyle
Expand description
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
Expand description
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.
Trait Implementations
impl Clone for LayoutSettings
[src]
impl Clone for LayoutSettings
[src]fn clone(&self) -> LayoutSettings
[src]
fn clone(&self) -> LayoutSettings
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Default for LayoutSettings
[src]
impl Default for LayoutSettings
[src]fn default() -> LayoutSettings
[src]
fn default() -> LayoutSettings
[src]Returns the “default value” for a type. Read more
impl PartialEq<LayoutSettings> for LayoutSettings
[src]
impl PartialEq<LayoutSettings> for LayoutSettings
[src]fn eq(&self, other: &LayoutSettings) -> bool
[src]
fn eq(&self, other: &LayoutSettings) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &LayoutSettings) -> bool
[src]
fn ne(&self, other: &LayoutSettings) -> bool
[src]This method tests for !=
.
impl Copy for LayoutSettings
[src]
impl StructuralPartialEq for LayoutSettings
[src]
Auto Trait Implementations
impl RefUnwindSafe for LayoutSettings
impl Send for LayoutSettings
impl Sync for LayoutSettings
impl Unpin for LayoutSettings
impl UnwindSafe for LayoutSettings
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more