“Swanky and Moo Moo” font is not working in ios

纵饮孤独 提交于 2019-12-02 19:34:45

问题


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:


  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



回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!