Skip to main content

MathConstants

Struct MathConstants 

Source
pub struct MathConstants {
Show 24 fields pub axis_height: f64, pub superscript_bottom_min: f64, pub superscript_shift_up: f64, pub superscript_shift_up_cramped: f64, pub superscript_baseline_drop_max: f64, pub subscript_top_max: f64, pub subscript_shift_down: f64, pub subscript_baseline_drop_min: f64, pub script_scale_down: f64, pub script_script_scale_down: f64, pub space_after_script: f64, pub sub_superscript_gap_min: f64, pub fraction_rule_thickness: f64, pub fraction_numer_shift_up: f64, pub fraction_numer_gap_min: f64, pub fraction_denom_shift_down: f64, pub fraction_denom_gap_min: f64, pub radical_extra_ascender: f64, pub radical_rule_thickness: f64, pub radical_vertical_gap: f64, pub upper_limit_gap_min: f64, pub upper_limit_baseline_rise_min: f64, pub lower_limit_gap_min: f64, pub lower_limit_baseline_drop_min: f64,
}
Expand description

OpenType MATH MathConstants table, each field stored as a RATIO of the font size (design-units ÷ units_per_em, or percent ÷ 100 for the two scale-downs) so lang-side callers just multiply by ctx.font_size/the current script size. Mirrors upstream FontFormat.math_constants (fontFormat.ml:2292-2323).

Fields§

§axis_height: f64§superscript_bottom_min: f64§superscript_shift_up: f64§superscript_shift_up_cramped: f64

superscript_shift_up_cramped — OpenType SuperscriptShiftUpCramped, the lowered shift-up used when the enclosing sub-formula is “cramped” (TeXbook Appendix G rule 18a).

§superscript_baseline_drop_max: f64§subscript_top_max: f64§subscript_shift_down: f64§subscript_baseline_drop_min: f64§script_scale_down: f64

script_percent_scale_down / 100.

§script_script_scale_down: f64

script_script_percent_scale_down / 100.

§space_after_script: f64§sub_superscript_gap_min: f64§fraction_rule_thickness: f64§fraction_numer_shift_up: f64

fraction_numerator_display_style_shift_up.

§fraction_numer_gap_min: f64

fraction_num_display_style_gap_min.

§fraction_denom_shift_down: f64

fraction_denominator_display_style_shift_down.

§fraction_denom_gap_min: f64

fraction_denom_display_style_gap_min.

§radical_extra_ascender: f64§radical_rule_thickness: f64§radical_vertical_gap: f64

radical_display_style_vertical_gap.

§upper_limit_gap_min: f64§upper_limit_baseline_rise_min: f64§lower_limit_gap_min: f64§lower_limit_baseline_drop_min: f64

Trait Implementations§

Source§

impl Clone for MathConstants

Source§

fn clone(&self) -> MathConstants

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MathConstants

Source§

impl Debug for MathConstants

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MathConstants

Source§

fn eq(&self, other: &MathConstants) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MathConstants

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Clone for T
where T: Clone,

Source§

fn clone(&self) -> T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Copy for T
where T: Copy,

Source§

impl<T> Debug for T
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.