pub struct FontDesc<'a> { /* private fields */ }Expand description
Describes a font
Implementations§
Source§impl<'a> FontDesc<'a>
impl<'a> FontDesc<'a>
Sourcepub fn resize(&self, size: f64) -> FontDesc<'a>
pub fn resize(&self, size: f64) -> FontDesc<'a>
Create a new font desc with the same font but different size
Sourcepub fn transform(&self, trans: FontTransform) -> Self
pub fn transform(&self, trans: FontTransform) -> Self
Set the font transformation
Sourcepub fn get_transform(&self) -> FontTransform
pub fn get_transform(&self) -> FontTransform
Get the font transformation description
Sourcepub fn color<C: Color>(&'a self, color: &'a C) -> TextStyle<'a>
pub fn color<C: Color>(&'a self, color: &'a C) -> TextStyle<'a>
Set the color of the font and return the result text style object
Sourcepub fn layout_box(&self, text: &str) -> FontResult<((i32, i32), (i32, i32))>
pub fn layout_box(&self, text: &str) -> FontResult<((i32, i32), (i32, i32))>
Get the size of the text if rendered in this font
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FontDesc<'a>
impl<'a> RefUnwindSafe for FontDesc<'a>
impl<'a> !Send for FontDesc<'a>
impl<'a> !Sync for FontDesc<'a>
impl<'a> Unpin for FontDesc<'a>
impl<'a> UnwindSafe for FontDesc<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more