I'm having a problem setting the font for UILabels and UITextViews with Interface Builder. I'm trying to set the font to Gill Sans. If I set it programmatically it works fine, like this:
myLabel.font = [UIFont fontWithName:@"Gill Sans" size:24.0];
But if I try setting it with Interface Builder, I get the same behaviour described in this question here iPhone SDK: Interface Builder label font, only shows when editing label, but the Gill Sans is supposedly available on the iPad (and it is, since it works if I set it by code). And if I run it and do this:
NSLog(@"%@", myLabel.font.fontName);
it prints out "Helvetica".
Usually I wouldn't mind setting it programmatically, but the problem is that this particular class is used in several different places with different nib files to provide different layouts, so I can't have it hardcoded to always use the same font family. And subclassing it for each time it appears would be a huge pain, specially because I want to enable designers to create and change all the layout with interface builder whenever they want, and if they have to tell me what font they want every time so I can hardcode every particular case, that would be very awkward.
Has anyone experienced this problem before? Maybe Interface Builder is limiting me to use the iPhone fonts even though the xib file's target is already set to iPad, but how do I convince it that I'm targeting the iPad?
Thanks in advance, filipe