[][src]Struct glint::figlet::Figlet

pub struct Figlet { /* fields omitted */ }

Methods

impl Figlet[src]

pub fn create_vec(&self) -> Vec<String>[src]

Creates a Vec for holding figlet output with enough vertical space to contain this font. You may borrow this as a mutable slice and pass it to Font::write_to_buf

pub fn write_to_buf(&self, s: &str, output: &mut [String]) -> usize[src]

Writes a single character to the buffer. The length of output should be at least font.height(), however it's safe to pass a smaller slice (the rendering will be cropped). The same number of characters will be appended to each string, padding with spaces if needed.

#Example

use glint::Figlet;
let figlet = Figlet::default();
let mut output = figlet.create_vec();
figlet.write_to_buf("feat(client)", &mut output[..]);

pub fn write_to_buf_color(
    &self,
    s: &str,
    output: &mut [String],
    style: impl FnMut(&str) -> String
) -> usize
[src]

pub fn from_file(path: impl AsRef<Path>) -> Result<Self, Error>[src]

pub fn height(&self) -> usize[src]

Returns the height of the largest character in the font. This operation is very fast.

Trait Implementations

impl Default for Figlet[src]

impl Clone for Figlet[src]

impl Debug for Figlet[src]

Auto Trait Implementations

impl Unpin for Figlet

impl Sync for Figlet

impl Send for Figlet

impl UnwindSafe for Figlet

impl RefUnwindSafe for Figlet

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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> 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]