fatyandao
fatyandao

Reputation: 81

custom font shows on storyboard, but not on simulator, device

first time using SO to ask a question after lurking for so long.

I have added a custom font for some UITextFields and UITextViews in the Storyboard.... screenshot of storyboard

...but the fonts are not showing on the Simulator, nor the actual device (iPad 2, iPad Mini3). screenshot of simulator

Please advise on how you got through this, or any additional information that you may need. Thanks! Running XCode 7.3.1 on El Capitan 10.11.6.

The iOS Application in development is set for running on iOS 9.3 and above.

Upvotes: 8

Views: 2894

Answers (4)

Gustavo Bergamo
Gustavo Bergamo

Reputation: 13

Try adding you font name into your info.plist with full path.

i.e.: fonts/Arial.ttf

Upvotes: 0

Vishwas Singh
Vishwas Singh

Reputation: 1657

Check that your font file's (exp. Chewy.ttf) target is set to the app target.

Steps:

  1. select the font file
  2. Check target membership in File inspector

Upvotes: 4

Sandy Patel
Sandy Patel

Reputation: 768

Add your custom font into your project. i.e. Dragged the font file(ocrb.TTF) into XCode project.

check below link you solve your issue : Custom Font issue

Upvotes: 2

Chaithanya Prathyush
Chaithanya Prathyush

Reputation: 311

You should add custom fonts to your application folder (TTF/OpenType) and then, modify the application-info.plist file. Add the key "Fonts provided by application" to a new row

It supports TTF and OpenType fonts both. One caveat is that it loads and parses all fonts in the startup of your app, so it will slow down the initial load time.

You also have to add the fonts to the "Copy Bundle Resources" in the Build phases.

Upvotes: 7

Related Questions