pub struct GlyphCalculatorBuilder<F = FontArc, H = DefaultSectionHasher> { /* private fields */ }
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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. 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.