4

I already found this article here Set a default font for whole iOS app? and I basically have the same question.

I want to set the default font for my whole application but without having to specify the font size. I Have different labels with different sizes in my app. I just want to change the font... not the size!

Thanks for helping...

Community
  • 1
  • 1
Georg
  • 3,664
  • 3
  • 34
  • 75
  • did you make any progress? I'm having the same issue. – Simon Apr 20 '12 at 16:10
  • Unfortunately not, no.. sorry I ended up using the default font for now... The requirement for the custom font wasn't that high! – Georg Apr 23 '12 at 14:29

1 Answers1

2

I think it is too late, but for whom who has the same question, there is a two solution for changing the app font without having to specify the font size.:

The first is workaround wich is iterating over all the labels in your UIView and change the labels font, check this question and the answers: How to set a custom font for entire iOS app without specifying size.

The Second is creating a Category for your control:

@implementation UILabel (MyCustomLabel)

-(void)awakeFromNib{
    float fontSize = [self.font pointSize];
    self.font = [UIFont fontWithName:@"MyCustomFont" size:fontSize];
}

@end
Community
  • 1
  • 1
Tarek Hallak
  • 18,422
  • 7
  • 59
  • 68