iOS Custom Fonts

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.