[][src]Struct plotters::style::FontDesc

pub struct FontDesc<'a> { /* fields omitted */ }

Describes a font

Methods

impl<'a> FontDesc<'a>[src]

pub fn new(typeface: &'a str, size: f64) -> Self[src]

Create a new font

pub fn resize(&self, size: f64) -> FontDesc<'a>[src]

Create a new font desc with the same font but different size

pub fn transform(&self, trans: FontTransform) -> Self[src]

Set the font transformation

pub fn get_transform(&self) -> FontTransform[src]

Get the font transformation description

pub fn color<C: Color>(&self, color: &C) -> TextStyle<'a>[src]

Set the color of the font and return the result text style object

pub fn get_name(&self) -> &'a str[src]

Get the name of the font

pub fn get_size(&self) -> f64[src]

Get the size of font

pub fn layout_box(&self, text: &str) -> FontResult<((i32, i32), (i32, i32))>[src]

Get the size of the text if rendered in this font

pub fn box_size(&self, text: &str) -> FontResult<(u32, u32)>[src]

Get the size of the text if rendered in this font

pub fn draw<E, DrawFunc: FnMut(i32, i32, f32) -> Result<(), E>>(
    &self,
    text: &str,
    (x, y): (i32, i32),
    draw: DrawFunc
) -> FontResult<Result<(), E>>
[src]

Actually draws a font with a drawing function

Trait Implementations

impl<'a> From<&'a str> for FontDesc<'a>[src]

impl<'a, T: Into<f64>> From<(&'a str, T)> for FontDesc<'a>[src]

impl<'a> Clone for FontDesc<'a>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'a> Send for FontDesc<'a>

impl<'a> Sync for FontDesc<'a>

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.