2
votes

I'd like to know why my bold font isn't bold in my app? I tried setting label in Interface Builder to System-Bold but the font didn't look bold. So I started investigating and found that the font the label was using was actually .HelveticaNeueInterface-MediumP4 with a weight of bold. But it looks to be medium instead of bold. So I went and tried setting the font in code to bold using boldSystemFontOfSize: and the font returned again was wrong.

So calling boldSystemFontOfSize will return a medium font.

NSLog(@"%@", [UIFont boldSystemFontOfSize:24]);
<UICTFont: 0x7f9ed0f4f380> font-family: ".HelveticaNeueInterface-MediumP4"; font-weight: bold; font-style: normal; font-size: 24.00pt

Is this a bug in UIFont? Or what is the problem here?

1

1 Answers

2
votes

There is no problem. Everything works as intended.

These methods return fonts that are appropriate for the operating system that you are using. "Bold" doesn't mean "bold", it means "bold in comparison to other user interface elements". So when Apple decides to change the way text in iOS or MacOS X looks, you don't have to change your code. In iOS 7 and 8 fonts tend to be rather slim, so when you ask for Bold, you get medium to match the overall theme.