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, Layout};


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

glyph_brush.queue(section, &Layout::default());
glyph_brush.queue(some_other_section, &Layout::default());

glyph_brush.draw_queued(&mut gfx_encoder, &gfx_target).unwrap();

Methods

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

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

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.

See Layout for available built-in glyph positioning layouts.

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

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