-1

For some reason, I can't seem to get the font I want displayed on the simulator.

foodfinderLabel.font = UIFont (name: "HelveticaNeue-Bold", size: 50)

The above code returns what you would expect it to.

However, when I try to execute the above code but with this font: 'Toppan Bunkyu Midashi Gothic Extrabold' Like this...

foodfinderLabel.font = UIFont (name: "ToppanBunkyuMidashiGothic", size: 50)

The code does not display the correct font.

How can I get this to run? Probably a simple problem, but I've had no luck. Having trouble with other fonts, too.

Peter H
  • 11
  • 6
  • 1
    Is `UIFont(name: "ToppanBunkyuMidashiGothic", size: 50)` nil? My guess, you are not using the postscript name. If you have the font installed on your Mac, open "Font Book.app", look for it, use the "Post Script Name" for the font name. Also, is it inside your app? – Larme Apr 30 '19 at 13:53

3 Answers3

0

You need to register custom fonts in your xcode project. Already answered here: Can I embed a custom font in an iPhone application?

yasirmturk
  • 1,924
  • 2
  • 22
  • 32
0

The Font you are looking to use does not come bundled with the OS. Here is a website that allows you to search the fonts for all versions of iOS: http://iosfonts.com/

You will need to obtain a copy of this font, and add it to your project. See apple's docs for an example: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app

Simon McLoughlin
  • 8,293
  • 5
  • 32
  • 56
0

If you are using custom fonts. Then you need to add fonts in application. And requires to add fonts in .plist file. After adding this you will get fonts in storyboard too.

Refer below link

https://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/