Enum tfm::pl::ast::LigTable

source ·
pub enum LigTable {
    Label(SingleValue<LigTableLabel>),
    Lig(PostLigOperation, TupleValue<Char, Char>),
    Kern(TupleValue<Char, Number>),
    Stop(SingleValue<()>),
    Skip(SingleValue<DecimalU8>),
    Comment(String),
}
Expand description

An element of a LIGTABLE property list.

A lig table property list contains elements of four kinds, specifying a program in a simple command language that TeX uses for ligatures and kerns. If several lig table lists appear, they are effectively concatenated into a single list.

The documentation here and on each variant is based on the documentation in PFtoTF.2014.13.

Variants§

§

Label(SingleValue<LigTableLabel>)

A label specifies that the program for the stated character value starts here. The integer must be the number of a character in the font; its CHARACTER property list must not have a NEXTLARGER or VARCHAR field. At least one LIG or KRN step must follow.

LABEL BOUNDARYCHAR means that the program for beginning-of-word ligatures starts here.

§

Lig(PostLigOperation, TupleValue<Char, Char>)

The instruction (LIG c r) means, “If the next character is c, then insert character r and possibly delete the current character and/or c; otherwise go on to the next instruction.” Characters r and c must be present in the font.

The LIG keyword may be immediately preceded or followed by a slash, and then immediately followed by > characters not exceeding the number of slashes. Thus there are eight possible forms:

The slashes specify retention of the left or right original character; the > signs specify passing over the result without further ligature processing.

§

Kern(TupleValue<Char, Number>)

A kern instruction (KRN c r) means, “If the next character is c, then insert a blank space of width r between the current character and c; otherwise go on to the next instruction.” The value of r, which is in design units, is often negative. Character code c must exist in the font.

§

Stop(SingleValue<()>)

A stop instruction ends a ligature/kern program. It must follow either a LIG or KRN instruction, not a LABEL or STOP or SKIP.

§

Skip(SingleValue<DecimalU8>)

A skip instruction specifies continuation of a ligature/kern program after the specified number of LIG or KRN steps has been skipped over. The number of subsequent LIG and KRN instructions must therefore exceed this specified amount.

§

Comment(String)

A comment that is ignored.

Implementations§

source§

impl LigTable

source

pub const LABEL: &'static str = "LABEL"

source

pub const LIG_1: &'static str = "LIG"

source

pub const LIG_2: &'static str = "/LIG"

source

pub const LIG_3: &'static str = "/LIG>"

source

pub const LIG_4: &'static str = "LIG/"

source

pub const LIG_5: &'static str = "LIG/>"

source

pub const LIG_6: &'static str = "/LIG/"

source

pub const LIG_7: &'static str = "/LIG/>"

source

pub const LIG_8: &'static str = "/LIG/>>"

source

pub const KERN: &'static str = "KRN"

source

pub const STOP: &'static str = "STOP"

source

pub const SKIP: &'static str = "SKIP"

source

pub const ALL_PROPERTY_NAMES: &'static [&'static str] = _

source§

impl LigTable

source

pub fn lower(self, char_display_format: CharDisplayFormat) -> Node

Trait Implementations§

source§

impl<'arbitrary> Arbitrary<'arbitrary> for LigTable

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl Debug for LigTable

source§

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

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

impl PartialEq<LigTable> for LigTable

source§

fn eq(&self, other: &LigTable) -> 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 Eq for LigTable

source§

impl StructuralEq for LigTable

source§

impl StructuralPartialEq for LigTable

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, 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.