All custom fonts on iphone (development) should be added to info.plist app
Add row
<key>UIAppFonts</key> <array> <string>custom.ttf</string> </array>
Then add custom.ttf to the project.
Subclass UILabel
@interface CustomLabel : UILabel { } @end @implementation CustomLabel - (id)initWithCoder:(NSCoder *)decoder { if (self = [super initWithCoder: decoder]) { UIColor *textColor = [UIColor colorWithRed:0.20f green:0.20f blue:0.20f alpha:1.0f]; [self setTextColor:textColor]; [self setShadowColor:textColor]; [self setHighlightedTextColor:textColor]; [self setFont:[UIFont fontWithName:@"custom" size:self.font.pointSize]]; } return self; } @end
So you're ready to create a custom font on your label.
Note:
For each shortcut added to the application that you want to have your own font, change the class identifier to CustomLabel (the name of the subclass is UILabel).
dianz source share