OptionaladvancedEnables the Advanced Text Renderer
The Advanced Text Renderer adds support for:
<b> tag for bold text
<b>This is bold</b><i> tag for italics text
<i>This is italics</i><color=$ARGB> tag for colored text
<color=0xff00ff00>This is green</color>See: https://github.com/rdkcentral/Lightning/pull/318 for more details
OptionalcutX coordinate of text cutting end position (in pixels)
OptionalcutY coordinate of text cutting end position (in pixels)
OptionalcutX coordinate of text cutting start position (in pixels)
OptionalcutY coordinate of text cutting start position (in pixels)
OptionalfontFont baseline ratio (Advanced Text Renderer only)
This can be used to improve vertical text alignment when using the Advanced Text Renderer.
You MUST enable advancedRenderer in order to use this.
See PR #378 for more information about this feature.
To calculate the ratio for a particular font face, you can do this calculation from font metadata:
(head.unitsPerEm − hhea.Ascender − hhea.Descender) / (2 × head.unitsPerEm)
This give you the ratio for the baseline, which is then used to figure out where the baseline is relative to the bottom of the text bounding box.
The input values can be retrieved using the opentype.js Font Inspector.
OptionalfontFont family
If an array is provided, font families that appear later in the array are used as fallbacks. If the
(default) null value is specified, the font family value specified in the defaultFontFace
Stage Option is used. If the resolved font
family (or families) is unavailable to the browser, a fallback is chosen by the browser. The special
CSS defined font family values
of "serif" and "sans-serif" may be used as well.
null (uses Stage.Options.defaultFontFace)
OptionalfontFont size (in pixels)
OptionalfontFont style
OptionalhTexture clipping height
If 0 then shows full width.
This should not be set at the same time as resizeMode.
See Clipping for more information.
OptionalhighlightHighlight mode
OptionalhighlightHighlight color
highlight must be enabled for this property to have any affect.
OptionalhighlightHighlight height (in pixels)
OptionalhighlightHighlight Y offset (in pixels)
Shifts the rendered highlight blocks down the Y-axis.
highlight must be enabled for this property to have any affect.
OptionalhighlightHighlight left padding (in pixels)
> 0:
< 0:
highlight must be enabled for this property to have any affect.
OptionalhighlightHighlight right padding (in pixels)
> 0:
< 0:
highlight must be enabled for this property to have any affect.
OptionalletterSpacing between letters
OptionallineLine height (in pixels)
OptionalmaxMaximum number of lines to display before truncation
If this is set to a value greater than 0, multiline text will be truncated at this number of lines. The maxLinesSuffix will be inserted at the end of the last rendered line of text.
OptionalmaxString rendered at the end of a truncated line of text
This suffix is used in the following situations:
"ellipsis",
and wordWrapWidth is exceeded.OptionaloffsetYText Y offset (in pixels)
Translates the position of rendered text along the Y-axis.
This value must be equal to at least the fontSize (which is the default) for the first line of
text to be completely visible in the texture. If set to 0, the first line of text will be completely
clipped.
OptionalpaddingPadding left (in pixels)
OptionalpaddingPadding right (in pixels)
OptionalprecisionRender precision of text
Stage.Options.precision stage option
OptionalresizeTexture resize mode (Automatic resize + clipping)
When set, enables automatic clipping to a specific rectangular area.
Note: resizeMode actually modifies the following texture clipping properties, so it should not be set at
the same time as them:
See Clipping - ResizeMode for more information.
OptionalshadowText shadow mode
If set, enables a text shadow behind the rendered text controlled by these properties:
See CanvasRenderingContext2D - Shadows (MDN) for more information on the properties that determine shadows.
OptionalshadowText shadow blur iterations
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowBlur (MDN)
for more information on this property.
OptionalshadowText shadow color
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowColor (MDN)
for more information on this property.
OptionalshadowText shadow X offset (in pixels)
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowOffsetX (MDN)
for more information on this property.
OptionalshadowText shadow Y offset
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowOffsetY (MDN)
for more information on this property.
OptionaltextText to display
OptionaltextHorizontal text alignment
OptionaltextText baseline
See CanvasRenderingContext2D.textBaseline (MDN)
for the available options.
OptionaltextText color
OptionaltextIndent of the first line of text (in pixels)
OptionaltextText overflow mode
When enabled, truncates long blocks of text with a suffix (like "..") to the size specified in wordWrapWidth. wordWrap must be disabled for this to work.
Values
"ellipsis": Truncated text will end in maxLinesSuffix."clip": Truncated text will not end in a suffix.string: Truncated text will end in this user-defined suffix.OptionaltypeOptionalverticalVertical text aligment
OptionalwTexture clipping width
If 0 then shows full width.
This should not be set at the same time as resizeMode.
See Clipping for more information.
OptionalwordWord Breaking mode (Advanced Text Renderer only)
When enabled, words that overflow the set width of the texture will be broken to another line.
You MUST enable advancedRenderer in order to use this.
OptionalwordWord wrap mode
When enabled (default), long lines that exceed wordWrapWidth will be be broken into new lines.
OptionalwordWord wrap width (in pixels)
OptionalxTexture clipping x-offset
OptionalyTexture clipping x-offset
Text Texture Settings