[][src]Struct psf::Font

pub struct Font { /* fields omitted */ }

Stores information about specific loaded font, including number of available characters, and each character width and height.

Implementations

impl Font[src]

pub fn new<P: AsRef<Path>>(path: P) -> Result<Font, Error>[src]

Creates a new font for specific path.

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

Returns height of every glyph

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

Returns width of every glyph

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

Returns number of available characters in the font

pub fn get_char(&self, c: char) -> Option<Glyph<'_>>[src]

Returns Glyph data for specific character. If it's not present in the font, None is returned.

pub fn get_char_owned<'b>(&self, c: char) -> Option<Glyph<'b>>[src]

Returns Glyph data for specific character. If it's not present in the font, None is returned. Contains copy of the data, so can be used even when Font is destroyed.

pub fn print_char(&self, c: char)[src]

Prints specified character to standard output using print!

Auto Trait Implementations

impl RefUnwindSafe for Font

impl Send for Font

impl Sync for Font

impl Unpin for Font

impl UnwindSafe for Font

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.