Object

DropCapStyle

The object for defining the drop cap text style for use in the first paragraph in a text component.

Properties

numberOfLines
integer
(Required)

The approximate number of text lines this drop cap should span. For example, if numberOfLines is set to 3, and the top of the drop cap is aligned with the top of the first line, the bottom of the drop cap will drop to the bottom of the third line, although the actual drop amount can vary depending on the device and its orientation.

  • Minimum: 2

  • Maximum: 10

backgroundColor

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.

  • Minimum: 1

  • Maximum: 4

Default value: 1

numberOfRaisedLines
integer

The number of text lines this drop cap should raise. For example: When numberOfRaisedLines is 3, and numberOfLines is 5, the top of the drop cap is raised above the first line by 3 lines and and the bottom of the drop cap drops to the bottom of the second line.

padding
integer

A number thay 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: 0

textColor

The color of the drop cap. The color defaults to the color of the associated text.

Discussion

Use a DropCapStyle object to define a drop cap that can be used by a ComponentTextStyle object. Drop caps can be applied to the first paragraph of the following components:

This object can be used 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 } } }}

See Also

Text Styles

Defining and Applying Text Styles

Define and apply custom, default, and inline text styles, or use HTML tags or Markdown syntax to style your text.

Applying Apple News Format Fonts

Choose an iOS font family for your article.

object TextStyle

The object for defining the text style (font family, size, color, and so on) that you can apply to ranges of text.

object ComponentTextStyle

The object for defining the style for a text component, including spacing, alignment, and drop caps.

object ListItemStyle

The object for defining the style for bulleted or numbered lists in an article.

object InlineTextStyle

The object for applying text styling when not using HTML or Markdown formatting.