The system font sometimes renders as Times New Roman on iOS 13
When a system font is set on a UITextView and similar views, it can switch to Times New Roman at runtime. Setting the UIFont explicitly in code works around it.
- Published
This article is also published elsewhere. https://iganin.hatenablog.com/entry/2019/11/10/214038
Originally written in Japanese. This is a translation of the same piece.
Overview
Exactly what the title says. As the bug report describes, when a
system font is set on a UITextView and similar views, the font can change to Times New Roman once the app
is running.
People have suggested causes — that it happens when you do not set a UIFont explicitly on
NSAttributedStringKey.font, for instance — but honestly, nobody seems to know the real reason.
What happened, and what fixed it
In my case, I had set the system font on the plain text of a UITextView in Interface Builder, and the
problem appeared when the app ran. Setting the UIFont explicitly in code, like this, avoids the bug:
textView.font = UIFont.systemFont(ofSize: 16.0)
I have collected the related material I found online below.
Thoughts
iOS 13 has produced plenty of bugs beyond this one, and it has been rough going, to be honest. It might be worth checking your app for fonts that have gone wrong, just in case.