1,导入ttf格式的字体到项目中
2.在info添加配置
3,双击字体,可以得到字体名(家族名)
4,可以在程序启动时打印出程序里面的所有字体名
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { rray *familyNames = [UIFont familyNames]; for( NSString *familyName in familyNames ){ printf( "Family: %s \n", [familyName UTF8String] ); NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for( NSString *fontName in fontNames ){ printf( "\tFont: %s \n", [fontName UTF8String] ); } } return YES;5,根据我们添加的字体的家族名,搜索到对应的成员名
6,设置字体,不用填写后缀名
[titleBtn.titleLabel setFont:[UIFont fontWithName:@"FZZDHJW--GB1-0" size:15]];
转载于:https://www.cnblogs.com/yulongjiayuan/p/5232213.html