pub struct GlyphKey {
pub font: u64,
pub glyph: u16,
pub size: u16,
pub subpixel: u8,
}Expand description
What identifies a glyph in the atlas.
A font identifier alongside the glyph index, because glyph indices are per font and two fonts will disagree about what index seven means. Size is in whole pixels: a cache keyed by a float would miss on values that differ only in their last bit, and rasterizing at a rounded size is what a caller is doing anyway.
subpixel is the fractional position the coverage was rasterized at, as
the caller buckets it: the same glyph a quarter of a pixel along is
different coverage, and Impeller keys its atlas the same way, by a quarter
across and a quarter down. The atlas only tells buckets apart; what one
means, and placing the glyph to match, is the caller’s. Zero for a glyph
rasterized on a whole pixel.
Fields§
§font: u64§glyph: u16§size: u16§subpixel: u8Implementations§
Trait Implementations§
impl Copy for GlyphKey
impl Eq for GlyphKey
Source§impl Ord for GlyphKey
impl Ord for GlyphKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for GlyphKey
impl PartialOrd for GlyphKey
impl StructuralPartialEq for GlyphKey
Auto Trait Implementations§
impl Forget for GlyphKey
impl Freeze for GlyphKey
impl Move for GlyphKey
impl RefUnwindSafe for GlyphKey
impl Send for GlyphKey
impl Sync for GlyphKey
impl Unpin for GlyphKey
impl UnsafeUnpin for GlyphKey
impl UnwindSafe for GlyphKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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