MathOptions class

Options for equation element rendering.

Every GreenNode is rendered with an MathOptions. It controls their size, color, font, etc.

MathOptions is immutable. Each modification returns a new instance of MathOptions.

Constructors

MathOptions({MathStyle style = MathStyle.display, Color color = Colors.black, MathSize sizeUnderTextStyle = MathSize.normalsize, FontOptions? textFontOptions, FontOptions? mathFontOptions, double? fontSize, double? logicalPpi})
Factory constructor for MathOptions.
factory

Properties

color Color
Text color.
final
fontMetrics → FontMetrics
Font metrics under current size.
latefinal
fontSize double
Font size under current size.
final
hashCode int
The hash code for this object.
no setterinherited
logicalPpi double
Logical pixels per inch on screen.
final
mathFontOptions FontOptions?
Font options for math mode.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size MathSize
Real size applied to equation elements under current style.
latefinal
sizeMultiplier double
Size multiplier applied to equation elements.
latefinal
sizeUnderTextStyle MathSize
Declared size for equation elements.
final
style MathStyle
The style used to render the math node.
final
textFontOptions FontOptions?
Font options for text mode.
final

Methods

copyWith({MathStyle? style, Color? color, MathSize? sizeUnderTextStyle, FontOptions? textFontOptions, FontOptions? mathFontOptions}) MathOptions
Utility method copyWith
havingBaseSize() MathOptions
Returns MathOptions with size reset to MathSize.normalsize
havingCrampedStyle() MathOptions
Returns MathOptions with their styles set to cramped (e.g. textCramped)
havingSize(MathSize size) MathOptions
Returns MathOptions with their user-declared size set to given size
havingStyle(MathStyle style) MathOptions
Returns MathOptions with given MathStyle
havingStyleUnderBaseSize(MathStyle? style) MathOptions
Returns MathOptions with size reset to MathSize.normalsize and given style. If style is not given, then the current style will be increased to at least MathStyle.text
merge(OptionsDiff partialOptions) MathOptions
Merge an OptionsDiff into current MathOptions
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
withColor(Color color) MathOptions
Returns MathOptions with given text color
withMathFont(FontOptions font) MathOptions
Returns MathOptions with given math font
withTextFont(PartialFontOptions font) MathOptions
Returns MathOptions with current text-mode font options merged with given font differences

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

displayOptions MathOptions
Default options for displayed equations
final
textOptions MathOptions
Default options for in-line equations
final

Static Methods

defaultFontSizeFor({required double logicalPpi}) double
Default value for fontSize when logicalPpi has been set.
defaultLogicalPpiFor({required double fontSize}) double
Default value for logicalPpi when fontSize has been set.

Constants

defaultFontSize → const double
Default logical pixel count for 1 em is 1600/72.27.
defaultLogicalPpi → const double
Default value for logicalPpi is 160.