[][src]Struct fit_text::Scribe

pub struct Scribe<'a, C, G> {
    pub format: TextFormat,
    pub glyphs: &'a mut C,
    pub transform: Matrix2d,
    pub graphics: &'a mut G,
}

A struct for writing text into multiple rectangles

Fields

format: TextFormat

The text format

glyphs: &'a mut C

The character cache

transform: Matrix2d

The transform

graphics: &'a mut G

The graphics abstraction being drawn to

Methods

impl<'a, C, G> Scribe<'a, C, G>[src]

pub fn new(
    format: TextFormat,
    glyphs: &'a mut C,
    transform: Matrix2d,
    graphics: &'a mut G
) -> Self
[src]

Create a new Scribe

impl<'a, C, G> Scribe<'a, C, G> where
    C: CharacterCache,
    G: Graphics<Texture = C::Texture>, 
[src]

pub fn write<S, R>(&mut self, text: S, rectangle: R) -> Result<(), C::Error> where
    S: AsRef<str>,
    R: Rectangle<Scalar = f64>, 
[src]

Write some text into a rectangle with the Scribe

pub fn write_colored<I, S, R>(
    &mut self,
    fragments: I,
    rectangle: R
) -> Result<(), C::Error> where
    I: IntoIterator<Item = (S, Color)>,
    S: AsRef<str>,
    R: Rectangle<Scalar = f64>, 
[src]

Write some colored text fragments into a rectangle with the Scribe

Auto Trait Implementations

impl<'a, C, G> Unpin for Scribe<'a, C, G>

impl<'a, C, G> Sync for Scribe<'a, C, G> where
    C: Sync,
    G: Sync

impl<'a, C, G> Send for Scribe<'a, C, G> where
    C: Send,
    G: Send

impl<'a, C, G> !UnwindSafe for Scribe<'a, C, G>

impl<'a, C, G> RefUnwindSafe for Scribe<'a, C, G> where
    C: RefUnwindSafe,
    G: RefUnwindSafe

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

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