iOS loading custom fonts requires a bit of work
Xcode font style query: http://iosfonts.com/
1. Download the required TTF file, import the project, Info.plist add an entry in: Fonts provided by application , fill in the font file name plus suffix.:
Info.plist Configuration
2. TARGETS -> Build Phases -> Copy Bundle Resources add a font file to the
Copy Bundle Resources Configuration
3. Through the eyesight to find the font file corresponding fontName , there is no better way, such as please let me know, thank you ~
NSArray *familyNames = [UIFont familyNames];for( NSString *familyName in familyNames ){ NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for( NSString *fontName in fontNames ) { printf( "\tFont: %s \n", [fontName UTF8String] ); }}
Zhongzi Jiang Brush Cursive fontname
Mona Comics Body Fonename
4. Use a custom font
self.Label.text = @"钟齐流江毛笔草体";self.Label.font = [UIFont fontWithName:@"LiuJian-Mao-Cao-2.0" size:30];self.Label2.text = @"蒙纳漫画体";self.Label2.font = [UIFont fontWithName:@"MComicHK-Medium" size:30];
End.
Wen/igeekxi (author of Jane's book)
Original link: http://www.jianshu.com/p/d728570bdf7b
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
iOS Custom Fonts