Contents

InlineTextStyle

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

Declaration

object InlineTextStyle

Properties

NameTypeDescription
rangeLength Requiredinteger

The length (in characters) of the portion of text to which Apple News applies alternative styling.

rangeStart Requiredinteger

The starting point of the text to which Apple News applies alternative styling. Note: the first available character is at 0, not 1.

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"
          }
        }
      ]
    }
  ]
}

See Also

Text Styles