简体   繁体   中英

macOS: "SF Pro Text" not available on new computer

I want to use the "SF Pro Text" font in my app. It works fine when I build my app on my main computer (running macOS11 Big Sur), but I have a 2nd partition to run macOS Monterey, and it doesn't seem to be available there at all, whether through Interface Builder or through code (using NSFontManager). Using this returns nil on my Monterey partition:

NSFont* boldFont = [[NSFontManager sharedFontManager] fontWithFamily:@"SF Pro Text" traits:NSFontWeightBold weight:8 size: 16.0];

What gives? Do I have to install the font manually? I thought it would come with the system, since it is a 'system font'?

You can install it manually, it's available here If you install it specifically for your user, you'll find it in YourUser/Library/fonts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM