pub struct OwnedFace { /* private fields */ }Expand description
An owned font face. swash::FontRef only ever BORROWS a byte slice —
it’s not meant to be stored long-term — so we keep the bytes ourselves
and reconstruct a FontRef on demand via [Self::as_ref], preserving
offset/key exactly as swash’s own doc comment on FontRef
recommends (a fresh FontRef::from_index call on every access would
mint a new CacheKey each time and defeat swash’s internal caching).
Implementations§
Source§impl OwnedFace
impl OwnedFace
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Load an in-memory face at wght: 400 if variable — the right
default for icon fonts (icon.rs’s own bundled Material Symbols
face is itself variable, “FILL 0, wght 400” being its documented
intended default instance) and any other single-weight custom face.
Auto Trait Implementations§
impl Freeze for OwnedFace
impl RefUnwindSafe for OwnedFace
impl Send for OwnedFace
impl Sync for OwnedFace
impl Unpin for OwnedFace
impl UnsafeUnpin for OwnedFace
impl UnwindSafe for OwnedFace
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