1、确定你的项目工程的resouce下有你要用的字体文件(.ttf,.odf)。

2、 然后在你的工程的Info.plist文件中新建一行(Add Row),添加key为:UIAppFonts(在我的机子上尝试了,它会自动转换成Fonts provided by application),类型为Array或Dictionary都行;添加Value为XXX.ttf(你字体的名字)。忘说了,是在建立的 UIAppFonts再建一对键值对,key为Item 0,值为xxxx.ttf。是这样,可以添加多个,使用的时候写对应字体名字就行。

3、

NSArray *familyNames =[[NSArray alloc]initWithArray:[UIFont familyNames]];
 	
     NSArray *fontNames;
 	
     NSInteger indFamily, indFont;
 	
     for(indFamily=0;indFamily<[familyNames count];++indFamily)
 	{
 		NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);
 		
         fontNames =[[NSArray alloc]initWithArray:[UIFont fontNamesForFamilyName:[familyNames objectAtIndex:indFamily]]];
 		
 		for(indFont=0; indFont<[fontNames count]; ++indFont)
 		{
 			NSLog(@"    Font name: %@",[fontNames objectAtIndex:indFont]);
 			}
 		[fontNames release];
 	}
 	[familyNames release];
 
 

在程序中先加入这段代码,运行,查看console,以上程式会列出所有的字型,当然也包含UIAPPFonts所加的字型,但请注意,名字可能差距很大,要自己找一下
例:
      msjh.ttf   (Window7中的微软正黑体)  , 加入UIAPPFonts

       执行以上程式会列出
       Family name: Microsoft JhengHei
                 Font name: MicrosoftJhengHeiRegular

要使用字体的Family name,而不是字体的文件名,弄错了将无法看到效果

 

在你的项目里要用字体的时候 xx.font = [UIFont fontWithName:@"Microsoft JhengHei" size:20.0],这样就可以了。

 

原文地址http://blog.csdn.net/sjzsp/archive/2011/04/21/6338282.aspx

 

在使用过程中添加Gill Sans MT字体,然后反复调用Gill Sans MT-Bold未果,打印项目中所有字体后发现应该使用GillSansMT-Bold,大部分字体使用Bold时都将前面字体名中的空格去掉或者有所改动,大家要注意呀~免得像我一样走弯路了~!

Family name: Gill Sans MT
     Font name: GillSansMT
     Font name: GillSansMT-Bold
     Font name: GillSansMT-Italic