Struct gfx_text::RendererBuilder [−][src]
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
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 builder.build().unwrap()
.
Auto Trait Implementations
impl<'r, R, F> RefUnwindSafe for RendererBuilder<'r, R, F> where
F: RefUnwindSafe,
R: RefUnwindSafe,
F: RefUnwindSafe,
R: RefUnwindSafe,
impl<'r, R, F> Send for RendererBuilder<'r, R, F> where
F: Send,
R: Send,
F: Send,
R: Send,
impl<'r, R, F> Sync for RendererBuilder<'r, R, F> where
F: Sync,
R: Sync,
F: Sync,
R: Sync,
impl<'r, R, F> Unpin for RendererBuilder<'r, R, F> where
F: Unpin,
R: Unpin,
F: Unpin,
R: Unpin,
impl<'r, R, F> UnwindSafe for RendererBuilder<'r, R, F> where
F: UnwindSafe,
R: UnwindSafe,
F: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &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.
pub 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>,