Trait fontkit::Metrics

source ·
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§

source

fn new(value: String) -> Self

source

fn duplicate(&self) -> Self

source

fn width(&self, font_size: f32, letter_spacing: f32) -> f32

source

fn height(&self, font_size: f32, line_height: Option<f32>) -> f32

source

fn ascender(&self, font_size: f32) -> f32

source

fn line_gap(&self) -> f32

source

fn slice(&self, start: u32, count: u32) -> Self

source

fn value(&self) -> String

source

fn units(&self) -> f32

source

fn is_rtl(&self) -> bool

source

fn append(&self, other: Self)

source

fn count(&self) -> u32

source

fn replace(&self, other: Self, fallback: bool)

replace this metrics with another, allowing fallback logic

source

fn split_by_width( &self, font_size: f32, letter_spacing: f32, width: f32, ) -> Self

source

fn chars(&self) -> Vec<char>

Provided Methods§

source

fn trim_start(&self)

source

fn pop(&self)

Object Safety§

This trait is not object safe.

Implementors§