pub struct Glyph {
pub uv_min: [f32; 2],
pub uv_max: [f32; 2],
pub size_px: [f32; 2],
pub offset_px: [f32; 2],
pub advance_px: f32,
}Expand description
UV layout and metrics for a glyph in the atlas.
§Examples
use ailloli_ui_render_wgpu::text::Glyph;
let glyph = Glyph { uv_min: [0.0, 0.0], uv_max: [0.5, 0.5],
size_px: [8.0, 10.0], offset_px: [1.0, -2.0], advance_px: 0.0 };
assert_eq!(glyph.size_px, [8.0, 10.0]);Fields§
§uv_min: [f32; 2]Inclusive lower UV corner in normalized atlas coordinates.
uv_max: [f32; 2]Exclusive upper UV corner in normalized atlas coordinates.
size_px: [f32; 2]Raster bitmap width and height in physical pixels.
offset_px: [f32; 2]Bitmap offset from the physical glyph pen position.
advance_px: f32Reserved advance in physical pixels; currently zero because layout owns advance.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnwindSafe for Glyph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.
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