MathConstants class
Centralized typesetting constants for the rendering engine.
Design rationale:
- Consolidates all magic numbers, eliminating hardcoded ratios in various Measurers.
- Naming follows TeX typesetting terminology (sigma, xi, mu) for easy comparison with the TeXbook.
- All values are ratio coefficients of fontSize; multiply by fontSizePx to get pixel values.
Reference: TeXbook Appendix G and KaTeX font metrics.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- bigOpLimitScale → const double
- Limit font size scaling factor
- bigOpNamedMinWeight → const int
- Named operator minimum fontWeight
- bigOpSymbolBaseWeight → const int
- Symbol operator normal fontWeight
- bigOpSymbolMinWeight → const int
- Symbol operator minimum fontWeight
- bigOpVerticalScaleWeightReduction → const int
- Extra weight reduction after vertical stretch (maximum value)
- bigOpWidthOverflowFactor → const double
- Operator width overflow protection factor
- binomialChildScale → const double
- Binomial child scaling factor
- binomialGap → const double
- Binomial vertical gap / fontSize
- boxedBorderWidthDp → const double
- Boxed border width (dp)
- boxedPadding → const double
- Boxed inner padding / fontSize
- canvasHorizontalPadding → const double
- Canvas horizontal padding / fontSize
- canvasVerticalPadding → const double
- Canvas vertical padding / fontSize
- delimiterPadding → const double
- Delimiter vertical padding / fontSize
- extensibleArrowHeadSizeDp → const double
- Arrow head size (dp)
- extensibleArrowMinLengthDp → const double
- Arrow minimum length (dp)
- extensibleArrowPaddingDp → const double
- Arrow horizontal padding (dp)
- extensibleArrowStrokeDp → const double
- Arrow stroke thickness (dp)
- extensibleArrowTextGap → const double
- Gap between arrow and scripts / fontSize (KaTeX xArrow: 2mu = 0.111em)
- fractionChildScale → const double
- Fraction child (numerator/denominator) font size reduction factor
- fractionGap → const double
- Gap between fraction rule and numerator/denominator / fontSize
- fractionRuleInset → const double
- Horizontal inset at both ends of the fraction rule / fontSize
- fractionRuleThickness → const double
- Fraction rule thickness / fontSize (ξ₈, default rule thickness)
- integralFontScaleRatio → const double
- Distribution ratio (0~1) of fontSize enlargement in mixed stretching. 0.5 means the square root of the total stretch is allocated to fontSize, and the square root to Canvas scale.
- integralHeightHintOvershoot → const double
- Overshoot coefficient implied by integral height
- integralMinVerticalScale → const double
- Integral symbol minimum vertical stretch multiplier
- integralVisualWidth → const double
- Integral symbol visual core width / fontSize
- italicLeftOverhang → const double
- Left italic overhang for specific first characters / fontSizePx
- italicRightOverhangLower → const double
- Lowercase right italic overhang / fontSizePx
- italicRightOverhangOther → const double
- Other characters right italic overhang / fontSizePx
- italicRightOverhangUpper → const double
- Uppercase right italic overhang / fontSizePx
- lineSpacing → const double
- Line spacing / fontSize
- mathAxisHeightRatio → const double
- Fallback ratio of math axis height to font size (used when dynamic calc fails)
- matrixColumnSpacing → const double
- Matrix column spacing / fontSize
- matrixRowSpacing → const double
- Matrix row spacing / fontSize
- mediumSpace → const double
- Medium space : = 4mu ≈ 0.222em
- multlineRowSpacing → const double
- Multline row spacing / fontSize
- operatorRightGap → const double
- Operator (sin/cos etc.) right gap / fontSize
- quadSpace → const double
- Quad space \quad = 18mu = 1em
- radicalHookWidth → const double
- Radical hook width / fontSize
- radicalIndexOffset → const double
- Radical index horizontal offset coefficient (relative to hookWidth)
- radicalTopGapMultiplier → const double
- Gap multiplier from top of radical content to the overline (relative to ruleThickness)
- scriptKernDp → const double
- Horizontal gap between script and base symbol (dp)
- scriptMinGap → const double
- Minimum gap between superscript and subscript / fontSize
- scriptScale → const double
- SCRIPT style font size scaling relative to TEXT/DISPLAY (σ₅)
- scriptScriptScale → const double
- SCRIPT_SCRIPT style font size scaling (σ₆)
- stackScriptScale → const double
- Stack vertical content font size scaling factor
- stackVerticalGap → const double
- Minimum vertical gap between Stack label and base box / fontSize
- subscriptShift → const double
- Subscript shift-down / fontSize (σ₁₆)
- superscriptShift → const double
- Superscript shift-up / fontSize (σ₁₃)
- thickSpace → const double
- Thick space ; = 5mu ≈ 0.278em
- thinSpace → const double
- Thin space , = 3mu ≈ 0.167em
- wideAccentArrowGap → const double
- Wide accent arrow gap / fontSize
- wideAccentArrowHeight → const double
- Wide accent line/arrow height / fontSize
- wideAccentDefaultGap → const double
- Wide accent default gap / fontSize
- wideAccentDefaultHeight → const double
- Wide accent default height / fontSize