Struct glium_glyph::GlyphBrush
source · pub struct GlyphBrush<'a, F: Font, H: BuildHasher = DefaultSectionHasher> { /* private fields */ }
Implementations§
source§impl<'p, F: Font> GlyphBrush<'p, F>
impl<'p, F: Font> GlyphBrush<'p, F>
source§impl<'p, F: Font + Sync, H: BuildHasher> GlyphBrush<'p, F, H>
impl<'p, F: Font + Sync, H: BuildHasher> GlyphBrush<'p, F, H>
sourcepub fn queue_custom_layout<'a, S, G>(&mut self, section: S, custom_layout: &G)where
G: GlyphPositioner,
S: Into<Cow<'a, Section<'a>>>,
pub fn queue_custom_layout<'a, S, G>(&mut self, section: S, custom_layout: &G)where
G: GlyphPositioner,
S: Into<Cow<'a, Section<'a>>>,
Queues a section/layout to be drawn by the next call of
draw_queued
. Can be called multiple times
to queue multiple sections for drawing.
Used to provide custom GlyphPositioner
logic, if using built-in
Layout
simply use queue
Benefits from caching, see caching behaviour.
sourcepub fn queue<'a, S>(&mut self, section: S)where
S: Into<Cow<'a, Section<'a>>>,
pub fn queue<'a, S>(&mut self, section: S)where
S: Into<Cow<'a, Section<'a>>>,
Queues a section/layout to be drawn by the next call of
draw_queued
. Can be called multiple times
to queue multiple sections for drawing.
Benefits from caching, see caching behaviour.
pub fn draw_queued<C: Facade + Deref<Target = Context>, S: Surface>(
&mut self,
facade: &C,
surface: &mut S
)
pub fn draw_queued_with_transform<C: Facade + Deref<Target = Context>, S: Surface>(
&mut self,
transform: [[f32; 4]; 4],
facade: &C,
surface: &mut S
)
Trait Implementations§
source§impl<'l, F: Font, H: BuildHasher> GlyphCruncher<F, Extra> for GlyphBrush<'l, F, H>
impl<'l, F: Font, H: BuildHasher> GlyphCruncher<F, Extra> for GlyphBrush<'l, F, H>
source§fn fonts(&self) -> &[F] ⓘ
fn fonts(&self) -> &[F] ⓘ
Returns the available fonts.
The FontId
corresponds to the index of the font data.
source§fn glyph_bounds_custom_layout<'a, S, L>(
&mut self,
section: S,
custom_layout: &L
) -> Option<Rect>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
fn glyph_bounds_custom_layout<'a, S, L>(
&mut self,
section: S,
custom_layout: &L
) -> Option<Rect>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
Returns a bounding box for the section glyphs calculated using each glyph’s
vertical & horizontal metrics. Read more
source§fn glyphs_custom_layout<'a, 'b, S, L>(
&'b mut self,
section: S,
custom_layout: &L
) -> SectionGlyphIter<'b>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
fn glyphs_custom_layout<'a, 'b, S, L>(
&'b mut self,
section: S,
custom_layout: &L
) -> SectionGlyphIter<'b>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, Section<'a>>>,
Returns an iterator over the
PositionedGlyph
s of the given section with a custom layout. Read more