TTML Style and Format

Closed captioning styles are not supported in a cascading style format. When style properties appear at various levels of the object hierarchy, a strict application order occurs.

Style Application Order

Styles are applied to the paragraph's content string in the following order:

  1. Style on the body tag
  2. Style on a default region declared by the body tag
  3. Style on a region declared by the paragraph tag
  4. Style on a paragraph
  5. Inline style properties on a paragraph tag

Supported Style Properties

The following table outlines the supported style properties for the closed captioning text:

Style Property

Description

"backgroundColor"

String attribute of the background color.

"color"

String attribute of the foreground color

"extent"

String attribute used to specify the width and height of a region area. Accepted values are expressed as "width% height%". Currently the width is ignored.

"fontFamily"

String attribute used to specify the font family name. The value is matched to the closest system font (for example, Helvetica Neue).

"fontSize"

String attribute used to specify the font size. Acceptable values are expressed as "80%" or "80px". The default value is "normal".

"fontStyle"

String attribute used to specify the font style.

"fontWeight"

String attribute used to specify the font weight.

"opacity"

String attribute between "1.00" and "0.00" representing values opaque to transparent.

"origin"

String attribute used to specify the x and y coordinates in percentage of the area with respect to the root origin. Accepted values are expressed as "horizontal% vertical%". Default values are "center bottom".

"paddingTop"

String attribute used to specify inset space on the top of the area. Acceptable values are expressed as "2px". The default value is "3px".

"paddingRight"

String attribute used to specify inset space to the right of the area. Acceptable values are expressed as "2px". The default value is "3px".

"paddingBottom"

String attribute used to specify inset space on the bottom of the area. Acceptable values are expressed as "2px". The default value is "3px".

"paddingLeft"

String attribute used to specify inset space to the left of the area. Acceptable values are expressed as "2px". The default value is "3px".

"textAlign"

String attribute used to specify how inline areas are aligned with the containing block area.

"textOutline"

String attribute used to specify a text outline effect. Accepted values are expressed as "#000000 2px".

Table of Contents