Well, I guess John Muchow's blog Load and Access Custom Fonts" pretty much said everything about adding custom font before xcode 4.3.2. Before Xcode 4.3.2, when you add custom font, you need to make sure name of font you use in following code snippet:
the "BlarkBoard" is the real name when you install it on mac. So the file name you just add to Resource and plist file , like "BlackBoard.ttf" is always the same the name of font that installed on mac.So you need to open that font file in FontBook, and write the name showing up down, like "Black BoardSb".
Then when you want to refer to font in the code:
That is so important and it is always easy to forget about. Actually there is one way to debug it when the fonts doesn't show up as you expected by using:
But if you use Xcode 4.3.2, although you are very sure that every steps above are done properly, you still can't find the font you expected in
the log message of [UIFont familyNames].
Here is the reason:
You have to go to "Copy Bundle Resources" in "Build Phases" of your project, and add font file to that list.
Then run the project. Bang! It works now.
I've no freaking idea what's going on.It seems there is a bug relating to custom font in Xcode 4.3.2.