pub struct FontTweak {
pub scale: f32,
pub y_offset_factor: f32,
pub y_offset: f32,
pub baseline_offset_factor: f32,
}
Expand description
Extra scale and vertical tweak to apply to all text of a certain font.
Fields§
§scale: f32
Scale 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: f32
Shift 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: f32
Shift 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
.
baseline_offset_factor: f32
When using this font’s metrics to layout a row, shift the entire row downwards by this fraction of the font size (in points).
A positive value shifts the text downwards. A negative value shifts it upwards.
Trait Implementations§
impl Copy for FontTweak
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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)