TextElement class abstract

Base class for text elements.

Inheritance
Implementers

Constructors

TextElement({required ChantContext ctxt, required String text, required String cssClass, required String fontFamily(ChantContext ctxt), required double fontSize(ChantContext ctxt), required TextAlign textAnchor, required int sourceIndex, required String sourceGabc})

Properties

bounds ↔ Rect
Relative bounds used to layout the element.
getter/setter pairinherited
boundsForHitTest → Rect
Relative bounds where the element is hit-testable.
no setteroverride
connectorSpan ↔ TextSpan?
getter/setter pair
cssClass ↔ String
getter/setter pair
dominantBaseline ↔ String
getter/setter pair
dropCap ↔ DropCap?
getter/setter pair
firstLineMaxWidth ↔ double
getter/setter pair
fontFamily → String Function(ChantContext ctxt)
final
fontSize → double Function(ChantContext ctxt)
final
forceConnector ↔ bool?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
highlight ↔ Color?
Overrides the default color of this element.
getter/setter pairinherited
ignoreBounds ↔ bool
Whether bounds of this element should affect bounds of the parent.
getter/setter pairinherited
needsLayout ↔ bool
getter/setter pair
numLines ↔ int
getter/setter pair
origin ↔ Point
Relative position used to layout the element.
getter/setter pairinherited
resize ↔ double?
getter/setter pair
rightAligned ↔ bool?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selected ↔ bool
Whether the element should be highlighted as selected.
getter/setter pairinherited
sourceGabc ↔ String
getter/setter pair
sourceIndex ↔ int
getter/setter pair
spans ↔ List<TextSpan>
getter/setter pair
text ↔ String
getter/setter pair
textAnchor ↔ TextAlign
getter/setter pair
textType ↔ TextStyleDefinition
getter/setter pair

Methods

createSvgNode(ChantContext ctxt, [ChantLayoutElement? source]) → XmlElement
Generates SVG representation of the element.
override
createSvgTree(ChantContext ctxt, [ChantLayoutElement? source]) → SvgTreeNode
Generates a lightweight in-memory SVG-like tree.
override
draw(ChantContext ctxt) → void
Paints this the element on Canvas attached to ctxt.
override
generateSpansFromText(ChantContext ctxt, String text) → void
Parses markup in text to fill spans with styled TextSpans.
getCssClasses() → String
getExtraStyleProperties(ChantContext ctxt) → Map<String, dynamic>
getSpanOptions(TextSpan span, ChantContext ctxt, [bool useStyleObject = false]) → Map<String, dynamic>
getSvgProps() → Map<String, dynamic>
measureSubstring(ChantContext ctxt, [int? length]) → double
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recalculateMetrics(ChantContext ctxt, [bool resetNewLines = true]) → void
setMaxWidth(ChantContext ctxt, double maxWidth, [double firstLineMaxWidth = -1]) → void
toGabcString() → String
toString() → String
A string representation of this object.
inherited

Operators

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