pub struct FontSource {
pub bytes: Vec<u8>,
pub family: String,
pub name: String,
pub style: String,
pub declared: Option<FaceAttributes>,
}Expand description
A font entering the engine: raw bytes and the identity the style tree matched against.
Bytes are opaque here — layout never decodes images or fonts twice; decoding happens once, at registration.
Fields§
§bytes: Vec<u8>The full font file (TTF/OTF). Registry-owned; callers hand over a copy.
family: StringFamily name for matching (lowercase, e.g. “eb garamond”).
name: StringFace name (name id 4), e.g. “EB Garamond Regular”.
style: StringStyle name (name id 2), e.g. “Regular”.
declared: Option<FaceAttributes>What a stylesheet declared this face to be, overriding what the file says about itself. A declared identity also pins registration to the file’s default instance: a sheet naming one slope and one weight is not describing a variable family’s five.
Implementations§
Source§impl FontSource
impl FontSource
Trait Implementations§
Source§impl Clone for FontSource
impl Clone for FontSource
Source§fn clone(&self) -> FontSource
fn clone(&self) -> FontSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FontSource
impl RefUnwindSafe for FontSource
impl Send for FontSource
impl Sync for FontSource
impl Unpin for FontSource
impl UnsafeUnpin for FontSource
impl UnwindSafe for FontSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.