DropCapStyle
The object for defining the drop cap text style to use in the first paragraph in a text component.
Declaration
object DropCapStyleProperties
| Name | Type | Description |
|---|---|---|
numberOfLines Required | integer | The approximate number of text lines this drop cap spans. For example, if
|
backgroundColor | Color | The background color of the drop cap. By default, no background color is applied, making the background effectively transparent. |
fontName | string | The PostScript name of the font to use for the drop cap. By default, the drop cap inherits the font of the component it’s in. |
numberOfCharacters | integer | A number that indicates the characters to render in the drop cap style.
Default value |
numberOfRaisedLines | integer | The number of text lines this drop cap raises. For example: When |
padding | integer | A number that sets the padding of the drop cap in points. When padding is applied, the drop cap is smaller than the box that surrounds it. Default value: |
textColor | Color | The color of the drop cap. The color defaults to the color of the associated text. |
Mentioned in
Discussion
Use a DropCapStyle object to define a drop cap that a ComponentTextStyle object can use. You can apply drop caps to the first paragraph of the following components:
You can use this object in TextStyle and ComponentTextStyle.
Example
{
"componentTextStyles": {
"exampleStyle": {
"fontName": "HelveticaNeue",
"fontSize": 20,
"dropCapStyle": {
"numberOfLines": 5,
"numberOfRaisedLines": 2,
"numberOfCharacters": 1,
"fontName": "HelveticaNeue",
"textColor": "#FFF",
"backgroundColor": "#000",
"padding": 5
}
}
}
}