API & Integration -> RenderScript

Text properties in RenderScript

These properties extend the base element properties.

Dimensions

Set the width and height of the text element. When set to null, dimensions will automatically adjust to fit the text content.

Example

"width": 300, "height": 100,

Defaults

"width": null, "height": null,

Fill color

The default fill color is #000000 (black).

Example

"fill_color": "#ffffff",

Default

"fill_color": "#000000",

Text alignment

Control horizontal and vertical text alignment within the element. X alignment: 0% (left) to 100% (right). Y alignment: 0% (top) to 100% (bottom).

Example

"x_alignment": "50%", "y_alignment": "50%",

Defaults

"x_alignment": "0%", "y_alignment": "0%",

Text

The text displayed in the element.

Example

"text": "Hello, world!",

Default

"text": "",

Font styling

Control the font appearance including family, weight, and style. Font family can reference custom fonts defined at the template level.

Example

"font_family": "Arial", "font_weight": 700, "font_style": "italic",

Defaults

"font_family": "Aileron", "font_weight": 400, "font_style": "normal",

Font sizing

Control font size behavior. Set a fixed size or use null for automatic sizing with minimum and maximum constraints.

Example

"font_size": null, "font_size_minimum": "2 vmin", "font_size_maximum": "50 vmin",

Defaults

"font_size": null, "font_size_minimum": "1 vmin", "font_size_maximum": "100 vmin",

Text formatting

Control text spacing, wrapping, clipping, and transformation. Letter spacing and line height are percentages of font size.

Example

"letter_spacing": "5%", "line_height": "150%", "text_wrap": false, "text_clip": true, "text_transform": "uppercase",

Defaults

"letter_spacing": "0%", "line_height": "115%", "text_wrap": true, "text_clip": false, "text_transform": "none",

Background styling

Add a background color behind the text with customizable padding, border radius, and alignment threshold for multi-line text.

Example

"background_color": "#ffffff", "background_x_padding": "50%", "background_y_padding": "50%", "background_border_radius": "10%", "background_align_threshold": "30%",

Defaults

"background_color": null, "background_x_padding": "25%", "background_y_padding": "25%", "background_border_radius": "0%", "background_align_threshold": "20%",

Transcript settings

Configure auto-transcription from video sources with customizable effects, splitting, placement, length limits, and highlighting colors.

Example

"transcript_source": "video-1", "transcript_effect": "karaoke", "transcript_split": "line", "transcript_placement": "animate", "transcript_maximum_length": 100, "transcript_color": "#3498db",

Defaults

"transcript_source": null, "transcript_effect": "color", "transcript_split": "word", "transcript_placement": "static", "transcript_maximum_length": null, "transcript_color": "#e74c3c",