Skip to main content

MathElement

Enum MathElement 

Source
pub enum MathElement {
    Char {
        class: MathKind,
        big: bool,
        chars: String,
    },
    CharWithKern {
        class: MathKind,
        big: bool,
        chars: String,
        kern_l: Box<Value>,
        kern_r: Box<Value>,
    },
    EmbeddedText {
        class: MathKind,
        body: Box<Value>,
    },
    VariantChar {
        class: MathKind,
        big: bool,
        style: Box<MathVariantStyle>,
    },
    VariantCharPending(String),
    EmbeddedBoxes {
        class: MathKind,
        boxes: Vec<HorzBox>,
    },
}
Expand description

The base-atom payload of Math::Pure — mirrors upstream math_element_main (types.cppo.ml:1009), flattened (the math-class lives directly on each variant here, rather than in a separate wrapping MathElement(kind, math_char_main) layer) since nothing else needs the undecorated math_char_main on its own.

Variants§

§

Char

math-char / math-big-char: a run of math characters, one atom. big selects the large-operator size class (\sum/\int-style; layout does not yet upscale it).

Fields

§class: MathKind
§big: bool
§chars: String
§

CharWithKern

math-char-with-kern / math-big-char-with-kern: like Char, plus opaque left/right kern-function closures (each length -> length -> length, fontsize/y-position -> kern amount; \int’s italic-correction kern is the motivating case). Not yet consulted by layout.

Fields

§class: MathKind
§big: bool
§chars: String
§kern_l: Box<Value>
§kern_r: Box<Value>
§

EmbeddedText

text-in-math (\text, \cases): an embedded context -> inline-boxes closure, carried opaquely — the box it eventually produces isn’t yet nestable into a math run’s glyph model, so this is stored faithfully but not rendered.

Fields

§class: MathKind
§body: Box<Value>
§

VariantChar

math-variant-char (primitives.cppo.ml’s MathVariantCharDirect) — one atom with a per-style codepoint set (Greek letters, math. satyh’s greek-lowercase/greek-uppercase). big mirrors Char’s (unused upstream for variant chars in practice, kept for shape parity).

Fields

§class: MathKind
§big: bool
§

VariantCharPending(String)

One MATHCHAR token from a ${…} literal, not yet resolved to a MathKind/codepoint — reflect_math_elem’s MathElem::Chars arm pushes exactly one of these per token, deferring both the whole-token class-map lookup and the per-char variant remap to layout time, where the current Context::font/math_char_class are available to metrics-probe the remap (resolve_variant_char).

§

EmbeddedBoxes

V0_1 only: embed-inline-to-math’s payload — already-evaluated inline boxes carrying an explicit math class. Contrast EmbeddedText’s 0.0.6 closure (evaluated lazily at layout time under a context); this is eager, already-materialized data, matching upstream’s embed_inline_to_math (which has no context to re-apply a closure under). Layout: the same stand-in rendering path EmbeddedText gets — math_glyphs_of_inline_boxes over boxes directly, no closure application.

Fields

§class: MathKind
§boxes: Vec<HorzBox>

Trait Implementations§

Source§

impl Clone for MathElement

Source§

fn clone(&self) -> MathElement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MathElement

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Clone for T
where T: Clone,

Source§

fn clone(&self) -> T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Debug for T
where T: Debug,

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V