Optional
advancedEnables 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
Optional
cutX coordinate of text cutting end position (in pixels)
Optional
cutY coordinate of text cutting end position (in pixels)
Optional
cutX coordinate of text cutting start position (in pixels)
Optional
cutY coordinate of text cutting start position (in pixels)
Optional
fontFont 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.
Optional
fontFont 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)
Optional
fontFont size (in pixels)
Optional
fontFont style
Optional
hTexture clipping height
If 0
then shows full width.
This should not be set at the same time as resizeMode.
See Clipping for more information.
Optional
highlightHighlight mode
Optional
highlightHighlight color
highlight must be enabled for this property to have any affect.
Optional
highlightHighlight height (in pixels)
Optional
highlightHighlight Y offset (in pixels)
Shifts the rendered highlight blocks down the Y-axis.
highlight must be enabled for this property to have any affect.
Optional
highlightHighlight left padding (in pixels)
> 0
:
< 0
:
highlight must be enabled for this property to have any affect.
Optional
highlightHighlight right padding (in pixels)
> 0
:
< 0
:
highlight must be enabled for this property to have any affect.
Optional
letterSpacing between letters
Optional
lineLine height (in pixels)
Optional
maxMaximum 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.
Optional
maxString rendered at the end of a truncated line of text
This suffix is used in the following situations:
"ellipsis"
,
and wordWrapWidth is exceeded.Optional
offsetYText 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.
Optional
paddingPadding left (in pixels)
Optional
paddingPadding right (in pixels)
Optional
precisionRender precision of text
Stage.Options.precision stage option
Optional
resizeTexture 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.
Optional
shadowText 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.
Optional
shadowText shadow blur iterations
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowBlur
(MDN)
for more information on this property.
Optional
shadowText shadow color
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowColor
(MDN)
for more information on this property.
Optional
shadowText 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.
Optional
shadowText shadow Y offset
shadow must be enabled for this property to have any affect.
See CanvasRenderingContext2D.shadowOffsetY
(MDN)
for more information on this property.
Optional
textText to display
Optional
textHorizontal text alignment
Optional
textText baseline
See CanvasRenderingContext2D.textBaseline
(MDN)
for the available options.
Optional
textText color
Optional
textIndent of the first line of text (in pixels)
Optional
textText 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.Optional
typeOptional
verticalVertical text aligment
Optional
wTexture clipping width
If 0
then shows full width.
This should not be set at the same time as resizeMode.
See Clipping for more information.
Optional
wordWord 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.
Optional
wordWord wrap mode
When enabled (default), long lines that exceed wordWrapWidth will be be broken into new lines.
Optional
wordWord wrap width (in pixels)
Optional
xTexture clipping x-offset
Optional
yTexture clipping x-offset
Text Texture Settings