Enum gfx_glyph::Layout
[−]
[src]
pub enum Layout<G: GlyphGrouper> { SingleLine(G, HorizontalAlign), Wrap(G, HorizontalAlign), }
Built-in GlyphPositioner
implementations.
Takes generic GlyphGrouper
to indicate the wrapping style,
see GlyphGroup
for built-in groupings.
Variants
SingleLine(G, HorizontalAlign)
Renders a single line from left-to-right according to the inner alignment. Newline characters will end the line, partially hitting the width bound will end the line.
Wrap(G, HorizontalAlign)
Renders multiple lines from left-to-right according to the inner alignment. Newline characters will cause advancement to another line. A characters hitting the width bound will also cause another line to start.
Methods
impl<G: GlyphGrouper> Layout<G>
[src]
fn calculate_glyphs_and_leftover<'a>(
&self,
font: &Font,
section: &GlyphInfo<'a>
) -> (Vec<PositionedGlyph>, Option<LayoutLeftover<'a>>)
&self,
font: &Font,
section: &GlyphInfo<'a>
) -> (Vec<PositionedGlyph>, Option<LayoutLeftover<'a>>)
Trait Implementations
impl<G: Debug + GlyphGrouper> Debug for Layout<G>
[src]
impl<G: Clone + GlyphGrouper> Clone for Layout<G>
[src]
fn clone(&self) -> Layout<G>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<G: Copy + GlyphGrouper> Copy for Layout<G>
[src]
impl<G: Hash + GlyphGrouper> Hash for Layout<G>
[src]
fn hash<__HG: Hasher>(&self, __arg_0: &mut __HG)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Layout<GlyphGroup>
[src]
impl<Grouper: GlyphGrouper> GlyphPositioner for Layout<Grouper>
[src]
fn calculate_glyphs<'a, G: Into<GlyphInfo<'a>>>(
&self,
font: &Font,
section: G
) -> Vec<PositionedGlyph>
&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>
Return a rectangle according to the requested render position and bounds appropriate for the glyph layout. Read more