如何在 iPhone SDK 中包含和使用新字体? [英] How to include and use new fonts in 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?
推荐答案
- 将字体文件添加到您的资源文件中
- 编辑您的
Info.plist
:使用键应用程序提供的字体
添加一个新条目. - 对于您的每个文件,将文件名添加到此数组中
- Add the font files to your resource files
- Edit your
Info.plist
: Add a new entry with the keyFonts provided by application
. - 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屋!