如何在iPhone SDK中包含和使用新字体? [英] How to include and use new fonts in iPhone SDK?

查看:123
本文介绍了如何在iPhone SDK中包含和使用新字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的iphone应用程序使用字体MgOpen Modata。但我没有看到它在字体列表中的属性检查器。

I want to use font "MgOpen Modata" in my iphone App. But I dont see it in the font list in Property inspector.

如何添加该字体,以便我可以使用它?

How do I include that font so that I can use it?

推荐答案


  1. 将字体文件添加到资源文件

  2. 编辑您的 Info.plist :添加 c。

  3. 对于每个文件,将文件名添加到此数组

  1. Add the font files to your resource files
  2. Edit your Info.plist: Add a new entry with the key Fonts provided by application.
  3. For each of your files, add the file name to this array

在下面的例子中,我添加了DejaVu Sans Mono字体:

On the example below, I've added the font "DejaVu Sans Mono":

在您的应用程序中,您可以使用 [UIFont fontWithName:@DejaVuSansMono-Boldsize:14.f]

In your application you can the use [UIFont fontWithName:@"DejaVuSansMono-Bold" size:14.f].

或者如果你想使用它在html / css,只需使用 font-family:DejaVu Sans Mono;

Or if you want to use it in html/css, just use font-family:DejaVu Sans Mono;

注意:,此功能在iOS 3.2及更高版本中可用。

Note: this is available in iOS 3.2 and later.

这篇关于如何在iPhone SDK中包含和使用新字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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