“Swanky和Moo Moo”字体在ios中不起作用 [英] "Swanky and Moo Moo" font is not working in ios

查看:116
本文介绍了“Swanky和Moo Moo”字体在ios中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用Swanky和Moo Moo,但它显示的字体样式与系统字体类似。

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:如何设置UILabel的非系统字体系列,样式和大小?

http://kgriff.posterous.com/45359635

但这对我没用... ...

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

可以告诉我如何将 myLabel 字体样式设置为 Swanky和Moo Moo ??

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

推荐答案


  1. 使用XCode将自定义字体文件添加到项目中
    资源。

  2. 将应用程序提供的关键字体添加到您的信息plist。(数组键)

  3. 对于每种字体添加完整字体文件名以及扩展名为
    项目的密钥。

  4. 现在您可以使用字体作为UIFont * customFont = [UIFont
    fontWithName:fontName size:fontSize];

  5. 每次捕获字体名称不是字体文件名.....

  6. 你可以安装字体文件以检查其字体名称....使用该
    名称并排序....

    注意: - 如果它仍然有效工作去构建阶段 - >复制捆绑资源并添加所有字体文件

  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

这篇关于“Swanky和Moo Moo”字体在ios中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆