proportional font size

i see that the fonts used in a table view cell label does not increase even if autolayoutresize mask is set. table is spread to whole screensize, neither row height increases nor text font.


my requirement is to use proportionate font sizes according to view port size, not only in tableview, but also in all the controls, is there a generic way of doing this ? i seee that html 5 vw vh does it quite well, but i need a solution in obj c


also as an extension, avenir ttf font same size looks smaller in android than iphone, what is the closest common way to define font size in this case ? sometimes in android phone even if view port is same size, same font same size looks smaller in android. whats the reason ?

You could try setting the font size to something really really big in IB, and ticking the "adjusts font size to fit width" so it will auto shrink. But that would only work for static text, and might not look right on different OS versions where default fonts change. Ugly as it is, you might end up having to programmatically set the font based on some empirically determined formula (fudge factor * label width / superview width or something) in viewDidLayoutSubviews. Hopefully someone can come up with a better idea.


Font sizes are specified in points, so the absolute size of text on different devices or platforms will depend on the DPI of the screen. The same font will have a different absolute (ruler) size even on different Apple devices that have varying "points per inch".

proportional font size
 
 
Q