Struct webgl2_glyph::glyph_brush::GlyphCalculatorBuilder [−][src]
pub struct GlyphCalculatorBuilder<F = FontArc, H = RandomXxHashBuilder64> { /* fields omitted */ }
Expand description
Builder for a GlyphCalculator
.
Example
use glyph_brush::{ab_glyph::FontArc, GlyphCalculator, GlyphCalculatorBuilder};
let dejavu = FontArc::try_from_slice(include_bytes!("../../fonts/DejaVuSans.ttf")).unwrap();
let mut glyphs: GlyphCalculator = GlyphCalculatorBuilder::using_font(dejavu).build();
Implementations
Specifies the default font used to render glyphs.
Referenced with FontId(0)
, which is default.
Adds additional fonts to the one added in using_font
.
Returns a FontId
to reference this font.
pub fn section_hasher<T>(
self,
section_hasher: T
) -> GlyphCalculatorBuilder<F, T> where
T: BuildHasher,
pub fn section_hasher<T>(
self,
section_hasher: T
) -> GlyphCalculatorBuilder<F, T> where
T: BuildHasher,
Sets the section hasher. GlyphCalculator
cannot handle absolute section hash collisions
so use a good hash algorithm.
This hasher is used to distinguish sections, rather than for hashmap internal use.
Defaults to xxHash.
Builds a GlyphCalculator
Trait Implementations
Auto Trait Implementations
impl<F, H> RefUnwindSafe for GlyphCalculatorBuilder<F, H> where
F: RefUnwindSafe,
H: RefUnwindSafe,
impl<F, H> Send for GlyphCalculatorBuilder<F, H> where
F: Send,
H: Send,
impl<F, H> Sync for GlyphCalculatorBuilder<F, H> where
F: Sync,
H: Sync,
impl<F, H> Unpin for GlyphCalculatorBuilder<F, H> where
F: Unpin,
H: Unpin,
impl<F, H> UnwindSafe for GlyphCalculatorBuilder<F, H> where
F: UnwindSafe,
H: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more