first 下载所需要的相关字体 后缀一般为.ttf
将字体添加到
注意勾选
在plist文件内配置相关字体
打印出所需字体的名称
NSArray *familyNames = [[NSArray alloc]initWithArray:[UIFont familyNames]]; NSInteger indFamily; for (indFamily = 0; indFamily < [familyNames count]; indFamily++) { NSLog(@"Family name:%@",[familyNames objectAtIndex:indFamily]); }
输出如下 。通过command+F搜索出方正启体简体的名字 FZQiTi-S14S。
使用该名字编辑汉字字体
for (int i = 0; i < 15 ; i++) { UILabel *testLabel = [[UILabel alloc]initWithFrame:(CGRectMake( 40 , 60 + 35 * i , self.view.frame.size.width - 80 , 30))]; testLabel.text = @"GoldBear 你好~\(≧▽≦)/~啦啦啦 "; testLabel.font = [UIFont fontWithName:@"FZQiTi-S14S" size:20]; testLabel.textColor = [UIColor colorWithRed:(5+i*10)/255.0 green:(18+i*10)/255.0 blue:(25+i*10)/255.0 alpha:1.0]; [self.view addSubview:testLabel]; }
效果如下