Class TextStyleBuilder

TextStyleBuilder

A builder for text styles.

Methods

MethodReturn typeBrief description
build()TextStyleCreates a text style from this builder.
setBold(bold)TextStyleBuilderSets whether or not the text is bold.
setFontFamily(fontFamily)TextStyleBuilderSets the text font family, such as "Arial".
setFontSize(fontSize)TextStyleBuilderSets the text font size in points.
setForegroundColor(cssString)TextStyleBuilderSets the text font color.
setItalic(italic)TextStyleBuilderSets whether or not the text is italic.
setStrikethrough(strikethrough)TextStyleBuilderSets whether or not the text has strikethrough.
setUnderline(underline)TextStyleBuilderSets whether or not the text is underlined.

Detailed documentation

build()

Creates a text style from this builder.

Return

TextStyle — A text style created from this builder.


setBold(bold)

Sets whether or not the text is bold.

Parameters

NameTypeDescription
boldBooleanWhether or not the text is bold.

Return

TextStyleBuilder — The builder for chaining.


setFontFamily(fontFamily)

Sets the text font family, such as "Arial".

Parameters

NameTypeDescription
fontFamilyStringThe desired font family.

Return

TextStyleBuilder — The builder for chaining.


setFontSize(fontSize)

Sets the text font size in points.

Parameters

NameTypeDescription
fontSizeIntegerThe desired font size.

Return

TextStyleBuilder — The builder for chaining.


setForegroundColor(cssString)

Sets the text font color.

Parameters

NameTypeDescription
cssStringStringThe desired font color in CSS notation (such as '#ffffff' or 'white').

Return

TextStyleBuilder — The builder for chaining.


setItalic(italic)

Sets whether or not the text is italic.

Parameters

NameTypeDescription
italicBooleanWhether or not the text is italic.

Return

TextStyleBuilder — The builder for chaining.


setStrikethrough(strikethrough)

Sets whether or not the text has strikethrough.

Parameters

NameTypeDescription
strikethroughBooleanWhether or not the text has strikethrough.

Return

TextStyleBuilder — The builder for chaining.


setUnderline(underline)

Sets whether or not the text is underlined.

Parameters

NameTypeDescription
underlineBooleanWhether or not the text is underlined.

Return

TextStyleBuilder — The builder for chaining.