-4

How can i use A Jannat LT Arabic font in my working ios application .I am working with objective c in xcode 8 .I need to use these fonts through out in myProject and from where i get (.ttf) file ? .I Searched a lot but i couldnt find a proper answer ,Kindly help me to fix this.

islahul
  • 194
  • 1
  • 11

2 Answers2

1

My question is do you need the font or do you need the way to implement it I think this is a nice explanation on how to add a custom font

If you need the font itself let me google it for you

Update

Not always the file name will coincide with the font family/font name, in order to check what Font families you have in your code you can use

Swift3

for family: String in UIFont.familyNames {
        print("\(family)")
        for names: String in UIFont.fontNames(forFamilyName: family) {
            print("== \(names)")
        }
    }

Obj-C

for (NSString* family in [UIFont familyNames]) {
    NSLog(@"%@", family);

    for (NSString* name in [UIFont fontNamesForFamilyName: family]) {
        NSLog(@"  %@", name);
    }
}

Please use the link i gave to you in order to check if it works as expected

sken3r
  • 414
  • 1
  • 4
  • 10
  • I need this font A Jannat LT , this is one arabic font name , UIFont* font = [UIFont fontWithName:@"A Jannat LT " size:24];but it is not working – islahul Apr 03 '17 at 13:14
  • I updated my response, most likely the file name and the font name are not the same – sken3r Apr 03 '17 at 13:34
1

Follow these steps

1.) Drag fonts into your project.

2.) Define your fonts name in your plist. Open plist > right click > add row > type : Fonts provided by application > press + > yourFontName.ttf.

It look like this in info plist

Fonts provided by application  : Array : (2 items)

item 0 : fontNameOne.ttf
item 1 : fontNameTwo.ttf

3.) Either you can check it from storyboard or you can do programmatically.

yourLabel.font=[UIFont fontWithName:@"yourFont" size:16.0f];//do not use .ttf here 
Dishant Rajput
  • 1,329
  • 1
  • 10
  • 20