pub enum GlyphBrush<F = FontArc, H = DefaultSectionHasher> {
    Core {
        pipeline: Pipeline,
        glyph_brush: GlyphBrush<Instance, Extra, F, H>,
    },
    Compatibility {
        pipeline: Pipeline,
        glyph_brush: GlyphBrush<[Vertex; 4], Extra, F, H>,
    },
}
Expand description

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.

Variants

Core

Fields

pipeline: Pipeline
glyph_brush: GlyphBrush<Instance, Extra, F, H>

Compatibility

Fields

pipeline: Pipeline
glyph_brush: GlyphBrush<[Vertex; 4], Extra, F, H>

Implementations

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.

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.

Queues pre-positioned glyphs to be processed by the next call of draw_queued. Can be called multiple times.

Retains the section in the cache as if it had been used in the last draw-frame.

Should not be necessary unless using multiple draws per frame with distinct transforms, see caching behaviour.

Retains the section in the cache as if it had been used in the last draw-frame.

Should not be necessary unless using multiple draws per frame with distinct transforms, see caching behaviour.

Returns the available fonts.

The FontId corresponds to the index of the font data.

Adds an additional font to the one(s) initially added on build.

Returns a new FontId to reference this font.

Draws all queued sections onto a render target. See queue.

Trims the cache, see caching behaviour.

Panics

Panics if the provided target has a texture format that does not match the render_format provided on creation of the GlyphBrush.

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

Trims the cache, see caching behaviour.

Panics

Panics if the provided target has a texture format that does not match the render_format provided on creation of the GlyphBrush.

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

Trims the cache, see caching behaviour.

Panics

Panics if the provided target has a texture format that does not match the render_format provided on creation of the GlyphBrush.

Trait Implementations

Formats the value using the given formatter. Read more

Returns an iterator over the PositionedGlyphs of the given section with a custom layout. Read more

Returns a bounding box for the section glyphs calculated using each glyph’s vertical & horizontal metrics. Read more

Returns the available fonts. Read more

Returns an iterator over the PositionedGlyphs of the given section. Read more

Returns a bounding box for the section glyphs calculated using each glyph’s vertical & horizontal metrics. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.