Last active
March 24, 2016 10:56
-
-
Save sketchytech/6c5ff4be95b2f0ef70ab to your computer and use it in GitHub Desktop.
Apple News Format: Adding Component Text Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.1", | |
"identifier": "sketchyTech_Demo", | |
"title": "My First Article", | |
"language": "en", | |
"layout": {}, | |
"components": [ | |
{ | |
"role": "title", | |
"text": "My First Article", | |
"textStyle": "titleStyle" | |
}, | |
{ | |
"role": "body", | |
"text": "This is just over the minimum amount of JSON required to create a valid article in Apple News Format. If you were to delete the dictionary enclosing this text, you'd be there.", | |
"textStyle": "bodyStyle" | |
} | |
], | |
"componentTextStyles": { | |
"titleStyle": { | |
"textAlignment": "center", | |
"fontName": "HelveticaNeue-Bold", | |
"fontSize": 64, | |
"lineHeight": 74, | |
"textColor": "#000" | |
}, | |
"bodyStyle": { | |
"textAlignment": "left", | |
"fontName": "Georgia", | |
"fontSize": 18, | |
"lineHeight": 26, | |
"textColor": "#000" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Once you have the basic structure of an Apple News Format article you can add text styles by first referencing them with a textStyle key inside a component and then adding a componentTextStyle of the same name to the componentTextStyles dictionary. Think of component text styles as paragraph styles for your text, they can be reused time and again.
Note: The fonts you employ can be chosen from the entire list of iOS fonts. Although it is possible to include custom fonts there don't appear to be any guidelines on whether you should.