Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Text Styles in Xcode (6.1)

How to set text styles in iOS 6? How do I set a font ("Futura 30pt" for example) as the default font for "body"?


(additional info)

In this dialog box:

Text Styles XCode

there is a label that says "Text Styles." I am assuming that this is how you can re-use font styles, but perhaps I am mistaken?

If this is wrong, how do I set a text style (for example: like you have h1, h2, body in css, and you can re-use these declarations elsewhere). How do you set a re-usable text style in Xcode? I'm trying to create a typographic system.

like image 737
Nick B Avatar asked Jan 25 '15 00:01

Nick B


2 Answers

If by "text styles" and "body" you are talking about Dynamic Type and its "body" style (UIFontTextStyleBody), as documented here, then the problem is that you have not understood what Dynamic Type is about. The whole point of Dynamic Type is that the font and size used are not up to you; they are up to the system (and the user's text size preferences). By using Dynamic Type, you are accepting the system's choice of font.

If you want to set a font as Futura 30pt, then set it. This has nothing to do with any "styles". If you want to set all UILabel fonts as Futura 30pt, you can use the appearance proxy. But there is no built-in "styles" system (unless you design one yourself somehow); this is not a web browser.

like image 53
matt Avatar answered Sep 17 '22 15:09

matt


Anyone coming here later should check out:

https://github.com/tombenner/nui

like image 43
Nick B Avatar answered Sep 20 '22 15:09

Nick B