1. Import the font file into the project (. ttf)
2. Open build phases. Copy Bundle Resources to determine that the font file has been added
3. Edit the Info.plist file, add fonts provided by application and include the font file in the item array
4. Use the following code to display all font names
//Show All Fonts- (void) showallfontbank{Nsarray*familynames =[[Nsarray Alloc]initwitharray:[uifont Familynames]]; Nsarray*FontNames; Nsinteger indfamily, Indfont; NSLog (@"[Familynames count]===%lu", (unsignedLong) [familynames Count]); for(indfamily=0; Indfamily<[familynames count];++indfamily) {NSLog (@"Family Name:%@", [Familynames objectatindex:indfamily]); FontNames=[[Nsarray Alloc]initwitharray:[uifont fontnamesforfamilyname:[familynames objectatindex:indfamily]]; for(indfont=0; Indfont<[fontnames Count]; ++Indfont) {NSLog (@"Font Name:%@", [FontNames Objectatindex:indfont]); } }}
5. Look for the font name in the console output
6. Calling fonts using Uifont
[Uifont fontwithname:@ "fzltxhkm" size:+]; [Uifont fontwithname: @" fzlthjw--gb1-0 " Size:+";
Ios_ a custom font