網絡搜索字體,並下載對應的.ttf文件。網絡
把.ttf文件添加到項目中,如圖:app
3.在Info.plist文件中新建一行(Add Row),添加key爲:Fonts provided by application,類型爲Array或Dictionary都行,在UIAppFonts下再創建一個鍵值對,key爲:Item 0,添加Value爲XXX.ttf(你字體的名字,string型),能夠添加多個如圖:ide
4.打印字體家族的名稱字體
NSArray *familyNames = [UIFont familyNames]; for( NSString *familyName in familyNames ){ NSLog(@"Family: %@ \n", familyName); NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for( NSString *fontName in fontNames ){ NSLog( @"\tFont: %@ \n", fontName); } }
能夠看到,多了微軟雅黑字體:spa
5.使用微軟雅黑字體3d
textView.font = [UIFont fontWithName:@"MicrosoftYaHei" size:16.];code
注意:這樣會涉及版權問題。
orm