开发者

How to add custom ttf fonts to iphone application?

开发者 https://www.devze.com 2023-03-17 17:49 出处:网络
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,

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

0

精彩评论

暂无评论...
验证码 换一张
取 消