verticalAlignment
An option that controls the text’s vertical placement within its bounding rectangle.
Overview
The runtime handles each option of this property differently depending on whether the text displays with line breaks. For more information, see wrapMode.
Declaration
token verticalAlignment = "center" (
allowedTokens = ["top", "middle", "lowerMiddle", "baseline", "bottom"]
)Vertical Alignments for Single-Line Text
For a single line of text, the vertical alignment is relative to font features.
topAligns the line of text vertically with the ascender.
middleAligns the line of text vertically with the center of capital letters.
lowerMiddleAligns the line of text vertically with the center of lowercase letters.
baselineAligns the line of text vertically with the baseline.
bottomAligns the line of text vertically with a descender.
Vertical Alignments for Multiline Text
For multiline text, each line of text bases its vertical alignment on the text’s bounding box.
topAligns each line of text vertically with the top.
middle, lowerMiddleAligns each line of text in the center with equal space above and below the line of text.
baseline, bottomAligns each line of text vertically with the bottom.