Trait read_fonts::tables::postscript::charstring::CommandSink

source ·
pub trait CommandSink {
    // Required methods
    fn move_to(&mut self, x: Fixed, y: Fixed);
    fn line_to(&mut self, x: Fixed, y: Fixed);
    fn curve_to(
        &mut self,
        cx0: Fixed,
        cy0: Fixed,
        cx1: Fixed,
        cy1: Fixed,
        x: Fixed,
        y: Fixed
    );
    fn close(&mut self);

    // Provided methods
    fn hstem(&mut self, y: Fixed, dy: Fixed) { ... }
    fn vstem(&mut self, x: Fixed, dx: Fixed) { ... }
    fn hint_mask(&mut self, mask: &[u8]) { ... }
    fn counter_mask(&mut self, mask: &[u8]) { ... }
}
Expand description

Trait for processing commands resulting from charstring evaluation.

During processing, the path construction operators (see “4.1 Path Construction Operators” at https://adobe-type-tools.github.io/font-tech-notes/pdfs/5177.Type2.pdf#page=15) are simplified into the basic move, line, curve and close commands.

This also has optional callbacks for processing hint operators. See “4.3 Hint Operators” at https://adobe-type-tools.github.io/font-tech-notes/pdfs/5177.Type2.pdf#page=21 for more detail.

Required Methods§

source

fn move_to(&mut self, x: Fixed, y: Fixed)

source

fn line_to(&mut self, x: Fixed, y: Fixed)

source

fn curve_to( &mut self, cx0: Fixed, cy0: Fixed, cx1: Fixed, cy1: Fixed, x: Fixed, y: Fixed )

source

fn close(&mut self)

Provided Methods§

source

fn hstem(&mut self, y: Fixed, dy: Fixed)

Horizontal stem hint at y with height dy.

source

fn vstem(&mut self, x: Fixed, dx: Fixed)

Vertical stem hint at x with width dx.

source

fn hint_mask(&mut self, mask: &[u8])

Bitmask defining the hints that should be made active for the commands that follow.

source

fn counter_mask(&mut self, mask: &[u8])

Bitmask defining the counter hints that should be made active for the commands that follow.

Implementors§

source§

impl<'a, P> CommandSink for PenSink<'a, P>
where P: Pen,