Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Importing Fonts to XCode

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 429
    Comment on it

    iPhone provides number of fonts for developing the app but not all. Sometimes we need to go beyond the fonts provided by iOS sdk.

    Following steps will do the needful

    1) Add desired font to project (It must be .tff or .otf);
    2) Go to info.plist and create a UIAppFonts key if it's not there else go to step3;
    3) This key's value should be set to "array";
    4) Add font file names to this array (i.e., if font name is abcd.tff, add this to the UIAppFonts key's array);
    5) Set font for object(s) in app just like you set for others: see example below</p>
    

    myLabel.font = [UIFont fontWithName:@"abcd" size:12.0f];

    To use light or bold version you've to add light and bold font of same.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: