Enum gfx_glyph::Layout [] [src]

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

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

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

Methods

impl Layout<BuiltInLineBreaker>
[src]

[src]

[src]

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

[src]

Returns an identical Layout but with the input h_align

[src]

Returns an identical Layout but with the input v_align

[src]

Returns an identical Layout but with the input line_breaker

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

[src]

Trait Implementations

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

[src]

Formats the value using the given formatter.

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

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

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

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

impl Default for Layout<BuiltInLineBreaker>
[src]

[src]

Returns the "default value" for a type. Read more

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

[src]

Calculate a sequence of positioned glyphs to render. Custom implementations should always return the same result when called with the same arguments. If not consider disabling cache_glyph_positioning. Read more

[src]

Return a rectangle according to the requested render position and bounds appropriate for the glyph layout. Read more