Struct gfx_text::RendererBuilder
[−]
[src]
pub struct RendererBuilder<'r, R: Resources, F: Factory<R>> { // some fields omitted }
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();
Methods
impl<'r, R: Resources, F: Factory<R>> RendererBuilder<'r, R, F>
[src]
fn new(factory: F) -> Self
Create a new text renderer builder.
fn with_size(self, size: u8) -> Self
Specify custom size.
fn with_font(self, path: &'r str) -> Self
Specify custom font by path.
fn with_font_data(self, data: &'r [u8]) -> Self
Pass raw font data.
fn with_outline(self, width: u8, color: [f32; 4]) -> Self
Specify outline width and color. Not implemented yet.
fn with_buffer_size(self, size: usize) -> Self
Specify custom initial buffer size.
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.
fn build(self) -> Result<Renderer<R, F>, Error>
Build a new text renderer instance using current settings.
fn unwrap(self) -> Renderer<R, F>
Just an alias for builder.build().unwrap()
.