Struct glium_glyph::GlyphBrush
source · pub struct GlyphBrush<'font, 'a, H: BuildHasher = DefaultSectionHasher> { /* private fields */ }
Implementations§
source§impl<'font, 'p> GlyphBrush<'font, 'p>
impl<'font, 'p> GlyphBrush<'font, 'p>
source§impl<'font, 'p, H: BuildHasher> GlyphBrush<'font, 'p, H>
impl<'font, 'p, H: BuildHasher> GlyphBrush<'font, 'p, H>
sourcepub fn queue_custom_layout<'a, S, G>(&mut self, section: S, custom_layout: &G)where
G: GlyphPositioner,
S: Into<Cow<'a, VariedSection<'a>>>,
pub fn queue_custom_layout<'a, S, G>(&mut self, section: S, custom_layout: &G)where
G: GlyphPositioner,
S: Into<Cow<'a, VariedSection<'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, VariedSection<'a>>>,
pub fn queue<'a, S>(&mut self, section: S)where
S: Into<Cow<'a, VariedSection<'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<F: Facade + Deref<Target = Context>>(
&mut self,
facade: &F,
frame: &mut Frame
)
pub fn draw_queued_with_transform<F: Facade + Deref<Target = Context>>(
&mut self,
transform: [[f32; 4]; 4],
facade: &F,
frame: &mut Frame
)
sourcepub fn fonts(&self) -> &[Font<'font>]
pub fn fonts(&self) -> &[Font<'font>]
Returns the available fonts.
The FontId
corresponds to the index of the font data.
pub fn add_font_bytes<'a: 'font, B: Into<SharedBytes<'a>>>(
&mut self,
font_data: B
) -> FontId
Trait Implementations§
source§impl<'font, 'l, H: BuildHasher> GlyphCruncher<'font> for GlyphBrush<'font, 'l, H>
impl<'font, 'l, H: BuildHasher> GlyphCruncher<'font> for GlyphBrush<'font, 'l, H>
source§fn pixel_bounds_custom_layout<'a, S, L>(
&mut self,
section: S,
custom_layout: &L
) -> Option<Rect<i32>>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, VariedSection<'a>>>,
fn pixel_bounds_custom_layout<'a, S, L>(
&mut self,
section: S,
custom_layout: &L
) -> Option<Rect<i32>>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, VariedSection<'a>>>,
Returns the pixel bounding box for the input section using a custom layout.
The box is a conservative whole number pixel rectangle that can contain the section. Read more
source§fn glyphs_custom_layout<'a, 'b, S, L>(
&'b mut self,
section: S,
custom_layout: &L
) -> PositionedGlyphIter<'b, 'font>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, VariedSection<'a>>>,
fn glyphs_custom_layout<'a, 'b, S, L>(
&'b mut self,
section: S,
custom_layout: &L
) -> PositionedGlyphIter<'b, 'font>where
L: GlyphPositioner + Hash,
S: Into<Cow<'a, VariedSection<'a>>>,
Returns an iterator over the
PositionedGlyph
s of the given section with a custom layout. Read moresource§fn pixel_bounds<'a, S>(&mut self, section: S) -> Option<Rect<i32>>where
S: Into<Cow<'a, VariedSection<'a>>>,
fn pixel_bounds<'a, S>(&mut self, section: S) -> Option<Rect<i32>>where
S: Into<Cow<'a, VariedSection<'a>>>,
Returns the pixel bounding box for the input section. The box is a conservative
whole number pixel rectangle that can contain the section. Read more
source§fn glyphs<'a, S, 'b>(
&'b mut self,
section: S
) -> Map<Iter<'b, (PositionedGlyph<'font>, [f32; 4], FontId)>, fn(_: &'b (PositionedGlyph<'font>, [f32; 4], FontId)) -> &'b PositionedGlyph<'font>>where
S: Into<Cow<'a, VariedSection<'a>>>,
fn glyphs<'a, S, 'b>(
&'b mut self,
section: S
) -> Map<Iter<'b, (PositionedGlyph<'font>, [f32; 4], FontId)>, fn(_: &'b (PositionedGlyph<'font>, [f32; 4], FontId)) -> &'b PositionedGlyph<'font>>where
S: Into<Cow<'a, VariedSection<'a>>>,
Returns an iterator over the
PositionedGlyph
s of the given section. Read more