我遇到了在iPhone应用程序中添加字体的问题,想知道如何做到这一点。请注意,我没有使用IB,并且我已经继承了UILabel并制作了该新类的标签。
请帮帮我, 我已经下载了ttf字体并想在我的应用程序中使用它, 我已将"Fonts Provided by application"添加到我的应用程序中,并添加了带有ttf扩展名的字体名称,但仍然无法正常工作,我该怎么办?
@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 setFont: [UIFont fontWithName: @"DS-DIGI" size: self.font.pointSize]];
}
return self;
}
我的字体是 DS-DIGI.ttf,已添加到资源文件夹中,RRSGlowLabel 是 UILabel 的继承类,现在我该怎么做?