1. Search for font files on the Internet (the suffix is. TTF or. ODF)
2. Import the Library to the resouce of the project.
3. InProgramLoad a section in viewdidloadCode
Nsarray * familynames = [uifont familynames];
For (nsstring * familyname in familynames ){
Printf ("Family: % s \ n", [familyname utf8string]);
Nsarray * fontnames = [uifont fontnamesforfamilyname: familyname];
For (nsstring * fontname in fontnames ){
Printf ("\ tfont: % s \ n", [fontname utf8string]);
}
}
4. If the font you added is, You can see microsoftyahei in nslog.
5.
Create a new line (add
Row), add the key: uiappfonts, the type is array or dictionary; create another key-Value Pair under uiappfonts, key
Is: Item 0, add value XXX. TTF (your font name, string type), you can add multiple
6. When the font is used in your project, XX. font = [uifont fontwithname: @ "microsoftyahei" Size: 20.0.