pub enum LineBreakAlgorithm {
Greedy,
Optimal,
Fixed(u8),
}Expand description
Which algorithm to use when breaking caption text into lines.
Variants§
Greedy
Break at the last space before max_width.
Optimal
Dynamic-programming algorithm that minimises raggedness (Knuth-Plass
inspired): cost(line) = (max_width - used_width)^2.
Fixed(u8)
Every line is exactly u8 characters wide (hard wrap, no splitting of words).
Trait Implementations§
Source§impl Clone for LineBreakAlgorithm
impl Clone for LineBreakAlgorithm
Source§fn clone(&self) -> LineBreakAlgorithm
fn clone(&self) -> LineBreakAlgorithm
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LineBreakAlgorithm
impl Debug for LineBreakAlgorithm
Source§impl PartialEq for LineBreakAlgorithm
impl PartialEq for LineBreakAlgorithm
impl StructuralPartialEq for LineBreakAlgorithm
Auto Trait Implementations§
impl Freeze for LineBreakAlgorithm
impl RefUnwindSafe for LineBreakAlgorithm
impl Send for LineBreakAlgorithm
impl Sync for LineBreakAlgorithm
impl Unpin for LineBreakAlgorithm
impl UnsafeUnpin for LineBreakAlgorithm
impl UnwindSafe for LineBreakAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more