[][src]Enum glyph_brush::Layout

pub enum Layout<L> where
    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]

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

pub fn h_align(self, h_align: HorizontalAlign) -> Layout<L>[src]

Returns an identical Layout but with the input h_align

pub fn v_align(self, v_align: VerticalAlign) -> Layout<L>[src]

Returns an identical Layout but with the input v_align

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

Returns an identical Layout but with the input line_breaker

Trait Implementations

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

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

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

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

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

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

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

impl Default for Layout<BuiltInLineBreaker>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,