InlineTextStyle
The object for applying text styling when not using HTML or Markdown formatting.
Declaration
object InlineTextStyleProperties
| Name | Type | Description |
|---|---|---|
rangeLength Required | integer | The length (in characters) of the portion of text to which Apple News applies alternative styling. |
rangeStart Required | integer | The starting point of the text to which Apple News applies alternative styling. Note: the first available character is at |
textStyle Required | (TextStyle | string) | Either a text style object or the name of a TextStyle object defined in the ArticleDocument.textStyles object. |
Mentioned in
Discussion
Use an InlineTextStyle object to apply text stylings (such as color, underline, font size, and font weight) to a specific range of text. The InlineTextStyle object contains either a TextStyle object or a reference to a text style that’s been defined in the ArticleDocument.textStyles object. Only properties that have values override the component text style and defaults.
You can use this object in Text.
Example
{
"components": [
{
"role": "pullquote",
"text": "The text of the pullquote.",
"textStyle": "pullquote-medium",
"inlineTextStyles": [
{
"rangeStart": 4,
"rangeLength": 4,
"textStyle": {
"textColor": "#FF0000",
"backgroundColor": "#000"
}
}
]
}
]
}