I have problem of adding fonts to my iphone application I want to know how to do it, and let me specify that I am not using IB and I have inherited the UILabel and making label of that new class,
Please Help me out, I have downloaded the ttf and want to use in my app, I added "Fonts Provided by application" to my app and then added the font name with ttf extension, but still didn't work, what should I do ?
@implementation RRSGlowLabel
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if(self != nil) {
self.glowOffset = CGSizeMake(0.0, 0.0);
self.glowAmount = 0.0;
self.glowColor = [UIColor clearColor];
[self setFo开发者_高级运维nt: [UIFont fontWithName: @"DS-DIGI" size: self.font.pointSize]];
}
return self;
}
Where DS-DIGI.ttf is my font, added tou resources forlder, and RRSGlowLabel is inherited class of UILabel, now what should I do?
In order to call the font in your fontWithName call, the string should be the name of the font as it is displayed in the Mac's 'Font Book' app, and not the actual filename of the referenced font file
精彩评论