TextStyle

class TextStyle(val fontSize: Float = 0.06f, val resolvedFontFamily: String? = null, val weight: FontWeight = FontWeight.Regular, val color: Int = WHITE, val backgroundColor: Int? = null, val alignment: TextAlignment = TextAlignment.Center, val maxWidth: Float = 0.9f)(source)

How burned-in text is drawn.

Sizes are fractions of the output frame rather than points, so the same style lands identically in a preview and in an export of any resolution.

Constructors

Link copied to clipboard
constructor(fontSize: Float = 0.06f, resolvedFontFamily: String? = null, weight: FontWeight = FontWeight.Regular, color: Int = WHITE, backgroundColor: Int? = null, alignment: TextAlignment = TextAlignment.Center, maxWidth: Float = 0.9f)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

How lines are aligned within the text block.

Link copied to clipboard

Packed ARGB for a plate drawn behind the text, or null for none.

Link copied to clipboard
val color: Int

Packed ARGB, as 0xAARRGGBB.

Link copied to clipboard

Cap height as a fraction of the output frame's height, in 0f..1f.

Link copied to clipboard

Maximum line width as a fraction of the frame, in 0f..1f. Text wraps at this width.

Link copied to clipboard

The font family to draw with, or null for the platform default. Filled in when the composition is built and used as-is at export.

Link copied to clipboard

How heavy the typeface is.