public class ReusableTextStyleScope : TextStyleScope
Mutable TextStyleScope implementation reused across layout and draw passes to avoid allocations.
Properties
color
public var color: Color = Color.Unspecified
Color to apply to the text, or Color.Unspecified if not set.
brush
public var brush: Brush? = null
Brush for painting the text, or null if not set.
alpha
public var alpha: Float = Float.NaN
Opacity of the text (0.0 to 1.0) applied when brush is provided, or Float.NaN if not set.
fontSize
public var fontSize: TextUnit = TextUnit.Unspecified
Size of glyphs to use when painting the text, or TextUnit.Unspecified if not set.
fontWeight
public var fontWeight: FontWeight? = null
Typeface thickness to use when painting the text, or null if not set.
fontStyle
public val fontStyle: FontStyle?
Typeface variant to use when drawing letters, or null if not set.
fontSynthesis
public val fontSynthesis: FontSynthesis?
Font synthesis rules determining if and how bold/italic styles are synthesized when the font family does not natively support them, or null if not set.
fontFamily
public var fontFamily: FontFamily? = null
Font family used when rendering text, or null if not set.
fontFeatureSettings
public var fontFeatureSettings: String? = null
Advanced typography settings in CSS format, or null if not set.
letterSpacing
public var letterSpacing: TextUnit = TextUnit.Unspecified
Amount of space to add between letters, or TextUnit.Unspecified if not set.
baselineShift
public var baselineShift: BaselineShift = BaselineShift.Unspecified
Vertical shift amount from the baseline, or BaselineShift.Unspecified if not set.
textGeometricTransform
public var textGeometricTransform: TextGeometricTransform? = null
Geometric transformation to apply to the text, or null if not set.
localeList
public var localeList: LocaleList? = null
Locale list used to select region-specific glyphs, or null if not set.
background
public var background: Color = Color.Unspecified
Background color covering the entire line height from start to end, or Color.Unspecified if not set.
textDecoration
public var textDecoration: TextDecoration? = null
Decorations to paint on the text, or null if not set.
shadow
public var shadow: Shadow? = null
Shadow effect applied to the text, or null if not set.
drawStyle
public var drawStyle: DrawStyle? = null
Drawing style of the text (fill or stroke), or null if not set.
textAlign
public val textAlign: TextAlign
Alignment of the text within lines of the paragraph, or TextAlign.Unspecified if not set.
textDirection
public val textDirection: TextDirection
Algorithm used to resolve text direction, or TextDirection.Unspecified if not set.
lineHeight
public var lineHeight: TextUnit = TextUnit.Unspecified
Line height for the paragraph, or TextUnit.Unspecified if not set.
textIndent
public var textIndent: TextIndent? = null
Paragraph indentation, or null if not set.
platformStyle
public var platformStyle: PlatformTextStyle? = null
Platform-specific text styling parameters, or null if not set.
lineHeightStyle
public var lineHeightStyle: LineHeightStyle? = null
Line height distribution configuration, or null if not set.
lineBreak
public val lineBreak: LineBreak
Line breaking configuration of the paragraph, or LineBreak.Unspecified if not set.
hyphens
public val hyphens: Hyphens
Hyphenation configuration of the paragraph, or Hyphens.Unspecified if not set.
textMotion
public var textMotion: TextMotion? = null
Text character placement optimization for animated or static text, or null if not set.
Functions
setTextStyle
override fun setTextStyle(style: TextStyle)
setColor
override fun setColor(color: Color)
setBrush
override fun setBrush(brush: Brush)
setAlpha
override fun setAlpha(alpha: Float)
setFontSize
override fun setFontSize(fontSize: TextUnit)
setFontWeight
override fun setFontWeight(fontWeight: FontWeight)
setFontStyle
override fun setFontStyle(fontStyle: FontStyle)
setFontSynthesis
override fun setFontSynthesis(fontSynthesis: FontSynthesis)
setFontFamily
override fun setFontFamily(fontFamily: FontFamily)
setFontFeatureSettings
override fun setFontFeatureSettings(fontFeatureSettings: String)
setLetterSpacing
override fun setLetterSpacing(letterSpacing: TextUnit)
setBaselineShift
override fun setBaselineShift(baselineShift: BaselineShift)
setTextGeometricTransform
override fun setTextGeometricTransform(textGeometricTransform: TextGeometricTransform)
setLocaleList
override fun setLocaleList(localeList: LocaleList)
setBackground
override fun setBackground(background: Color)
setTextDecoration
override fun setTextDecoration(textDecoration: TextDecoration)
setShadow
override fun setShadow(shadow: Shadow)
setDrawStyle
override fun setDrawStyle(drawStyle: DrawStyle)
setTextAlign
override fun setTextAlign(textAlign: TextAlign)
setTextDirection
override fun setTextDirection(textDirection: TextDirection)
setLineHeight
override fun setLineHeight(lineHeight: TextUnit)
setTextIndent
override fun setTextIndent(textIndent: TextIndent)
setPlatformStyle
override fun setPlatformStyle(platformStyle: PlatformTextStyle)
setLineHeightStyle
override fun setLineHeightStyle(lineHeightStyle: LineHeightStyle)
setLineBreak
override fun setLineBreak(lineBreak: LineBreak)
setHyphens
override fun setHyphens(hyphens: Hyphens)
setTextMotion
override fun setTextMotion(textMotion: TextMotion)
reset
public fun reset()
Resets all text attributes to their initial unspecified values.
hasSameLayoutAffectingAttributes
public fun hasSameLayoutAffectingAttributes(other: ReusableTextStyleScope): Boolean
Returns whether this scope and other have equivalent layout-affecting attributes.
Parameters
| other | style scope to compare against |
Return
true if all layout-affecting attributes match
hasSameLayoutAffectingAttributes
public fun hasSameLayoutAffectingAttributes(style: TextStyle): Boolean
Returns whether this scope and style have equivalent layout-affecting attributes.
Parameters
| style | text style to compare against |
Return
true if all layout-affecting attributes match
hasSameDrawAffectingAttributes
public fun hasSameDrawAffectingAttributes(other: ReusableTextStyleScope): Boolean
Returns whether this scope and other have equivalent draw-affecting attributes.
Parameters
| other | style scope to compare against |
Return
true if all draw-affecting attributes match
hasSameDrawAffectingAttributes
public fun hasSameDrawAffectingAttributes(style: TextStyle): Boolean
Returns whether this scope and style have equivalent draw-affecting attributes.
Parameters
| style | text style to compare against |
Return
true if all draw-affecting attributes match
copyFrom
public fun copyFrom(other: ReusableTextStyleScope)
Copies all attributes from other into this ReusableTextStyleScope.
Parameters
| other | source scope to copy attributes from |