[][src]Trait sixtyfps_corelib::font::HasFont

pub trait HasFont {
    pub fn font_family(&self) -> SharedString;
pub fn font_weight(&self) -> i32;
pub fn font_pixel_size(&self, window: &ComponentWindow) -> f32; pub fn font_request(&self, window: &ComponentWindow) -> FontRequest { ... }
pub fn font(&self, window: &ComponentWindow) -> Rc<Font> { ... } }

HasFont is a convenience trait for items holding font properties, such as Text or TextInput.

Required methods

pub fn font_family(&self) -> SharedString[src]

Return the value of the font-family property.

pub fn font_weight(&self) -> i32[src]

Return the value of the font-weight property.

pub fn font_pixel_size(&self, window: &ComponentWindow) -> f32[src]

Return the value if the font-size property converted to window specific pixels, respecting the window scale factor.

Loading content...

Provided methods

pub fn font_request(&self, window: &ComponentWindow) -> FontRequest[src]

Translates the values of the different font related properties into a FontRequest object.

pub fn font(&self, window: &ComponentWindow) -> Rc<Font>[src]

Returns a Font object that matches the requested font properties of this trait object (item).

Loading content...

Implementations on Foreign Types

impl<'_> HasFont for Pin<&'_ Text>[src]

impl<'_> HasFont for Pin<&'_ TextInput>[src]

Loading content...

Implementors

Loading content...