Skip to content

Instantly share code, notes, and snippets.

Last active Feb 6, 2017
What would you like to do?
macOS 输出系统支持的所有字体
#import <Cocoa/Cocoa.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSLog(@"%@", [[[NSFontManager sharedFontManager] availableFontFamilies] description]);
return 0;
import Cocoa
var fonts = NSFontManager.shared().availableFontFamilies
fonts = fonts.sorted()
for fn in fonts {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment