如何在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
:添加 c。 - 对于每个文件,将文件名添加到此数组
- 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-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屋!