[][src]Struct glyph_brush::GlyphCalculatorBuilder

pub struct GlyphCalculatorBuilder<'a, H = DefaultSectionHasher> { /* fields omitted */ }

Builder for a GlyphCalculator.

Example

use glyph_brush::GlyphCalculatorBuilder;

let dejavu: &[u8] = include_bytes!("../../fonts/DejaVuSans.ttf");
let mut glyphs = GlyphCalculatorBuilder::using_font_bytes(dejavu).build();

Methods

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

pub fn using_font_bytes<B: Into<SharedBytes<'a>>>(font_0_data: B) -> Self[src]

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

pub fn using_fonts_bytes<B, V>(font_data: V) -> Self where
    B: Into<SharedBytes<'a>>,
    V: Into<Vec<B>>, 
[src]

pub fn using_font(font_0_data: Font<'a>) -> Self[src]

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

pub fn using_fonts<V: Into<Vec<Font<'a>>>>(fonts: V) -> Self[src]

impl<'a, H: BuildHasher> GlyphCalculatorBuilder<'a, H>[src]

pub fn add_font_bytes<B: Into<SharedBytes<'a>>>(
    &mut self,
    font_data: B
) -> FontId
[src]

Adds additional fonts to the one added in using_font / using_font_bytes.

Returns a FontId to reference this font.

pub fn add_font(&mut self, font_data: Font<'a>) -> FontId[src]

Adds additional fonts to the one added in using_font / using_font_bytes.

Returns a FontId to reference this font.

pub fn section_hasher<T: BuildHasher>(
    self,
    section_hasher: T
) -> GlyphCalculatorBuilder<'a, 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(self) -> GlyphCalculator<'a, H>[src]

Builds a GlyphCalculator

Trait Implementations

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

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

Auto Trait Implementations

impl<'a, H> RefUnwindSafe for GlyphCalculatorBuilder<'a, H> where
    H: RefUnwindSafe

impl<'a, H> Send for GlyphCalculatorBuilder<'a, H> where
    H: Send

impl<'a, H> Sync for GlyphCalculatorBuilder<'a, H> where
    H: Sync

impl<'a, H> Unpin for GlyphCalculatorBuilder<'a, H> where
    H: Unpin

impl<'a, H> UnwindSafe for GlyphCalculatorBuilder<'a, H> where
    H: UnwindSafe

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> 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>,