How do I get the font name from an otf or ttf file?

前端 未结 15 1658
-上瘾入骨i
-上瘾入骨i 2020-11-28 03:44

I have used a custom font in my previous app.

The file name was \"ProximaNova-Regular.otf\" and to load the font I just used...

[UIFont fontWithName:         


        
15条回答
  •  离开以前
    2020-11-28 03:59

    Swift 3.0

    for familyName in UIFont.familyNames {
            for fontName in UIFont.fontNames(forFamilyName: familyName ) {
                print("\(familyName) : \(fontName)")
            }
        }
    

提交回复
热议问题