pub struct FontTweak {
pub scale: f32,
pub y_offset_factor: f32,
pub y_offset: f32,
pub hinting: Option<bool>,
pub hinting_target: HintingTarget,
pub subpixel_binning: Option<bool>,
pub coords: VariationCoords,
pub thin_space_width: f32,
pub tab_size: f32,
}Expand description
Extra scale and vertical tweak to apply to all text of a certain font.
Fields§
§scale: f32Scale the font’s glyphs by this much. this is only a visual effect and does not affect the text layout.
Default: 1.0 (no scaling).
y_offset_factor: f32Shift font’s glyphs downwards by this fraction of the font size (in points). this is only a visual effect and does not affect the text layout.
Affects larger font sizes more.
A positive value shifts the text downwards. A negative value shifts it upwards.
Example value: -0.2.
y_offset: f32Shift font’s glyphs downwards by this amount of logical points. this is only a visual effect and does not affect the text layout.
Affects all font sizes equally.
Example value: 2.0.
hinting: Option<bool>Override the global font hinting setting for this specific font.
None means use the global setting in TextOptions::font_hinting.
hinting_target: HintingTargetHow to grid-fit the glyph outlines when hinting is enabled.
Has no effect when hinting is disabled (see Self::hinting).
subpixel_binning: Option<bool>Override the global sub-pixel binning setting for this specific font.
None means use the global setting in TextOptions::subpixel_binning.
coords: VariationCoordsOverride the font’s default variation coordinates for its axes (“wght”, etc.).
thin_space_width: f32Width of a thin space (\u{2009}) and narrow no-break space (\u{202F}),
as a fraction of the normal space width.
Thin space is often used as a thousands separator: 1 234 567.
Default: 0.5 (half a normal space).
tab_size: f32Width of a tab character (\t), measured in number of space widths.
Default: 4.0.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FontTweak
impl<'de> Deserialize<'de> for FontTweak
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FontTweak, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FontTweak, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for FontTweak
impl Serialize for FontTweak
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for FontTweak
Auto Trait Implementations§
impl Freeze for FontTweak
impl RefUnwindSafe for FontTweak
impl Send for FontTweak
impl Sync for FontTweak
impl Unpin for FontTweak
impl UnsafeUnpin for FontTweak
impl UnwindSafe for FontTweak
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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