Enum tfm::ligkern::lang::Operation

source ·
pub enum Operation {
    Kern(Number),
    KernAtIndex(u16),
    Ligature {
        char_to_insert: Char,
        post_lig_operation: PostLigOperation,
        post_lig_tag_invalid: bool,
    },
    EntrypointRedirect(u16, bool),
}
Expand description

A lig/kern operation to perform.

Variants§

§

Kern(Number)

Insert a kern between the current character and the next character.

The variant payload is the size of the kern.

§

KernAtIndex(u16)

Insert a kern between the current character and the next character.

The variant payload is the index of the kern in the kerns array.

§

Ligature

Fields

§char_to_insert: Char

Character to insert.

§post_lig_operation: PostLigOperation

What to do after inserting the character.

§post_lig_tag_invalid: bool

If the tag in the .tfm file was invalid, this will be true. In this case the post_lig_operation will be PostLigOperation::RetainNeitherMoveToInserted.

This field is used in the .tfm validation function to generate a warning for this case. We could also generate a warning in the deserialization code itself but then the ordering of the warning would be incorrect with respect to other validation warnings.

Perform a ligature step. This inserts char_to_insert between the left and right characters, and then performs the post-lig operation.

§

EntrypointRedirect(u16, bool)

If the entrypoint for a character is this operation, go to the instruction indexed by the payload.

This redirect mechanism exists because in .tfm files entrypoints are u8s but lig/kern programs can contain more than 256 instructions.

If this operation is encountered in another situation, it is an unconditional stop.

The boolean value in the payload is true if the boundary character should be serialized inside the instruction.

Trait Implementations§

source§

impl Clone for Operation

source§

fn clone(&self) -> Operation

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 Operation

source§

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

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

impl PartialEq<Operation> for Operation

source§

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

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

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

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

impl Copy for Operation

source§

impl Eq for Operation

source§

impl StructuralEq for Operation

source§

impl StructuralPartialEq for Operation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.