pub enum MathAtom {
Glyph {
text: String,
x: f32,
y_baseline: f32,
size: f32,
weight: FontWeight,
italic: bool,
},
GlyphId {
glyph_id: u16,
rect: Rect,
view_box: Rect,
},
Rule {
rect: Rect,
},
Radical {
points: [[f32; 2]; 5],
thickness: f32,
},
Delimiter {
delimiter: String,
rect: Rect,
thickness: f32,
},
}Expand description
One positioned paint primitive in a MathLayout.
All coordinates follow the MathLayout convention: relative to the
box origin on the main baseline, y-down (negative y is above the
baseline). The renderer translates atoms to the element’s baseline and
paints them in order.
Variants§
Glyph
Text run drawn through the regular text pipeline.
Fields
y_baseline: f32Baseline of the run relative to the main baseline
(0.0 = on the main baseline; negative = raised, e.g. superscripts).
weight: FontWeightFont weight for the run.
GlyphId
Single glyph from the bundled math font, addressed by OpenType glyph
id and drawn as a vector outline scaled into rect. Used for OpenType
stretchy-delimiter variants, delimiter assembly parts, big-operator
variants, and radical signs.
Fields
Rule
Filled rectangle, used for fraction rules and radical overbars.
Radical
Vector-drawn radical sign (fallback when no OpenType radical variant
fits): a polyline from the left flair through the hook and tick up to
the overbar, stroked at thickness.
Fields
Delimiter
Stretched fence delimiter drawn as a vector shape (fallback when the math font offers no variant or assembly tall enough).
Trait Implementations§
impl StructuralPartialEq for MathAtom
Auto Trait Implementations§
impl Freeze for MathAtom
impl RefUnwindSafe for MathAtom
impl Send for MathAtom
impl Sync for MathAtom
impl Unpin for MathAtom
impl UnsafeUnpin for MathAtom
impl UnwindSafe for MathAtom
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,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.