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).
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.
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.
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).
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.
Trait Implementations§
Source§impl Clone for MathElement
impl Clone for MathElement
Source§fn clone(&self) -> MathElement
fn clone(&self) -> MathElement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MathElement
impl !Send for MathElement
impl !Sync for MathElement
impl !UnwindSafe for MathElement
impl Freeze for MathElement
impl Unpin for MathElement
impl UnsafeUnpin for MathElement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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