Struct gfx_text::RendererBuilder
source · pub struct RendererBuilder<'r, R: Resources, F: Factory<R>> { /* private fields */ }Expand description
Text renderer builder. Allows to set rendering options using builder pattern.
Examples
ⓘ
let mut text = gfx_text::RendererBuilder::new(factory)
.with_size(25)
.with_font("/path/to/font.ttf")
.with_chars(&['a', 'b', 'c'])
.build()
.unwrap();Implementations
sourceimpl<'r, R: Resources, F: Factory<R>> RendererBuilder<'r, R, F>
impl<'r, R: Resources, F: Factory<R>> RendererBuilder<'r, R, F>
sourcepub fn with_font_data(self, data: &'r [u8]) -> Self
pub fn with_font_data(self, data: &'r [u8]) -> Self
Pass raw font data.
sourcepub fn with_outline(self, width: u8, color: [f32; 4]) -> Self
pub fn with_outline(self, width: u8, color: [f32; 4]) -> Self
Specify outline width and color. Not implemented yet.
sourcepub fn with_buffer_size(self, size: usize) -> Self
pub fn with_buffer_size(self, size: usize) -> Self
Specify custom initial buffer size.
sourcepub fn with_chars(self, chars: &'r [char]) -> Self
pub fn with_chars(self, chars: &'r [char]) -> Self
Make available only provided characters in font texture instead of loading all existing from the font face.
Auto Trait Implementations
impl<'r, R, F> RefUnwindSafe for RendererBuilder<'r, R, F>where
F: RefUnwindSafe,
R: RefUnwindSafe,
impl<'r, R, F> Send for RendererBuilder<'r, R, F>where
F: Send,
R: Send,
impl<'r, R, F> Sync for RendererBuilder<'r, R, F>where
F: Sync,
R: Sync,
impl<'r, R, F> Unpin for RendererBuilder<'r, R, F>where
F: Unpin,
R: Unpin,
impl<'r, R, F> UnwindSafe for RendererBuilder<'r, R, F>where
F: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more