Last active
February 6, 2017 05:56
-
-
Save oldj/057903ff966fd8eb9e0e5cf4f0540687 to your computer and use it in GitHub Desktop.
macOS 输出系统支持的所有字体
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSLog(@"%@", [[[NSFontManager sharedFontManager] availableFontFamilies] description]); | |
} | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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