A builder for text styles.
Methods
Method | Return type | Brief description |
---|---|---|
build() | TextStyle | Creates a text style from this builder. |
setBold(bold) | TextStyleBuilder | Sets whether or not the text is bold. |
setFontFamily(fontFamily) | TextStyleBuilder | Sets the text font family, such as "Arial". |
setFontSize(fontSize) | TextStyleBuilder | Sets the text font size in points. |
setForegroundColor(cssString) | TextStyleBuilder | Sets the text font color. |
setForegroundColorObject(color) | TextStyleBuilder | Sets the text font color. |
setItalic(italic) | TextStyleBuilder | Sets whether or not the text is italic. |
setStrikethrough(strikethrough) | TextStyleBuilder | Sets whether or not the text has strikethrough. |
setUnderline(underline) | TextStyleBuilder | Sets whether or not the text is underlined. |
Detailed documentation
build()
setBold(bold)
Sets whether or not the text is bold.
Parameters
Name | Type | Description |
---|---|---|
bold | Boolean | Whether or not the text is bold. |
Return
TextStyleBuilder
— The builder for chaining.
setFontFamily(fontFamily)
Sets the text font family, such as "Arial".
Parameters
Name | Type | Description |
---|---|---|
fontFamily | String | The desired font family. |
Return
TextStyleBuilder
— The builder for chaining.
setFontSize(fontSize)
Sets the text font size in points.
Parameters
Name | Type | Description |
---|---|---|
fontSize | Integer | The desired font size. |
Return
TextStyleBuilder
— The builder for chaining.
setForegroundColor(cssString)
Sets the text font color.
Parameters
Name | Type | Description |
---|---|---|
cssString | String | The desired font color in CSS notation (such as '#ffffff' or 'white' ). |
Return
TextStyleBuilder
— The builder for chaining.
setForegroundColorObject(color)
Sets the text font color.
Parameters
Name | Type | Description |
---|---|---|
color | Color | The desired font color. |
Return
TextStyleBuilder
— The builder for chaining.
setItalic(italic)
Sets whether or not the text is italic.
Parameters
Name | Type | Description |
---|---|---|
italic | Boolean | Whether or not the text is italic. |
Return
TextStyleBuilder
— The builder for chaining.
setStrikethrough(strikethrough)
Sets whether or not the text has strikethrough.
Parameters
Name | Type | Description |
---|---|---|
strikethrough | Boolean | Whether or not the text has strikethrough. |
Return
TextStyleBuilder
— The builder for chaining.
setUnderline(underline)
Sets whether or not the text is underlined.
Parameters
Name | Type | Description |
---|---|---|
underline | Boolean | Whether or not the text is underlined. |
Return
TextStyleBuilder
— The builder for chaining.