7

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.

fatyandao
  • 71
  • 1
  • 3

4 Answers4

7

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.

  • For the textfield you can sent the font for the textfield with the 'font' property of the UITextFeild class. – Chaithanya Prathyush Sep 05 '16 at 13:27
  • Hi, thanks for answering. actually i have done all the above already: a) Added custom fonts to the application folder b) Modified teh Info.plist file for "Fonts Provided By Application" c) Added the font file to teh "Copy Bundle Resources" d) Set the custom font for the affected textfields. if you can take a look at the 2 images in the original post, the custom font shows in all the text fields in the Storyboard, but not on the Simulator. – fatyandao Sep 06 '16 at 01:49
  • Copy bundle resources it was i always forget up vote for you – Travis Delly Aug 24 '18 at 21:44
4

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
Vishwas Singh
  • 1,497
  • 1
  • 18
  • 16
2

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

Community
  • 1
  • 1
Sandy Patel
  • 768
  • 7
  • 19
  • i had to set the font programmatically for it to work. setting the font on the Storyboard does not. – fatyandao Sep 06 '16 at 08:33
  • set Verdana font and increase size and check in your simulator, this default font show in simulator. if yes then your custom font has some issue to install in your machine. – Sandy Patel Sep 06 '16 at 09:20
0

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

i.e.: fonts/Arial.ttf