Glyph

Struct Glyph 

Source
#[non_exhaustive]
pub struct Glyph<T> { pub user_data: T, pub codepoint: char, pub rotated: bool, pub left: f32, pub right: f32, pub bottom: f32, pub top: f32, pub tex_left: f32, pub tex_right: f32, pub tex_top: f32, pub tex_bottom: f32, }
Expand description

Metadata for a glyph that was rendered in an asset.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§user_data: T

The user_data from the GlyphRequest.

§codepoint: char

The codepoint that was rendered.

§rotated: bool

Whether rotation was applied when this glyph was packed.

§left: f32

The relative left edge of a bounding box from the glyph’s 0 position that will position the resulting SDF so that the middle distance describes a character as specified by the font.

§right: f32

The relative right edge of a bounding box from the glyph’s 0 position that will position the resulting SDF so that the middle distance describes a character as specified by the font.

§bottom: f32

The relative bottom edge of a bounding box from the glyph’s 0 position that will position the resulting SDF so that the middle distance describes a character as specified by the font.

§top: f32

The relative top edge of a bounding box from the glyph’s 0 position that will position the resulting SDF so that the middle distance describes a character as specified by the font.

§tex_left: f32

The left edge of the rendered glyph as a texture coordinate

§tex_right: f32

The right edge of the rendered glyph as a texture coordinate

§tex_top: f32

The top edge of the rendered glyph as a texture coordinate

§tex_bottom: f32

The bottom edge of the rendered glyph as a texture coordinate

Trait Implementations§

Source§

impl<T: Clone> Clone for Glyph<T>

Source§

fn clone(&self) -> Glyph<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Glyph<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Copy> Copy for Glyph<T>

Auto Trait Implementations§

§

impl<T> Freeze for Glyph<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Glyph<T>
where T: RefUnwindSafe,

§

impl<T> Send for Glyph<T>
where T: Send,

§

impl<T> Sync for Glyph<T>
where T: Sync,

§

impl<T> Unpin for Glyph<T>
where T: Unpin,

§

impl<T> UnwindSafe for Glyph<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.