pub trait CharStringVisitor<T: Debug, E: Error> {
// Provided methods
fn visit(
&mut self,
_op: VisitOp,
_stack: &ArgumentsStack<'_, T>,
) -> Result<(), E> { ... }
fn enter_subr(&mut self, _index: SubroutineIndex) -> Result<(), E> { ... }
fn exit_subr(&mut self) -> Result<(), E> { ... }
fn enter_seac(&mut self, _seac: SeacChar, _dx: T, _dy: T) -> Result<(), E> { ... }
fn exit_seac(&mut self, _seac: SeacChar) -> Result<(), E> { ... }
fn hint_data(&mut self, _op: VisitOp, _hints: &[u8]) -> Result<(), E> { ... }
}Expand description
Trait for types that can be used to traverse a CFF CharString.
Used in conjunction with CharStringVisitorContext. The visitor will receive
a visit call for each operator with its operands. All methods are optional
as they have default no-op implementations.
Provided Methods§
Sourcefn visit(
&mut self,
_op: VisitOp,
_stack: &ArgumentsStack<'_, T>,
) -> Result<(), E>
fn visit( &mut self, _op: VisitOp, _stack: &ArgumentsStack<'_, T>, ) -> Result<(), E>
Called for each operator in the CharString, except for callsubr and callgsubr
— these are handled by enter/exit_subr.
Sourcefn enter_subr(&mut self, _index: SubroutineIndex) -> Result<(), E>
fn enter_subr(&mut self, _index: SubroutineIndex) -> Result<(), E>
Called prior to entering a subroutine.
The index argument indicates the type of subroutine (local/global) and holds its index.
Sourcefn enter_seac(&mut self, _seac: SeacChar, _dx: T, _dy: T) -> Result<(), E>
fn enter_seac(&mut self, _seac: SeacChar, _dx: T, _dy: T) -> Result<(), E>
Called before entering a component of an accented character.
The seac argument indicates if it’s the base or accent character. dx and dy
are the x and y position of the accent character. The same values will be supplied
for both the base and accent.