[][src]Struct azul_core::app_resources::FontMetrics

pub struct FontMetrics {
    pub font_size: usize,
    pub x_ppem: u16,
    pub y_ppem: u16,
    pub x_scale: i64,
    pub y_scale: i64,
    pub ascender: i64,
    pub descender: i64,
    pub height: i64,
    pub max_advance: i64,
}

Fields

font_size: usize

Font size that these metrics were created for, usually 1000px (so every metric has to be divided by 1000 before it can be used for measurements)

x_ppem: u16y_ppem: u16x_scale: i64y_scale: i64ascender: i64descender: i64height: i64max_advance: i64

Implementations

impl FontMetrics[src]

pub fn zero() -> Self[src]

pub fn get_x_ppem(&self, target_font_size: f32) -> f32[src]

pub fn get_y_ppem(&self, target_font_size: f32) -> f32[src]

pub fn get_x_scale(&self, target_font_size: f32) -> f32[src]

pub fn get_y_scale(&self, target_font_size: f32) -> f32[src]

pub fn get_ascender(&self, target_font_size: f32) -> f32[src]

pub fn get_descender(&self, target_font_size: f32) -> f32[src]

pub fn get_height(&self, target_font_size: f32) -> f32[src]

pub fn get_max_advance(&self, target_font_size: f32) -> f32[src]

Trait Implementations

impl Clone for FontMetrics[src]

impl Copy for FontMetrics[src]

impl Debug for FontMetrics[src]

impl Eq for FontMetrics[src]

impl Hash for FontMetrics[src]

impl Ord for FontMetrics[src]

impl PartialEq<FontMetrics> for FontMetrics[src]

impl PartialOrd<FontMetrics> for FontMetrics[src]

impl StructuralEq for FontMetrics[src]

impl StructuralPartialEq for FontMetrics[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.