Rajesh
Rajesh

Reputation: 556

open sans regular font not working as expected in iOS 7

I'm new to iOS programming .. trying to use fonts in my application. While doing so I'm stuck at one step. I have downloaded Google's Open-Sans family fonts. Except the Open-Sans Regular, all fonts are working fine.. This is driving me crazy now ..

I have followed all the steps which are required to add a font into the project's directory.

Upvotes: 4

Views: 9521

Answers (2)

iOS Lifee
iOS Lifee

Reputation: 2201

Extra bold is not available for OpenSans

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

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

So Try OpenSans or OpenSans-Semibold example:-

label.font = [UIFont fontWithName:@"OpenSans-Semibold" size:16.0f];

Upvotes: -2

paxx
paxx

Reputation: 1079

It's either:

  1. Not included in the target (click on OpenSans-Regular.ttf and check if target membership includes your app)
  2. Not included in Info.plist under Fonts provided by application
  3. Font name misspelled (for regular use [UIFont fontWithName:"OpenSans" size:size];, without "-Regular" par or spaces between open and sans)

Upvotes: 22

Related Questions