A new font titled 'SF Mono' was introduced with Xcode 8.
It's a font that I personally find very readable, and I would like to use it in a NSTextView
. However, to set a font for an NSTextView
, it is required to use an NSFont
object. The problem is that I cannot seem to find the SF Mono
font in the list of available fonts through NSFontManager.shared().availableFonts
.
Does anyone know what the SF Mono
's programmatic name is for the initialisation of an NSFont (NSFont(name: String, size: CGFloat)
) for its typeface?
"SF Mono" is not a system font. You cannot select SF Mono outside of Terminal, Console and Xcode because it is not installed to the system.
The "SF Mono" in Terminal is a custom font in
/Applications/Utilities/Terminal.app/Contents/Resources/Fonts/
.Similarly, the "SF Mono" in Console is another custom font in
/Applications/Utilities/Console.app/Contents/Resources/Fonts
.Similarly, the "SF Mono" in Xcode is also a custom font in
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Resources/
.And of course you cannot bundle SF Mono alongside your program without violating Apple's copyright license:
If the user has manually installed the font, it can be found with family name
SF Mono
, or the font nameSFMono-Regular
(similar for the other weights).