pub struct MemoryFace {
pub font_match: FontMatch,
pub weight: FcWeight,
pub italic: bool,
pub oblique: bool,
pub stretch: FcStretch,
pub weight_axis: Option<(f32, f32)>,
}Expand description
One in-memory face registered under a family name, with the style attributes
needed to choose the right face for a CSS (weight, italic/oblique) query.
FontManager::register_named_font registers several faces under the same
family name (e.g. Helvetica regular, bold, oblique). Keying
FontManager::memory_families by family alone therefore collapsed them —
the last registration won and font-weight: bold silently rendered in the
regular face. Each face now records its own weight/style so resolution can
pick the closest one (see getters::split_memory_matches).
Fields§
§font_match: FontMatchThe FontMatch the resolver emits when this face is chosen.
weight: FcWeightOS/2 weight of this face (static fonts). For a variable font this is the
default-instance weight; weight_axis carries the selectable range.
italic: boolhead/OS-2 italic bit.
oblique: boolOS/2 oblique bit.
stretch: FcStretchOS/2 width class.
weight_axis: Option<(f32, f32)>For a variable font, the wght axis (min, max) in user units; None
for a static face. Lets a single VF satisfy any requested weight.
Trait Implementations§
Source§impl Clone for MemoryFace
impl Clone for MemoryFace
Source§fn clone(&self) -> MemoryFace
fn clone(&self) -> MemoryFace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MemoryFace
impl RefUnwindSafe for MemoryFace
impl Send for MemoryFace
impl Sync for MemoryFace
impl Unpin for MemoryFace
impl UnsafeUnpin for MemoryFace
impl UnwindSafe for MemoryFace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more