XCode: custom font is not applied - ios

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.

Related

The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels

I've looked at other questions with the same issue and did what was suggested in them but keep getting the same error.
I've dragged 120x120 file into my project, cleaned, built, archived, same error.
I've dragged 120x120 file into the asset catalog manually, cleaned, built, archived, same error.
Here's a pic of my asset appicon:
There is no drag and drop for 120x120. Where am I suppose to add it?
Thanks
Dont drag images in asset.
Go to this link - https://makeappicon.com
Upload your 1024 image, it will email you the icons for iOS and Android as well.
Just copy and paste AppIcon.appiconset file into bundle.
You probably have already solved this, but I'd like to share an observation about this topic as I'm currently struggling with the same problem.
When you generate an app icon set with tools like makeappicon.com, chances are that not all possible icon variants are created. For example, old icon sizes (for iOS 5/6) are probably not produced.
In Xcode's assets editor (at least in Xcode 8.2.1) you only see the slots for which an icon is provided; for me this led to the misinterpretation that all possible icons are present. However, if you manually add an empty icon set in Xcode ("+" -> "New iOS App Icon"), you will see that there are more possible slots then are filled by the icon tool.
In my case the problem was that the deployment target was set to iOS6, but some icons required for iOS6 were not included in the icon set; so I created a new, empty icon set, manually dragged in the files which were created by my icon tool, and then created the missing icons by hand.

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

Font won't load into iOS application (can't see it in Xcode)

I've purchased a Font (UniversLTStd) and included the .ttf file in my application.
I can see the font name in my Info.plist file.
When I click on a UILabel in Interface Builder and attempt to select this font, it's not there. Am I missing something?
Xcode: Version 7.1
To see font enlisted from InterfaceBuilder you should install it in you operation system.
Open ttf file with Fonts app and click install. Basically, just double click it - it will use Fonts.app as default to open in. In the right-lower corner you'll find, what you need

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.

Icon dimensions don't meet size requirements no matter what

I am trying to put my app on the market and am granted with this error everytime I try:
Ipad: icon.png: dimensions (57 x 57) don't meet the size requirements. The icon file must be 72x72 pixels in .png format.
I have seen the endless posts about about modifying the .plist and also Edit Project Settings -> Build -> uncheck Compress PNG Files( Icon.png file error in universal app ). I have done both of this. I have also went through apples guide for universal app Icons and followed that as well. However I noticed a difference in the .plist file I have and they have (http://developer.apple.com/library/ios/#qa/qa1686/_index.html). (Mine has a Primary Icon attribute ) Is there something I am missing or is the apple documentation our of date?
When I change the icon to 72x72 I then get the same error except it says the icon file must be 57x57. It seems like it's trying to use icon.png for both the iphone and ipad icon when It should be using icon-72.png for ipad and icon.png for iphone. Is this defined somewhere else?
First of all I'm not sure if this is a rule or if it's just common practice, but your icons should start with a capital "I". Second, your iPad icon should be 72x72 not 57x57 like the iPhone icon. And finally, you're missing your iPad retina icon "Icon-72#2x.png" 144x144px.
Full break down of icons.
Icon.png = 57x57 iPhone non retina
Icon#2x.png = 114x114 iPhone retina
Icon-72.png = 72x72 iPad non retina
Icon-72#2x.png = 144x144 iPad retina
If you make sure your icons are exactly as I've listed then you won't have any problems.
If you are still experiencing problems after making these changes then try deleting all icon images from the project, and deleting the icon keys from your .plist file.
Then re-add the images to the project by dragging them directly to their corresponding placeholder in the summary tab of Xcode's navigator.
Well, I agree with #NSPostWhenIdle, But as far as the Naming conventions he is right, if you are adding directly to the plist,
But when it is concerned with Xcode , from Xcode 4.2, when you open the target settings -> Summary
I hope that you are using Xcode later than 4.2
And when you mouse over the App Icons section, it will show the size of icons and right click there and add icons. Xcode itself fix the names for your icons according to the size of the icons which you are selecting like this
So, No matter of fighting with the naming conventions of iCons, and if you add like this, these icon names are fixed my Xcode itself and these icons are automatically added to the plist File as well.
I removed the icons from my project via the file system, renamed them as suggested by NSPostWhenIdle and sree charan. I then dragged and dropped them into the the app icon section and removed and readded the entries in the .plist via a text editor. However this still wasn't effecient enough, I thought that removing the files from the project in the file system would remove the references in the project, THIS IS NOT TRUE. I suggest to anyone that with icon problems after this to do what I previously stated and remove all icon references/files via the project and NOT the file system before re-adding.
Your icon.png is probably not exactly 57x57. in finder, right click on the icon.png, get info. If it still says 57x57, then I am not sure why its throwing that error.
I had a similar issue when my icon.png was 57x56 (which I had never checked until xcode whined).
IF these dont work, restart your Xcode and or Mac, make a clean build.
I just want to add (for others finding this question) that I recently ran into this error, but in my case it was complaining that 76x76 did not meet the requirement of 72x72, which didn't make any sense to me since our iPad app is iOS 7 only and therefore according to all official documentation only requires icons of size 76x76 and 152x152.
Icon dimensions (76 x 76) don't meet the size requirements. The icon file must be 72x72 pixels, in .png format.
Anyhow it turned out the person uploading the binary was using an older version of Application Loader (from Xcode 4.6) and this check was happening client-side before the upload even took place.
Submitting the same binary using the newer Application Loader from Xcode 5 had no problem!

Resources