Custom font iOS 8 not effect in device

251 Views Asked by At

i am using Xcode 6.4 beta and i have issue with custom font

custom font ios 8 storyboard working but in device not working

1

There are 1 best solutions below

4
On

Step 1: Include your fonts in your XCode project

Step 2: Make sure that the target you want to use your font in is checked under “Target Membership, double check that your fonts are included as Resources in your bundle

Step 3: Include your iOS custom fonts in your application plist

Step 4: Find the name of the font, the tricky part is that the font name may not be what you expect

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

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

use above code to find the name

Step 5: Use UIFont and specify the name of the font

And finally, you can simply display your custom font using UIFont and whatever UILabel or text view you want.

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 60)];
label.textAlignment = NSTextAlignmentCenter;
label.text = @"Using Custom Fonts";
label.font = [UIFont fontWithName:@"Neutraface2Display-Titling" size:20];