Enum skrifa::outline::Target

source ·
pub enum Target {
    Mono,
    Smooth {
        mode: SmoothMode,
        symmetric_rendering: bool,
        preserve_linear_metrics: bool,
    },
}
Expand description

Defines the target settings for hinting.

Variants§

§

Mono

Strong hinting style that should only be used for aliased, monochromatic rasterization.

Corresponds to FT_LOAD_TARGET_MONO in FreeType.

§

Smooth

Hinting style that is suitable for anti-aliased rasterization.

Corresponds to the non-monochrome load targets in FreeType. See SmoothMode for more detail.

Fields

§mode: SmoothMode

The basic mode for smooth hinting.

Defaults to SmoothMode::Normal.

§symmetric_rendering: bool

If true, TrueType bytecode may assume that the resulting outline will be rasterized with supersampling in the vertical direction.

When this is enabled, ClearType fonts will often generate wider horizontal stems that may lead to blurry images when rendered with an analytical area rasterizer (such as the one in FreeType).

The effect of this setting is to control the “ClearType symmetric rendering bit” of the TrueType GETINFO instruction. For more detail, see this issue.

FreeType has no corresponding setting and behaves as if this is always enabled.

This only applies to the TrueType interpreter.

Defaults to true.

§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 and behaves as if this is always disabled.

This applies to the TrueType interpreter and the automatic hinter.

Defaults to false.

Trait Implementations§

source§

impl Clone for Target

source§

fn clone(&self) -> Target

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 Target

source§

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

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

impl Default for Target

source§

fn default() -> Self

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

impl From<SmoothMode> for Target

source§

fn from(value: SmoothMode) -> Self

Converts to this type from the input type.
source§

impl From<Target> for HintingOptions

source§

fn from(value: Target) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Target

source§

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

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

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

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

impl Copy for Target

source§

impl Eq for Target

source§

impl StructuralPartialEq for Target

Auto Trait Implementations§

§

impl Freeze for Target

§

impl RefUnwindSafe for Target

§

impl Send for Target

§

impl Sync for Target

§

impl Unpin for Target

§

impl UnwindSafe for Target

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

source§

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>,

source§

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>,

source§

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.