Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ITextStyleBuilder

interface ITextStyleBuilder
Extends com.amazon.apmf.IStandard interface which builds the text styling object

Methods

color()

void color(Color* color)
Sets the color of the text. The default color value is BLACK{0xFF, 0x00, 0x00, 0x00} .

Parameters

color
Color* — Required Color object representing the desired text color.

backgroundColor()

void backgroundColor(Color* bgColor)
Sets the background color for text. Background color does not have a default value. When no background color is set, text is drawn without a background.

Parameters

bgColor
Color* — Required Color object representing the desired text background color.

fontSize()

void fontSize(float fontSize)
Sets the size of the font to be used for rendering text. The default font size value is 14.0f.

Parameters

fontSize
float — Required The desired font size as a float value. Note: The font size is specified in absolute points on the screen.

Throws


fontScale()

void fontScale(float fontScale)
Sets the font scale for the text. The font scale factor represents the adjustment applied to the font size. The default font scale value is 1.0f.

Parameters

fontScale
float — Required The desired font scale as a float value. Note: Font scale is a scaling factor or multiplier. For example, a font scale of 1.0 means no scaling (the original font size), a scale of 0.5 would reduce the font size by half, and a scale of 2.0 would double the font size

Throws


fontStyle()

void fontStyle(IFontStyle* fontStyle)
Sets the font style for the text using the provided IFontStyle object.

Parameters

fontStyle
IFontStyle* — Required An IFontStyle object representing the desired font style.

letterSpacing()

void letterSpacing(float letterSpacing)
Sets the letter spacing property that adjusts the space between characters in a text element. The default letter spacing is 0.0f.

Parameters

letterSpacing
float — Required The letter spacing in absolute point value. Note: The letter spacing is specified in points, which are a physical measurement on the screen.

wordSpacing()

void wordSpacing(float wordSpacing)
Sets the word spacing property that adjusts the space between words in a text element. The default word spacing is 0.0f.

Parameters

wordSpacing
float — Required The word spacing in absolute point value. Note: The word spacing is specified in points, which are a physical measurement on the screen.

lineHeight()

void lineHeight(float lineHeight)
Sets the line height for the text as a multiplier of the font size. The default value is 0.0f, which indicates that no explicit line height has been set by the caller, and the rendering engine will fall back to the font’s intrinsic line height as defined by its font metrics.

Parameters

lineHeight
float — Required The line height multiplier of the font size.

Throws


textDecoration()

void textDecoration(TextDecoration textDecoration)
Sets the text decoration to be applied on the text eg underline. The default decoration is none.

Parameters

textDecoration
TextDecoration — Required The desired textDecoration value.

superscript()

void superscript(bool superscript)
Sets the superscript formatting for the text. If superscript is true, the text will be formatted as superscript; otherwise, the formatting will be disabled. By default, it is false.

Parameters

superscript
bool — Required true to enable superscript formatting, false to disable it.

subscript()

void subscript(bool subscript)
Sets the subscript formatting for the text. If subscript is true, the text will be formatted as subscript; otherwise, the formatting will be disabled. By default, it is false.

Parameters

subscript
bool — Required true to enable subscript formatting, false to disable it.

textDecorationStyle()

void textDecorationStyle(TextDecorationStyle textDecorationStyle)
Sets the styling for text line decoration. The default decoration style is SOLID. In case of no line decoration, this styling will be no-operation.

Parameters

textDecorationStyle
TextDecorationStyle — Required The text decoration style to set. Use one of the values from the TextDecorationStyle enum.

fontFamilies()

void fontFamilies(string[] fontFamilies)
Sets the font families for the text style to be used in rendering text.

Parameters

fontFamilies
string[] — Required An array of font family names. Note: Default font family i.e. sans-serif will be used in case of empty or none font-family array value.

font()

void font(IFont* font)
Adds the font for rendering text. Users can also specify font families using the ITextStyleBuilder::fontFamilies. If font families are already set, the specified font will be appended to the list.

Parameters

font
IFont* — Required An IFont instance.

build()

ITextStyle* build()
Creates the instance of ITextStyle

Returns

ITextStyle* The new ITextStyle instance.
Last modified on October 29, 2026