Enum skrifa::outline::HintingMode
source · pub enum HintingMode {
Strong,
Smooth {
lcd_subpixel: Option<LcdLayout>,
preserve_linear_metrics: bool,
},
}Expand description
Modes that control hinting when using embedded instructions.
Only the TrueType interpreter supports all hinting modes.
§FreeType compatibility
The following table describes how to map FreeType hinting modes:
| FreeType mode | Variant |
|---|---|
| FT_LOAD_TARGET_MONO | Strong |
| FT_LOAD_TARGET_NORMAL | Smooth { lcd_subpixel: None, preserve_linear_metrics: false } |
| FT_LOAD_TARGET_LCD | Smooth { lcd_subpixel: Some(LcdLayout::Horizontal), preserve_linear_metrics: false } |
| FT_LOAD_TARGET_LCD_V | Smooth { lcd_subpixel: Some(LcdLayout::Vertical), preserve_linear_metrics: false } |
Note: FT_LOAD_TARGET_LIGHT is equivalent to FT_LOAD_TARGET_NORMAL since
FreeType 2.7.
The default value of this type is equivalent to FT_LOAD_TARGET_NORMAL.
Variants§
Strong
Strong hinting mode that should only be used for aliased, monochromatic rasterization.
Corresponds to FT_LOAD_TARGET_MONO in FreeType.
Smooth
Fields
lcd_subpixel: Option<LcdLayout>If set, enables support for optimized hinting that takes advantage
of subpixel layouts in LCD displays and corresponds to
FT_LOAD_TARGET_LCD or FT_LOAD_TARGET_LCD_V in FreeType.
If unset, corresponds to FT_LOAD_TARGET_NORMAL in FreeType.
preserve_linear_metrics: boolIf true, prevents adjustment of the outline in the horizontal direction and preserves inter-glyph spacing.
This is useful for performing layout without concern that hinting will modify the advance width of a glyph. Specifically, it means that layout will not require evaluation of glyph outlines.
FreeType has no corresponding setting.
Lighter hinting mode that is intended for anti-aliased rasterization.
Trait Implementations§
source§impl Clone for HintingMode
impl Clone for HintingMode
source§fn clone(&self) -> HintingMode
fn clone(&self) -> HintingMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for HintingMode
impl Debug for HintingMode
source§impl Default for HintingMode
impl Default for HintingMode
source§impl PartialEq for HintingMode
impl PartialEq for HintingMode
source§fn eq(&self, other: &HintingMode) -> bool
fn eq(&self, other: &HintingMode) -> bool
self and other values to be equal, and is used
by ==.