pub struct SmoothHinting {
pub light: bool,
pub symmetric_rendering: bool,
pub preserve_linear_metrics: bool,
}Expand description
Tuning for HintingTarget::Smooth, mirroring skrifa’s Target::Smooth.
Fields§
§light: boolHint only lightly: snap stems vertically but leave horizontal shapes
alone (FreeType’s “light” mode). Preserves the font’s proportions
better, at the cost of a little horizontal sharpness.
false uses the “normal” mode, which also fits horizontally.
Maps to SmoothMode::Light (true) vs SmoothMode::Normal (false).
symmetric_rendering: boolRender a glyph the same way regardless of its sub-pixel position.
true makes glyphs position-independent (better for caching and
animation), but a font’s instructions may then widen stems and look
slightly blurrier under an analytic rasterizer like egui’s.
Only affects fonts hinted via the TrueType interpreter (i.e. fonts
that ship their own instructions). It has no effect on the auto-hinter.
Mirrors Target::Smooth { symmetric_rendering }.
preserve_linear_metrics: boolKeep advance widths independent of hinting (don’t grid-fit horizontally in a way that changes spacing).
true keeps inter-glyph spacing identical to the unhinted font, so
layout never depends on hinting — but it also prevents horizontal
grid-fitting, leaving vertical stems softer on low-dpi screens.
false lets the (auto)hinter snap horizontally for crisper stems.
egui positions glyphs from the shaper’s advances, not the hinted
outline, so this mainly affects sharpness here, not layout.
Mirrors Target::Smooth { preserve_linear_metrics }.
Trait Implementations§
Source§impl Clone for SmoothHinting
impl Clone for SmoothHinting
Source§fn clone(&self) -> SmoothHinting
fn clone(&self) -> SmoothHinting
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more