Wednesday, April 17, 2013

UIFont fontWithName size example objc


UIFont fontWithName size 
Creates and returns a font object for the specified font name and size.
+ (UIFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize

Parameters of (UIFont fontWithName size )

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

fontSize
The size (in points) to which the font is scaled. This value must be greater than 0.0.

Return Value of (UIFont fontWithName size )
A font object of the specified name and size.

Discussion
You can use the fontNamesForFamilyName: method to retrieve the specific font names for a given font family.

Example of ( UIFont fontWithName size )
{
  //...

  UIFont   *myFont = [UIFont fontWithName:@"HelveticaNeue-Medium" size:14.0f];
  //...
}