2
votes

I have an app developed for iOS6 and I am just migrating to iOS7

there's a new font used with this interface: "HelveticaNeue-Light"

I want to replace my system font to this one globally for buttons, labels, textviews, textfields to this, respecting all other attributes (if font is bold, italic, font-size...)

how can I do that

I was applying:

[[UILabel appearance] setFont:[UIFont fontWithName:@"HelveticaNeue-Light" size:15.0f]];

but it changes size of all my fonts, if I set the size to default in zero my fonts dissappear

also tried this:

[[UILabel appearance] setFont:[UIFont preferredFontForTextStyle:@"HelveticaNeue-Light"]];

but this changes my font to a small size that's not the solution as well

thanks in advance for your support

1
What is exactly your question?Tarek Hallak
I want to change the font-type of the whole app to "HelveticaNeue-Light", but just that, the other atributes (size, bold, italic) I want to keep themJesús Ayala

1 Answers

0
votes

You probably need subclass UILabel and override awakeFromNib like below:

@implementation MyUILabel

- (void)awakeFromNib
{
    [super awakeFromNib];
    self.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:self.font.pointSize];
}
@end