Skip to content

Instantly share code, notes, and snippets.

@oldj
Last active February 6, 2017 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oldj/057903ff966fd8eb9e0e5cf4f0540687 to your computer and use it in GitHub Desktop.
Save oldj/057903ff966fd8eb9e0e5cf4f0540687 to your computer and use it in GitHub Desktop.
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 {
print(fn)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment