The new fonts in San Francisco in iOS 9 are optimized for the size at which it will be used by adjusting tracking and dynamically switching between SF Display and SF Text. At a WWDC 804 session, it was noted that developers should not use San Francisco when trying to initialize UIFont with fontWithName , for example:
UIFont *originalFont = [UIFont systemFontOfSize:11]; UIFont *newFont = [UIFont fontWithName:originalFont.fontName size:44];
This is because the system cannot optimize the font for the new size when using the fontWithName API.
Instead, it was recommended to get a UIFontDescriptor from the original font and create a new font with a new size, for example:
UIFont *originalFont = [UIFont systemFontOfSize:11]; UIFont *newFont = [UIFont fontWithDescriptor:originalFont.fontDescriptor size:44];
However, they did not mention whether the following optimizations allow or not:
UIFont *originalFont = [UIFont systemFontOfSize:11]; UIFont *newFont = [originalFont fontWithSize:44];
My question is, does the fontWithSize API fontWithSize as the fontWithName API or the fontWithDescriptor API - does this lead to font optimization for the new size or not?
source share