Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }
Expand description

The layout engine: a face roster plus the calibrated math constants.

Implementations§

Source§

impl Engine

Source

pub fn new(faces: FaceSet) -> Self

Build an engine over a face roster with the CM constants.

Source

pub fn bundled() -> Result<Self, FontError>

The engine over the bundled sovereign face set.

§Errors

Propagates a bundled-face parse failure (build corruption).

Source

pub fn faces(&self) -> &FaceSet

The face roster.

Source

pub fn constants(&self) -> &MathConstants

The math constants in force.

Source

pub fn typeset(&self, source: &str, style: Style) -> Result<Layout, MathError>

Typeset a math-mode string at the given outer style.

§Errors

Parse errors pass through; layout adds MathError::UnmappedChar for characters no face covers and named layout-pending errors for the extensions bead’s constructs.

Source

pub fn typeset_text(&self, source: &str) -> Result<Layout, MathError>

Typeset a TexText-contract string (text mainland + math islands).

§Errors

As Engine::typeset.

Source

pub fn typeset_with_macros( &self, source: &str, style: Style, macros: &MacroSet, ) -> Result<Layout, MathError>

Engine::typeset, against a macro set (a preamble pack and/or caller definitions).

§Errors

As Engine::typeset, plus the macro-expansion errors.

Source

pub fn typeset_text_with_macros( &self, source: &str, macros: &MacroSet, ) -> Result<Layout, MathError>

Engine::typeset_text, against a macro set.

§Errors

As Engine::typeset_with_macros.

Auto Trait Implementations§

§

impl !Freeze for Engine

§

impl !RefUnwindSafe for Engine

§

impl !Sync for Engine

§

impl Send for Engine

§

impl Unpin for Engine

§

impl UnsafeUnpin for Engine

§

impl UnwindSafe for Engine

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.