I have an InvisionApp design with a typeface set to "SF UI Display" & "SF UI Text". I downloaded the font from apple, with an installer. It installed it in "~/Library/Fonts".
I can understand that if I use "System", then it will use "SF Pro Display". My question is, how can I actively/manually use it - so it will not change accordingly and or together with iOS. I can not find see "SF Pro Display", in Xcode when I choose "Custom" font.
Do you know how to use it? One solution is/could be to add the "otf" file as described here
But I can see "SF Pro Display" when I use TextEdit and other Mac applications.
You don't need to manually choose between those font families (Text & Display), the system will decide which one to use. You can just get the system font which you need (size & weight) and Apple will take care about the rest :) Here is the source, explanation is between 12:30 and 13:30 in the video.
Related
I want to use the SF Pro font in my app, but I don't see it in the font drop-down menu. What do I do?
You don't need to see it listed by name in the drop-down menu. It is the System font.
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!
I want a monospace font for my UILabel in my iOS application.
Unfortunately, I could not find one. Even "American Typewriter" was not actually monospaced. What is a monospace font available in XCode?
iOS mono-spaced fonts
Courier
Courier-Bold
Courier-BoldOblique
Courier-Oblique
CourierNewPS-BoldItalicMT
CourierNewPS-BoldMT
CourierNewPS-ItalicMT
CourierNewPSMT
Menlo-Bold
Menlo-BoldItalic
Menlo-Italic
Menlo-Regular
iosfonts.com maintain a list of all iOS fonts.
This webpage detects your installed system fonts and returns a fairly comprehensive list.
Looking at an old listing of fonts shipped with iOS I see several one monospace fonts.
(eg. Andale Mono, Monaco, Courier New)
For 2018 it's only Menlo and Courier.
If your intent is to display numbers and you don't care about the specific font used, you can do this:
UIFont.monospacedDigitSystemFontOfSize(
UIFont.systemFontSize(),
weight: UIFontWeightRegular)
Adobe just released a nice monospaced font Source Code Pro in both TTF and OTF formats.
It's licensed with the Open Font License so it is available for free use within applications, including commercial applications.
You will need to add the font file as a resource in Xcode, by setting the UIAppFonts key in the info.plist to point to the SourceCodeProRegular.ttf file.
Now in your code you can set, for example:
self.textView.font = [UIFont fontWithName:#"Source Code Pro" size:14];
Expanding upon #reggie-pinkham's answer, I built this JS Bin for folks to use as a live test page; to save future reader's some time, here's a few screen shots using iOS Simulator on Mavericks:
iPad Air, iOS 8.1
iPhone 6 plus, iOS 8.1
As of iOS 13, San Francisco (SF) Mono is available. Couldn't find a way to set this in interface builder, but by code it's:
let font = UIFont.monospacedSystemFont(ofSize: 17.0, weight: .regular)
If you're looking for a monospace font for numbers, then try "Helvetica Neue".
A list of built-in fonts available on iOS: http://iosfonts.com. Courier and Menlo seem to be the only monospace fonts in there.
SwiftUI
You can use Font's instance method monospacedDigit
Text("0123456789")
.foregroundColor(.white)
.font(Font.custom("San Francisco", size: 20).monospacedDigit())
You can access system fonts in monospaced with the following Font factory method:
static func system(Font.TextStyle, design: Font.Design) -> Font
Example:
let monospacedBody = Font.system(.body, .monospaced)
Other usage:
let serifTitle = Font.system(.title, .serif)
In the meantime there is a good Monospace font available from Apple, that can be downloaded here: Apple SFUI
Here is how to add the fonts to Xcode: Add fonts to xcode
In my app I need to support iOS since iOS 7. As you know iOS 9 uses new system font "San-Francisco".
Is it possible some how to use system font (to make native font for operation system) with setting size and attributes like Light, Medium, Bold, Italic, etc?
I found only one solution to hard code font name as for iOS 9 use "San-Francisco" and for less use "HelveticaNueue".
Maybe some one know a better solution.
I want a monospace font for my UILabel in my iOS application.
Unfortunately, I could not find one. Even "American Typewriter" was not actually monospaced. What is a monospace font available in XCode?
iOS mono-spaced fonts
Courier
Courier-Bold
Courier-BoldOblique
Courier-Oblique
CourierNewPS-BoldItalicMT
CourierNewPS-BoldMT
CourierNewPS-ItalicMT
CourierNewPSMT
Menlo-Bold
Menlo-BoldItalic
Menlo-Italic
Menlo-Regular
iosfonts.com maintain a list of all iOS fonts.
This webpage detects your installed system fonts and returns a fairly comprehensive list.
Looking at an old listing of fonts shipped with iOS I see several one monospace fonts.
(eg. Andale Mono, Monaco, Courier New)
For 2018 it's only Menlo and Courier.
If your intent is to display numbers and you don't care about the specific font used, you can do this:
UIFont.monospacedDigitSystemFontOfSize(
UIFont.systemFontSize(),
weight: UIFontWeightRegular)
Adobe just released a nice monospaced font Source Code Pro in both TTF and OTF formats.
It's licensed with the Open Font License so it is available for free use within applications, including commercial applications.
You will need to add the font file as a resource in Xcode, by setting the UIAppFonts key in the info.plist to point to the SourceCodeProRegular.ttf file.
Now in your code you can set, for example:
self.textView.font = [UIFont fontWithName:#"Source Code Pro" size:14];
Expanding upon #reggie-pinkham's answer, I built this JS Bin for folks to use as a live test page; to save future reader's some time, here's a few screen shots using iOS Simulator on Mavericks:
iPad Air, iOS 8.1
iPhone 6 plus, iOS 8.1
As of iOS 13, San Francisco (SF) Mono is available. Couldn't find a way to set this in interface builder, but by code it's:
let font = UIFont.monospacedSystemFont(ofSize: 17.0, weight: .regular)
If you're looking for a monospace font for numbers, then try "Helvetica Neue".
A list of built-in fonts available on iOS: http://iosfonts.com. Courier and Menlo seem to be the only monospace fonts in there.
SwiftUI
You can use Font's instance method monospacedDigit
Text("0123456789")
.foregroundColor(.white)
.font(Font.custom("San Francisco", size: 20).monospacedDigit())
You can access system fonts in monospaced with the following Font factory method:
static func system(Font.TextStyle, design: Font.Design) -> Font
Example:
let monospacedBody = Font.system(.body, .monospaced)
Other usage:
let serifTitle = Font.system(.title, .serif)
In the meantime there is a good Monospace font available from Apple, that can be downloaded here: Apple SFUI
Here is how to add the fonts to Xcode: Add fonts to xcode