I have multiple custom fonts provided with my app, all defined in the app's plist correctly. I can load UIFonts with those custom fonts with no problems. UILabels using [UIFont fontWithName:@"some-custom-font" size:14] as font work flawlessly.
What doesn't work is CoreText methods.
I need to use those fonts in attributed strings, so I absolutely need the CTFontRef. Till iOS 5 I had no problem what-so-ever. Now, CTFontCreateWithName tends to return a font called .LastResort, instead of what I need. If I kill the app and relaunch, some of the fonts that failed last time do work now, but others don't. Seemingly random. If I call CTFontCreateWithName immediately on app launch, that specific font works later, but again most of the others do not.
I never encountered this kind of behavior before. My app isn't very memory heavy. This feels like some iOS 5 bug. Any help or advice will be very welcome.
I've only used custom fonts via UIKit. You may want to contact DTS, or definitely bugreport.apple.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With