Struct fea_rs::compile::Compilation

source ·
pub struct Compilation {
    pub warnings: Vec<Diagnostic>,
    pub head: Option<Head>,
    pub hhea: Option<Hhea>,
    pub vhea: Option<Vhea>,
    pub os2: Option<Os2>,
    pub gdef: Option<Gdef>,
    pub base: Option<Base>,
    pub name: Option<Name>,
    pub stat: Option<Stat>,
    pub gsub: Option<Gsub>,
    pub gpos: Option<Gpos>,
}
Expand description

The tables generated by this compilation.

All tables are optional, and the set of tables that are present depends on the input file.

Each table is a type defined in the [write-fonts][] crate. The caller may either interact with these directly, or else they may use the to_binary method to generate a binary font.

Fields§

§warnings: Vec<Diagnostic>

Any warnings encountered during parsing or compilation

§head: Option<Head>

The head table, if one was generated

§hhea: Option<Hhea>

The hhea table, if one was generated

§vhea: Option<Vhea>

The vhea table, if one was generated

§os2: Option<Os2>

The OS/2 table, if one was generated

§gdef: Option<Gdef>

The GDEF table, if one was generated

§base: Option<Base>

The BASE table, if one was generated

§name: Option<Name>

The name table, if one was generated

§stat: Option<Stat>

The STAT table, if one was generated

§gsub: Option<Gsub>

The GSUB table, if one was generated

§gpos: Option<Gpos>

The GPOS table, if one was generated

Implementations§

source§

impl Compilation

source

pub fn to_font_builder(&self) -> Result<FontBuilder<'_>, BinaryCompilationError>

Assemble the output tables into a FontBuilder.

This is a convenience method. To compile a binary font you can use to_binary instead, and for more fine-grained control you can inspect and manipulate the raw tables directly.

source

pub fn to_binary( &self, glyph_map: &GlyphMap, opts: Opts ) -> Result<Vec<u8>, BinaryCompilationError>

Compile the output tables into a font.

This is a convenience method used for things like testing; if you are building a font compiler you will probably prefer to manipulate the generated tables directly.

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<U, T> ToOwnedObj<U> for Twhere U: FromObjRef<T>,

source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
source§

impl<U, T> ToOwnedTable<U> for Twhere U: FromTableRef<T>,

source§

fn to_owned_table(&self) -> U

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.