May be the below code helps u,I achieved the same result of rotating the string in 45 degree
-(UIImage*) drawText:(NSString*) text
atPoint:(CGPoint) point
{
UIGraphicsBeginImageContextWithOptions(CGSizeMake(65, 65),NO,0.0);
CGRect rect = CGRectMake(point.x, point.y, 50, 30);
[[UIColor whiteColor] set];
CGContextConcatCTM(UIGraphicsGetCurrentContext(), CGAffineTransformMakeTranslation(32.5, 32.5));
CGContextConcatCTM(UIGraphicsGetCurrentContext(), CGAffineTransformMakeRotation(M_PI / 4));
CGContextConcatCTM(UIGraphicsGetCurrentContext(), CGAffineTransformMakeTranslation(-32.5, -32.5));
//[text drawInRect:CGRectIntegral(rect) withFont:font ];
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
[paragraphStyle setLineBreakMode:NSLineBreakByWordWrapping];
[paragraphStyle setAlignment:NSTextAlignmentCenter];
NSDictionary *attributes = @{ NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-CondensedBold" size:12],
NSForegroundColorAttributeName: [UIColor blackColor],
NSParagraphStyleAttributeName:paragraphStyle};
[text drawInRect:CGRectIntegral(rect) withAttributes:attributes];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
Below is screenshot where i achieved the result