pub struct CacheKey {
pub text_hash: u64,
pub font_cache_key: u64,
pub font_size: u32,
pub weight: u16,
pub stretch: u16,
pub style: u8,
pub direction: u8,
pub letter_spacing: i32,
pub word_spacing: i32,
}Expand description
Deterministic cache key for shaped text.
Uses font swash::CacheKey (u64) which is derived from font data identity, not fontdb::ID which uses slotmap and differs across processes.
Fields§
§text_hash: u64Hash of the text content.
font_cache_key: u64Font swash cache key (identifies font data uniquely).
font_size: u32Font size in pixels (quantized to 0.5px steps for cache friendliness).
weight: u16Font weight.
stretch: u16Font stretch raw value.
style: u8Font style discriminant.
direction: u8Direction: 0 = LTR, 1 = RTL.
letter_spacing: i32Letter spacing (quantized to 1/100px).
word_spacing: i32Word spacing (quantized to 1/100px).
Implementations§
Trait Implementations§
impl Copy for CacheKey
impl Eq for CacheKey
impl StructuralPartialEq for CacheKey
Auto Trait Implementations§
impl Freeze for CacheKey
impl RefUnwindSafe for CacheKey
impl Send for CacheKey
impl Sync for CacheKey
impl Unpin for CacheKey
impl UnsafeUnpin for CacheKey
impl UnwindSafe for CacheKey
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