Currently the San Francisco font is the system font for all Apple devices (Mac, iPhone/iPad, Apple Watch, TV etc.) and Apple recommends developers use the system font in their apps for all their text needs. Just use the Apple API's like:preferredFontForTextStyleorsystemFontOfSizeWhen you see System Font in Apple's documentation, it is San Francisco. No need to select the font by name.Also, for developers, I'll give a plug for my library to make it easy to use the special SF font features in your app:https://github.com/djfitz/SFFontFeaturesCheers!
Post
Replies
Boosts
Views
Activity
I think you might need to be more specific.
If you're creating an app for a non-Apple device, then you can't use San Francisco font.
However, if you're creating an app on an Apple device (e.g. iPhone, iPad, Apple Watch, Apple TV), then use the System font and it will use San Francisco font. Also, when you use the system font APIs, it will automatically pick the correct Text or Display versions (technically "optical size variants") depending on the font size used.
See also
UIFont.preferredFont(forTextStyle style:) - https://developer.apple.com/documentation/uikit/uifont/1619030-preferredfont
UIFont.systemFont(ofSize:) - https://developer.apple.com/documentation/uikit/uifont/1619042-systemfont
Hope this answers your question.
Doug Hill
https://github.com/djfitz/SFFontFeatures
The solution Apple recommends is to use the System font in your app. You can easily do this by using system font APIs.
See for example UIFont.systemFont(ofSize:) - https://developer.apple.com/documentation/uikit/uifont
This allows your application to work correctly on all iOS versions you support. Apple has said that the vertical metrics for the system font won't change, so the text in your app will layout correctly in all cases. You will get San Francisco font on versions of iOS that support it, and will (likely) use Helvetica Neue on older systems. And when your app runs with San Francisco as the system font, there are a lot of real cool typographic effects you get for free (e.g. vertically centered colon). Really, San Francisco is a great application font.
Doug Hill
https://github.com/djfitz/SFFontFeatures
I see that Apple has been locking down the San Francisco font for users to pick in a font menu. For example, I see in iOS 14 that SF font no longer shows up in a list of enumerated fonts. Unfortunately, you can't assume the systemFont APIs will return SF as the system font has already changed twice in my memory (Helvetica -> Helvetica Neue -> San Francisco). But it will likely not change anytime soon it's probably a good bet system font will be SF.
Also, has been noted many times, it's appears legally murky to install the SF font in your app. My suggestion is to keep using system font and check font attributes for supported features you might require.
Doug Hill
https://github.com/djfitz/SFFontFeatures
I did some research and managed to figure out much of the special typographic features mentioned in the WWDC talk, as well as a few others. I've documented the ones found here:
https://github.com/djfitz/SFFontFeatures
Here is a list of features that I support with my library:
Straight-sided six and nine
Open Four
Vertically Centered Colon
High Legibility
One Story a
Upper Case Small Capitals
Lower Case Small Capitals
Contextual Fractional Forms
Monospaced/Proportional Numbers
Superiors/Superscripts
Inferiors/Subscripts
Good luck!
Doug Hill
Use the UIFont.systemFont APIs in your application and you will be using San Francisco font. No fonts need to be installed.
First, I don't think there's any restrictions on using Helvetica Neue so feel free to use that in you app for whatever you need.
San Francisco font doesn't show up when enumerating installed fonts so you can't "pick" it in the usual sense. If you use the UIFont systemFont APIs, and San Francisco is the system font, it will be used automatically and you don't need to install anything. In fact, Apple prohibits installing SF font in your app.
And if the system font is Helvetica Neue (which was standard before SF font), you will get that automatically by using systemFont APIs. So that's the correct way to handle this situation. systemFont will pick Helvetica Neue when it is system font on old systems, and SF on newer systems.
Doug Hill
https://github.com/djfitz/SFFontFeatures/graphs/traffic
I've documented many of the different typographic features of San Francisco font, and have a library to allow using them very easy:
https://github.com/djfitz/SFFontFeatures
See below for a list of features that I support.
Doug Hill
Straight-sided six and nine
Open Four
Vertically Centered Colon
High Legibility
One Story a
Upper Case Small Capitals
Lower Case Small Capitals
Contextual Fractional Forms
Monospaced/Proportional Numbers
Superiors/Superscripts
Inferiors/Subscripts
I believe what you're referring to is a "one story a". Which doesn't have the swoop on top of the lower-case 'a'.
If so, the San Francisco system font has a 'one-story a', which is an OpenType alternative stylistic variant. I created a library to make using these variants in your app very easy. See here:
https://github.com/djfitz/SFFontFeatures
Doug Hill
Just to be clear, app developers can use San Francisco font in their app using the systemFont APIs. You just can't download the font from Apple and install it in your app.
Downloading the font can only be used for mockups, which graphic designers need to do when developing UI in Sketch, etc.
That said, why the live preview show correct fonts/symbols with Adobe XD is something you should bring up with Adobe.
You can use San Francisco font in both your Apple ecosystem devices (iphone, ipad, apple watch, etc.), and your websites.
For your app, use the UIFont.systemFont APIs. You will get San Francisco font on phones for which San Francisco is the system font, which I think is iOS 9 and later.
For your website, there are tags for Safari that allow you to specify system font.
"You can access system fonts in a standards-compliant way by utilizing the system-ui family. And in Safari 13.1 we introduced new standards-based keywords to access serif, monospace, and rounded forms."
https://developer.apple.com/forums/thread/127350?answerId=614912022#614912022
The restriction on San Francisco font is that if you download the font, any are for UI mockups only.
Hope this helps.
Doug Hill
https://github.com/djfitz/SFFontFeatures
You used to be to enumerate installed fonts and get San Francisco variants. In iOS 14 this may no longer be the case. If you do see SFCompact show up then I don't see why you can't use an installed font in your non-watch app. But I would check with Apple to be sure.
I don't think there's any way to change out the system font at either the device/Settings level or the app level.
You might be able to use the UIAppearance classes to achieve similar things though. For example:
UILabel.appearance(whenContainedInInstancesOf: [UIViewController.self]).font = UIFont.init(name: "Courier", size: 14)
to customize appearance in all view controllers.
To customize specific UI elements, you can do something like this:
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UIViewController.self]).font = UIFont.init(name: "Courier", size: 14)
if you want to just customize just the Navigation Bar or Tab Bar. You'll probably have to go through your UI to find things that need to be customized but it's relatively easy to create theme classes that abstract all this away and include all customizations in one place.
Doug Hill
https://github.com/djfitz/SFFontFeatures
Hello,
Generally, fonts that were already installed by the OS were not embedded in iOS apps. You would typically use UIFont APIs to use the fonts included with the OS. UIFont.systemFont(ofSize:) would have given you Helvetica Neue when it was the system font. You could also use something like UIFont.init(name: "Helvetica Neue", size: 14).
Font embedding means that you have the font binary locally and embedded it your app with a build step. This means that you had to acquire the font from somewhere and download it locally. Where you got the font would be important as that would set the terms of the license agreement. If it was downloaded from Apple then I would go to them and ask about their license agreement. If the font was acquired through a font provider, you would need to discuss it with them. I see that fonts often have license agreements embedded in them, and that might be a good place to start looking.
Unfortunately, this appears to be a license agreement issue and you'll probably need to discuss this with someone who knows copyright/IP law. For example, Apple might indemnify developers who use their fonts within their iOS apps. Someone who knows law would be able to explain that better.
But as to your question, it was not standard practice to embed Helvetica Neue on iOS apps when that font was already installed in the system.
Good luck!
Doug Hill
https://github.com/djfitz/SFFontFeatures
Hello,
Apple is making it very clear they don't want developers to access San Francisco font unless they use the approved system APIs. For example
UIFont.systemFont(ofSize: )
or
UIFont.preferredFont(style:)
Attempting to load the font by name is no longer supported, as the warning indicates. San Francisco font doesn't seem to show up in the list of enumerated installed fonts any more either.
There's kind of a good reason for this though. According to how San Francisco font should be used, you don't want to pick the font yourself. For example, Apple says the Text variant is for point sizes less than 21 point. To make that work in all scenarios is difficult if not impossible to replicate. See here for more info on how the system makes the determination on which font variant should be used based on size:
WWDC: Introducing the New System - https://developer.apple.com/videos/play/wwdc2015/804/
So you probably shouldn't include Text and Display in a popup and just allow the user to pick it. As the app developer you need to make sure the correct variant is used.
There's also the question whether the app developer should arbitrarily choose the rounded or compact variants. I see that Apple has included the following in iOS 13:
UIFont.withDesign(design:)
That allows you to specify rounded variant but not compact. Apple says that compact is supposed to be for watch apps, so that's probably why it isn't made available on iOS.
I hope this gives you a better idea of how to use the San Francisco font.
Doug Hill
https://github.com/djfitz/SFFontFeatures