7

The docs say:

+ (UIFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize

The fully specified name of the font. This name incorporates both the font family name and the specific style information for the font.

The examples I find only specify a font name. But I want to specify other attributes as well such as medium font weight etc. How is this encoded into the name?

Proud Member
  • 40,078
  • 47
  • 146
  • 231

1 Answers1

18

See this answer for naming scheme. Full font list (with names) can be found here.

Example:

[UIFont fontWithName:@"HelveticaNeue-Bold" size:15.0];

Update

iOS 8.2 added this method for fetching system fonts of different weights.

Example:

[UIFont systemFontOfSize:15.0 weight:UIFontWeightBold];
Community
  • 1
  • 1
jnic
  • 8,695
  • 3
  • 33
  • 47