pub struct Program {
pub instructions: Vec<Instruction>,
pub left_boundary_char_entrypoint: Option<u16>,
pub right_boundary_char: Option<Char>,
pub passthrough: HashSet<u16>,
}
Expand description
A lig/kern program.
In theory the program also includes entrypoints. However because these are provided in different ways in .tfm and .pl files, it’s easier to exclude them on this type and pass them in when needed.
Fields§
§instructions: Vec<Instruction>
§left_boundary_char_entrypoint: Option<u16>
§right_boundary_char: Option<Char>
§passthrough: HashSet<u16>
Implementations§
source§impl Program
impl Program
pub fn unpack_entrypoint( &mut self, entrypoint: u8 ) -> Result<u16, InvalidEntrypointError>
pub fn pack_entrypoints( &mut self, entrypoints: HashMap<Char, u16> ) -> HashMap<Char, u8>
pub fn unpack_kerns(&mut self) -> Vec<Number>
pub fn pack_kerns(&mut self, kerns: &[Number])
pub fn reachable_iter<I: Iterator<Item = (Char, u16)>>( &self, entrypoints: I ) -> ReachableIter<'_> ⓘ
sourcepub fn instructions_for_entrypoint(
&self,
entrypoint: u16
) -> InstructionsForEntrypointIter<'_> ⓘ
pub fn instructions_for_entrypoint( &self, entrypoint: u16 ) -> InstructionsForEntrypointIter<'_> ⓘ
Iterate over the lig/kern instructions for a specific entrypoint.
pub fn is_seven_bit_safe(&self, entrypoints: HashMap<Char, u16>) -> bool
pub fn validate_and_fix<I, T>( &mut self, smallest_char: Char, entrypoints: I, char_exists: T, kerns: &[Number] ) -> Vec<ValidationWarning>where I: Iterator<Item = (Char, u8)>, T: Fn(Char) -> bool,
Trait Implementations§
source§impl PartialEq<Program> for Program
impl PartialEq<Program> for Program
impl Eq for Program
impl StructuralEq for Program
impl StructuralPartialEq for Program
Auto Trait Implementations§
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more