M13ProgressSuite
M13ProgressSuite copied to clipboard
iOS13 Font system name access
Since iOS13 you cannot get system font name by string.
The console outputs a note: CoreText note: Client requested name ".SFUI-Regular", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:].
One use case is into maximumFontSizeThatFitsInRect
method of M13ProgressViewBar.m
textRect = [@"100%" boundingRectWithSize:frame.size options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName : [UIFont fontWithName:((__bridge UIFont*)_percentageLabel.font).fontName size:fontSize]} context:nil];
I think it should be changed in [UIFont systemFontOfSize: fontSize]