Skip to main content

Hinter

Trait Hinter 

Source
pub trait Hinter<C: PointCoord> {
    // Required method
    fn hint(&mut self, zone: &mut GlyphZone<'_, C>) -> Result<(), HintError>;

    // Provided methods
    fn backward_compatibility(&self) -> bool { ... }
    fn round_composite_x_offset(&self) -> bool { ... }
}
Expand description

Receives each instructed glyph from OutlinePlan::load.

Required Methods§

Source

fn hint(&mut self, zone: &mut GlyphZone<'_, C>) -> Result<(), HintError>

Hints one glyph.

A failure stops the load, which reports it as Error::InvalidOperation. A hinter that wants the detail keeps the HintError itself. The hinter decides whether a failure is fatal: returning Ok carries on with the points as the program left them.

Provided Methods§

Source

fn backward_compatibility(&self) -> bool

Whether backward compatibility mode is active, which affects phantom point rounding even for a glyph with no instructions.

Source

fn round_composite_x_offset(&self) -> bool

Returns whether to round the horizontal offset of a component to the pixel grid.

This applies to composite components with the ROUND_XY_TO_GRID flag. If true, the horizontal offset is rounded along with the vertical one. Otherwise, only the vertical offset is rounded. Defaults to false.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§