read_fonts::tables::postscript::charstring

Trait 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§