pub enum BoxContent {
Empty,
Rule,
Glyph {
ch: char,
glyph_id: u16,
},
HList(Vec<MathBox>),
VList(Vec<MathBox>),
Kern(Dim),
Color(Color, Box<MathBox>),
BackColor(Color, Box<MathBox>),
Overlap(Vec<MathBox>),
Line {
x1: Dim,
y1: Dim,
x2: Dim,
y2: Dim,
thickness: Dim,
},
Frame {
thickness: Dim,
stroke: Option<Color>,
inner: Box<MathBox>,
},
}Expand description
What a box contains.
Glyphs carry an OpenType id from the math face. Lists compose children.
Color wrappers do not change dimensions. BoxContent::Line and
BoxContent::Frame are decorations from cancel / boxed constructs.
Variants§
Empty
Empty box (strut or placeholder).
Rule
Solid rule (fraction bar, vinculum). No glyph.
Glyph
A single character whose metrics came from the math font.
HList(Vec<MathBox>)
Horizontal list. Width is the sum of children.
VList(Vec<MathBox>)
Vertical list. Height/depth stack on the baseline of the first box.
Kern(Dim)
Horizontal kern (atom spacing, \hspace).
Color(Color, Box<MathBox>)
Color wrapper. Dimensions match the inner box. Sets SVG fill.
BackColor(Color, Box<MathBox>)
Background color (\colorbox). Inner glyphs keep the default fill.
Overlap(Vec<MathBox>)
Children share the left edge; each child’s MathBox::shift is its baseline.
Line
Diagonal or free line in em, relative to the box left and baseline (y up).
Fields
Frame
Stroked rectangle around the inner box. Inner is laid out at the same origin.
Trait Implementations§
Source§impl Clone for BoxContent
impl Clone for BoxContent
Source§fn clone(&self) -> BoxContent
fn clone(&self) -> BoxContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoxContent
impl Debug for BoxContent
impl Eq for BoxContent
Source§impl PartialEq for BoxContent
impl PartialEq for BoxContent
impl StructuralPartialEq for BoxContent
Auto Trait Implementations§
impl Freeze for BoxContent
impl RefUnwindSafe for BoxContent
impl Send for BoxContent
impl Sync for BoxContent
impl Unpin for BoxContent
impl UnsafeUnpin for BoxContent
impl UnwindSafe for BoxContent
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