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

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.

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.

Check that your font file's (exp. Chewy.ttf) target is set to the app target.
Steps:
select the font file
Check target membership in File inspector

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

Try adding you font name into your info.plist with full path.
i.e.: fonts/Arial.ttf

Related

Font not showing in Xcode Attribute Inspector

I'm using Xcode ver 13.2.1 and
Hi, I have downloaded Poppins font from fonts.google.com and the problem is it's not showing in the font family dropdown(refer to the attached picture). I have declared it in my Info.plist, Project Target and still the problem occurs
This is expected behavior. The storyboard editor knows nothing of any custom fonts you may have installed for the app.

Adding Custom Fonts in Xcode

I am trying to add custom fonts, however, the target membership is not shown to me in Xcode 12.5.1
What should appear
What actually appears
How can I solve this?
After you added the custom font files, you must add the name list of the fonts in Info.plist file as below

XCode: custom font is not applied

I'm trying to add the custom font to my application. I've already tried to follow all standard recommendations from the documentation and the rest of articles related to the problem.
What I've done:
installed the font to the Font Book
copied ttf files to application directory
added font files to the "Fonts provided by application" in Info.plist
checked app in "Target Membership"
checked font files in "Copy Bundle Resources"
As a result font is visible in Attribute Inspector and successfully changed in the LaunchScreen storyboard. But when I run app in simulator only size and colour are applied but not font-face.
I'm using XCode 12.2 (12B45b) in Big Sur.
What else should I try? Thank you in advance.
In the case that the problem is only for LaunchScreen, you can't use custom fonts on the LaunchScreen. System will automatically replace your custom font to system font during runtime.
A quick workaround is to use an UIImageView and have your text as UIImage on it, literally a picture of your text as .png / .jpeg or similar.
Note: It may take some time before you can see the image, sometimes you had to clean the Build Folder and reinstall the app a couple of times in order to see the image.

Xcode custom font not showing in app

I have downloaded Open Sans font and added all the .tff files into my Xcode project, and have checked the checkbox in "Target Membership" pane for each file. I have added the UIAppFonts key and values in Info.plist, and I am sure that the values are typo-free. Plus, the .tff files are added to "Copy Bundle Resources", and the custom font is showing up in Interface Builder. And then I changed the font of all the labels to Open Sans in the Interface Builder (no code).
But when I run the app in the simulator, all the labels and buttons are showing the system font in ultra small sizes, like this:
One thing to note is that I am using Xcode 7 beta 5, and the app's Base SDK is iOS 9.
But why is there this problem? Is it a bug? Thanks!
Check That fonts inside the proyect are part of the target.
Select fonts, verify the property Target Membership for your app is checked at the right in File Inspector.
That solved the problem for me:
Blip, here's a photo of what I did in an empty "Single View" project. And, I could see the font on sim and IB editor. Anything look different for your project? Maybe recreate the basics in a new project, just to double check? All of my notes on the image were associated with my original thoughts...just use them for reference as you double check things.
I recently encountered this problem too. But it only happened for one font-style of a font-family, the others worked fine.
I could only solve it by using this font in a button, then the font was also available for other controls such as labels or the large title.

How to do Custom Fonts at design time in Xcode 6?

It was explained in the WWDC 2014 videos that you can have Custom Fonts at designing time directly in Storyboard, but so far I only see the list of iOS fonts. Any help?
All you have to do is to drag and drop the font files to your Xcode project, then you can find the font in the Custom font list. You don't even have to have them included in your Application Plist. That makes things simpler.
If you already had fonts added to Xcode 5.1 project, they will not show up in the custom fonts list upon upgrading to Xcode6. You can just remove references to the fonts then drop them in the project again and check the "copy to target". This will show custom fonts in the interface builder custom fonts dropdown on xCode6.
First use your custom font in storyboard then you can use it in code.

Resources