[][src]Struct fontdue::layout::Layout

pub struct Layout { /* fields omitted */ }

Text layout requires a small amount of heap usage which is contained in the Layout struct. This context is reused between layout calls. Reusing the Layout struct will greatly reduce memory allocations and is advisable for performance.

Implementations

impl Layout[src]

pub fn new() -> Layout[src]

pub fn layout_horizontal<T: Borrow<Font>>(
    &mut self,
    fonts: &[T],
    styles: &[&TextStyle<'_>],
    settings: &LayoutSettings,
    output: &mut Vec<GlyphPosition>
)
[src]

Performs layout for text horizontally, and wrapping vertically. This makes a best effort attempt at laying out the text defined in the given styles with the provided layout settings. Text may overflow out of the bounds defined in the layout settings and it's up to the application to decide how to deal with this. Works with &Font or &[&Font].

Characters from the input string can only be omitted from the output, they are never reordered. The output buffer will always contain characters in the order they were defined in the styles.

Auto Trait Implementations

impl RefUnwindSafe for Layout

impl Send for Layout

impl Sync for Layout

impl Unpin for Layout

impl UnwindSafe for Layout

Blanket Implementations

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

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

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

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.