tobihagemann / THLabel

UILabel subclass, which additionally allows shadow blur, inner shadow, stroke text and fill gradient.
https://tobiha.de
Other
665 stars 111 forks source link

Update API to fix behavior in iOS 13 #48

Closed sochalewski closed 4 years ago

sochalewski commented 4 years ago

iOS 13 has changed APIs around fonts, so CTFontCreateWithName does not any longer work properly (at least with system fonts). It results with warnings like this:

CoreText performance note: Client called CTFontCreateWithName() using name ".SFUI-Ultralight" and got font with PostScript name "TimesNewRomanPSMT". For best performance, only use PostScript names when calling this API.

and incorrect fonts to be shown.

Instead CTFontCreateWithFontDescriptor should be used.

tobihagemann commented 4 years ago

Thank you for the fix! 👍