Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS13 Font system name access #133

Open
fabiosoft opened this issue Oct 21, 2019 · 0 comments
Open

iOS13 Font system name access #133

fabiosoft opened this issue Oct 21, 2019 · 0 comments

Comments

@fabiosoft
Copy link

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant