Struct gfx_text::RendererBuilder [−][src]
pub struct RendererBuilder<'r, R: Resources, F: Factory<R>> { /* fields omitted */ }
Text renderer builder. Allows to set rendering options using builder pattern.
Examples
ⓘThis example is not tested
let mut text = gfx_text::RendererBuilder::new(factory) .with_size(25) .with_font("/path/to/font.ttf") .with_chars(&['a', 'b', 'c']) .build() .unwrap();
Methods
impl<'r, R: Resources, F: Factory<R>> RendererBuilder<'r, R, F>
[src]
impl<'r, R: Resources, F: Factory<R>> RendererBuilder<'r, R, F>
pub fn new(factory: F) -> Self
[src]
pub fn new(factory: F) -> Self
Create a new text renderer builder.
pub fn with_size(self, size: u8) -> Self
[src]
pub fn with_size(self, size: u8) -> Self
Specify custom size.
pub fn with_font(self, path: &'r str) -> Self
[src]
pub fn with_font(self, path: &'r str) -> Self
Specify custom font by path.
pub fn with_font_data(self, data: &'r [u8]) -> Self
[src]
pub fn with_font_data(self, data: &'r [u8]) -> Self
Pass raw font data.
pub fn with_outline(self, width: u8, color: [f32; 4]) -> Self
[src]
pub fn with_outline(self, width: u8, color: [f32; 4]) -> Self
Specify outline width and color. Not implemented yet.
pub fn with_buffer_size(self, size: usize) -> Self
[src]
pub fn with_buffer_size(self, size: usize) -> Self
Specify custom initial buffer size.
pub fn with_chars(self, chars: &'r [char]) -> Self
[src]
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.
pub fn build(self) -> Result<Renderer<R, F>, Error>
[src]
pub fn build(self) -> Result<Renderer<R, F>, Error>
Build a new text renderer instance using current settings.
pub fn unwrap(self) -> Renderer<R, F>
[src]
pub fn unwrap(self) -> Renderer<R, F>
Just an alias for builder.build().unwrap()
.
Auto Trait Implementations
impl<'r, R, F> Send for RendererBuilder<'r, R, F> where
F: Send,
R: Send,
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> Sync for RendererBuilder<'r, R, F> where
F: Sync,
R: Sync,