pub struct Style {
pub italic: bool,
pub weight: u16,
}Expand description
Font selection / synthesis request. Carried through the shaper.
Fields§
§italic: boolCaller wants italic. If the underlying face is already italic
(Face::italic_angle() is non-zero), no synthesis is applied —
the font already provides the slant. If the face is upright,
the consumer applies a horizontal shear of
tan(-DEFAULT_SYNTHETIC_ITALIC_DEG) (~12° forward slant) at
outline-flatten time.
weight: u16OpenType usWeightClass value (100..=1000). Consumed by
downstream rasterizers wanting to synthesise bold; the shaper
itself doesn’t apply it (true bold should always come from a
real Bold face when one is available).
Implementations§
Source§impl Style
impl Style
Sourcepub fn regular() -> Self
pub fn regular() -> Self
Upright, regular weight — same as Style::REGULAR. Convenience
for symmetry with italic().
Sourcepub fn with_italic(self, italic: bool) -> Self
pub fn with_italic(self, italic: bool) -> Self
Builder: set the italic flag.
Sourcepub fn with_weight(self, weight: u16) -> Self
pub fn with_weight(self, weight: u16) -> Self
Builder: set the weight (clamped to 1..=1000 to keep the cache key well-defined; OpenType allows 100..=1000 in 100 increments but variable fonts can land any integer in between).