Skip to main content

FontRef

Struct FontRef 

Source
pub struct FontRef<'a> { /* private fields */ }
Expand description

Borrowed version of Font.

Trait Implementations§

Source§

impl Font for FontRef<'_>

Source§

unsafe fn as_bytes(&self) -> &[u8]

Get the raw font file representation. Read more
Source§

fn is_ascii(&self) -> bool

Check if the font encoding is ASCII.
Source§

fn line_width_ascii(&self, t: &str) -> u32

Calculate width (in pixels) of the given ASCII text. Read more
Source§

fn line_width_utf8(&self, t: &str) -> u32

Calculate width (in pixels) of the given UTF-8 text. Read more
Source§

fn char_width(&self) -> u8

The width (in pixels) of one glyph bounding box.
Source§

fn char_height(&self) -> u8

The height (in pixels) of one glyph (one line) bounding box.
Source§

fn baseline(&self) -> u8

Offset from the top of the glyph bounding box to the baseline.
Source§

impl<'a> From<FileRef<'a>> for FontRef<'a>

Source§

fn from(value: FileRef<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for FontRef<'a>

§

impl<'a> RefUnwindSafe for FontRef<'a>

§

impl<'a> Send for FontRef<'a>

§

impl<'a> Sync for FontRef<'a>

§

impl<'a> Unpin for FontRef<'a>

§

impl<'a> UnsafeUnpin for FontRef<'a>

§

impl<'a> UnwindSafe for FontRef<'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>,

Source§

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>,

Source§

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.