Struct composable::views::text::Font

source ·
pub struct Font<'a> { /* private fields */ }
Available on crate features unstable and views only.
Expand description

Implementations§

source§

impl<'a> Font<'a>

source

pub fn full_name(&self) -> Option<String>

Full font name that reflects all family and relevant subfamily descriptors.

source

pub fn family(&self) -> Option<String>

Family name.

source

pub fn style(&self) -> Option<String>

Subfamily name.

source

pub fn identifier(&self) -> Option<String>

Unique font identifier

source

pub fn version(&self) -> Option<String>

Should begin with the syntax “Version N.M” (upper case, lower case, or mixed, with a space between “Version” and the number).

source

pub fn size(&self) -> f32

Font size in points.

source

pub fn ascender(&self) -> f32

Horizontal face ascender.

source

pub fn descender(&self) -> f32

Horizontal face descender,

source

pub fn height(&self) -> f32

Horizontal height,

source

pub fn capital_height(&self) -> f32

Capital height,

source

pub fn line_gap(&self) -> f32

Line gap,

source

pub fn text(&self, rgba: [u8; 4], string: &str) -> Text<'_>

Returns a Text in this font.

source§

impl<'a> Font<'a>

source

pub fn from(data: &'a [u8]) -> Option<FontConfig<'_>>

Create a Font from the raw font data.

source

pub fn from_collection(data: &'a [u8], index: u32) -> Option<FontConfig<'_>>

Create a Font from a font collection. Returns the font at index, if any

Auto Trait Implementations§

§

impl<'a> Freeze for Font<'a>

§

impl<'a> !RefUnwindSafe for Font<'a>

§

impl<'a> Send for Font<'a>

§

impl<'a> Sync for Font<'a>

§

impl<'a> Unpin for Font<'a>

§

impl<'a> !UnwindSafe for Font<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.