How can I get a list of the available NSFont families?

前端 未结 6 1584
故里飘歌
故里飘歌 2021-02-05 10:15

How can I get a list of the available NSFont families, preferably with the fontName: equivalents.

6条回答
  •  梦谈多话
    2021-02-05 10:31

    Here's how it can be done for Swift:

    let fontFamilyNames = NSFontManager.sharedFontManager().availableFontFamilies
    
    print("avaialble fonts is \(fontFamilyNames)")
    

提交回复
热议问题