Skip to content

Instantly share code, notes, and snippets.

@oldj
Last active Feb 6, 2017
Embed
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 {
print(fn)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment