[−][src]Struct glyph_brush::GlyphCalculatorBuilder
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]
B: Into<SharedBytes<'a>>,
V: Into<Vec<B>>,
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]
&mut self,
font_data: B
) -> FontId
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]
self,
section_hasher: T
) -> GlyphCalculatorBuilder<'a, T>
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]
fn clone(&self) -> GlyphCalculatorBuilder<'a, H>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, H: Debug> Debug for GlyphCalculatorBuilder<'a, H>
[src]
Auto Trait Implementations
impl<'a, H> Unpin for GlyphCalculatorBuilder<'a, H> where
H: Unpin,
H: Unpin,
impl<'a, H> Sync for GlyphCalculatorBuilder<'a, H> where
H: Sync,
H: Sync,
impl<'a, H> Send for GlyphCalculatorBuilder<'a, H> where
H: Send,
H: Send,
impl<'a, H> UnwindSafe for GlyphCalculatorBuilder<'a, H> where
H: UnwindSafe,
H: UnwindSafe,
impl<'a, H> RefUnwindSafe for GlyphCalculatorBuilder<'a, H> where
H: RefUnwindSafe,
H: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,