#[non_exhaustive]pub struct GlyphCacheKey {
pub font_face_id: FontFaceId,
pub glyph_id: u16,
pub size_bits: u32,
pub weight: u32,
pub hinted: bool,
pub italic: bool,
}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.font_face_id: FontFaceId§glyph_id: u16§size_bits: u32§weight: u32Font weight (variation axis) so that e.g. Inter Regular and Inter
Bold produce separate cache entries even though they share the
same font_face_id and glyph_id in a variable font.
hinted: boolWhether the bitmap was rasterized with hinting. Rasters produced
under a raster scale (zoomed content) are unhinted, and the same
physical size can be reached both ways — 7px at raster_scale 2
and 14px at raster_scale 1 share size_bits but must not share
a bitmap.
italic: boolWhether the text asks for italic: an upright face is rasterized
slanted for it (see crate::font::synthesis), and the slanted bitmap
must not stand in for the upright one.
Implementations§
Source§impl GlyphCacheKey
impl GlyphCacheKey
pub fn new(font_face_id: FontFaceId, glyph_id: u16, size_px: f32) -> Self
pub fn with_weight( font_face_id: FontFaceId, glyph_id: u16, size_px: f32, weight: u32, hinted: bool, ) -> Self
Sourcepub fn with_style(
font_face_id: FontFaceId,
glyph_id: u16,
size_px: f32,
weight: u32,
hinted: bool,
italic: bool,
) -> Self
pub fn with_style( font_face_id: FontFaceId, glyph_id: u16, size_px: f32, weight: u32, hinted: bool, italic: bool, ) -> Self
with_weight for text that asks for italic when
italic.
Trait Implementations§
Source§impl Clone for GlyphCacheKey
impl Clone for GlyphCacheKey
impl Copy for GlyphCacheKey
Source§impl Debug for GlyphCacheKey
impl Debug for GlyphCacheKey
impl Eq for GlyphCacheKey
Source§impl Hash for GlyphCacheKey
impl Hash for GlyphCacheKey
Source§impl PartialEq for GlyphCacheKey
impl PartialEq for GlyphCacheKey
impl StructuralPartialEq for GlyphCacheKey
Auto Trait Implementations§
impl Freeze for GlyphCacheKey
impl RefUnwindSafe for GlyphCacheKey
impl Send for GlyphCacheKey
impl Sync for GlyphCacheKey
impl Unpin for GlyphCacheKey
impl UnsafeUnpin for GlyphCacheKey
impl UnwindSafe for GlyphCacheKey
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.