problem with adding custom font in Xcode 4.3.2
Apr 13, 2012
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:
Where is my font ?
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:[label2 setFont: [UIFont fontWithName: @"Black BoardSb" size:18]];
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:
NSLog(@"Available fonts: %@", [UIFont familyNames]);
So far, all is good.