Struct gfx_glyph::GlyphBrushBuilder [] [src]

pub struct GlyphBrushBuilder<'a> { /* fields omitted */ }

Builder for a GlyphBrush.

Example

extern crate gfx_glyph;
use gfx_glyph::GlyphBrushBuilder;

let arial = include_bytes!("examples/Arial Unicode.ttf");
let mut glyph_brush = GlyphBrushBuilder::using_font(arial)
    .build(gfx_factory.clone());

Methods

impl<'a> GlyphBrushBuilder<'a>
[src]

Specifies the font data used to render glyphs

Initial size of 2D texture used as a gpu cache, pixels (width, height). The GPU cache will automatically quadruple if insufficient.

Defaults to (256, 256)

Sets the maximum allowed difference in scale used for judging whether to reuse an existing glyph in the GPU cache.

Defaults to 0.5

See rusttype docs for rusttype::gpu_cache::Cache

Sets the maximum allowed difference in subpixel position used for judging whether to reuse an existing glyph in the GPU cache. Anything greater than or equal to 1.0 means "don't care".

Defaults to 1.0

See rusttype docs for rusttype::gpu_cache::Cache

Sets whether perform the calculation of glyph positioning according to the layout every time, or use a cached result if the input Section and GlyphPositioner are the same hash as a previous call.

Improves performance. Should only disable if using a custom GlyphPositioner that is impure according to it's inputs, so caching a previous call is not desired.

Defaults to true

Sets optimising drawing by reusing the last draw requesting an identical draw queue.

Improves performance. Can be disabled as a workaround to missing characters, as this has been observed at lower position tolerances. The repeated draws can cure the missing characters. This is probably an upstream bug. Without bugs it makes sense to use this optimisation.

Defaults to true

Builds a GlyphBrush using the input gfx factory

Trait Implementations

impl<'a> Debug for GlyphBrushBuilder<'a>
[src]

Formats the value using the given formatter.