pub trait Measure {
// Required methods
fn advances(&self, text: &str, font: Font) -> Rc<Vec<f32>>;
fn in_cells(&self) -> bool;
// Provided methods
fn cell_pixels(&self) -> Option<(u32, u32)> { ... }
fn width(&self, text: &str, font: Font) -> f32 { ... }
}Expand description
Measures text, in cells, one advance per char.
Required Methods§
Provided Methods§
Sourcefn cell_pixels(&self) -> Option<(u32, u32)>
fn cell_pixels(&self) -> Option<(u32, u32)>
A cell’s size in pixels, where there are pixels.
fn width(&self, text: &str, font: Font) -> f32
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".