7
votes

I'm trying to add 2 different font sizes for iphone and ipad layouts using size classes. It works cool with a default System font but doesn't work with custom font(I'm using PragmataPro in my project). If I add the second size for wR hR then font looks correctly in interface builder(I even checked xml) but in simulator and on device it becomes System instead of PragmataPro. But if I remove wR hR(or whatever layout I'm using for another size) then font shows correctly. Any idea how to solve this issue? Thanks!

3

3 Answers

3
votes

Subclass UILabel and override "layoutSubviews" method like:

- (void)layoutSubviews
{
 [super layoutSubviews];
 // Implement font logic depending on screen size
  self.font = [UIFont fontWithName:@"CustomFont" size:self.font.pointSize];
}
-1
votes

The 'custom' is there to define one single setting per type class. If you don't define a 'custom' library with all the variations you want than I don't really think there to be a solution, mainly because by 'custom' you mean ONE SINGLE COMPONENT OF A GIVEN LIST OF CHOICES...