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.


let mut text = gfx_text::RendererBuilder::new(factory)
    .with_chars(&['a', 'b', 'c'])


impl<'r, R: Resources, F: Factory<R>> RendererBuilder<'r, R, F>[src]

pub fn new(factory: F) -> Self[src]

Create a new text renderer builder.

pub fn with_size(self, size: u8) -> Self[src]

Specify custom size.

pub fn with_font(self, path: &'r str) -> Self[src]

Specify custom font by path.

pub fn with_font_data(self, data: &'r [u8]) -> Self[src]

Pass raw font data.

pub fn with_outline(self, width: u8, color: [f32; 4]) -> Self[src]

Specify outline width and color. Not implemented yet.

pub fn with_buffer_size(self, size: usize) -> Self[src]

Specify custom initial buffer size.

pub fn with_chars(self, chars: &'r [char]) -> Self[src]

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]

Build a new text renderer instance using current settings.

pub fn unwrap(self) -> Renderer<R, F>[src]

Just an alias for

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

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.