CueStyle

data class CueStyle(val fontFamily: String? = null, val fontSizePx: Float? = null, val bold: Boolean = false, val italic: Boolean = false, val underline: Boolean = false, val strikeThrough: Boolean = false, val primaryColor: Int = 0xFFFFFFFF.toInt(), val outlineColor: Int = 0xFF000000.toInt(), val shadowColor: Int = 0x80000000.toInt(), val outlineWidthPx: Float = 2.0f, val shadowOffsetPx: Float = 1.0f, val backgroundColor: Int = 0, val backgroundPaddingPx: Float = 4.0f, val relativeSize: Float = 1.0f)

Visual style for a run of text.

Sizes are in the authoring resolution's pixels when CueLayout.authoredHeight is set, and in points otherwise. Colours are ARGB with a non-premultiplied alpha, which is the form every subtitle format uses.

What the built-in rasterizers actually apply

A parser fills every field it can read. The three built-in rasterizers do NOT all use every one, so this is what a consumer can rely on. Measured against the tree 2026-08-30.

FieldDesktopAppleAndroid
primaryColor, bold, italic, underline, strikeThroughper spanper spanper span
fontSizePx, relativeSize, outlineColor, outlineWidthPxper spanper spanper span
fontFamilyper spanper spanper span
shadowColor, shadowOffsetPxfirst span, whole cuefirst span, whole cuefirst span, whole cue

"First span, whole cue" means a cue whose spans disagree renders with the FIRST span's value everywhere. Only the shadow works that way now: it changes the cue's bitmap SIZE, so two spans asking for different shadows would be asking for two different layouts of one cue.

The optional libass renderer is not covered by this table: it does its own ASS styling and reads the original script rather than this type.

Constructors

Link copied to clipboard
constructor(fontFamily: String? = null, fontSizePx: Float? = null, bold: Boolean = false, italic: Boolean = false, underline: Boolean = false, strikeThrough: Boolean = false, primaryColor: Int = 0xFFFFFFFF.toInt(), outlineColor: Int = 0xFF000000.toInt(), shadowColor: Int = 0x80000000.toInt(), outlineWidthPx: Float = 2.0f, shadowOffsetPx: Float = 1.0f, backgroundColor: Int = 0, backgroundPaddingPx: Float = 4.0f, relativeSize: Float = 1.0f)

Properties

Link copied to clipboard

ARGB box behind each line of text, padded by backgroundPaddingPx. The default is fully transparent, which draws nothing and costs nothing. WebVTT authors it with its bg_ colour classes and its stylesheets, and the viewer's SubtitleStyleOverride sets it. Taken from the cue's FIRST span.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The face to use. A family this system does not have falls back to the platform default, so a script naming a font only its author had still reads.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A factor on the size the text would otherwise have, from fontSizePx or the renderer's default, as a WebVTT stylesheet's font-size: 120% gives one. 1 leaves the size alone.

Link copied to clipboard

The drop shadow's colour. A fully transparent one turns the shadow off, and costs nothing.

Link copied to clipboard

How far down and right the shadow falls. Negative reaches up and left; zero turns it off.

Link copied to clipboard
Link copied to clipboard