I have some nice fonts that I like to use in my iOS applications. However, it is slightly annoying to add the font to Xcode every time. Is there a way I can keep add a font permanently to a project so it will stay in there forever? Please let me know if I am not being specific enough. Thanks!
Unfortunately only standard iOS fonts are "permanently" in Xcode. Other fonts have to be added in manually when you want to use it in a specific project.
This is because when you add the font it is included in your bundle when uploaded to the app store vs. the system fonts already being on the iOS system.
Related
I am updating the icons in my app. After I heard Apple released an icon font named SF Symbols with iOS 13, I was wondering if I can only use them in iOS 13 or if it is possible to use them in lower versions of iOS too.
If I want to use them, do I have to implement a fallback for older versions?
You can not use SFSymbols natively in iOS versions older than iOS 13 (see Apple's Human Interface Guidelines for SF Symbols).
However, if you are interested in using the graphics you can use the SF Symbols app to export SVG versions of the icon. Then use some graphics tool to convert them to PNG icons you can import into your asset catalog.
You can open .svg use Figma. Then select the Regular-M and export as PDF or PNG.
Update for more details:
You can use the PDF vector assets in Xcode. So that the icon should fit any size you want. Please check this blog: https://useyourloaf.com/blog/xcode-9-vector-images/
The new Xcode has a different UI but basically the same. In the Assets Catalog:
Drag your PDF vector file in.
Check "Preserve Vector Data"
Choose "Single Scale"
Work around in progress
I did not manage to find the solution, I gave up, but actually I went pretty far in investigating. Maybe someone luckier than me will be able to figure out hpw to continue the work I started:
In Apple documentation, it is said that, in order to easily browse all the new iOS 13 SF Symbols, you can dowmload the SF Symbols app : https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/
Once instaled you can go in Application > SF Symbols > showPackage content
From there, under content > Resources we can find an interesting file named SFSymbolsFallback.ttf
And if you try to open this file on https://fontdrop.info/ you can see that it contains all the font glyphs that are released in iOS 13 as SF Font, with associated unicodes
Bingo? not so fast...
From there I tried to import this .ttf into my project in iOS 12, on XCode 10.2.1, but it seems that it is never properly imported. It is not retrievable in the list of available fonts when calling UIFont.familyNames
More interesting, if I try to import this font in Font Book app, I receive a warning that says that it contains duplication, some kind of conflict with an existing font
From there?
My guess is that there is another font that prevent SF Symbols to be installed, in Font Book and on Xcode.
One of the solution could be to find the one that is in conflict in XCode package and delete it ( this may be Symbols font or San Francisco that are causing problems idk)
I also tried to open the font file with a font editor and change its Name and family Name without success.
If anyone want to continue investigating..
Hope this can help someone !
This icon set is based on SF Symbols https://framework7.io/icons/
You can upload the new ios 13 sf-pro-rounded font to your project. Then enable that font in your label.
Open sf symbols, click on the smbol you want, cmd+c, go to your project, click on a label cmd+v. Run the project, and there should be the icon
cheers,
In SF Symbols 3.1, Edit > Copy Image as...
You can choose PNG/point size/pixel scale and paste into Preview etc.
SF Symbols is a system only supported on iOS 13 or later - it's not possible to use them on iOS 12 or below. You'll need to use fallbacks for those older operating systems.
See Human Interface Guidelines
1. Import the font:
Open the Fonts app, search for the SF Pro Rounded font, right-click on the variant you want (e.g. Light) and click Show in Finder. Drag that file (e.g. SF-Pro-Rounded-Light.otf) into your XCode project and tick "Copy if necessary".
2. Select the font:
Select your UILabel or UIButton, set the Title to Attributed (this is important) and select the font you just copied (e.g. SF Pro Rounded Light).
3. Set the symbol:
Find the icon you want in SF Symbols, select it, press CMD+C to copy, switch back to XCode and click in the text part of the UILabel or UIButton Title and press CMD+V to paste.
A huge thank you to Dave van Wijk for the solution!
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
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.
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.
Can someone explain me or link - I have 512x512 icon but I have no idea what icons sizes I need to create and how to add them in to my iOS app. What sizes I need and how to add them, and for what?
The Apple documentation has all you need to know.
In a nutshell: 57x57 for non-retina iPhone or iPod Touch, 114x114 for retina display, and 72x72 for iPad.
Ive put all the images named correctly at the correct size into a github repo, so there can be no confusion.
https://github.com/FattusMannus/iOS-Development-Image-Placeholders
Just download them as a zip, edit them and copy them into your project
AH
In the current 5.x xCode version you can use app icon set (AppIcon.appiconset). In the picture you can see where you can found it. Here is online tool, Icons Master, which will take care how icons should be big naming convection as well.
Specific name doesn't matter's any more for ios icon. All you need is perfect size.
I have created this application which will provide you all the icons based on information provided here. Get the application from here, and follow the instructions in readme file to create all the required icons for iOS application.
Download Asset Catalog Creator Free from iTunes. All you have to do is select a base image, and the program will create all required iOS icon sizes for you and place them neatly in an .xcassets file, which you can simply drag into Xcode without worrying about the sizes/resolutions of individual icons.
Question was asked a while back but the answer changes from time to time. Here are a few web tools that are updated with the latest requirements and get the job done:
http://www.theappicon.com/ or
https://resizeappicon.com/
Drag and drop the .xcassets folder that they return into your xcode assets catalog and it should populate your app icons as you need them.