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
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 u8
s 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.