[][src]Struct quicksilver::graphics::Font

pub struct Font { /* fields omitted */ }

An in-memory TTF font that can render text on demand

Methods

impl Font[src]

pub fn load(
    path: impl AsRef<Path>
) -> impl Future<Item = Font, Error = QuicksilverError>
[src]

Load a font at a given file

pub fn from_slice(data: &'static [u8]) -> Result<Self>[src]

Creates font from bytes sequence.

pub fn from_bytes(data: Vec<u8>) -> Result<Self>[src]

Creates font from owned bytes sequence.

pub fn render(&self, text: &str, style: &FontStyle) -> Result<Image>[src]

Render a text string to an Image

This function handles line breaks but it does not take into account unicode normalization or other text formatting.

Auto Trait Implementations

impl Send for Font

impl Sync for Font

impl Unpin for Font

impl UnwindSafe for Font

impl RefUnwindSafe for Font

Blanket Implementations

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

impl<T> From<T> for 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> SetParameter for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Downcast for T where
    T: Any