问题
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??
回答1:
- Add your custom font files into your project using XCode as resources.
- Add key font provided by application to your info plist.(array key)
- For each font add the full font file name along with extension as item into the key.
- Now you can use the font as UIFont *customFont = [UIFont fontWithName:fontName size:fontSize];
- The catch the font name is not the font file name every time.....
- 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
回答2:
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
.
来源:https://stackoverflow.com/questions/14355985/swanky-and-moo-moo-font-is-not-working-in-ios