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

查看:22
本文介绍了如何在 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:使用键应用程序提供的字体添加一个新条目.
  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-Bold" size: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天全站免登陆