Skip to main content

Typesetter

Struct Typesetter 

Source
pub struct Typesetter<L: FontLoader> { /* private fields */ }
Expand description

Typesets math fragments against one format, keeping the fonts it loaded across fragments.

Implementations§

Source§

impl<L: FontLoader> Typesetter<L>

Source

pub fn new( format: Format, fonts: L, options: Options, ) -> Result<Self, TypesetError>

Rebinds the format’s native fonts through fonts, failing when one cannot be loaded.

Source

pub fn typeset( &mut self, tex: &str, mode: MathMode, boxes: &dyn HostBoxes, ) -> Result<Typeset, TypesetError>

Typesets tex in a sandbox, \hostbox{token} asks boxes for its box.

Source

pub fn fonts(&self) -> &L

The font loader, which hosts use to draw the faces a fragment’s runs name.

Source

pub fn clear_cache(&mut self)

Drops every cached fragment.

Trait Implementations§

Source§

impl<L: FontLoader> Debug for Typesetter<L>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L> !RefUnwindSafe for Typesetter<L>

§

impl<L> !Send for Typesetter<L>

§

impl<L> !Sync for Typesetter<L>

§

impl<L> !UnwindSafe for Typesetter<L>

§

impl<L> Freeze for Typesetter<L>
where L: Freeze,

§

impl<L> Unpin for Typesetter<L>
where L: Unpin,

§

impl<L> UnsafeUnpin for Typesetter<L>
where L: UnsafeUnpin,

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.