UITextView with custom font not working when text set to "attributed"

Franck picture Franck · Jun 28, 2015 · Viewed 10.5k times · Source

I have a UITextView with some text that came from a .rtf (pasted directly onto Xcode)

The context contain only one custom font (Futura Book BT 11.0)

If I set the "text(attributed)" property to "plain"= The custom font appear properly from the storyboard and from the app

If I set the "text" property to "attributed"=. The custom font appear properly from the storyboard BUT not from the app.

As my goal was to have a text with multiple font working, how to have the attributed property to work with custom fonts? (Swift)

Thanks!

Answer

scott picture scott · Jul 8, 2015

The custom font appear properly from the storyboard BUT not from the app.

Does the app not show the font at all, or does it restore to system font? If it is reverting to Helvetica, it looks like this may be a known bug in iOS 8.1 http://openradar.appspot.com/radar?id=5117089870249984

Possible Solution: Did you test it on the simulator and a device? It could be that it just doesn't work on the simulator, which means you could fix it by installing the font on your system.