[][src]Trait embedded_text::utils::font_ext::FontExt

pub trait FontExt {
    fn measure_line(iter: Chars, max_width: u32) -> LineMeasurement;
fn total_char_width(c: char) -> u32;
fn measure_text(text: &str, max_width: u32) -> u32;
fn str_width(s: &str) -> u32; }

Font extensions

Required methods

fn measure_line(iter: Chars, max_width: u32) -> LineMeasurement

Measures a sequence of characters in a line with a determinate maximum width.

Returns the width of the characters that fit into the given space and whether or not all of the input fits into the given space.

fn total_char_width(c: char) -> u32

Returns the total width of the character plus the character spacing.

fn measure_text(text: &str, max_width: u32) -> u32

Measures text height when rendered using a given width.

fn str_width(s: &str) -> u32

Measure text width

Loading content...

Implementors

impl<F> FontExt for F where
    F: Font
[src]

Loading content...