LineMetrics class
The LineMetrics object contains measurements of a text line.
A line of text can be thought of as surrounded by a box (rect) that outlines the boundaries of the text, plus there is a baseline inside the box which is the line on top of which the text is placed.
The LineMetrics box surrounding a piece of text is not necessarily tight: there's usually some amount of space above and below the text glyphs to improve legibility of multi-line text.
Constructors
Properties
- ascent → double
-
The distance from the baseline to the top of the box.
no setter
- baseline → double
-
Y-coordinate of the baseline of the box. When several line fragments are
placed next to each other, their baselines will match.
no setter
- bottom → double
-
no setter
- descent → double
-
The distance from the baseline to the bottom of the box.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
no setter
- left → double
-
X-coordinate of the left edge of the box.
no setter
- right → double
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Vector2
-
no setter
- top → double
-
no setter
- width → double
-
The total width of the box.
no setter
Methods
-
append(
LineMetrics other) → void -
Appends another LineMetrics box that is adjacent to the current and on
the same baseline. The current object will be modified to encompass the
other
box. -
moveToOrigin(
) → void - Moves this LineMetrics box to the origin, setting left and baseline to 0.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setLeftEdge(
double x) → void - Sets the position of the left edge of this LineMetrics box, leaving the right edge in place.
-
toRect(
) → Rect -
toString(
) → String -
A string representation of this object.
override
-
translate(
double dx, double dy) → void -
Moves the LineMetrics box by the specified offset
dx
,dy
leaving its width and height unmodified.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited