Struct gfx_glyph::GlyphBrush [] [src]

pub struct GlyphBrush<'a, R: Resources, F: Factory<R>> { /* fields omitted */ }

Object allowing glyph drawing, containing cache state. Manages glyph positioning cacheing, glyph draw caching & efficient GPU texture cache updating and re-sizing on demand.

Build using a GlyphBrushBuilder.

Example

extern crate gfx_glyph;
use gfx_glyph::Section;


let section = Section {
    text: "Hello gfx_glyph",
    ..Section::default()
};

glyph_brush.queue(section);
glyph_brush.queue(some_other_section);

glyph_brush.draw_queued(&mut gfx_encoder, &gfx_color, &gfx_depth).unwrap();

Methods

impl<'font, R: Resources, F: Factory<R>> GlyphBrush<'font, R, F>
[src]

[src]

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.

If the section is empty or would result in no drawn glyphs will return None

[src]

Returns the pixel bounding box for the input section. The box is a conservative whole number pixel rectangle that can contain the section.

If the section is empty or would result in no drawn glyphs will return None

[src]

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

[src]

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.

[src]

Draws all queued sections onto a render target, applying a position transform (e.g. a projection). See queue.

[src]

Draws all queued sections onto a render target, applying a position transform (e.g. a projection). See queue.

[src]

Returns FontId -> Font map of available fonts.