Struct tfm::pl::File

source ·
pub struct File {
    pub header: Header,
    pub design_units: Number,
    pub char_dimens: BTreeMap<Char, CharDimensions>,
    pub char_tags: BTreeMap<Char, CharTag>,
    pub unset_char_tags: BTreeMap<Char, u8>,
    pub lig_kern_program: Program,
    pub params: Vec<Number>,
    pub additional_widths: Vec<Number>,
    pub additional_heights: Vec<Number>,
    pub additional_depths: Vec<Number>,
    pub additional_italics: Vec<Number>,
}
Expand description

Complete contents of a property list (.pl) file.

Fields§

§header: Header§design_units: Number§char_dimens: BTreeMap<Char, CharDimensions>§char_tags: BTreeMap<Char, CharTag>§unset_char_tags: BTreeMap<Char, u8>

Tags that have been unset, but whose discriminant is still written to a .tfm file by PLtoTF.

§lig_kern_program: Program§params: Vec<Number>§additional_widths: Vec<Number>

Additional widths that appear in the plst file but not appear in the fully parsed file.

This can happen due to the following plst listing:

(CHARACTER C X (CHARWD D 8.0))
(CHARACTER C X (CHARWD D 9.0))

In this case the width 8.0 is not in the fully parsed file because it is overwritten by 9.0. However pltotf still writes the 8.0 width to the .tfm file.

§additional_heights: Vec<Number>

Additional heights; similar to additional widths.

§additional_depths: Vec<Number>

Additional depths; similar to additional widths.

§additional_italics: Vec<Number>

Additional italic corrections; similar to additional widths.

Implementations§

source§

impl File

source

pub fn from_pl_source_code(source: &str) -> (File, Vec<ParseWarning>)

Build a File from PL source code.

source

pub fn lig_kern_entrypoints(&self, include_orphans: bool) -> HashMap<Char, u16>

Return a map from characters to the lig/kern entrypoint for that character.

source

pub fn clear_lig_kern_data(&mut self)

Clear all lig/kern data from the file.

source

pub fn from_ast(ast: Ast, errors: &mut Vec<ParseWarning>) -> File

Build a File from an AST.

source§

impl File

source

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

Lower a File to an AST.

source

pub fn display( &self, indent: usize, char_display_format: CharDisplayFormat ) -> Display<'_>

Display this file.

This function returns a helper type that implements the std::fmt::Display trait and can be used in print! and similar macros.

Trait Implementations§

source§

impl Debug for File

source§

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

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

impl Default for File

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<File> for File

source§

fn from(pl_file: File) -> Self

Converts to this type from the input type.
source§

impl From<File> for File

source§

fn from(tfm_file: File) -> Self

Converts to this type from the input type.
source§

impl PartialEq<File> for File

source§

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

source§

impl StructuralEq for File

source§

impl StructuralPartialEq for File

Auto Trait Implementations§

§

impl RefUnwindSafe for File

§

impl Send for File

§

impl Sync for File

§

impl Unpin for File

§

impl UnwindSafe for File

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.