How to add custom ttf fonts to iphone application?
Asked Answered
I

1

3

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 setFont: [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?

Insufferable answered 7/7, 2011 at 9:38 Comment(0)
D
7

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

Daniels answered 7/7, 2011 at 9:42 Comment(4)
it is not working, can u give me link for ttf, might be issue with mine ttf filesInsufferable
if u add the .ttf file to your font book and there u can see the fonts displayed correctly then ur font file is ok...then check the name being diplayed in the font book,if ur ttf files name is different change it to as diplayed in font book and change the same in plist and tryDaniels
its displaying DS-Digital in font bookDaniels
I downloaded DS-Digital, these are not working, while other ttf are working, now what should I do, where I can find DS-Digital?Insufferable

© 2022 - 2024 — McMap. All rights reserved.