Object

ArticleDocument.textStyles

An object containing text style objects that can be referred to inline in text.

Properties

Any Key

A text style, with a name you define that can be referred to by components within this document.

Discussion

Article Document.textStyles is an object containing the text style objects that components in your article can refer to inline from their text, using HTML or Markdown. See Using HTML with Apple News Format and Using Markdown with Apple News Format. You can also refer to these text style objects in an InlineTextStyle object within a component.

You provide each component layout object as a key-value pair. In each pair, you create a key that’s meaningful to you. The value of each pair is a TextStyle object.

Example

{ "title": "Article Title", "identifier": "sample", "version": "1.8", "language": "en", "layout": { "columns": 20, "width": 1024, "margin": 60, "gutter": 20 }, "documentStyle": { "backgroundColor": "#FFF" }, "components": [ { "role": "section", "components": [ { "role": "body", "format": "html", "text": "<span data-anf-textstyle='exampleStyle'>There is a moment in every dawn</span> when light floats, there is the possibility of magic. Creation holds its breath." } ] } ], "componentTextStyles": {}, "textStyles": { "exampleStyle": { "fontFamily": "Gill Sans", "fontWeight": "bolder", "textColor": "#333333", "fontSize": 18, "textShadow": { "radius": 20, "opacity": 0.3, "color": "#99999930", "offset": { "x": -10, "y": 5 } }, "stroke": { "color": "#FFC800", "width": 1 } } }, "componentStyles": {}, "componentLayouts": {}}