Using San Francisco in an app

I'm developing an app that allows users to select a font and type text overtop images, similar to Skitch and others. To allow users to change the font, I have an array of font names which I display in table view cells. I provide a font preview by simply using UIFont(name:size:) and providing the name, for example "Helvetica Neue." Now with iOS 9 I want to add support for using San Francisco. The problem is, initializing a UIFont with "San Francisco" returns nil. In fact, it doesn't look like San Francisco is even included when printing out all available fonts.


I could check if the app is running on iOS 9 and if so just include "San Francisco" in the array and use UIFont.systemFontOfSize when San Francisco is selected, but this is a really poor and dirty solution. How can I do this more appropriately?

Replies

This is from the license agreement that came along with the watch resources download originally:

IMPORTANT NOTE: THE APPLE SAN FRANCISCO FONT IS TO BE USED SOLELY FOR PURPOSES OF DESIGN AND DEVELOPMENT OF APPLICATIONS FOR APPLE WATCH.

This seems to be in conflict with the following statement by Apple:


"Get your apps ready with the latest beta versions of the San Francisco fonts for iOS 9,OS X El Capitan, and watchOS 2."


Found here: https://developer.apple.com/fonts/


I was able to download the fonts from the page above. So I am not sure about the source KMT's post and whether is is against the HIG or something for an iOS 9 app? It appears that the post from KMT is from here:


https://developer.apple.com/watch/human-interface-guidelines/resources/


And it looks like it pertains to resources for WatchOS downloads. But if you download the SF Fonts from the above link, then the Apple License Agreement with with files says this:


APPLE INC.

LICENSE AGREEMENT FOR THE APPLE SAN FRANCISCO FONT

For iOS and OS X application uses only

---

So it looks like you can use it with an iOS app and this article seems to confirm that:


http://appleinsider.com/articles/15/06/12/apple-releases-san-francisco-system-fonts-for-ios-os-x-and-watchos-2-to-developers


The Font Tool Suite also listed on the Font page above seems to be no where to be found. So this article looks like it should work for install custom fonts:


http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

Hi Jordan,


I believe the license may currently be incorrect and will be changed, or may only apply to the beta, which is under nondisclosure.


It may be that Apple only intended to state that San Francisco Compact specifically be used for Apple Watch display, not OS X or iOS display. This needs some clarification, because it has definitely been stated that you can use this font when composing graphics in drawing tools, for example.


I would recommend you watch the "Introduction to the New System Fonts" WWDC 2015 video. Font usage outside of systems like the style settings in the IDE can be quite complex.


That video walks through how to use the new fonts when constructing your own displays, and describes things like sizing tables, which are supposed to be available for download. Because the font also continues to be adjusted, not all of those resources may be available yet.

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