[][src]Struct glyph_brush::GlyphCalculatorBuilder

pub struct GlyphCalculatorBuilder<F = FontArc, H = DefaultSectionHasher> { /* fields omitted */ }

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

impl<F: Font> GlyphCalculatorBuilder<F>[src]

pub fn using_font(font: F) -> Self[src]

Specifies the default font used to render glyphs. Referenced with FontId(0), which is default.

pub fn using_fonts(fonts: Vec<F>) -> Self[src]

impl<F: Font, H: BuildHasher> GlyphCalculatorBuilder<F, H>[src]

pub fn add_font<I: Into<F>>(&mut self, font_data: I) -> FontId[src]

Adds additional fonts to the one added in using_font.

Returns a FontId to reference this font.

pub fn section_hasher<T: BuildHasher>(
    self,
    section_hasher: T
) -> GlyphCalculatorBuilder<F, T>
[src]

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.

pub fn build<X>(self) -> GlyphCalculator<F, X, H>[src]

Builds a GlyphCalculator

Trait Implementations

impl<F: Clone, H: Clone> Clone for GlyphCalculatorBuilder<F, H>[src]

impl<F: Debug, H: Debug> Debug for GlyphCalculatorBuilder<F, H>[src]

Auto Trait Implementations

impl<F, H> RefUnwindSafe for GlyphCalculatorBuilder<F, H> where
    F: RefUnwindSafe,
    H: RefUnwindSafe
[src]

impl<F, H> Send for GlyphCalculatorBuilder<F, H> where
    F: Send,
    H: Send
[src]

impl<F, H> Sync for GlyphCalculatorBuilder<F, H> where
    F: Sync,
    H: Sync
[src]

impl<F, H> Unpin for GlyphCalculatorBuilder<F, H> where
    F: Unpin,
    H: Unpin
[src]

impl<F, H> UnwindSafe for GlyphCalculatorBuilder<F, H> where
    F: UnwindSafe,
    H: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,