TextStyle
class TextStyle(val fontName: String, val fontSize: Float = 10.0f, val hAlign: HAlignment = HAlignment.LEFT, val vAlign: VAlignment = VAlignment.BASELINE, val spacing: Double = 1.0, val direction: TextDirection = TextDirection.LTR, val lineSpacing: Double = 1.0, val color: Color? = null) : Customisable
A TextStyle allows you to define a style, and then use it for many Text objects, which cuts down on duplicate code.
TextStyle is immutable, and methods such as font, fontSize, hAlign etc all return a new TextStyle, leaving the original untouched.
Constructors
Link copied to clipboard
constructor()
constructor(fontName: String, fontSize: Float = 10.0f, hAlign: HAlignment = HAlignment.LEFT, vAlign: VAlignment = VAlignment.BASELINE, spacing: Double = 1.0, direction: TextDirection = TextDirection.LTR, lineSpacing: Double = 1.0, color: Color? = null)
Properties
Link copied to clipboard
The direction of the text. The default is TextDirection.LTR
Link copied to clipboard
Defaults to HAlignment.LEFT
Link copied to clipboard
For multi-line text, controls the spacing between lines. This is a scaling factor, e.g. a value of 2 would make the lines twice as far apart as normal. The default is 1.0
Link copied to clipboard
Defaults to VAlignment.BASELINE