#[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,
pub subpixel_x: u8,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
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.
subpixel_x: u8Which of the SUBPIXEL_BINS
horizontal offsets the bitmap was rasterized at: the glyph’s pen
position fell that many quarters of a pixel past a pixel edge (see
split_subpixel_x).
0 for a glyph drawn at a whole pixel, which is every glyph of a
scaled (unhinted) raster.
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.
Sourcepub fn at_subpixel_x(self, bin: u8) -> Self
pub fn at_subpixel_x(self, bin: u8) -> Self
This key for the bitmap rasterized bin quarters of a pixel to the
right (see split_subpixel_x).
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 Forget for GlyphCacheKey
impl Freeze for GlyphCacheKey
impl Move 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
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
key and return true if they are equal.