pub trait Metrics: Clone {
Show 17 methods
// Required methods
fn new(value: String) -> Self;
fn duplicate(&self) -> Self;
fn width(&self, font_size: f32, letter_spacing: f32) -> f32;
fn height(&self, font_size: f32, line_height: Option<f32>) -> f32;
fn ascender(&self, font_size: f32) -> f32;
fn line_gap(&self) -> f32;
fn slice(&self, start: u32, count: u32) -> Self;
fn value(&self) -> String;
fn units(&self) -> f32;
fn is_rtl(&self) -> bool;
fn append(&self, other: Self);
fn count(&self) -> u32;
fn replace(&self, other: Self, fallback: bool);
fn split_by_width(
&self,
font_size: f32,
letter_spacing: f32,
width: f32,
) -> Self;
fn chars(&self) -> Vec<char>;
// Provided methods
fn trim_start(&self) { ... }
fn pop(&self) { ... }
}Required Methods§
fn new(value: String) -> Self
fn duplicate(&self) -> Self
fn width(&self, font_size: f32, letter_spacing: f32) -> f32
fn height(&self, font_size: f32, line_height: Option<f32>) -> f32
fn ascender(&self, font_size: f32) -> f32
fn line_gap(&self) -> f32
fn slice(&self, start: u32, count: u32) -> Self
fn value(&self) -> String
fn units(&self) -> f32
fn is_rtl(&self) -> bool
fn append(&self, other: Self)
fn count(&self) -> u32
sourcefn replace(&self, other: Self, fallback: bool)
fn replace(&self, other: Self, fallback: bool)
replace this metrics with another, allowing fallback logic
fn split_by_width( &self, font_size: f32, letter_spacing: f32, width: f32, ) -> Self
fn chars(&self) -> Vec<char>
Provided Methods§
fn trim_start(&self)
fn pop(&self)
Object Safety§
This trait is not object safe.