-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.

1
  • 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? Commented Apr 30, 2019 at 13:53

3 Answers 3

0

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

Sign up to request clarification or add additional context in comments.

1 Comment

did that afterwards
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

Comments

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/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.