pub struct TextShapingStyle {
pub font: Option<FontId>,
pub weight: Option<FontWeight>,
pub slant: Option<TextSlant>,
pub letter_spacing_em: Option<f32>,
pub features: Vec<TextFontFeatureSetting>,
pub axes: Vec<TextFontAxisSetting>,
}Fields§
§font: Option<FontId>§weight: Option<FontWeight>§slant: Option<TextSlant>§letter_spacing_em: Option<f32>§features: Vec<TextFontFeatureSetting>Explicit OpenType feature overrides (best-effort).
This is intended for editor-grade text surfaces (e.g. ligature policy in code) and diagnostics. Callers should treat this as best-effort: if the resolved face does not support a requested tag, it will be ignored by shaping backends.
axes: Vec<TextFontAxisSetting>Explicit variable font axis overrides.
This is an advanced surface intended for code editors and diagnostics. Callers should treat this as best-effort: if the requested axis is not supported by the resolved font face, it will be ignored by the shaping backend.
Implementations§
Source§impl TextShapingStyle
impl TextShapingStyle
pub fn with_font(self, font: FontId) -> Self
pub fn with_weight(self, weight: FontWeight) -> Self
pub fn with_slant(self, slant: TextSlant) -> Self
pub fn with_letter_spacing_em(self, letter_spacing_em: f32) -> Self
pub fn with_axis(self, tag: impl Into<String>, value: f32) -> Self
pub fn with_feature(self, tag: impl Into<String>, value: u32) -> Self
Trait Implementations§
Source§impl Clone for TextShapingStyle
impl Clone for TextShapingStyle
Source§fn clone(&self) -> TextShapingStyle
fn clone(&self) -> TextShapingStyle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextShapingStyle
impl Debug for TextShapingStyle
Source§impl Default for TextShapingStyle
impl Default for TextShapingStyle
Source§fn default() -> TextShapingStyle
fn default() -> TextShapingStyle
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TextShapingStyle
impl<'de> Deserialize<'de> for TextShapingStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TextShapingStyle
impl PartialEq for TextShapingStyle
Source§impl Serialize for TextShapingStyle
impl Serialize for TextShapingStyle
impl StructuralPartialEq for TextShapingStyle
Auto Trait Implementations§
impl Freeze for TextShapingStyle
impl RefUnwindSafe for TextShapingStyle
impl Send for TextShapingStyle
impl Sync for TextShapingStyle
impl Unpin for TextShapingStyle
impl UnsafeUnpin for TextShapingStyle
impl UnwindSafe for TextShapingStyle
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