Guides and Sample Code

Developer

Apple News Format: Design Tutorial

Default Text Style

Because a default text style determines the default style for all components in the article that display text, you can use this style to ensure that components will complement your overall design, even if they do not have other text styles defined.

A default text style is strongly recommended for every News article.

The default text style for an article is an object that has the name default and is located within the componentTextStyles property. The default text style is what’s known as a component text style object, because it determines the text style for one or more entire components.

JSON Example: Default Text Style

Define a default component text style object for the article. Within the component text style object, specify a font name, text color, and some other properties.

Example Code

Ellipses (...) indicate lines of code that have been omitted from this example.

  1. {
  2. ...
  3. "componentTextStyles": {
  4. "default": {
  5. "fontName": "DINAlternate-Bold",
  6. "textColor": "#222222",
  7. "fontSize": 16,
  8. "lineHeight": 22,
  9. "linkStyle": {
  10. "textColor": "#D5B327"
  11. }
  12. }
  13. }
  14. ...
  15. }