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 modeVariant
FT_LOAD_TARGET_MONOStrong
FT_LOAD_TARGET_NORMALSmooth { lcd_subpixel: None, preserve_linear_metrics: false }
FT_LOAD_TARGET_LCDSmooth { lcd_subpixel: Some(LcdLayout::Horizontal), preserve_linear_metrics: false }
FT_LOAD_TARGET_LCD_VSmooth { 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: bool

If 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

source§

fn clone(&self) -> HintingMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HintingMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for HintingMode

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl PartialEq for HintingMode

source§

fn eq(&self, other: &HintingMode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for HintingMode

source§

impl Eq for HintingMode

source§

impl StructuralPartialEq for HintingMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.