0

I am using "Swanky and Moo Moo" in my application, but it displays the font style as like of system font..

Here my code....

myLabel.font=[UIFont fontWithName:@"Swanky and Moo Moo" size:16];

I have refer the following links..

iOS: How can i set a non system font family, style, size of UILabel?

http://kgriff.posterous.com/45359635

But thats are not useful for me.......

Can antone tell me that how to set the myLabel font style as Swanky and Moo Moo??

Community
  • 1
  • 1
Venk
  • 5,949
  • 9
  • 41
  • 52
  • Dont use file name of that font, open font in your Mac in font book and write same name present in font book – P.J Jan 16 '13 at 10:17
  • Please take a look it will help http://codefriends.blogspot.in/2012/04/adding-custom-font-in-xcode.html – amar Jan 16 '13 at 10:21
  • @Prateek in font book, the font name is like Swanky and Moo Moo only – Venk Jan 16 '13 at 10:23
  • Please check this for reference: http://stackoverflow.com/questions/13922705/custom-font-not-being-set-iphone/13923089 – Luke Jan 16 '13 at 10:24

2 Answers2

1
  1. Add your custom font files into your project using XCode as resources.
  2. Add key font provided by application to your info plist.(array key)
  3. For each font add the full font file name along with extension as item into the key.
  4. Now you can use the font as UIFont *customFont = [UIFont fontWithName:fontName size:fontSize];
  5. The catch the font name is not the font file name every time.....
  6. you can install the font file to check its font name....use that name and you are sorted....
    Note:- If it still dosent work go to build phases ->copy bundle resources and add all your font files
amar
  • 4,285
  • 8
  • 40
  • 52
  • 1
    ty `build phases ->copy bundle resources and add all your font files` this will helps me..... – Venk Jan 16 '13 at 10:31
  • what's the name of the font you use finally? Swanky and Moo Moo? I am curious if you need to use the Full name or Postcript name. – tiguero Jan 16 '13 at 10:33
0

Beside the solution you will find on SO you need to make sure you provide the exact name you will see for the Full name or 'Postscript name tag in fontbook. Try SwankyandMooMoo or Swanky and Moo Moo.

Community
  • 1
  • 1
tiguero
  • 11,477
  • 5
  • 43
  • 61