#[repr(C)]pub struct GpuGlyph {
pub bounds: [f32; 4],
pub uv_bounds: [f32; 4],
pub color: [f32; 4],
pub clip_bounds: [f32; 4],
pub clip_fade: [f32; 4],
pub flags: [f32; 4],
}Expand description
A GPU text glyph instance (matches shader GlyphInstance struct)
Memory layout:
- bounds:
vec4<f32>(16 bytes) - position and size - uv_bounds:
vec4<f32>(16 bytes) - UV coordinates in atlas - color:
vec4<f32>(16 bytes) - text color - clip_bounds:
vec4<f32>(16 bytes) - clip region (x, y, width, height) - clip_fade:
vec4<f32>(16 bytes) - overflow fade distances (top, right, bottom, left) Total: 96 bytes
Fields§
§bounds: [f32; 4]Position and size (x, y, width, height)
uv_bounds: [f32; 4]UV coordinates in atlas (u_min, v_min, u_max, v_max)
color: [f32; 4]Text color (RGBA)
clip_bounds: [f32; 4]Clip bounds (x, y, width, height) - set to large values for no clip
clip_fade: [f32; 4]Overflow fade distances (top, right, bottom, left) in pixels
flags: [f32; 4]Flags: [is_color, unused, unused, unused] is_color: 1.0 for color emoji (use color atlas), 0.0 for grayscale (use main atlas)
Implementations§
Trait Implementations§
impl Copy for GpuGlyph
impl Pod for GpuGlyph
Auto Trait Implementations§
impl Freeze for GpuGlyph
impl RefUnwindSafe for GpuGlyph
impl Send for GpuGlyph
impl Sync for GpuGlyph
impl Unpin for GpuGlyph
impl UnsafeUnpin for GpuGlyph
impl UnwindSafe for GpuGlyph
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.