Enum gfx_glyph::Layout
[−]
[src]
pub enum Layout<L: LineBreaker> { SingleLine(L, HorizontalAlign), Wrap(L, HorizontalAlign), }
Built-in GlyphPositioner
implementations.
Takes generic LineBreaker
to indicate the wrapping style.
See StandardLineBreaker
,
AnyCharLineBreaker
.
Variants
SingleLine(L, HorizontalAlign)
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.
Wrap(L, HorizontalAlign)
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.
Methods
impl<L: LineBreaker> Layout<L>
[src]
fn calculate_glyphs_and_leftover<'a>(
&self,
font: &Font,
section: &GlyphInfo<'a>
) -> (Vec<PositionedGlyph>, Option<LayoutLeftover<'a>>)
[src]
&self,
font: &Font,
section: &GlyphInfo<'a>
) -> (Vec<PositionedGlyph>, Option<LayoutLeftover<'a>>)
Trait Implementations
impl<L: Debug + LineBreaker> Debug for Layout<L>
[src]
impl<L: Clone + LineBreaker> Clone for Layout<L>
[src]
fn clone(&self) -> Layout<L>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
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]
fn hash<__HL: Hasher>(&self, __arg_0: &mut __HL)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Layout<StandardLineBreaker>
[src]
impl<L: LineBreaker> GlyphPositioner for Layout<L>
[src]
fn calculate_glyphs<'a, G: Into<GlyphInfo<'a>>>(
&self,
font: &Font,
section: G
) -> Vec<PositionedGlyph>
[src]
&self,
font: &Font,
section: G
) -> Vec<PositionedGlyph>
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
fn bounds_rect<'a, G: Into<GlyphInfo<'a>>>(&self, section: G) -> Rect<f32>
[src]
Return a rectangle according to the requested render position and bounds appropriate for the glyph layout. Read more