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 more