[][src]Enum glyph_brush_layout::Layout

pub enum Layout<L: LineBreaker> {
    SingleLine {
        line_breaker: L,
        h_align: HorizontalAlign,
        v_align: VerticalAlign,
    },
    Wrap {
        line_breaker: L,
        h_align: HorizontalAlign,
        v_align: VerticalAlign,
    },
}

Built-in GlyphPositioner implementations.

Takes generic LineBreaker to indicate the wrapping style. See BuiltInLineBreaker.

Example

let layout = Layout::default().h_align(HorizontalAlign::Right);

Variants

SingleLine

Renders a single line from left-to-right according to the inner alignment. Hard breaking will end the line, partially hitting the width bound will end the line.

Fields of SingleLine

line_breaker: Lh_align: HorizontalAlignv_align: VerticalAlign
Wrap

Renders multiple lines from left-to-right according to the inner alignment. Hard breaking characters will cause advancement to another line. A characters hitting the width bound will also cause another line to start.

Fields of Wrap

line_breaker: Lh_align: HorizontalAlignv_align: VerticalAlign

Methods

impl Layout<BuiltInLineBreaker>[src]

pub fn default_single_line() -> Self[src]

pub fn default_wrap() -> Self[src]

impl<L: LineBreaker> Layout<L>[src]

pub fn h_align(self, h_align: HorizontalAlign) -> Self[src]

Returns an identical Layout but with the input h_align

pub fn v_align(self, v_align: VerticalAlign) -> Self[src]

Returns an identical Layout but with the input v_align

pub fn line_breaker<L2: LineBreaker>(self, line_breaker: L2) -> Layout<L2>[src]

Returns an identical Layout but with the input line_breaker

Trait Implementations

impl<L: LineBreaker> GlyphPositioner for Layout<L>[src]

impl<L: Clone + LineBreaker> Clone for Layout<L>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Layout<BuiltInLineBreaker>[src]

impl<L: PartialEq + LineBreaker> PartialEq<Layout<L>> for Layout<L>[src]

impl<L: Copy + LineBreaker> Copy for Layout<L>[src]

impl<L: Eq + LineBreaker> Eq for Layout<L>[src]

impl<L: Debug + LineBreaker> Debug for Layout<L>[src]

impl<L: Hash + LineBreaker> Hash for Layout<L>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<L> Sync for Layout<L> where
    L: Sync

impl<L> Send for Layout<L> where
    L: Send

impl<L> Unpin for Layout<L> where
    L: Unpin

impl<L> RefUnwindSafe for Layout<L> where
    L: RefUnwindSafe

impl<L> UnwindSafe for Layout<L> where
    L: UnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]