pub enum BoxContent {
Show 20 variants
HBox(Vec<LayoutBox>),
VBox(Vec<VBoxChild>),
Glyph {
font_id: FontId,
char_code: u32,
},
Rule {
thickness: f64,
raise: f64,
},
Kern,
Fraction {
numer: Box<LayoutBox>,
denom: Box<LayoutBox>,
numer_shift: f64,
denom_shift: f64,
bar_thickness: f64,
numer_scale: f64,
denom_scale: f64,
},
SupSub {
base: Box<LayoutBox>,
sup: Option<Box<LayoutBox>>,
sub: Option<Box<LayoutBox>>,
sup_shift: f64,
sub_shift: f64,
sup_scale: f64,
sub_scale: f64,
center_scripts: bool,
},
Radical {
body: Box<LayoutBox>,
index: Option<Box<LayoutBox>>,
index_offset: f64,
rule_thickness: f64,
inner_height: f64,
},
OpLimits {
base: Box<LayoutBox>,
sup: Option<Box<LayoutBox>>,
sub: Option<Box<LayoutBox>>,
base_shift: f64,
sup_kern: f64,
sub_kern: f64,
slant: f64,
sup_scale: f64,
sub_scale: f64,
},
Accent {
base: Box<LayoutBox>,
accent: Box<LayoutBox>,
clearance: f64,
skew: f64,
is_below: bool,
},
LeftRight {
left: Box<LayoutBox>,
right: Box<LayoutBox>,
inner: Box<LayoutBox>,
},
Array {
cells: Vec<Vec<LayoutBox>>,
col_widths: Vec<f64>,
col_aligns: Vec<u8>,
row_heights: Vec<f64>,
row_depths: Vec<f64>,
col_gap: f64,
offset: f64,
},
SvgPath {
commands: Vec<PathCommand>,
fill: bool,
},
Framed {
body: Box<LayoutBox>,
padding: f64,
border_thickness: f64,
has_border: bool,
bg_color: Option<Color>,
border_color: Color,
},
RaiseBox {
body: Box<LayoutBox>,
shift: f64,
},
Scaled {
body: Box<LayoutBox>,
child_scale: f64,
},
Angl {
path_commands: Vec<PathCommand>,
body: Box<LayoutBox>,
},
Overline {
body: Box<LayoutBox>,
rule_thickness: f64,
},
Underline {
body: Box<LayoutBox>,
rule_thickness: f64,
},
Empty,
}Expand description
What a LayoutBox contains.
Variants§
HBox(Vec<LayoutBox>)
Horizontal list of child boxes laid out left-to-right.
VBox(Vec<VBoxChild>)
Vertical list of child boxes laid out top-to-bottom.
Glyph
A single glyph character.
Rule
Filled rectangle from \rule[<raise>]{width}{height}.
thickness is the ink height; raise is the distance (in em) from the baseline
to the bottom edge of the rectangle, positive toward the top of the line.
Kern
Empty space (kern).
Fraction
A fraction: numerator over denominator with optional bar.
Fields
SupSub
Superscript/subscript layout.
Fields
Radical
A radical (square root).
Fields
OpLimits
An operator with limits above/below (e.g. \sum_{i=0}^{n}).
Fields
Accent
An accent above or below its base.
LeftRight
A stretchy delimiter (\left, \right) wrapping inner content.
Array
A matrix/array: rows × columns of cells.
Fields
SvgPath
An SVG-style path (arrows, braces, etc.).
Framed
A framed/colored box (fbox, colorbox, fcolorbox). body is the inner content; padding and border add to the outer dimensions.
Fields
RaiseBox
A raised/lowered box (raisebox). shift > 0 moves content up, shift < 0 moves content down.
Scaled
A scaled box (for \scriptstyle, \scriptscriptstyle in inline context). The child is rendered at child_scale relative to the parent.
Angl
Actuarial angle \angl{body}: path (horizontal roof + vertical bar) and body share the same baseline.
Overline
\overline{body}: body with a horizontal rule drawn above it.
The rule sits 2 * rule_thickness above the body’s top (clearance), and is rule_thickness thick.
Underline
\underline{body}: body with a horizontal rule drawn below it.
The rule sits 2 * rule_thickness below the body’s bottom (clearance), and is rule_thickness thick.
Empty
Empty placeholder.
Trait Implementations§
Source§impl Clone for BoxContent
impl Clone for BoxContent
Source§fn clone(&self) -> BoxContent
fn clone(&self) -> BoxContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more